From 58b9ea0c24d331ae0f15626ed1661344b93ada44 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Mon, 10 Feb 2025 00:07:40 +0300 Subject: [PATCH 01/10] Add boilerplate for new API in Version2Client --- CHANGELOG.md | 9 + package-lock.json | 16 +- package.json | 4 +- src/version2/appDataPolicies.ts | 42 ++ src/version2/appMigration.ts | 4 +- src/version2/appProperties.ts | 53 +- src/version2/avatars.ts | 161 +++--- src/version2/classificationLevels.ts | 42 ++ src/version2/dashboards.ts | 103 ++-- src/version2/filters.ts | 136 ++--- src/version2/groups.ts | 82 +-- src/version2/index.ts | 31 +- src/version2/issueAttachments.ts | 494 ++++++++++++------ src/version2/issueComments.ts | 63 +-- .../issueCustomFieldConfigurationApps.ts | 95 +++- src/version2/issueCustomFieldOptions.ts | 61 ++- src/version2/issueCustomFieldOptionsApps.ts | 66 +-- src/version2/issueCustomFieldValuesApps.ts | 63 ++- src/version2/issueFields.ts | 55 +- src/version2/issueNotificationSchemes.ts | 60 ++- src/version2/issuePriorities.ts | 104 ++-- src/version2/issueResolutions.ts | 102 ++-- src/version2/issueSearch.ts | 209 +++++--- src/version2/issueTypes.ts | 83 +-- src/version2/issueWorklogs.ts | 174 ++++-- src/version2/issues.ts | 439 ++++++++++++---- src/version2/jiraExpressions.ts | 45 +- src/version2/jiraSettings.ts | 50 +- src/version2/jqlFunctionsApps.ts | 62 ++- .../models/addAtlassianTeamRequest.ts | 12 + .../models/addNotificationsDetails.ts | 7 + .../addSecuritySchemeLevelsRequestBean.ts | 6 + .../models/appWorkflowTransitionRule.ts | 12 + src/version2/models/approvalConfiguration.ts | 30 ++ .../models/archiveIssueAsyncRequest.ts | 3 + .../models/archivedIssuesFilterRequest.ts | 14 + ...sociateSecuritySchemeWithProjectDetails.ts | 11 + src/version2/models/attachmentArchive.ts | 8 + src/version2/models/bulkChangelog.ts | 12 + src/version2/models/bulkChangelogRequest.ts | 11 + .../models/bulkContextualConfiguration.ts | 13 + src/version2/models/bulkEditActionError.ts | 7 + .../models/bulkEditShareableEntityRequest.ts | 14 + src/version2/models/bulkFetchIssueRequest.ts | 43 ++ src/version2/models/bulkIssue.ts | 14 + src/version2/models/changeFilterOwner.ts | 5 + src/version2/models/columnRequestBody.ts | 3 + src/version2/models/component.ts | 8 + src/version2/models/compoundClause.ts | 14 + .../models/configurationsListParameters.ts | 5 + src/version2/models/context.ts | 10 + .../createCrossProjectReleaseRequest.ts | 6 + .../models/createCustomFieldRequest.ts | 6 + src/version2/models/createDateFieldRequest.ts | 6 + .../models/createExclusionRulesRequest.ts | 14 + .../models/createIssueSourceRequest.ts | 9 + .../models/createPermissionHolderRequest.ts | 9 + .../models/createPermissionRequest.ts | 7 + .../models/createPlanOnlyTeamRequest.ts | 14 + src/version2/models/createPlanRequest.ts | 23 + .../models/createPrioritySchemeDetails.ts | 16 + .../models/createSchedulingRequest.ts | 12 + ...FieldContextDefaultValueCascadingOption.ts | 10 + .../customFieldContextDefaultValueDate.ts | 8 + .../customFieldContextDefaultValueDateTime.ts | 8 + .../customFieldContextDefaultValueFloat.ts | 6 + ...ldContextDefaultValueForgeDateTimeField.ts | 10 + ...FieldContextDefaultValueForgeGroupField.ts | 8 + ...ContextDefaultValueForgeMultiGroupField.ts | 8 + ...ontextDefaultValueForgeMultiStringField.ts | 6 + ...dContextDefaultValueForgeMultiUserField.ts | 8 + ...ieldContextDefaultValueForgeNumberField.ts | 8 + ...ieldContextDefaultValueForgeObjectField.ts | 6 + ...ieldContextDefaultValueForgeStringField.ts | 8 + ...mFieldContextDefaultValueForgeUserField.ts | 11 + .../customFieldContextDefaultValueLabels.ts | 6 + ...FieldContextDefaultValueMultiUserPicker.ts | 8 + ...dContextDefaultValueMultipleGroupPicker.ts | 8 + ...mFieldContextDefaultValueMultipleOption.ts | 8 + ...ontextDefaultValueMultipleVersionPicker.ts | 11 + .../customFieldContextDefaultValueProject.ts | 8 + .../customFieldContextDefaultValueReadOnly.ts | 6 + ...eldContextDefaultValueSingleGroupPicker.ts | 8 + ...tomFieldContextDefaultValueSingleOption.ts | 8 + ...dContextDefaultValueSingleVersionPicker.ts | 11 + .../customFieldContextDefaultValueTextArea.ts | 6 + ...customFieldContextDefaultValueTextField.ts | 6 + .../customFieldContextDefaultValueURL.ts | 8 + ...tomFieldContextSingleUserPickerDefaults.ts | 11 + .../models/dataClassificationLevels.ts | 7 + src/version2/models/dataClassificationTag.ts | 17 + src/version2/models/dateRangeFilterRequest.ts | 7 + .../models/deleteAndReplaceVersion.ts | 13 + src/version2/models/deprecatedWorkflow.ts | 23 + .../models/detailedErrorCollection.ts | 11 + src/version2/models/duplicatePlanRequest.ts | 4 + src/version2/models/errorCollections.ts | 1 + src/version2/models/errorMessage.ts | 4 + src/version2/models/evaluateMetaData.ts | 11 + .../models/evaluatedJiraExpression.ts | 16 + .../models/expandPrioritySchemeBean.ts | 9 + .../models/expandPrioritySchemePage.ts | 5 + ...xportArchivedIssuesTaskProgressResponse.ts | 9 + src/version2/models/fieldChangedClause.ts | 15 + src/version2/models/fieldCreateMetadata.ts | 26 + src/version2/models/fieldUpdateOperation.ts | 13 + src/version2/models/fieldValueClause.ts | 10 + src/version2/models/fieldWasClause.ts | 17 + src/version2/models/functionOperand.ts | 12 + .../models/getAtlassianTeamResponse.ts | 12 + .../models/getCrossProjectReleaseResponse.ts | 6 + src/version2/models/getCustomFieldResponse.ts | 6 + src/version2/models/getDateFieldResponse.ts | 6 + .../models/getExclusionRulesResponse.ts | 14 + src/version2/models/getIssueSourceResponse.ts | 9 + .../models/getPermissionHolderResponse.ts | 9 + src/version2/models/getPermissionResponse.ts | 7 + .../models/getPlanOnlyTeamResponse.ts | 16 + src/version2/models/getPlanResponseForPage.ts | 12 + src/version2/models/getSchedulingResponse.ts | 12 + src/version2/models/getTeamResponseForPage.ts | 8 + src/version2/models/healthCheckResult.ts | 9 + src/version2/models/iconBean.ts | 9 + src/version2/models/idSearchRequest.ts | 8 + src/version2/models/idSearchResults.ts | 10 + src/version2/models/inputStreamSource.ts | 3 + .../models/issueArchivalSyncRequest.ts | 4 + src/version2/models/issueChangeLog.ts | 9 + src/version2/models/issueError.ts | 7 + src/version2/models/issueLimitReport.ts | 8 + .../models/issueLimitReportRequest.ts | 9 + src/version2/models/jQLCount.ts | 4 + src/version2/models/jQLCountRequest.ts | 7 + .../models/jiraExpressionEvaluateRequest.ts | 11 + ...jqlFunctionPrecomputationGetByIdRequest.ts | 4 + ...qlFunctionPrecomputationGetByIdResponse.ts | 9 + .../jqlFunctionPrecomputationUpdateBean.ts | 12 + ...nctionPrecomputationUpdateErrorResponse.ts | 7 + ...jqlFunctionPrecomputationUpdateResponse.ts | 8 + src/version2/models/jqlQueryClauseOperand.ts | 2 + .../models/jqlQueryClauseTimePredicate.ts | 8 + src/version2/models/jqlQueryUnitaryOperand.ts | 2 + src/version2/models/jsonNode.ts | 38 ++ src/version2/models/keywordOperand.ts | 9 + .../models/legacyJackson1ListAttachment.ts | 1 + .../models/legacyJackson1ListColumnItem.ts | 1 + .../models/legacyJackson1ListIssueEvent.ts | 1 + .../legacyJackson1ListIssueTypeWithStatus.ts | 1 + .../models/legacyJackson1ListProject.ts | 1 + .../legacyJackson1ListProjectComponent.ts | 1 + .../legacyJackson1ListProjectRoleDetails.ts | 1 + .../models/legacyJackson1ListProjectType.ts | 1 + .../legacyJackson1ListUserMigrationBean.ts | 1 + .../models/legacyJackson1ListVersion.ts | 1 + .../models/legacyJackson1ListWorklog.ts | 1 + src/version2/models/listOperand.ts | 9 + .../models/mappingsByIssueTypeOverride.ts | 13 + src/version2/models/mappingsByWorkflow.ts | 15 + src/version2/models/multipartFile.ts | 12 + ...ficationSchemeAndProjectMappingJsonBean.ts | 4 + .../oldToNewSecurityLevelMappingsBean.ts | 6 + .../models/pageBean2ComponentJsonBean.ts | 19 + .../pageBeanFieldConfigurationDetails.ts | 19 + ...chemeWithPaginatedPrioritiesAndProjects.ts | 19 + .../models/pageBeanPriorityWithSequence.ts | 19 + .../models/pageBeanUiModificationDetails.ts | 19 + .../models/pageBulkContextualConfiguration.ts | 19 + src/version2/models/pageContext.ts | 19 + .../pageOfCreateMetaIssueTypeWithField.ts | 14 + .../models/pageOfCreateMetaIssueTypes.ts | 14 + .../pageWithCursorGetPlanResponseForPage.ts | 10 + .../pageWithCursorGetTeamResponseForPage.ts | 10 + .../models/paginatedResponseComment.ts | 8 + .../paginatedResponseFieldCreateMetadata.ts | 8 + ...tedResponseIssueTypeIssueCreateMetadata.ts | 8 + src/version2/models/plan.ts | 29 + src/version2/models/priorityMapping.ts | 18 + .../prioritySchemeChangesWithoutMappings.ts | 4 + src/version2/models/prioritySchemeId.ts | 8 + ...chemeWithPaginatedPrioritiesAndProjects.ts | 20 + src/version2/models/priorityWithSequence.ts | 19 + src/version2/models/projectDataPolicies.ts | 7 + src/version2/models/projectDataPolicy.ts | 5 + src/version2/models/projectFeatureState.ts | 5 + src/version2/models/projectUsage.ts | 5 + src/version2/models/projectUsagePage.ts | 9 + src/version2/models/projectWithDataPolicy.ts | 8 + .../models/publishDraftWorkflowScheme.ts | 7 + .../models/removeOptionFromIssuesResult.ts | 9 + .../models/requiredMappingByIssueType.ts | 7 + .../models/requiredMappingByWorkflows.ts | 9 + src/version2/models/resolutionJsonBean.ts | 8 + src/version2/models/resource.ts | 10 + .../models/searchAndReconcileRequest.ts | 63 +++ .../models/searchAutoCompleteFilter.ts | 7 + .../models/securitySchemeLevelBean.ts | 12 + .../models/securitySchemeLevelMemberBean.ts | 6 + .../models/serviceManagementNavigationInfo.ts | 5 + src/version2/models/serviceRegistry.ts | 15 + src/version2/models/serviceRegistryTier.ts | 12 + src/version2/models/simpleErrorCollection.ts | 10 + src/version2/models/simpleUsage.ts | 7 + .../models/simplifiedHierarchyLevel.ts | 39 ++ src/version2/models/softwareNavigationInfo.ts | 6 + src/version2/models/statusMetadata.ts | 9 + .../models/statusProjectIssueTypeUsage.ts | 5 + .../models/statusProjectIssueTypeUsageDTO.ts | 10 + .../models/statusProjectIssueTypeUsagePage.ts | 9 + src/version2/models/statusProjectUsage.ts | 5 + src/version2/models/statusProjectUsageDTO.ts | 8 + src/version2/models/statusProjectUsagePage.ts | 9 + src/version2/models/statusWorkflowUsageDTO.ts | 8 + .../models/statusWorkflowUsagePage.ts | 9 + .../models/statusWorkflowUsageWorkflow.ts | 5 + src/version2/models/statusesPerWorkflow.ts | 9 + src/version2/models/streamingResponseBody.ts | 1 + src/version2/models/stringList.ts | 1 + ...ggestedMappingsForPrioritiesRequestBean.ts | 7 + ...suggestedMappingsForProjectsRequestBean.ts | 5 + .../models/suggestedMappingsRequest.ts | 14 + src/version2/models/taskProgressNode.ts | 30 ++ ...askProgressRemoveOptionFromIssuesResult.ts | 30 ++ .../updateDefaultProjectClassification.ts | 5 + .../models/updateDefaultScreenScheme.ts | 5 + .../updateIssueSecuritySchemeRequestBean.ts | 6 + .../models/updatePrioritiesInSchemeRequest.ts | 7 + .../models/updatePrioritySchemeRequest.ts | 16 + .../models/updatePrioritySchemeResponse.ts | 8 + .../models/updateProjectsInSchemeRequest.ts | 7 + src/version2/models/userColumnRequestBody.ts | 3 + src/version2/models/userFilter.ts | 15 + src/version2/models/userPermission.ts | 26 + src/version2/models/valueOperand.ts | 7 + src/version2/models/versionApprover.ts | 11 + src/version2/models/versionRelatedWork.ts | 19 + .../models/workManagementNavigationInfo.ts | 3 + .../workflowAssociationStatusMapping.ts | 7 + .../models/workflowCompoundCondition.ts | 10 + src/version2/models/workflowCreateResponse.ts | 7 +- .../models/workflowCreateValidateRequest.ts | 7 + src/version2/models/workflowIDs.ts | 7 + .../workflowMetadataAndIssueTypeRestModel.ts | 8 + .../models/workflowMetadataRestModel.ts | 20 + .../models/workflowProjectIssueTypeUsage.ts | 5 + .../workflowProjectIssueTypeUsageDTO.ts | 10 + .../workflowProjectIssueTypeUsagePage.ts | 9 + .../models/workflowProjectUsageDTO.ts | 8 + src/version2/models/workflowReadRequest.ts | 10 + .../models/workflowSchemeAssociation.ts | 7 + .../models/workflowSchemeProjectUsageDTO.ts | 8 + .../models/workflowSchemeReadRequest.ts | 7 + .../models/workflowSchemeReadResponse.ts | 27 + .../models/workflowSchemeUpdateRequest.ts | 36 ++ ...flowSchemeUpdateRequiredMappingsRequest.ts | 14 + ...lowSchemeUpdateRequiredMappingsResponse.ts | 15 + src/version2/models/workflowSchemeUsage.ts | 5 + src/version2/models/workflowSchemeUsageDTO.ts | 8 + .../models/workflowSchemeUsagePage.ts | 9 + src/version2/models/workflowSearchResponse.ts | 22 + .../models/workflowSimpleCondition.ts | 8 + .../models/workflowTransitionLinks.ts | 9 + src/version2/models/workflowUpdateResponse.ts | 6 + .../models/workflowUpdateValidateRequest.ts | 7 + src/version2/models/workflowUsages.ts | 12 + src/version2/models/worklogsMoveRequest.ts | 6 + src/version2/models/workspaceDataPolicy.ts | 5 + src/version2/myself.ts | 115 +++- src/version2/parameters/addAtlassianTeam.ts | 6 + src/version2/parameters/addNotifications.ts | 6 + src/version2/parameters/archivePlan.ts | 4 + src/version2/parameters/bulkDeleteWorklogs.ts | 19 + src/version2/parameters/bulkFetchIssues.ts | 3 + src/version2/parameters/bulkMoveWorklogs.ts | 18 + .../parameters/bulkSetIssuesPropertiesList.ts | 3 + src/version2/parameters/countIssues.ts | 3 + src/version2/parameters/createPlan.ts | 6 + src/version2/parameters/createPlanOnlyTeam.ts | 6 + .../parameters/createPriorityScheme.ts | 3 + src/version2/parameters/createRelatedWork.ts | 5 + .../parameters/deleteForgeAppProperty.ts | 4 + src/version2/parameters/deletePlanOnlyTeam.ts | 6 + src/version2/parameters/deletePriority.ts | 4 + .../parameters/deletePriorityScheme.ts | 4 + src/version2/parameters/deleteRelatedWork.ts | 6 + src/version2/parameters/deleteVersion.ts | 14 + src/version2/parameters/duplicatePlan.ts | 6 + .../parameters/evaluateJSISJiraExpression.ts | 13 + .../parameters/findComponentsForProjects.ts | 19 + .../parameters/findUserKeysByQuery.ts | 8 +- src/version2/parameters/getAllProjects.ts | 19 + .../getAllUserDataClassificationLevels.ts | 6 + src/version2/parameters/getAllWorkflows.ts | 4 + .../getApproximateApplicationLicenseCount.ts | 4 + src/version2/parameters/getAtlassianTeam.ts | 6 + .../getAvailablePrioritiesByPriorityScheme.ts | 12 + src/version2/parameters/getBulkChangelogs.ts | 3 + src/version2/parameters/getBulkScreenTabs.ts | 16 + .../getContextsForFieldDeprecated.ts | 8 + .../getCreateIssueMetaIssueTypeId.ts | 10 + .../getCreateIssueMetaIssueTypes.ts | 8 + .../getCustomFieldsConfigurations.ts | 34 ++ .../getDefaultProjectClassification.ts | 4 + src/version2/parameters/getGroup.ts | 11 + .../parameters/getIssueLimitReport.ts | 10 + src/version2/parameters/getPlan.ts | 6 + src/version2/parameters/getPlanOnlyTeam.ts | 6 + src/version2/parameters/getPlans.ts | 10 + src/version2/parameters/getPolicies.ts | 4 + .../parameters/getPrecomputationsByID.ts | 11 + .../getPrioritiesByPriorityScheme.ts | 8 + src/version2/parameters/getPrioritySchemes.ts | 28 + .../getProjectIssueTypeUsagesForStatus.ts | 10 + .../parameters/getProjectUsagesForStatus.ts | 8 + .../parameters/getProjectUsagesForWorkflow.ts | 8 + .../getProjectUsagesForWorkflowScheme.ts | 8 + .../parameters/getProjectsByPriorityScheme.ts | 12 + src/version2/parameters/getRelatedWork.ts | 4 + src/version2/parameters/getResolution.ts | 4 + src/version2/parameters/getTeams.ts | 8 + .../getWorkflowProjectIssueTypeUsages.ts | 10 + .../getWorkflowSchemeUsagesForWorkflow.ts | 8 + .../parameters/getWorkflowUsagesForStatus.ts | 8 + .../parameters/putForgeAppProperty.ts | 4 + .../parameters/readWorkflowSchemes.ts | 14 + .../parameters/removeAtlassianTeam.ts | 6 + .../removeDefaultProjectClassification.ts | 4 + .../parameters/replaceCustomFieldOption.ts | 12 + .../searchAndReconsileIssuesUsingJql.ts | 65 +++ .../searchAndReconsileIssuesUsingJqlPost.ts | 3 + src/version2/parameters/searchForIssuesIds.ts | 3 + src/version2/parameters/searchWorkflows.ts | 25 + src/version2/parameters/services.ts | 4 + src/version2/parameters/setLocale.ts | 3 + .../suggestedPrioritiesForMappings.ts | 3 + src/version2/parameters/trashPlan.ts | 4 + .../parameters/updateAtlassianTeam.ts | 6 + .../updateDefaultProjectClassification.ts | 6 + src/version2/parameters/updatePlan.ts | 6 + src/version2/parameters/updatePlanOnlyTeam.ts | 6 + .../parameters/updatePriorityScheme.ts | 6 + src/version2/parameters/updateRelatedWork.ts | 6 + src/version2/parameters/updateSchemes.ts | 3 + .../updateWorkflowSchemeMappings.ts | 3 + src/version2/permissionSchemes.ts | 46 +- src/version2/permissions.ts | 40 +- src/version2/plans.ts | 292 +++++++++++ src/version2/prioritySchemes.ts | 320 ++++++++++++ src/version2/projectClassificationLevels.ts | 119 +++++ src/version2/projectComponents.ts | 177 ++++--- src/version2/projectEmail.ts | 22 +- src/version2/projectRoles.ts | 118 ++--- src/version2/projectVersions.ts | 348 +++++++++--- src/version2/projects.ts | 219 ++++---- src/version2/screenTabs.ts | 37 ++ src/version2/serviceRegistry.ts | 38 ++ src/version2/status.ts | 78 +++ src/version2/tasks.ts | 8 + src/version2/teamsInPlan.ts | 322 ++++++++++++ src/version2/uIModificationsApps.ts | 42 +- src/version2/userSearch.ts | 45 +- src/version2/users.ts | 49 +- src/version2/workflowSchemes.ts | 157 ++++++ src/version2/workflows.ts | 159 +++++- src/version3/models/index.ts | 1 + src/version3/models/projectUsage.ts | 5 + src/version3/models/projectUsagePage.ts | 9 + .../models/workflowSchemeProjectUsage.ts | 8 + .../getProjectUsagesForWorkflowScheme.ts | 8 + src/version3/parameters/getUser.ts | 12 +- src/version3/parameters/index.ts | 1 + src/version3/parameters/removeUser.ts | 12 +- src/version3/parameters/resetUserColumns.ts | 6 +- src/version3/status.ts | 131 +++-- src/version3/users.ts | 37 +- src/version3/workflowSchemes.ts | 26 + src/version3/workflows.ts | 129 +++++ 376 files changed, 7618 insertions(+), 1521 deletions(-) create mode 100644 src/version2/appDataPolicies.ts create mode 100644 src/version2/classificationLevels.ts create mode 100644 src/version2/models/addAtlassianTeamRequest.ts create mode 100644 src/version2/models/addNotificationsDetails.ts create mode 100644 src/version2/models/addSecuritySchemeLevelsRequestBean.ts create mode 100644 src/version2/models/appWorkflowTransitionRule.ts create mode 100644 src/version2/models/approvalConfiguration.ts create mode 100644 src/version2/models/archiveIssueAsyncRequest.ts create mode 100644 src/version2/models/archivedIssuesFilterRequest.ts create mode 100644 src/version2/models/associateSecuritySchemeWithProjectDetails.ts create mode 100644 src/version2/models/attachmentArchive.ts create mode 100644 src/version2/models/bulkChangelog.ts create mode 100644 src/version2/models/bulkChangelogRequest.ts create mode 100644 src/version2/models/bulkContextualConfiguration.ts create mode 100644 src/version2/models/bulkEditActionError.ts create mode 100644 src/version2/models/bulkEditShareableEntityRequest.ts create mode 100644 src/version2/models/bulkFetchIssueRequest.ts create mode 100644 src/version2/models/bulkIssue.ts create mode 100644 src/version2/models/changeFilterOwner.ts create mode 100644 src/version2/models/columnRequestBody.ts create mode 100644 src/version2/models/component.ts create mode 100644 src/version2/models/compoundClause.ts create mode 100644 src/version2/models/configurationsListParameters.ts create mode 100644 src/version2/models/context.ts create mode 100644 src/version2/models/createCrossProjectReleaseRequest.ts create mode 100644 src/version2/models/createCustomFieldRequest.ts create mode 100644 src/version2/models/createDateFieldRequest.ts create mode 100644 src/version2/models/createExclusionRulesRequest.ts create mode 100644 src/version2/models/createIssueSourceRequest.ts create mode 100644 src/version2/models/createPermissionHolderRequest.ts create mode 100644 src/version2/models/createPermissionRequest.ts create mode 100644 src/version2/models/createPlanOnlyTeamRequest.ts create mode 100644 src/version2/models/createPlanRequest.ts create mode 100644 src/version2/models/createPrioritySchemeDetails.ts create mode 100644 src/version2/models/createSchedulingRequest.ts create mode 100644 src/version2/models/customFieldContextDefaultValueCascadingOption.ts create mode 100644 src/version2/models/customFieldContextDefaultValueDate.ts create mode 100644 src/version2/models/customFieldContextDefaultValueDateTime.ts create mode 100644 src/version2/models/customFieldContextDefaultValueFloat.ts create mode 100644 src/version2/models/customFieldContextDefaultValueForgeDateTimeField.ts create mode 100644 src/version2/models/customFieldContextDefaultValueForgeGroupField.ts create mode 100644 src/version2/models/customFieldContextDefaultValueForgeMultiGroupField.ts create mode 100644 src/version2/models/customFieldContextDefaultValueForgeMultiStringField.ts create mode 100644 src/version2/models/customFieldContextDefaultValueForgeMultiUserField.ts create mode 100644 src/version2/models/customFieldContextDefaultValueForgeNumberField.ts create mode 100644 src/version2/models/customFieldContextDefaultValueForgeObjectField.ts create mode 100644 src/version2/models/customFieldContextDefaultValueForgeStringField.ts create mode 100644 src/version2/models/customFieldContextDefaultValueForgeUserField.ts create mode 100644 src/version2/models/customFieldContextDefaultValueLabels.ts create mode 100644 src/version2/models/customFieldContextDefaultValueMultiUserPicker.ts create mode 100644 src/version2/models/customFieldContextDefaultValueMultipleGroupPicker.ts create mode 100644 src/version2/models/customFieldContextDefaultValueMultipleOption.ts create mode 100644 src/version2/models/customFieldContextDefaultValueMultipleVersionPicker.ts create mode 100644 src/version2/models/customFieldContextDefaultValueProject.ts create mode 100644 src/version2/models/customFieldContextDefaultValueReadOnly.ts create mode 100644 src/version2/models/customFieldContextDefaultValueSingleGroupPicker.ts create mode 100644 src/version2/models/customFieldContextDefaultValueSingleOption.ts create mode 100644 src/version2/models/customFieldContextDefaultValueSingleVersionPicker.ts create mode 100644 src/version2/models/customFieldContextDefaultValueTextArea.ts create mode 100644 src/version2/models/customFieldContextDefaultValueTextField.ts create mode 100644 src/version2/models/customFieldContextDefaultValueURL.ts create mode 100644 src/version2/models/customFieldContextSingleUserPickerDefaults.ts create mode 100644 src/version2/models/dataClassificationLevels.ts create mode 100644 src/version2/models/dataClassificationTag.ts create mode 100644 src/version2/models/dateRangeFilterRequest.ts create mode 100644 src/version2/models/deleteAndReplaceVersion.ts create mode 100644 src/version2/models/deprecatedWorkflow.ts create mode 100644 src/version2/models/detailedErrorCollection.ts create mode 100644 src/version2/models/duplicatePlanRequest.ts create mode 100644 src/version2/models/errorCollections.ts create mode 100644 src/version2/models/errorMessage.ts create mode 100644 src/version2/models/evaluateMetaData.ts create mode 100644 src/version2/models/evaluatedJiraExpression.ts create mode 100644 src/version2/models/expandPrioritySchemeBean.ts create mode 100644 src/version2/models/expandPrioritySchemePage.ts create mode 100644 src/version2/models/exportArchivedIssuesTaskProgressResponse.ts create mode 100644 src/version2/models/fieldChangedClause.ts create mode 100644 src/version2/models/fieldCreateMetadata.ts create mode 100644 src/version2/models/fieldUpdateOperation.ts create mode 100644 src/version2/models/fieldValueClause.ts create mode 100644 src/version2/models/fieldWasClause.ts create mode 100644 src/version2/models/functionOperand.ts create mode 100644 src/version2/models/getAtlassianTeamResponse.ts create mode 100644 src/version2/models/getCrossProjectReleaseResponse.ts create mode 100644 src/version2/models/getCustomFieldResponse.ts create mode 100644 src/version2/models/getDateFieldResponse.ts create mode 100644 src/version2/models/getExclusionRulesResponse.ts create mode 100644 src/version2/models/getIssueSourceResponse.ts create mode 100644 src/version2/models/getPermissionHolderResponse.ts create mode 100644 src/version2/models/getPermissionResponse.ts create mode 100644 src/version2/models/getPlanOnlyTeamResponse.ts create mode 100644 src/version2/models/getPlanResponseForPage.ts create mode 100644 src/version2/models/getSchedulingResponse.ts create mode 100644 src/version2/models/getTeamResponseForPage.ts create mode 100644 src/version2/models/healthCheckResult.ts create mode 100644 src/version2/models/iconBean.ts create mode 100644 src/version2/models/idSearchRequest.ts create mode 100644 src/version2/models/idSearchResults.ts create mode 100644 src/version2/models/inputStreamSource.ts create mode 100644 src/version2/models/issueArchivalSyncRequest.ts create mode 100644 src/version2/models/issueChangeLog.ts create mode 100644 src/version2/models/issueError.ts create mode 100644 src/version2/models/issueLimitReport.ts create mode 100644 src/version2/models/issueLimitReportRequest.ts create mode 100644 src/version2/models/jQLCount.ts create mode 100644 src/version2/models/jQLCountRequest.ts create mode 100644 src/version2/models/jiraExpressionEvaluateRequest.ts create mode 100644 src/version2/models/jqlFunctionPrecomputationGetByIdRequest.ts create mode 100644 src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts create mode 100644 src/version2/models/jqlFunctionPrecomputationUpdateBean.ts create mode 100644 src/version2/models/jqlFunctionPrecomputationUpdateErrorResponse.ts create mode 100644 src/version2/models/jqlFunctionPrecomputationUpdateResponse.ts create mode 100644 src/version2/models/jqlQueryClauseOperand.ts create mode 100644 src/version2/models/jqlQueryClauseTimePredicate.ts create mode 100644 src/version2/models/jqlQueryUnitaryOperand.ts create mode 100644 src/version2/models/jsonNode.ts create mode 100644 src/version2/models/keywordOperand.ts create mode 100644 src/version2/models/legacyJackson1ListAttachment.ts create mode 100644 src/version2/models/legacyJackson1ListColumnItem.ts create mode 100644 src/version2/models/legacyJackson1ListIssueEvent.ts create mode 100644 src/version2/models/legacyJackson1ListIssueTypeWithStatus.ts create mode 100644 src/version2/models/legacyJackson1ListProject.ts create mode 100644 src/version2/models/legacyJackson1ListProjectComponent.ts create mode 100644 src/version2/models/legacyJackson1ListProjectRoleDetails.ts create mode 100644 src/version2/models/legacyJackson1ListProjectType.ts create mode 100644 src/version2/models/legacyJackson1ListUserMigrationBean.ts create mode 100644 src/version2/models/legacyJackson1ListVersion.ts create mode 100644 src/version2/models/legacyJackson1ListWorklog.ts create mode 100644 src/version2/models/listOperand.ts create mode 100644 src/version2/models/mappingsByIssueTypeOverride.ts create mode 100644 src/version2/models/mappingsByWorkflow.ts create mode 100644 src/version2/models/multipartFile.ts create mode 100644 src/version2/models/notificationSchemeAndProjectMappingJsonBean.ts create mode 100644 src/version2/models/oldToNewSecurityLevelMappingsBean.ts create mode 100644 src/version2/models/pageBean2ComponentJsonBean.ts create mode 100644 src/version2/models/pageBeanFieldConfigurationDetails.ts create mode 100644 src/version2/models/pageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects.ts create mode 100644 src/version2/models/pageBeanPriorityWithSequence.ts create mode 100644 src/version2/models/pageBeanUiModificationDetails.ts create mode 100644 src/version2/models/pageBulkContextualConfiguration.ts create mode 100644 src/version2/models/pageContext.ts create mode 100644 src/version2/models/pageOfCreateMetaIssueTypeWithField.ts create mode 100644 src/version2/models/pageOfCreateMetaIssueTypes.ts create mode 100644 src/version2/models/pageWithCursorGetPlanResponseForPage.ts create mode 100644 src/version2/models/pageWithCursorGetTeamResponseForPage.ts create mode 100644 src/version2/models/paginatedResponseComment.ts create mode 100644 src/version2/models/paginatedResponseFieldCreateMetadata.ts create mode 100644 src/version2/models/paginatedResponseIssueTypeIssueCreateMetadata.ts create mode 100644 src/version2/models/plan.ts create mode 100644 src/version2/models/priorityMapping.ts create mode 100644 src/version2/models/prioritySchemeChangesWithoutMappings.ts create mode 100644 src/version2/models/prioritySchemeId.ts create mode 100644 src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts create mode 100644 src/version2/models/priorityWithSequence.ts create mode 100644 src/version2/models/projectDataPolicies.ts create mode 100644 src/version2/models/projectDataPolicy.ts create mode 100644 src/version2/models/projectFeatureState.ts create mode 100644 src/version2/models/projectUsage.ts create mode 100644 src/version2/models/projectUsagePage.ts create mode 100644 src/version2/models/projectWithDataPolicy.ts create mode 100644 src/version2/models/publishDraftWorkflowScheme.ts create mode 100644 src/version2/models/removeOptionFromIssuesResult.ts create mode 100644 src/version2/models/requiredMappingByIssueType.ts create mode 100644 src/version2/models/requiredMappingByWorkflows.ts create mode 100644 src/version2/models/resolutionJsonBean.ts create mode 100644 src/version2/models/resource.ts create mode 100644 src/version2/models/searchAndReconcileRequest.ts create mode 100644 src/version2/models/searchAutoCompleteFilter.ts create mode 100644 src/version2/models/securitySchemeLevelBean.ts create mode 100644 src/version2/models/securitySchemeLevelMemberBean.ts create mode 100644 src/version2/models/serviceManagementNavigationInfo.ts create mode 100644 src/version2/models/serviceRegistry.ts create mode 100644 src/version2/models/serviceRegistryTier.ts create mode 100644 src/version2/models/simpleErrorCollection.ts create mode 100644 src/version2/models/simpleUsage.ts create mode 100644 src/version2/models/simplifiedHierarchyLevel.ts create mode 100644 src/version2/models/softwareNavigationInfo.ts create mode 100644 src/version2/models/statusMetadata.ts create mode 100644 src/version2/models/statusProjectIssueTypeUsage.ts create mode 100644 src/version2/models/statusProjectIssueTypeUsageDTO.ts create mode 100644 src/version2/models/statusProjectIssueTypeUsagePage.ts create mode 100644 src/version2/models/statusProjectUsage.ts create mode 100644 src/version2/models/statusProjectUsageDTO.ts create mode 100644 src/version2/models/statusProjectUsagePage.ts create mode 100644 src/version2/models/statusWorkflowUsageDTO.ts create mode 100644 src/version2/models/statusWorkflowUsagePage.ts create mode 100644 src/version2/models/statusWorkflowUsageWorkflow.ts create mode 100644 src/version2/models/statusesPerWorkflow.ts create mode 100644 src/version2/models/streamingResponseBody.ts create mode 100644 src/version2/models/stringList.ts create mode 100644 src/version2/models/suggestedMappingsForPrioritiesRequestBean.ts create mode 100644 src/version2/models/suggestedMappingsForProjectsRequestBean.ts create mode 100644 src/version2/models/suggestedMappingsRequest.ts create mode 100644 src/version2/models/taskProgressNode.ts create mode 100644 src/version2/models/taskProgressRemoveOptionFromIssuesResult.ts create mode 100644 src/version2/models/updateDefaultProjectClassification.ts create mode 100644 src/version2/models/updateDefaultScreenScheme.ts create mode 100644 src/version2/models/updateIssueSecuritySchemeRequestBean.ts create mode 100644 src/version2/models/updatePrioritiesInSchemeRequest.ts create mode 100644 src/version2/models/updatePrioritySchemeRequest.ts create mode 100644 src/version2/models/updatePrioritySchemeResponse.ts create mode 100644 src/version2/models/updateProjectsInSchemeRequest.ts create mode 100644 src/version2/models/userColumnRequestBody.ts create mode 100644 src/version2/models/userFilter.ts create mode 100644 src/version2/models/userPermission.ts create mode 100644 src/version2/models/valueOperand.ts create mode 100644 src/version2/models/versionApprover.ts create mode 100644 src/version2/models/versionRelatedWork.ts create mode 100644 src/version2/models/workManagementNavigationInfo.ts create mode 100644 src/version2/models/workflowAssociationStatusMapping.ts create mode 100644 src/version2/models/workflowCompoundCondition.ts create mode 100644 src/version2/models/workflowCreateValidateRequest.ts create mode 100644 src/version2/models/workflowIDs.ts create mode 100644 src/version2/models/workflowMetadataAndIssueTypeRestModel.ts create mode 100644 src/version2/models/workflowMetadataRestModel.ts create mode 100644 src/version2/models/workflowProjectIssueTypeUsage.ts create mode 100644 src/version2/models/workflowProjectIssueTypeUsageDTO.ts create mode 100644 src/version2/models/workflowProjectIssueTypeUsagePage.ts create mode 100644 src/version2/models/workflowProjectUsageDTO.ts create mode 100644 src/version2/models/workflowReadRequest.ts create mode 100644 src/version2/models/workflowSchemeAssociation.ts create mode 100644 src/version2/models/workflowSchemeProjectUsageDTO.ts create mode 100644 src/version2/models/workflowSchemeReadRequest.ts create mode 100644 src/version2/models/workflowSchemeReadResponse.ts create mode 100644 src/version2/models/workflowSchemeUpdateRequest.ts create mode 100644 src/version2/models/workflowSchemeUpdateRequiredMappingsRequest.ts create mode 100644 src/version2/models/workflowSchemeUpdateRequiredMappingsResponse.ts create mode 100644 src/version2/models/workflowSchemeUsage.ts create mode 100644 src/version2/models/workflowSchemeUsageDTO.ts create mode 100644 src/version2/models/workflowSchemeUsagePage.ts create mode 100644 src/version2/models/workflowSearchResponse.ts create mode 100644 src/version2/models/workflowSimpleCondition.ts create mode 100644 src/version2/models/workflowTransitionLinks.ts create mode 100644 src/version2/models/workflowUpdateValidateRequest.ts create mode 100644 src/version2/models/workflowUsages.ts create mode 100644 src/version2/models/worklogsMoveRequest.ts create mode 100644 src/version2/models/workspaceDataPolicy.ts create mode 100644 src/version2/parameters/addAtlassianTeam.ts create mode 100644 src/version2/parameters/addNotifications.ts create mode 100644 src/version2/parameters/archivePlan.ts create mode 100644 src/version2/parameters/bulkDeleteWorklogs.ts create mode 100644 src/version2/parameters/bulkFetchIssues.ts create mode 100644 src/version2/parameters/bulkMoveWorklogs.ts create mode 100644 src/version2/parameters/bulkSetIssuesPropertiesList.ts create mode 100644 src/version2/parameters/countIssues.ts create mode 100644 src/version2/parameters/createPlan.ts create mode 100644 src/version2/parameters/createPlanOnlyTeam.ts create mode 100644 src/version2/parameters/createPriorityScheme.ts create mode 100644 src/version2/parameters/createRelatedWork.ts create mode 100644 src/version2/parameters/deleteForgeAppProperty.ts create mode 100644 src/version2/parameters/deletePlanOnlyTeam.ts create mode 100644 src/version2/parameters/deletePriority.ts create mode 100644 src/version2/parameters/deletePriorityScheme.ts create mode 100644 src/version2/parameters/deleteRelatedWork.ts create mode 100644 src/version2/parameters/deleteVersion.ts create mode 100644 src/version2/parameters/duplicatePlan.ts create mode 100644 src/version2/parameters/evaluateJSISJiraExpression.ts create mode 100644 src/version2/parameters/findComponentsForProjects.ts create mode 100644 src/version2/parameters/getAllProjects.ts create mode 100644 src/version2/parameters/getAllUserDataClassificationLevels.ts create mode 100644 src/version2/parameters/getAllWorkflows.ts create mode 100644 src/version2/parameters/getApproximateApplicationLicenseCount.ts create mode 100644 src/version2/parameters/getAtlassianTeam.ts create mode 100644 src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts create mode 100644 src/version2/parameters/getBulkChangelogs.ts create mode 100644 src/version2/parameters/getBulkScreenTabs.ts create mode 100644 src/version2/parameters/getContextsForFieldDeprecated.ts create mode 100644 src/version2/parameters/getCreateIssueMetaIssueTypeId.ts create mode 100644 src/version2/parameters/getCreateIssueMetaIssueTypes.ts create mode 100644 src/version2/parameters/getCustomFieldsConfigurations.ts create mode 100644 src/version2/parameters/getDefaultProjectClassification.ts create mode 100644 src/version2/parameters/getGroup.ts create mode 100644 src/version2/parameters/getIssueLimitReport.ts create mode 100644 src/version2/parameters/getPlan.ts create mode 100644 src/version2/parameters/getPlanOnlyTeam.ts create mode 100644 src/version2/parameters/getPlans.ts create mode 100644 src/version2/parameters/getPolicies.ts create mode 100644 src/version2/parameters/getPrecomputationsByID.ts create mode 100644 src/version2/parameters/getPrioritiesByPriorityScheme.ts create mode 100644 src/version2/parameters/getPrioritySchemes.ts create mode 100644 src/version2/parameters/getProjectIssueTypeUsagesForStatus.ts create mode 100644 src/version2/parameters/getProjectUsagesForStatus.ts create mode 100644 src/version2/parameters/getProjectUsagesForWorkflow.ts create mode 100644 src/version2/parameters/getProjectUsagesForWorkflowScheme.ts create mode 100644 src/version2/parameters/getProjectsByPriorityScheme.ts create mode 100644 src/version2/parameters/getRelatedWork.ts create mode 100644 src/version2/parameters/getResolution.ts create mode 100644 src/version2/parameters/getTeams.ts create mode 100644 src/version2/parameters/getWorkflowProjectIssueTypeUsages.ts create mode 100644 src/version2/parameters/getWorkflowSchemeUsagesForWorkflow.ts create mode 100644 src/version2/parameters/getWorkflowUsagesForStatus.ts create mode 100644 src/version2/parameters/putForgeAppProperty.ts create mode 100644 src/version2/parameters/readWorkflowSchemes.ts create mode 100644 src/version2/parameters/removeAtlassianTeam.ts create mode 100644 src/version2/parameters/removeDefaultProjectClassification.ts create mode 100644 src/version2/parameters/replaceCustomFieldOption.ts create mode 100644 src/version2/parameters/searchAndReconsileIssuesUsingJql.ts create mode 100644 src/version2/parameters/searchAndReconsileIssuesUsingJqlPost.ts create mode 100644 src/version2/parameters/searchForIssuesIds.ts create mode 100644 src/version2/parameters/searchWorkflows.ts create mode 100644 src/version2/parameters/services.ts create mode 100644 src/version2/parameters/setLocale.ts create mode 100644 src/version2/parameters/suggestedPrioritiesForMappings.ts create mode 100644 src/version2/parameters/trashPlan.ts create mode 100644 src/version2/parameters/updateAtlassianTeam.ts create mode 100644 src/version2/parameters/updateDefaultProjectClassification.ts create mode 100644 src/version2/parameters/updatePlan.ts create mode 100644 src/version2/parameters/updatePlanOnlyTeam.ts create mode 100644 src/version2/parameters/updatePriorityScheme.ts create mode 100644 src/version2/parameters/updateRelatedWork.ts create mode 100644 src/version2/parameters/updateSchemes.ts create mode 100644 src/version2/parameters/updateWorkflowSchemeMappings.ts create mode 100644 src/version2/plans.ts create mode 100644 src/version2/prioritySchemes.ts create mode 100644 src/version2/projectClassificationLevels.ts create mode 100644 src/version2/serviceRegistry.ts create mode 100644 src/version2/teamsInPlan.ts create mode 100644 src/version3/models/projectUsage.ts create mode 100644 src/version3/models/projectUsagePage.ts create mode 100644 src/version3/models/workflowSchemeProjectUsage.ts create mode 100644 src/version3/parameters/getProjectUsagesForWorkflowScheme.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index f52abb8b98..6dee44bff5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -113,6 +113,15 @@ - **Change**: Renamed `JiraExpressionEvaluateContextBean` to `JiraExpressionEvaluateContext`. +// todo + +- `getProjectUsagesForWorkflowScheme` added to `WorkflowSchemes` +- `getWorkflowProjectIssueTypeUsages` added to `Workflows` +- `WorkflowUpdateResponse`, `WorkflowCreateResponse` was deprecated +- `Users.setUserColumns` parameters are required now +- `Users.getUser` parameters are required now +- Added `getProjectIssueTypeUsagesForStatus`, `getProjectUsagesForStatus`, `getWorkflowUsagesForStatus` to `Status` + --- ### 4.0.6 diff --git a/package-lock.json b/package-lock.json index c025bc7013..5d62783fa9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,10 +24,10 @@ "eslint-config-airbnb-base": "^15.0.0", "eslint-import-resolver-typescript": "^3.7.0", "eslint-plugin-import": "^2.31.0", - "prettier": "^3.4.2", + "prettier": "^3.5.0", "prettier-plugin-jsdoc": "^1.3.2", "sinon": "^18.0.1", - "typedoc": "^0.27.6", + "typedoc": "^0.27.7", "typescript": "^5.7.3", "vite-tsconfig-paths": "^5.1.4", "vitest": "^3.0.5" @@ -4938,9 +4938,9 @@ } }, "node_modules/prettier": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", - "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.0.tgz", + "integrity": "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==", "dev": true, "license": "MIT", "bin": { @@ -5830,9 +5830,9 @@ } }, "node_modules/typedoc": { - "version": "0.27.6", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.6.tgz", - "integrity": "sha512-oBFRoh2Px6jFx366db0lLlihcalq/JzyCVp7Vaq1yphL/tbgx2e+bkpkCgJPunaPvPwoTOXSwasfklWHm7GfAw==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.7.tgz", + "integrity": "sha512-K/JaUPX18+61W3VXek1cWC5gwmuLvYTOXJzBvD9W7jFvbPnefRnCHQCEPw7MSNrP/Hj7JJrhZtDDLKdcYm6ucg==", "dev": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 3c52140358..9a6192600e 100644 --- a/package.json +++ b/package.json @@ -66,10 +66,10 @@ "eslint-config-airbnb-base": "^15.0.0", "eslint-import-resolver-typescript": "^3.7.0", "eslint-plugin-import": "^2.31.0", - "prettier": "^3.4.2", + "prettier": "^3.5.0", "prettier-plugin-jsdoc": "^1.3.2", "sinon": "^18.0.1", - "typedoc": "^0.27.6", + "typedoc": "^0.27.7", "typescript": "^5.7.3", "vite-tsconfig-paths": "^5.1.4", "vitest": "^3.0.5" diff --git a/src/version2/appDataPolicies.ts b/src/version2/appDataPolicies.ts new file mode 100644 index 0000000000..4fe49eb9cc --- /dev/null +++ b/src/version2/appDataPolicies.ts @@ -0,0 +1,42 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class AppDataPolicies { + constructor(private client: Client) {} + /** Returns data policy for the workspace. */ + async getPolicy(callback: Callback): Promise; + /** Returns data policy for the workspace. */ + async getPolicy(callback?: never): Promise; + async getPolicy(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/data-policy', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + /** Returns data policies for the projects specified in the request. */ + async getPolicies( + parameters: Parameters.GetPolicies | undefined, + callback: Callback, + ): Promise; + /** Returns data policies for the projects specified in the request. */ + async getPolicies(parameters?: Parameters.GetPolicies, callback?: never): Promise; + async getPolicies( + parameters?: Parameters.GetPolicies, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/data-policy/project', + method: 'GET', + params: { + ids: parameters?.ids, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/appMigration.ts b/src/version2/appMigration.ts index 78cf122932..4d894ad020 100644 --- a/src/version2/appMigration.ts +++ b/src/version2/appMigration.ts @@ -12,7 +12,7 @@ export class AppMigration { * fields can be updated. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. + * Connect apps can make this request */ async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback: Callback): Promise; /** @@ -20,7 +20,7 @@ export class AppMigration { * fields can be updated. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. + * Connect apps can make this request */ async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback?: never): Promise; async updateIssueFields( diff --git a/src/version2/appProperties.ts b/src/version2/appProperties.ts index cb897fb889..5f1b26e071 100644 --- a/src/version2/appProperties.ts +++ b/src/version2/appProperties.ts @@ -11,9 +11,8 @@ export class AppProperties { * Gets all the properties of an app. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async getAddonProperties( parameters: Parameters.GetAddonProperties | string, @@ -23,9 +22,8 @@ export class AppProperties { * Gets all the properties of an app. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async getAddonProperties( parameters: Parameters.GetAddonProperties | string, @@ -49,9 +47,8 @@ export class AppProperties { * Returns the key and value of an app's property. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async getAddonProperty( parameters: Parameters.GetAddonProperty, @@ -61,9 +58,8 @@ export class AppProperties { * Returns the key and value of an app's property. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async getAddonProperty( parameters: Parameters.GetAddonProperty, @@ -88,7 +84,8 @@ export class AppProperties { * maximum length is 32768 characters. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async putAddonProperty( parameters: Parameters.PutAddonProperty, @@ -101,7 +98,8 @@ export class AppProperties { * maximum length is 32768 characters. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async putAddonProperty( parameters: Parameters.PutAddonProperty, @@ -124,14 +122,16 @@ export class AppProperties { * Deletes an app's property. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback: Callback): Promise; /** * Deletes an app's property. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback?: never): Promise; async deleteAddonProperty( @@ -149,7 +149,9 @@ export class AppProperties { /** * Sets the value of a Forge app's property. These values can be retrieved in [Jira * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context - * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). + * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). They are also + * available in [entity property display + * conditions](/platform/forge/manifest-reference/display-conditions/entity-property-conditions/). * * For other use cases, use the [Storage * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). @@ -159,6 +161,9 @@ export class AppProperties { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only * Forge apps can make this request. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async putAppProperty( parameters: Parameters.PutAppProperty, @@ -167,7 +172,9 @@ export class AppProperties { /** * Sets the value of a Forge app's property. These values can be retrieved in [Jira * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context - * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). + * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). They are also + * available in [entity property display + * conditions](/platform/forge/manifest-reference/display-conditions/entity-property-conditions/). * * For other use cases, use the [Storage * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). @@ -177,6 +184,9 @@ export class AppProperties { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only * Forge apps can make this request. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async putAppProperty( parameters: Parameters.PutAppProperty, @@ -186,7 +196,6 @@ export class AppProperties { parameters: Parameters.PutAppProperty, callback?: Callback, ): Promise { - // todo const config: RequestConfig = { url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, method: 'PUT', @@ -201,6 +210,9 @@ export class AppProperties { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only * Forge apps can make this request. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback: Callback): Promise; /** @@ -208,6 +220,9 @@ export class AppProperties { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only * Forge apps can make this request. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback?: never): Promise; async deleteAppProperty( diff --git a/src/version2/avatars.ts b/src/version2/avatars.ts index 9e9f16b3ce..40011ccc30 100644 --- a/src/version2/avatars.ts +++ b/src/version2/avatars.ts @@ -8,43 +8,42 @@ export class Avatars { constructor(private client: Client) {} /** - * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. + * Returns a list of system avatar details by owner type, where the owner types are issue type, project, user or + * priority. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, + parameters: Parameters.GetAllSystemAvatars, callback: Callback, ): Promise; /** - * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. + * Returns a list of system avatar details by owner type, where the owner types are issue type, project, user or + * priority. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, + parameters: Parameters.GetAllSystemAvatars, callback?: never, ): Promise; async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, + parameters: Parameters.GetAllSystemAvatars, callback?: Callback, ): Promise { - const type = typeof parameters === 'string' ? parameters : parameters.type; - const config: RequestConfig = { - url: `/rest/api/2/avatar/${type}/system`, + url: `/rest/api/2/avatar/${parameters.type}/system`, method: 'GET', }; return this.client.sendRequest(config, callback); } - /** - * Returns the system and custom avatars for a project or issue type. + * Returns the system and custom avatars for a project, issue type or priority. * * This operation can be accessed anonymously. * @@ -55,10 +54,11 @@ export class Avatars { * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. * - For system avatars, none. + * - For priority avatars, none. */ async getAvatars(parameters: Parameters.GetAvatars, callback: Callback): Promise; /** - * Returns the system and custom avatars for a project or issue type. + * Returns the system and custom avatars for a project, issue type or priority. * * This operation can be accessed anonymously. * @@ -69,6 +69,7 @@ export class Avatars { * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. * - For system avatars, none. + * - For priority avatars, none. */ async getAvatars(parameters: Parameters.GetAvatars, callback?: never): Promise; async getAvatars(parameters: Parameters.GetAvatars, callback?: Callback): Promise { @@ -79,9 +80,27 @@ export class Avatars { return this.client.sendRequest(config, callback); } - /** - * Loads a custom avatar for a project or issue type. + * Loads a custom avatar for a project, issue type or priority. + * + * 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/universal_avatar/type/{type}/owner/{entityId}'` * * 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. @@ -93,13 +112,33 @@ export class Avatars { * - [Update issue type](#api-rest-api-2-issuetype-id-put) to set it as the issue type's displayed avatar. * - [Set project avatar](#api-rest-api-2-project-projectIdOrKey-avatar-put) to set it as the project's displayed * avatar. + * - [Update priority](#api-rest-api-2-priority-id-put) to set it as the priority's displayed avatar. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async storeAvatar(parameters: Parameters.StoreAvatar, callback: Callback): Promise; /** - * Loads a custom avatar for a project or issue type. + * Loads a custom avatar for a project, issue type or priority. + * + * 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/universal_avatar/type/{type}/owner/{entityId}'` * * 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. @@ -111,6 +150,7 @@ export class Avatars { * - [Update issue type](#api-rest-api-2-issuetype-id-put) to set it as the issue type's displayed avatar. * - [Set project avatar](#api-rest-api-2-project-projectIdOrKey-avatar-put) to set it as the project's displayed * avatar. + * - [Update priority](#api-rest-api-2-priority-id-put) to set it as the priority's displayed avatar. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -120,30 +160,24 @@ export class Avatars { const config: RequestConfig = { url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, method: 'POST', - headers: { - 'X-Atlassian-Token': 'no-check', - 'Content-Type': parameters.mimeType, - }, params: { x: parameters.x, y: parameters.y, - size: parameters.size ?? 0, + size: parameters.size, }, - data: parameters.avatar, }; return this.client.sendRequest(config, callback); } - /** - * Deletes an avatar from a project or issue type. + * Deletes an avatar from a project, issue type or priority. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async deleteAvatar(parameters: Parameters.DeleteAvatar, callback: Callback): Promise; /** - * Deletes an avatar from a project or issue type. + * Deletes an avatar from a project, issue type or priority. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -157,57 +191,45 @@ export class Avatars { return this.client.sendRequest(config, callback); } - /** - * Returns the default project or issue type avatar image. + * Returns the default project, issue type or priority avatar image. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType, callback: Callback, ): Promise; /** - * Returns the default project or issue type avatar image. + * Returns the default project, issue type or priority avatar image. * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType, callback?: never, ): Promise; - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType, callback?: Callback, ): Promise { - const type = typeof parameters === 'string' ? parameters : parameters.type; - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/view/type/${type}`, + url: `/rest/api/2/universal_avatar/view/type/${parameters.type}`, method: 'GET', - responseType: 'arraybuffer', params: { - size: typeof parameters !== 'string' && parameters.size, - format: typeof parameters !== 'string' && parameters.format, + 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); + return this.client.sendRequest(config, callback); } - /** - * Returns a project or issue type avatar image by ID. + * Returns a project, issue type or priority avatar image by ID. * * This operation can be accessed anonymously. * @@ -218,13 +240,14 @@ export class Avatars { * the project the avatar belongs to. * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. + * - For priority avatars, none. */ - async getAvatarImageByID( + async getAvatarImageByID( parameters: Parameters.GetAvatarImageByID, callback: Callback, ): Promise; /** - * Returns a project or issue type avatar image by ID. + * Returns a project, issue type or priority avatar image by ID. * * This operation can be accessed anonymously. * @@ -235,37 +258,29 @@ export class Avatars { * the project the avatar belongs to. * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. + * - For priority avatars, none. */ - async getAvatarImageByID( + async getAvatarImageByID( parameters: Parameters.GetAvatarImageByID, callback?: never, ): Promise; - async getAvatarImageByID( + 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); + return this.client.sendRequest(config, callback); } - /** - * Returns the avatar image for a project or issue type. + * Returns the avatar image for a project, issue type or priority. * * This operation can be accessed anonymously. * @@ -276,13 +291,14 @@ export class Avatars { * the project the avatar belongs to. * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. + * - For priority avatars, none. */ - async getAvatarImageByOwner( + async getAvatarImageByOwner( parameters: Parameters.GetAvatarImageByOwner, callback: Callback, ): Promise; /** - * Returns the avatar image for a project or issue type. + * Returns the avatar image for a project, issue type or priority. * * This operation can be accessed anonymously. * @@ -293,32 +309,25 @@ export class Avatars { * the project the avatar belongs to. * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. + * - For priority avatars, none. */ - async getAvatarImageByOwner( + async getAvatarImageByOwner( parameters: Parameters.GetAvatarImageByOwner, callback?: never, ): Promise; - async getAvatarImageByOwner( + 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); + return this.client.sendRequest(config, callback); } } diff --git a/src/version2/classificationLevels.ts b/src/version2/classificationLevels.ts new file mode 100644 index 0000000000..ce62ae3caa --- /dev/null +++ b/src/version2/classificationLevels.ts @@ -0,0 +1,42 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class ClassificationLevels { + constructor(private client: Client) {} + /** + * Returns all classification levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllUserDataClassificationLevels( + parameters: Parameters.GetAllUserDataClassificationLevels | undefined, + callback: Callback, + ): Promise; + /** + * Returns all classification levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllUserDataClassificationLevels( + parameters?: Parameters.GetAllUserDataClassificationLevels, + callback?: never, + ): Promise; + async getAllUserDataClassificationLevels( + parameters?: Parameters.GetAllUserDataClassificationLevels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/classification-levels', + method: 'GET', + params: { + status: parameters?.status, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/dashboards.ts b/src/version2/dashboards.ts index 8714d7cfb1..66f03ca4db 100644 --- a/src/version2/dashboards.ts +++ b/src/version2/dashboards.ts @@ -2,12 +2,10 @@ import * as Models from './models'; import * as Parameters from './parameters'; import { Client } from '../clients'; import { Callback } from '../callback'; -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. @@ -48,14 +46,13 @@ export class Dashboards { 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, + parameters: Parameters.CreateDashboard | undefined, callback: Callback, ): Promise; /** @@ -63,25 +60,27 @@ export class Dashboards { * * **[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?: never): Promise; async createDashboard( - parameters: Parameters.CreateDashboard, + parameters?: Parameters.CreateDashboard, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/dashboard', method: 'POST', + params: { + extendAdminPermissions: parameters?.extendAdminPermissions, + }, data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, + 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. * @@ -90,7 +89,7 @@ export class Dashboards { * The dashboards to be updated must be owned by the user, or the user must be an administrator. */ async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, + parameters: Parameters.BulkEditDashboards | undefined, callback: Callback, ): Promise; /** @@ -101,28 +100,27 @@ export class Dashboards { * The dashboards to be updated must be owned by the user, or the user must be an administrator. */ async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, + parameters?: Parameters.BulkEditDashboards, callback?: never, ): Promise; async bulkEditDashboards( - parameters: Parameters.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, + 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. * @@ -147,7 +145,6 @@ export class Dashboards { 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 @@ -200,6 +197,7 @@ export class Dashboards { params: { dashboardName: parameters?.dashboardName, accountId: parameters?.accountId, + owner: parameters?.owner, groupname: parameters?.groupname, groupId: parameters?.groupId, projectId: parameters?.projectId, @@ -213,7 +211,6 @@ export class Dashboards { return this.client.sendRequest(config, callback); } - /** * Returns a list of dashboard gadgets on a dashboard. * @@ -258,15 +255,14 @@ export class Dashboards { url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, method: 'GET', params: { - moduleKey: paramSerializer('moduleKey', parameters.moduleKey), + moduleKey: parameters.moduleKey, uri: parameters.uri, - gadgetId: paramSerializer('gadgetId', parameters.gadgetId), + gadgetId: parameters.gadgetId, }, }; return this.client.sendRequest(config, callback); } - /** * Adds a gadget to a dashboard. * @@ -298,7 +294,6 @@ export class Dashboards { return this.client.sendRequest(config, callback); } - /** * Changes the title, position, and color of the gadget on a dashboard. * @@ -324,7 +319,6 @@ export class Dashboards { return this.client.sendRequest(config, callback); } - /** * Removes a dashboard gadget from a dashboard. * @@ -351,7 +345,6 @@ export class Dashboards { return this.client.sendRequest(config, callback); } - /** * Returns the keys of all properties for a dashboard item. * @@ -361,7 +354,7 @@ export class Dashboards { * 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. + * Jira\u2019s anonymous access is permitted. */ async getDashboardItemPropertyKeys( parameters: Parameters.GetDashboardItemPropertyKeys, @@ -376,7 +369,7 @@ export class Dashboards { * 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. + * Jira\u2019s anonymous access is permitted. */ async getDashboardItemPropertyKeys( parameters: Parameters.GetDashboardItemPropertyKeys, @@ -393,7 +386,6 @@ export class Dashboards { return this.client.sendRequest(config, callback); } - /** * Returns the key and value of a dashboard item property. * @@ -417,7 +409,7 @@ export class Dashboards { * 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. + * Jira\u2019s anonymous access is permitted. */ async getDashboardItemProperty( parameters: Parameters.GetDashboardItemProperty, @@ -446,7 +438,7 @@ export class Dashboards { * 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. + * Jira\u2019s anonymous access is permitted. */ async getDashboardItemProperty( parameters: Parameters.GetDashboardItemProperty, @@ -463,7 +455,6 @@ export class Dashboards { 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. @@ -533,15 +524,10 @@ export class Dashboards { 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. * @@ -579,7 +565,6 @@ export class Dashboards { return this.client.sendRequest(config, callback); } - /** * Returns a dashboard. * @@ -591,10 +576,7 @@ export class Dashboards { * 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; + async getDashboard(parameters: Parameters.GetDashboard, callback: Callback): Promise; /** * Returns a dashboard. * @@ -606,21 +588,18 @@ export class Dashboards { * 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, callback?: never): Promise; async getDashboard( - parameters: Parameters.GetDashboard | string, + parameters: Parameters.GetDashboard, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${id}`, + url: `/rest/api/2/dashboard/${parameters.id}`, method: 'GET', }; return this.client.sendRequest(config, callback); } - /** * Updates a dashboard, replacing all the dashboard details with those provided. * @@ -647,6 +626,9 @@ export class Dashboards { const config: RequestConfig = { url: `/rest/api/2/dashboard/${parameters.id}`, method: 'PUT', + params: { + extendAdminPermissions: parameters.extendAdminPermissions, + }, data: { description: parameters.description, editPermissions: parameters.editPermissions, @@ -657,7 +639,6 @@ export class Dashboards { return this.client.sendRequest(config, callback); } - /** * Deletes a dashboard. * @@ -665,10 +646,7 @@ export class Dashboards { * * The dashboard to be deleted must be owned by the user. */ - async deleteDashboard( - parameters: Parameters.DeleteDashboard | string, - callback: Callback, - ): Promise; + async deleteDashboard(parameters: Parameters.DeleteDashboard, callback: Callback): Promise; /** * Deletes a dashboard. * @@ -676,21 +654,15 @@ export class Dashboards { * * 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; - + async deleteDashboard(parameters: Parameters.DeleteDashboard, callback?: never): Promise; + async deleteDashboard(parameters: Parameters.DeleteDashboard, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/dashboard/${id}`, + url: `/rest/api/2/dashboard/${parameters.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. * @@ -714,6 +686,9 @@ export class Dashboards { const config: RequestConfig = { url: `/rest/api/2/dashboard/${parameters.id}/copy`, method: 'POST', + params: { + extendAdminPermissions: parameters.extendAdminPermissions, + }, data: { description: parameters.description, editPermissions: parameters.editPermissions, diff --git a/src/version2/filters.ts b/src/version2/filters.ts index e8db779027..97df20fbf2 100644 --- a/src/version2/filters.ts +++ b/src/version2/filters.ts @@ -6,7 +6,6 @@ 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. @@ -14,7 +13,10 @@ export class Filters { * **[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; + async createFilter( + parameters: Parameters.CreateFilter | undefined, + 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. @@ -22,39 +24,39 @@ export class Filters { * **[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?: never): Promise; async createFilter( - parameters: Parameters.CreateFilter, + parameters?: Parameters.CreateFilter, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/filter', method: 'POST', params: { - expand: parameters.expand, - overrideSharePermissions: parameters.overrideSharePermissions, + 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, + approximateLastUsed: parameters?.approximateLastUsed, + 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. * @@ -113,7 +115,6 @@ export class Filters { 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. @@ -168,7 +169,6 @@ export class Filters { 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: @@ -227,6 +227,7 @@ export class Filters { params: { filterName: parameters?.filterName, accountId: parameters?.accountId, + owner: parameters?.owner, groupname: parameters?.groupname, groupId: parameters?.groupId, projectId: parameters?.projectId, @@ -236,12 +237,12 @@ export class Filters { maxResults: parameters?.maxResults, expand: parameters?.expand, overrideSharePermissions: parameters?.overrideSharePermissions, + isSubstringMatch: parameters?.isSubstringMatch, }, }; return this.client.sendRequest(config, callback); } - /** * Returns a filter. * @@ -257,7 +258,7 @@ export class Filters { * - Shared with a public project. * - Shared with the public. */ - async getFilter(parameters: Parameters.GetFilter | string, callback: Callback): Promise; + async getFilter(parameters: Parameters.GetFilter, callback: Callback): Promise; /** * Returns a filter. * @@ -273,25 +274,19 @@ export class Filters { * - 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; - + async getFilter(parameters: Parameters.GetFilter, callback?: never): Promise; + async getFilter(parameters: Parameters.GetFilter, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/filter/${id}`, + url: `/rest/api/2/filter/${parameters.id}`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, - overrideSharePermissions: typeof parameters !== 'string' && parameters.overrideSharePermissions, + expand: parameters.expand, + overrideSharePermissions: parameters.overrideSharePermissions, }, }; return this.client.sendRequest(config, callback); } - /** * Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. * @@ -317,18 +312,11 @@ export class Filters { expand: parameters.expand, overrideSharePermissions: parameters.overrideSharePermissions, }, - data: { - name: parameters.name, - description: parameters.description, - jql: parameters.jql, - favourite: parameters.favourite, - sharePermissions: parameters.sharePermissions, - }, + data: parameters.body, }; return this.client.sendRequest(config, callback); } - /** * Delete a filter. * @@ -336,7 +324,7 @@ export class Filters { * 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; + async deleteFilter(parameters: Parameters.DeleteFilter, callback: Callback): Promise; /** * Delete a filter. * @@ -344,21 +332,15 @@ export class Filters { * 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; - + async deleteFilter(parameters: Parameters.DeleteFilter, callback?: never): Promise; + async deleteFilter(parameters: Parameters.DeleteFilter, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/filter/${id}`, + url: `/rest/api/2/filter/${parameters.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_. @@ -375,10 +357,7 @@ export class Filters { * - Filters shared with a public project. * - Filters shared with the public. */ - async getColumns( - parameters: Parameters.GetColumns | string, - callback: Callback, - ): Promise; + async getColumns(parameters: Parameters.GetColumns, 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_. @@ -395,21 +374,18 @@ export class Filters { * - 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, callback?: never): Promise; async getColumns( - parameters: Parameters.GetColumns | string, + parameters: Parameters.GetColumns, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}/columns`, + url: `/rest/api/2/filter/${parameters.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 @@ -456,12 +432,13 @@ export class Filters { const config: RequestConfig = { url: `/rest/api/2/filter/${parameters.id}/columns`, method: 'PUT', - data: parameters.columns, + data: { + columns: parameters.columns, + }, }; return this.client.sendRequest(config, callback); } - /** * Reset the user's column configuration for the filter to the default. * @@ -498,7 +475,6 @@ export class Filters { return this.client.sendRequest(config, callback); } - /** * Add a filter as a favorite for the user. * @@ -513,7 +489,7 @@ export class Filters { * - Filters shared with the public. */ async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, + parameters: Parameters.SetFavouriteForFilter, callback: Callback, ): Promise; /** @@ -530,26 +506,23 @@ export class Filters { * - Filters shared with the public. */ async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, + parameters: Parameters.SetFavouriteForFilter, callback?: never, ): Promise; async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, + parameters: Parameters.SetFavouriteForFilter, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}/favourite`, + url: `/rest/api/2/filter/${parameters.id}/favourite`, method: 'PUT', params: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: 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 @@ -559,7 +532,7 @@ export class Filters { * Permission to access Jira. */ async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, + parameters: Parameters.DeleteFavouriteForFilter, callback: Callback, ): Promise; /** @@ -571,26 +544,23 @@ export class Filters { * Permission to access Jira. */ async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, + parameters: Parameters.DeleteFavouriteForFilter, callback?: never, ): Promise; async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, + parameters: Parameters.DeleteFavouriteForFilter, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}/favourite`, + url: `/rest/api/2/filter/${parameters.id}/favourite`, method: 'DELETE', params: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: parameters.expand, }, }; return this.client.sendRequest(config, callback); } - /** * Changes the owner of the filter. * diff --git a/src/version2/groups.ts b/src/version2/groups.ts index 1555da63d8..57a4ad3f98 100644 --- a/src/version2/groups.ts +++ b/src/version2/groups.ts @@ -13,53 +13,56 @@ export class Groups { * **[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; + async createGroup( + parameters: Parameters.CreateGroup | undefined, + 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 { + 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, + data: { + name: parameters?.name, + }, }; 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; + async removeGroup(parameters: Parameters.RemoveGroup | undefined, 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 { + 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, + 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. @@ -98,7 +101,6 @@ export class Groups { 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. @@ -106,11 +108,14 @@ export class Groups { * Note that users are ordered by username, however the username is not returned in the results due to privacy * reasons. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, + parameters: Parameters.GetUsersFromGroup | undefined, callback: Callback, ): Promise; /** @@ -120,66 +125,70 @@ export class Groups { * Note that users are ordered by username, however the username is not returned in the results due to privacy * reasons. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, + parameters?: Parameters.GetUsersFromGroup, callback?: never, ): Promise; async getUsersFromGroup( - parameters: Parameters.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, + 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; + async addUserToGroup( + parameters: Parameters.AddUserToGroup | undefined, + 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?: never): Promise; async addUserToGroup( - parameters: Parameters.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, + groupname: parameters?.groupname, + groupId: parameters?.groupId, }, data: { - name: parameters.name, - accountId: parameters.accountId, + accountId: parameters?.accountId, + name: parameters?.name, }, }; return this.client.sendRequest(config, callback); } - /** * Removes a user from a group. * @@ -214,7 +223,6 @@ export class Groups { 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. @@ -268,11 +276,13 @@ export class Groups { url: '/rest/api/2/groups/picker', method: 'GET', params: { + accountId: parameters?.accountId, query: parameters?.query, exclude: parameters?.exclude, excludeId: parameters?.excludeId, maxResults: parameters?.maxResults, caseInsensitive: parameters?.caseInsensitive, + userName: parameters?.userName, }, }; diff --git a/src/version2/index.ts b/src/version2/index.ts index f44c40620e..d185ac5960 100644 --- a/src/version2/index.ts +++ b/src/version2/index.ts @@ -1,13 +1,15 @@ export * from './announcementBanner'; -export * from './applicationRoles'; +export * from './appDataPolicies'; export * from './appMigration'; export * from './appProperties'; +export * from './applicationRoles'; export * from './auditRecords'; export * from './avatars'; +export * from './classificationLevels'; export * from './dashboards'; export * from './dynamicModules'; -export * from './filters'; export * from './filterSharing'; +export * from './filters'; export * from './groupAndUserPicker'; export * from './groups'; export * from './issueAttachments'; @@ -20,26 +22,26 @@ export * from './issueCustomFieldOptionsApps'; export * from './issueCustomFieldValuesApps'; export * from './issueFieldConfigurations'; export * from './issueFields'; -export * from './issueLinks'; export * from './issueLinkTypes'; +export * from './issueLinks'; export * from './issueNavigatorSettings'; export * from './issueNotificationSchemes'; export * from './issuePriorities'; export * from './issueProperties'; export * from './issueRemoteLinks'; export * from './issueResolutions'; -export * from './issues'; export * from './issueSearch'; export * from './issueSecurityLevel'; export * from './issueSecuritySchemes'; export * from './issueTypeProperties'; -export * from './issueTypes'; export * from './issueTypeSchemes'; export * from './issueTypeScreenSchemes'; +export * from './issueTypes'; export * from './issueVotes'; export * from './issueWatchers'; export * from './issueWorklogProperties'; export * from './issueWorklogs'; +export * from './issues'; export * from './jiraExpressions'; export * from './jiraSettings'; export * from './jQL'; @@ -47,10 +49,13 @@ export * from './jqlFunctionsApps'; export * from './labels'; export * from './licenseMetrics'; export * from './myself'; -export * from './permissions'; export * from './permissionSchemes'; +export * from './permissions'; +export * from './plans'; +export * from './prioritySchemes'; export * from './projectAvatars'; export * from './projectCategories'; +export * from './projectClassificationLevels'; export * from './projectComponents'; export * from './projectEmail'; export * from './projectFeatures'; @@ -59,23 +64,24 @@ export * from './projectPermissionSchemes'; export * from './projectProperties'; export * from './projectRoleActors'; export * from './projectRoles'; -export * from './projects'; export * from './projectTypes'; export * from './projectVersions'; -export * from './screens'; +export * from './projects'; export * from './screenSchemes'; export * from './screenTabFields'; export * from './screenTabs'; +export * from './screens'; export * from './serverInfo'; +export * from './serviceRegistry'; export * from './status'; export * from './tasks'; +export * from './teamsInPlan'; export * from './timeTracking'; export * from './uIModificationsApps'; export * from './userProperties'; -export * from './users'; export * from './userSearch'; +export * from './users'; export * from './webhooks'; -export * from './workflows'; export * from './workflowSchemeDrafts'; export * from './workflowSchemeProjectAssociations'; export * from './workflowSchemes'; @@ -83,7 +89,4 @@ 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'; +export * from './workflows'; diff --git a/src/version2/issueAttachments.ts b/src/version2/issueAttachments.ts index 8400766bd6..aa99be1fd4 100644 --- a/src/version2/issueAttachments.ts +++ b/src/version2/issueAttachments.ts @@ -1,5 +1,3 @@ -import { FormData, File } from 'formdata-node'; -import type { Mime } from 'mime' with { 'resolution-mode': 'import' }; import * as Models from './models'; import * as Parameters from './parameters'; import { Client } from '../clients'; @@ -8,7 +6,6 @@ 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) @@ -26,9 +23,10 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, + async getAttachmentContent>( + parameters: Parameters.GetAttachmentContent, callback: Callback, ): Promise; /** @@ -48,29 +46,26 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, + async getAttachmentContent>( + parameters: Parameters.GetAttachmentContent, callback?: never, ): Promise; - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, + async getAttachmentContent>( + parameters: Parameters.GetAttachmentContent, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/attachment/content/${id}`, + url: `/rest/api/2/attachment/content/${parameters.id}`, method: 'GET', params: { - redirect: typeof parameters !== 'string' && parameters.redirect, + redirect: 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. * @@ -101,7 +96,6 @@ export class IssueAttachments { return this.client.sendRequest(config, callback); } - /** * Returns the thumbnail of an attachment. * @@ -116,9 +110,10 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, + async getAttachmentThumbnail>( + parameters: Parameters.GetAttachmentThumbnail, callback: Callback, ): Promise; /** @@ -135,32 +130,29 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, + async getAttachmentThumbnail>( + parameters: Parameters.GetAttachmentThumbnail, callback?: never, ): Promise; - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, + async getAttachmentThumbnail>( + parameters: Parameters.GetAttachmentThumbnail, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/attachment/thumbnail/${id}`, + url: `/rest/api/2/attachment/thumbnail/${parameters.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, + redirect: parameters.redirect, + fallbackToDefault: parameters.fallbackToDefault, + width: parameters.width, + height: parameters.height, }, - responseType: 'arraybuffer', }; return this.client.sendRequest(config, callback); } - /** * Returns the metadata for an attachment. Note that the attachment itself is not returned. * @@ -172,9 +164,10 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async getAttachment( - parameters: Parameters.GetAttachment | string, + parameters: Parameters.GetAttachment, callback: Callback, ): Promise; /** @@ -188,25 +181,23 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async getAttachment( - parameters: Parameters.GetAttachment | string, + parameters: Parameters.GetAttachment, callback?: never, ): Promise; async getAttachment( - parameters: Parameters.GetAttachment | string, + parameters: Parameters.GetAttachment, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/attachment/${id}`, + url: `/rest/api/2/attachment/${parameters.id}`, method: 'GET', }; return this.client.sendRequest(config, callback); } - /** * Deletes an attachment from an issue. * @@ -220,10 +211,7 @@ export class IssueAttachments { * - _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; + async removeAttachment(parameters: Parameters.RemoveAttachment, callback: Callback): Promise; /** * Deletes an attachment from an issue. * @@ -237,21 +225,15 @@ export class IssueAttachments { * - _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; - + async removeAttachment(parameters: Parameters.RemoveAttachment, callback?: never): Promise; + async removeAttachment(parameters: Parameters.RemoveAttachment, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/attachment/${id}`, + url: `/rest/api/2/attachment/${parameters.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 @@ -271,9 +253,10 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, + parameters: Parameters.ExpandAttachmentForHumans, callback: Callback, ): Promise; /** @@ -295,25 +278,23 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, + parameters: Parameters.ExpandAttachmentForHumans, callback?: never, ): Promise; async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, + parameters: Parameters.ExpandAttachmentForHumans, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/attachment/${id}/expand/human`, + url: `/rest/api/2/attachment/${parameters.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 @@ -333,9 +314,10 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, + parameters: Parameters.ExpandAttachmentForMachines, callback: Callback, ): Promise; /** @@ -357,29 +339,168 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, + parameters: Parameters.ExpandAttachmentForMachines, callback?: never, ): Promise; async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, + parameters: Parameters.ExpandAttachmentForMachines, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/attachment/${id}/expand/raw`, + url: `/rest/api/2/attachment/${parameters.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`. + * + * The following examples upload a file called _myfile.txt_ to the issue _TEST-123_: + * + * #### curl + * + * curl --location --request POST 'https://your-domain.atlassian.net/rest/api/2/issue/TEST-123/attachments' + * -u 'email@example.com:' + * -H 'X-Atlassian-Token: no-check' + * --form 'file=@"myfile.txt"' + * + * #### Node.js + * + * // This code sample uses the 'node-fetch' and 'form-data' libraries: + * // https://www.npmjs.com/package/node-fetch + * // https://www.npmjs.com/package/form-data + * const fetch = require('node-fetch'); + * const FormData = require('form-data'); + * const fs = require('fs'); + * + * const filePath = 'myfile.txt'; + * const form = new FormData(); + * const stats = fs.statSync(filePath); + * const fileSizeInBytes = stats.size; + * const fileStream = fs.createReadStream(filePath); + * + * form.append('file', fileStream, { knownLength: fileSizeInBytes }); + * + * fetch('https://your-domain.atlassian.net/rest/api/2/issue/TEST-123/attachments', { + * method: 'POST', + * body: form, + * headers: { + * Authorization: `Basic ${Buffer.from('email@example.com:').toString('base64')}`, + * Accept: 'application/json', + * 'X-Atlassian-Token': 'no-check', + * }, + * }) + * .then(response => { + * console.log(`Response: ${response.status} ${response.statusText}`); + * return response.text(); + * }) + * .then(text => console.log(text)) + * .catch(err => console.error(err)); + * + * #### Java + * + * // This code sample uses the 'Unirest' library: + * // http://unirest.io/java.html + * HttpResponse response = Unirest.post("https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments") + * .basicAuth("email@example.com", "") + * .header("Accept", "application/json") + * .header("X-Atlassian-Token", "no-check") + * .field("file", new File("myfile.txt")) + * .asJson(); + * + * System.out.println(response.getBody()); + * + * #### Python + * + * # This code sample uses the 'requests' library: + * # http://docs.python-requests.org + * import requests + * from requests.auth import HTTPBasicAuth + * import json + * + * url = "https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments" + * + * auth = HTTPBasicAuth("email@example.com", "") + * + * headers = { + * "Accept": "application/json", + * "X-Atlassian-Token": "no-check" + * } + * + * response = requests.request( + * "POST", + * url, + * headers = headers, + * auth = auth, + * files = { + * "file": ("myfile.txt", open("myfile.txt","rb"), "application-type") + * } + * ) + * + * print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": "))) + * + * #### PHP + * + * // This code sample uses the 'Unirest' library: + * // http://unirest.io/php.html + * Unirest\Request::auth('email@example.com', ''); + * + * $headers = array( + * 'Accept' => 'application/json', + * 'X-Atlassian-Token' => 'no-check' + * ); + * + * $parameters = array( + * 'file' => File::add('myfile.txt') + * ); + * + * $response = Unirest\Request::post( + * 'https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments', + * $headers, + * $parameters + * ); + * + * var_dump($response) + * + * #### Forge + * + * // This sample uses Atlassian Forge and the `form-data` library. + * // https://developer.atlassian.com/platform/forge/ + * // https://www.npmjs.com/package/form-data + * import api from '@forge/api'; + * import FormData from 'form-data'; + * + * const form = new FormData(); + * form.append('file', fileStream, { knownLength: fileSizeInBytes }); + * + * const response = await api.asApp().requestJira('/rest/api/2/issue/{issueIdOrKey}/attachments', { + * method: 'POST', + * body: form, + * headers: { + * Accept: 'application/json', + * 'X-Atlassian-Token': 'no-check', + * }, + * }); + * + * console.log(`Response: ${response.status} ${response.statusText}`); + * console.log(await response.json()); + * + * Tip: Use a client library. Many client libraries have classes for handling multipart POST operations. For example, + * in Java, the Apache HTTP Components library provides a + * [MultiPartEntity](http://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntity.html) + * class for multipart POST operations. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -397,6 +518,147 @@ export class IssueAttachments { * 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`. + * + * The following examples upload a file called _myfile.txt_ to the issue _TEST-123_: + * + * #### curl + * + * curl --location --request POST 'https://your-domain.atlassian.net/rest/api/2/issue/TEST-123/attachments' + * -u 'email@example.com:' + * -H 'X-Atlassian-Token: no-check' + * --form 'file=@"myfile.txt"' + * + * #### Node.js + * + * // This code sample uses the 'node-fetch' and 'form-data' libraries: + * // https://www.npmjs.com/package/node-fetch + * // https://www.npmjs.com/package/form-data + * const fetch = require('node-fetch'); + * const FormData = require('form-data'); + * const fs = require('fs'); + * + * const filePath = 'myfile.txt'; + * const form = new FormData(); + * const stats = fs.statSync(filePath); + * const fileSizeInBytes = stats.size; + * const fileStream = fs.createReadStream(filePath); + * + * form.append('file', fileStream, { knownLength: fileSizeInBytes }); + * + * fetch('https://your-domain.atlassian.net/rest/api/2/issue/TEST-123/attachments', { + * method: 'POST', + * body: form, + * headers: { + * Authorization: `Basic ${Buffer.from('email@example.com:').toString('base64')}`, + * Accept: 'application/json', + * 'X-Atlassian-Token': 'no-check', + * }, + * }) + * .then(response => { + * console.log(`Response: ${response.status} ${response.statusText}`); + * return response.text(); + * }) + * .then(text => console.log(text)) + * .catch(err => console.error(err)); + * + * #### Java + * + * // This code sample uses the 'Unirest' library: + * // http://unirest.io/java.html + * HttpResponse response = Unirest.post("https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments") + * .basicAuth("email@example.com", "") + * .header("Accept", "application/json") + * .header("X-Atlassian-Token", "no-check") + * .field("file", new File("myfile.txt")) + * .asJson(); + * + * System.out.println(response.getBody()); + * + * #### Python + * + * # This code sample uses the 'requests' library: + * # http://docs.python-requests.org + * import requests + * from requests.auth import HTTPBasicAuth + * import json + * + * url = "https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments" + * + * auth = HTTPBasicAuth("email@example.com", "") + * + * headers = { + * "Accept": "application/json", + * "X-Atlassian-Token": "no-check" + * } + * + * response = requests.request( + * "POST", + * url, + * headers = headers, + * auth = auth, + * files = { + * "file": ("myfile.txt", open("myfile.txt","rb"), "application-type") + * } + * ) + * + * print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": "))) + * + * #### PHP + * + * // This code sample uses the 'Unirest' library: + * // http://unirest.io/php.html + * Unirest\Request::auth('email@example.com', ''); + * + * $headers = array( + * 'Accept' => 'application/json', + * 'X-Atlassian-Token' => 'no-check' + * ); + * + * $parameters = array( + * 'file' => File::add('myfile.txt') + * ); + * + * $response = Unirest\Request::post( + * 'https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments', + * $headers, + * $parameters + * ); + * + * var_dump($response) + * + * #### Forge + * + * // This sample uses Atlassian Forge and the `form-data` library. + * // https://developer.atlassian.com/platform/forge/ + * // https://www.npmjs.com/package/form-data + * import api from '@forge/api'; + * import FormData from 'form-data'; + * + * const form = new FormData(); + * form.append('file', fileStream, { knownLength: fileSizeInBytes }); + * + * const response = await api.asApp().requestJira('/rest/api/2/issue/{issueIdOrKey}/attachments', { + * method: 'POST', + * body: form, + * headers: { + * Accept: 'application/json', + * 'X-Atlassian-Token': 'no-check', + * }, + * }); + * + * console.log(`Response: ${response.status} ${response.statusText}`); + * console.log(await response.json()); + * + * Tip: Use a client library. Many client libraries have classes for handling multipart POST operations. For example, + * in Java, the Apache HTTP Components library provides a + * [MultiPartEntity](http://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntity.html) + * class for multipart POST operations. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -411,113 +673,11 @@ export class IssueAttachments { parameters: Parameters.AddAttachment, callback?: Callback, ): Promise { - const formData = new FormData(); - const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; - - const { default: mime } = await import('mime'); - - let Readable: typeof import('stream').Readable | undefined; - - if (typeof window === 'undefined') { - const { Readable: NodeReadable } = await import('stream'); - - Readable = NodeReadable; - } - - // eslint-disable-next-line no-restricted-syntax - for await (const attachment of attachments) { - const file = await this._convertToFile(attachment, mime, Readable); - - if (!(file instanceof File || file instanceof Blob)) { - throw new Error(`Unsupported file type for attachment: ${typeof file}`); - } - - formData.append('file', 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', - }, - data: formData, - maxBodyLength: Infinity, - maxContentLength: Infinity, }; return this.client.sendRequest(config, callback); } - - private async _convertToFile( - attachment: Parameters.Attachment, - mime: Mime, - Readable?: typeof import('stream').Readable, - ): Promise { - const mimeType = attachment.mimeType ?? (mime.getType(attachment.filename) || undefined); - - if (attachment.file instanceof Blob || attachment.file instanceof File) { - return attachment.file; - } - - if (typeof attachment.file === 'string') { - return new File([attachment.file], attachment.filename, { type: mimeType }); - } - - if (Readable && attachment.file instanceof Readable) { - return this._streamToBlob(attachment.file, attachment.filename, mimeType); - } - - if (attachment.file instanceof ReadableStream) { - return this._streamToBlob(attachment.file, attachment.filename, mimeType); - } - - if (ArrayBuffer.isView(attachment.file) || attachment.file instanceof ArrayBuffer) { - return new File([attachment.file], attachment.filename, { type: mimeType }); - } - - throw new Error('Unsupported attachment file type.'); - } - - private async _streamToBlob( - stream: import('stream').Readable | ReadableStream, - filename: string, - mimeType?: string, - ): Promise { - if (typeof window === 'undefined' && stream instanceof (await import('stream')).Readable) { - return new Promise((resolve, reject) => { - const chunks: Uint8Array[] = []; - - stream.on('data', chunk => chunks.push(chunk)); - stream.on('end', () => { - const blob = new Blob(chunks, { type: mimeType }); - - resolve(new File([blob], filename, { type: mimeType })); - }); - stream.on('error', reject); - }); - } - - if (stream instanceof ReadableStream) { - const reader = stream.getReader(); - const chunks: Uint8Array[] = []; - - let done = false; - - while (!done) { - // eslint-disable-next-line no-await-in-loop - const { value, done: streamDone } = await reader.read(); - - if (value) chunks.push(value); - done = streamDone; - } - - const blob = new Blob(chunks, { type: mimeType }); - - return new File([blob], filename, { type: mimeType }); - } - - throw new Error('Unsupported stream type.'); - } } diff --git a/src/version2/issueComments.ts b/src/version2/issueComments.ts index 031a7d4d71..d484f265ee 100644 --- a/src/version2/issueComments.ts +++ b/src/version2/issueComments.ts @@ -6,7 +6,6 @@ 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. @@ -23,7 +22,7 @@ export class IssueComments { * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ async getCommentsByIds( - parameters: Parameters.GetCommentsByIds, + parameters: Parameters.GetCommentsByIds | undefined, callback: Callback, ): Promise; /** @@ -41,25 +40,27 @@ export class IssueComments { * 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, + 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, + expand: parameters?.expand, }, data: { - ids: parameters.ids, + ids: parameters?.ids, }, }; return this.client.sendRequest(config, callback); } - /** * Returns all comments for an issue. * @@ -76,7 +77,7 @@ export class IssueComments { * restricted to. */ async getComments( - parameters: Parameters.GetComments | string, + parameters: Parameters.GetComments, callback: Callback, ): Promise; /** @@ -94,30 +95,24 @@ export class IssueComments { * - 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, callback?: never): Promise; async getComments( - parameters: Parameters.GetComments | string, - callback?: never, - ): Promise; - async getComments( - parameters: Parameters.GetComments | string, + parameters: Parameters.GetComments, callback?: Callback, ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/comment`, + url: `/rest/api/2/issue/${parameters.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, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + orderBy: parameters.orderBy, + expand: parameters.expand, }, }; return this.client.sendRequest(config, callback); } - /** * Adds a comment to an issue. * @@ -152,24 +147,23 @@ export class IssueComments { expand: parameters.expand, }, data: { - self: parameters.self, - id: parameters.id, author: parameters.author, - body: parameters.comment, + body: parameters.body, + created: parameters.created, + id: parameters.id, + jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, + jsdPublic: parameters.jsdPublic, + properties: parameters.properties, renderedBody: parameters.renderedBody, + self: parameters.self, updateAuthor: parameters.updateAuthor, - created: parameters.created, updated: parameters.updated, visibility: parameters.visibility, - jsdPublic: parameters.jsdPublic, - jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, - properties: parameters.properties, }, }; return this.client.sendRequest(config, callback); } - /** * Returns a comment. * @@ -211,7 +205,6 @@ export class IssueComments { return this.client.sendRequest(config, callback); } - /** * Updates a comment. * @@ -258,16 +251,11 @@ export class IssueComments { overrideEditableFlag: parameters.overrideEditableFlag, expand: parameters.expand, }, - data: { - body: parameters.comment, - visibility: parameters.visibility, - properties: parameters.properties, - }, + data: parameters.body, }; return this.client.sendRequest(config, callback); } - /** * Deletes a comment. * @@ -302,6 +290,9 @@ export class IssueComments { const config: RequestConfig = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, method: 'DELETE', + params: { + parentId: parameters.parentId, + }, }; return this.client.sendRequest(config, callback); diff --git a/src/version2/issueCustomFieldConfigurationApps.ts b/src/version2/issueCustomFieldConfigurationApps.ts index 366656a37f..eeb3ffb2d5 100644 --- a/src/version2/issueCustomFieldConfigurationApps.ts +++ b/src/version2/issueCustomFieldConfigurationApps.ts @@ -6,10 +6,80 @@ 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 list of custom fields of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations for the provided list of custom fields are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that provided the custom field type. + */ + async getCustomFieldsConfigurations( + parameters: Parameters.GetCustomFieldsConfigurations | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * configurations for list of custom fields of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations for the provided list of custom fields are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that provided the custom field type. + */ + async getCustomFieldsConfigurations( + parameters?: Parameters.GetCustomFieldsConfigurations, + callback?: never, + ): Promise; + async getCustomFieldsConfigurations( + parameters?: Parameters.GetCustomFieldsConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/app/field/context/configuration/list', + method: 'POST', + params: { + id: parameters?.id, + fieldContextId: parameters?.fieldContextId, + issueId: parameters?.issueId, + projectKeyOrId: parameters?.projectKeyOrId, + issueTypeId: parameters?.issueTypeId, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + data: { + fieldIdsOrKeys: parameters?.fieldIdsOrKeys, + }, + }; + return this.client.sendRequest(config, callback); + } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). + * configurations for a custom field of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * * The result can be filtered by one of these criteria: * @@ -22,7 +92,7 @@ export class IssueCustomFieldConfigurationApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. + * for the Forge app that provided the custom field type. */ async getCustomFieldConfiguration( parameters: Parameters.GetCustomFieldConfiguration, @@ -30,7 +100,9 @@ export class IssueCustomFieldConfigurationApps { ): Promise; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). + * configurations for a custom field of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * * The result can be filtered by one of these criteria: * @@ -43,7 +115,7 @@ export class IssueCustomFieldConfigurationApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. + * for the Forge app that provided the custom field type. */ async getCustomFieldConfiguration( parameters: Parameters.GetCustomFieldConfiguration, @@ -69,26 +141,27 @@ export class IssueCustomFieldConfigurationApps { 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/). + * Update the configuration for contexts of a custom field of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. + * for the Forge app that created the custom field type. */ async updateCustomFieldConfiguration( parameters: Parameters.UpdateCustomFieldConfiguration, callback: Callback, ): Promise; /** - * Update the configuration for contexts of a custom field created by a [Forge - * app](https://developer.atlassian.com/platform/forge/). + * Update the configuration for contexts of a custom field of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. + * for the Forge app that created the custom field type. */ async updateCustomFieldConfiguration( parameters: Parameters.UpdateCustomFieldConfiguration, diff --git a/src/version2/issueCustomFieldOptions.ts b/src/version2/issueCustomFieldOptions.ts index 6325259464..0cc7ba6ad4 100644 --- a/src/version2/issueCustomFieldOptions.ts +++ b/src/version2/issueCustomFieldOptions.ts @@ -6,7 +6,6 @@ import { RequestConfig } from '../requestConfig'; export class IssueCustomFieldOptions { constructor(private client: Client) {} - /** * Returns a custom field option. For example, an option in a select list. * @@ -25,7 +24,7 @@ export class IssueCustomFieldOptions { * to view. */ async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, + parameters: Parameters.GetCustomFieldOption, callback: Callback, ): Promise; /** @@ -46,23 +45,20 @@ export class IssueCustomFieldOptions { * to view. */ async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, + parameters: Parameters.GetCustomFieldOption, callback?: never, ): Promise; async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, + parameters: Parameters.GetCustomFieldOption, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/customFieldOption/${id}`, + url: `/rest/api/2/customFieldOption/${parameters.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 @@ -112,7 +108,6 @@ export class IssueCustomFieldOptions { 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. @@ -163,7 +158,6 @@ export class IssueCustomFieldOptions { return this.client.sendRequest(config, callback); } - /** * Updates the options of a custom field. * @@ -212,7 +206,6 @@ export class IssueCustomFieldOptions { return this.client.sendRequest(config, callback); } - /** * Changes the order of custom field options or cascading options in a context. * @@ -249,15 +242,14 @@ export class IssueCustomFieldOptions { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/move`, method: 'PUT', data: { - customFieldOptionIds: parameters.customFieldOptionIds, after: parameters.after, + customFieldOptionIds: parameters.customFieldOptionIds, position: parameters.position, }, }; return this.client.sendRequest(config, callback); } - /** * Deletes a custom field option. * @@ -296,6 +288,49 @@ export class IssueCustomFieldOptions { method: 'DELETE', }; + return this.client.sendRequest(config, callback); + } + /** + * Replaces the options of a custom field. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect or Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async replaceCustomFieldOption( + parameters: Parameters.ReplaceCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Replaces the options of a custom field. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect or Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async replaceCustomFieldOption( + parameters: Parameters.ReplaceCustomFieldOption, + callback?: never, + ): Promise; + async replaceCustomFieldOption( + parameters: Parameters.ReplaceCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}/issue`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + jql: parameters.jql, + }, + }; + return this.client.sendRequest(config, callback); } } diff --git a/src/version2/issueCustomFieldOptionsApps.ts b/src/version2/issueCustomFieldOptionsApps.ts index 5f20a2946a..2a80e9086b 100644 --- a/src/version2/issueCustomFieldOptionsApps.ts +++ b/src/version2/issueCustomFieldOptionsApps.ts @@ -6,7 +6,6 @@ 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 @@ -22,7 +21,7 @@ export class IssueCustomFieldOptionsApps { * for the app providing the field. */ async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, + parameters: Parameters.GetAllIssueFieldOptions, callback: Callback, ): Promise; /** @@ -40,27 +39,24 @@ export class IssueCustomFieldOptionsApps { * for the app providing the field. */ async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, + parameters: Parameters.GetAllIssueFieldOptions, callback?: never, ): Promise; async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, + parameters: Parameters.GetAllIssueFieldOptions, callback?: Callback, ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldKey}/option`, + url: `/rest/api/2/field/${parameters.fieldKey}/option`, method: 'GET', params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; return this.client.sendRequest(config, callback); } - /** * Creates an option for a select list issue field. * @@ -68,6 +64,8 @@ export class IssueCustomFieldOptionsApps { * used with issue field select list options created in Jira or using operations from the [Issue custom field * options](#api-group-Issue-custom-field-options) resource. * + * Each field can have a maximum of 10000 options, and each option can have a maximum of 10000 scopes. + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required * for the app providing the field. @@ -83,6 +81,8 @@ export class IssueCustomFieldOptionsApps { * used with issue field select list options created in Jira or using operations from the [Issue custom field * options](#api-group-Issue-custom-field-options) resource. * + * Each field can have a maximum of 10000 options, and each option can have a maximum of 10000 scopes. + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required * for the app providing the field. @@ -99,15 +99,14 @@ export class IssueCustomFieldOptionsApps { url: `/rest/api/2/field/${parameters.fieldKey}/option`, method: 'POST', data: { - value: parameters.value, - properties: parameters.properties, config: parameters.config, + properties: parameters.properties, + value: parameters.value, }, }; 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. @@ -120,7 +119,7 @@ export class IssueCustomFieldOptionsApps { * Permission to access Jira. */ async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, + parameters: Parameters.GetSelectableIssueFieldOptions, callback: Callback, ): Promise; /** @@ -135,28 +134,25 @@ export class IssueCustomFieldOptionsApps { * Permission to access Jira. */ async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, + parameters: Parameters.GetSelectableIssueFieldOptions, callback?: never, ): Promise; async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, + parameters: Parameters.GetSelectableIssueFieldOptions, callback?: Callback, ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldKey}/option/suggestions/edit`, + url: `/rest/api/2/field/${parameters.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, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: 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. @@ -169,7 +165,7 @@ export class IssueCustomFieldOptionsApps { * Permission to access Jira. */ async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, + parameters: Parameters.GetVisibleIssueFieldOptions, callback: Callback, ): Promise; /** @@ -184,28 +180,25 @@ export class IssueCustomFieldOptionsApps { * Permission to access Jira. */ async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, + parameters: Parameters.GetVisibleIssueFieldOptions, callback?: never, ): Promise; async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, + parameters: Parameters.GetVisibleIssueFieldOptions, callback?: Callback, ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldKey}/option/suggestions/search`, + url: `/rest/api/2/field/${parameters.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, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, }, }; return this.client.sendRequest(config, callback); } - /** * Returns an option from a select list issue field. * @@ -247,7 +240,6 @@ export class IssueCustomFieldOptionsApps { 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 @@ -290,16 +282,15 @@ export class IssueCustomFieldOptionsApps { url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, method: 'PUT', data: { + config: parameters.config, id: parameters.id, - value: parameters.value, properties: parameters.properties, - config: parameters.config, + value: parameters.value, }, }; return this.client.sendRequest(config, callback); } - /** * Deletes an option from a select list issue field. * @@ -338,7 +329,6 @@ export class IssueCustomFieldOptionsApps { 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 diff --git a/src/version2/issueCustomFieldValuesApps.ts b/src/version2/issueCustomFieldValuesApps.ts index cbad362805..2fc4e20189 100644 --- a/src/version2/issueCustomFieldValuesApps.ts +++ b/src/version2/issueCustomFieldValuesApps.ts @@ -1,3 +1,4 @@ +import * as Models from './models'; import * as Parameters from './parameters'; import { Client } from '../clients'; import { Callback } from '../callback'; @@ -5,64 +6,92 @@ 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. + * be unique within the request. + * + * Apps can only perform this operation on [custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/) and [custom + * field types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) + * declared in their own manifests. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. + * the app that owns the custom field or custom field type can update its values with this operation. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, + parameters: Parameters.UpdateMultipleCustomFieldValues | undefined, 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. + * be unique within the request. + * + * Apps can only perform this operation on [custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/) and [custom + * field types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) + * declared in their own manifests. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. + * the app that owns the custom field or custom field type can update its values with this operation. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, + parameters?: Parameters.UpdateMultipleCustomFieldValues, callback?: never, ): Promise; async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, + parameters?: Parameters.UpdateMultipleCustomFieldValues, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/app/field/value', method: 'POST', params: { - generateChangelog: parameters.generateChangelog, + generateChangelog: parameters?.generateChangelog, }, data: { - updates: parameters.updates, + 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. + * Updates the value of a custom field on one or more issues. + * + * Apps can only perform this operation on [custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/) and [custom + * field types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) + * declared in their own manifests. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. + * the app that owns the custom field or custom field type can update its values with this operation. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateCustomFieldValue( parameters: Parameters.UpdateCustomFieldValue, callback: Callback, ): Promise; /** - * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that - * created them. + * Updates the value of a custom field on one or more issues. + * + * Apps can only perform this operation on [custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/) and [custom + * field types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) + * declared in their own manifests. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. + * the app that owns the custom field or custom field type can update its values with this operation. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateCustomFieldValue(parameters: Parameters.UpdateCustomFieldValue, callback?: never): Promise; async updateCustomFieldValue( diff --git a/src/version2/issueFields.ts b/src/version2/issueFields.ts index 6bd4324294..4ea9fbc852 100644 --- a/src/version2/issueFields.ts +++ b/src/version2/issueFields.ts @@ -6,7 +6,6 @@ import { RequestConfig } from '../requestConfig'; export class IssueFields { constructor(private client: Client) {} - /** * Returns system and custom issue fields according to the following rules: * @@ -47,7 +46,6 @@ export class IssueFields { return this.client.sendRequest(config, callback); } - /** * Creates a custom field. * @@ -76,16 +74,15 @@ export class IssueFields { url: '/rest/api/2/field', method: 'POST', data: { - name: parameters?.name, description: parameters?.description, - type: parameters?.type, + name: parameters?.name, searcherKey: parameters?.searcherKey, + type: parameters?.type, }, }; 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: @@ -95,7 +92,7 @@ export class IssueFields { * - Fields that contain a string in the field name or description, by defining `query` * - Specific fields that contain a string in the field name or description, by defining `id` and `query` * - * Only custom fields can be queried, `type` must be set to `custom`. + * Use `type` must be set to `custom` to show custom fields only. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -113,7 +110,7 @@ export class IssueFields { * - Fields that contain a string in the field name or description, by defining `query` * - Specific fields that contain a string in the field name or description, by defining `id` and `query` * - * Only custom fields can be queried, `type` must be set to `custom`. + * Use `type` must be set to `custom` to show custom fields only. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -142,7 +139,6 @@ export class IssueFields { 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. @@ -188,7 +184,6 @@ export class IssueFields { return this.client.sendRequest(config, callback); } - /** * Updates a custom field. * @@ -211,15 +206,53 @@ export class IssueFields { url: `/rest/api/2/field/${parameters.fieldId}`, method: 'PUT', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, searcherKey: parameters.searcherKey, }, }; return this.client.sendRequest(config, callback); } + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * contexts a field is used in. Deprecated, use [ Get custom field + * contexts](#api-rest-api-2-field-fieldId-context-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 getContextsForFieldDeprecated( + parameters: Parameters.GetContextsForFieldDeprecated, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * contexts a field is used in. Deprecated, use [ Get custom field + * contexts](#api-rest-api-2-field-fieldId-context-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 getContextsForFieldDeprecated( + parameters: Parameters.GetContextsForFieldDeprecated, + callback?: never, + ): Promise; + async getContextsForFieldDeprecated( + parameters: Parameters.GetContextsForFieldDeprecated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/contexts`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + 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. @@ -257,7 +290,6 @@ export class IssueFields { 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. @@ -288,7 +320,6 @@ export class IssueFields { 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. diff --git a/src/version2/issueNotificationSchemes.ts b/src/version2/issueNotificationSchemes.ts index 2eff08bd84..07decb80ff 100644 --- a/src/version2/issueNotificationSchemes.ts +++ b/src/version2/issueNotificationSchemes.ts @@ -6,7 +6,6 @@ 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. @@ -54,7 +53,6 @@ export class IssueNotificationSchemes { return this.client.sendRequest(config, callback); } - /** * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. * @@ -62,7 +60,7 @@ export class IssueNotificationSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, + parameters: Parameters.CreateNotificationScheme | undefined, callback: Callback, ): Promise; /** @@ -72,26 +70,25 @@ export class IssueNotificationSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, + parameters?: Parameters.CreateNotificationScheme, callback?: never, ): Promise; async createNotificationScheme( - parameters: Parameters.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, + 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 @@ -137,7 +134,6 @@ export class IssueNotificationSchemes { 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. @@ -147,7 +143,7 @@ export class IssueNotificationSchemes { * with the notification scheme. */ async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, + parameters: Parameters.GetNotificationScheme, callback: Callback, ): Promise; /** @@ -159,26 +155,23 @@ export class IssueNotificationSchemes { * with the notification scheme. */ async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, + parameters: Parameters.GetNotificationScheme, callback?: never, ): Promise; async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, + parameters: Parameters.GetNotificationScheme, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/notificationscheme/${id}`, + url: `/rest/api/2/notificationscheme/${parameters.id}`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: parameters.expand, }, }; return this.client.sendRequest(config, callback); } - /** * Updates a notification scheme. * @@ -214,7 +207,37 @@ export class IssueNotificationSchemes { return this.client.sendRequest(config, callback); } + /** + * Adds notifications to a notification scheme. You can add up to 1000 notifications per request. + * + * _Deprecated: The notification type `EmailAddress` is no longer supported in Cloud. Refer to the + * [changelog](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1031) for more details._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addNotifications(parameters: Parameters.AddNotifications, callback: Callback): Promise; + /** + * Adds notifications to a notification scheme. You can add up to 1000 notifications per request. + * + * _Deprecated: The notification type `EmailAddress` is no longer supported in Cloud. Refer to the + * [changelog](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1031) for more details._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addNotifications(parameters: Parameters.AddNotifications, callback?: never): Promise; + async addNotifications(parameters: Parameters.AddNotifications, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/notificationscheme/${parameters.id}/notification`, + method: 'PUT', + data: { + notificationSchemeEvents: parameters.notificationSchemeEvents, + }, + }; + return this.client.sendRequest(config, callback); + } /** * Deletes a notification scheme. * @@ -246,7 +269,6 @@ export class IssueNotificationSchemes { return this.client.sendRequest(config, callback); } - /** * Removes a notification from a notification scheme. * diff --git a/src/version2/issuePriorities.ts b/src/version2/issuePriorities.ts index 61b7f7fdd6..2b7daf9921 100644 --- a/src/version2/issuePriorities.ts +++ b/src/version2/issuePriorities.ts @@ -2,12 +2,10 @@ import * as Models from './models'; import * as Parameters from './parameters'; import { Client } from '../clients'; import { Callback } from '../callback'; -import { paramSerializer } from '../paramSerializer'; import { RequestConfig } from '../requestConfig'; export class IssuePriorities { constructor(private client: Client) {} - /** * Returns the list of all issue priorities. * @@ -30,42 +28,47 @@ export class IssuePriorities { return this.client.sendRequest(config, callback); } - /** * Creates an issue priority. * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createPriority( - parameters: Parameters.CreatePriority, + parameters: Parameters.CreatePriority | undefined, callback: Callback, ): Promise; /** * Creates an issue priority. * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createPriority(parameters: Parameters.CreatePriority, callback?: never): Promise; + async createPriority(parameters?: Parameters.CreatePriority, callback?: never): Promise; async createPriority( - parameters: Parameters.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, + avatarId: parameters?.avatarId, + description: parameters?.description, + iconUrl: parameters?.iconUrl, + name: parameters?.name, + statusColor: parameters?.statusColor, }, }; return this.client.sendRequest(config, callback); } - /** * Sets default issue priority. * @@ -97,35 +100,36 @@ export class IssuePriorities { 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; + async movePriorities( + parameters: Parameters.MovePriorities | undefined, + 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 { + 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, + 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/v2/intro/#pagination) list of * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: @@ -171,48 +175,48 @@ export class IssuePriorities { startAt: parameters?.startAt, maxResults: parameters?.maxResults, id: parameters?.id, - projectId: paramSerializer('projectId', parameters?.projectId), + projectId: parameters?.projectId, + priorityName: parameters?.priorityName, onlyDefault: parameters?.onlyDefault, + expand: parameters?.expand, }, }; 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; + async getPriority(parameters: Parameters.GetPriority, 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, callback?: never): Promise; async getPriority( - parameters: Parameters.GetPriority | string, + parameters: Parameters.GetPriority, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/priority/${id}`, + url: `/rest/api/2/priority/${parameters.id}`, method: 'GET', }; return this.client.sendRequest(config, callback); } - /** * Updates an issue priority. * + * At least one request body parameter must be defined. + * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -220,6 +224,11 @@ export class IssuePriorities { /** * Updates an issue priority. * + * At least one request body parameter must be defined. + * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -229,6 +238,7 @@ export class IssuePriorities { url: `/rest/api/2/priority/${parameters.id}`, method: 'PUT', data: { + avatarId: parameters.avatarId, description: parameters.description, iconUrl: parameters.iconUrl, name: parameters.name, @@ -236,6 +246,38 @@ export class IssuePriorities { }, }; + return this.client.sendRequest(config, callback); + } + /** + * Deletes an issue priority. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriority(parameters: Parameters.DeletePriority, callback: Callback): Promise; + /** + * Deletes an issue priority. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriority(parameters: Parameters.DeletePriority, callback?: never): Promise; + async deletePriority(parameters: Parameters.DeletePriority, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/priority/${parameters.id}`, + method: 'DELETE', + }; + return this.client.sendRequest(config, callback); } } diff --git a/src/version2/issueResolutions.ts b/src/version2/issueResolutions.ts index 041fcce7dc..569165c8ed 100644 --- a/src/version2/issueResolutions.ts +++ b/src/version2/issueResolutions.ts @@ -6,7 +6,28 @@ import { RequestConfig } from '../requestConfig'; export class IssueResolutions { constructor(private client: Client) {} + /** + * Returns a list of all issue resolution values. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolutions(callback: Callback): Promise; + /** + * Returns a list of all issue resolution values. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolutions(callback?: never): Promise; + async getResolutions(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/resolution', + method: 'GET', + }; + return this.client.sendRequest(config, callback); + } /** * Creates an issue resolution. * @@ -14,7 +35,7 @@ export class IssueResolutions { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createResolution( - parameters: Parameters.CreateResolution, + parameters: Parameters.CreateResolution | undefined, callback: Callback, ): Promise; /** @@ -24,22 +45,24 @@ export class IssueResolutions { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createResolution( - parameters: Parameters.CreateResolution, + parameters?: Parameters.CreateResolution, callback?: never, ): Promise; async createResolution( - parameters: Parameters.CreateResolution, + parameters?: Parameters.CreateResolution, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/resolution', method: 'POST', - data: parameters, + data: { + description: parameters?.description, + name: parameters?.name, + }, }; return this.client.sendRequest(config, callback); } - /** * Sets default issue resolution. * @@ -47,7 +70,7 @@ export class IssueResolutions { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async setDefaultResolution( - parameters: Parameters.SetDefaultResolution, + parameters: Parameters.SetDefaultResolution | undefined, callback: Callback, ): Promise; /** @@ -56,50 +79,51 @@ export class IssueResolutions { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setDefaultResolution(parameters: Parameters.SetDefaultResolution, callback?: never): Promise; + async setDefaultResolution(parameters?: Parameters.SetDefaultResolution, callback?: never): Promise; async setDefaultResolution( - parameters: Parameters.SetDefaultResolution, + parameters?: Parameters.SetDefaultResolution, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/resolution/default', method: 'PUT', data: { - id: parameters.id, + 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; + async moveResolutions( + parameters: Parameters.MoveResolutions | undefined, + 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 { + 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, + 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/v2/intro/#pagination) list of * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: @@ -147,7 +171,34 @@ export class IssueResolutions { return this.client.sendRequest(config, callback); } + /** + * Returns an issue resolution value. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolution( + parameters: Parameters.GetResolution, + callback: Callback, + ): Promise; + /** + * Returns an issue resolution value. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolution(parameters: Parameters.GetResolution, callback?: never): Promise; + async getResolution( + parameters: Parameters.GetResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/resolution/${parameters.id}`, + method: 'GET', + }; + return this.client.sendRequest(config, callback); + } /** * Updates an issue resolution. * @@ -167,16 +218,13 @@ export class IssueResolutions { url: `/rest/api/2/resolution/${parameters.id}`, method: 'PUT', data: { - ...parameters, - name: parameters.name, description: parameters.description, - id: undefined, + name: parameters.name, }, }; return this.client.sendRequest(config, callback); } - /** * Deletes an issue resolution. * @@ -188,10 +236,7 @@ export class IssueResolutions { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteResolution( - parameters: Parameters.DeleteResolution, - callback: Callback, - ): Promise; + async deleteResolution(parameters: Parameters.DeleteResolution, callback: Callback): Promise; /** * Deletes an issue resolution. * @@ -203,11 +248,8 @@ export class IssueResolutions { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteResolution( - parameters: Parameters.DeleteResolution, - callback?: never, - ): Promise; - async deleteResolution( + async deleteResolution(parameters: Parameters.DeleteResolution, callback?: never): Promise; + async deleteResolution( parameters: Parameters.DeleteResolution, callback?: Callback, ): Promise { diff --git a/src/version2/issueSearch.ts b/src/version2/issueSearch.ts index 2ee45270b1..a955671640 100644 --- a/src/version2/issueSearch.ts +++ b/src/version2/issueSearch.ts @@ -6,7 +6,6 @@ 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. @@ -64,7 +63,6 @@ export class IssueSearch { return this.client.sendRequest(config, callback); } - /** * Checks whether one or more issues would be returned by one or more JQL queries. * @@ -100,14 +98,13 @@ export class IssueSearch { url: '/rest/api/2/jql/match', method: 'POST', data: { - jqls: parameters?.jqls, issueIds: parameters?.issueIds, + jqls: parameters?.jqls, }, }; return this.client.sendRequest(config, callback); } - /** * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). * @@ -164,12 +161,12 @@ export class IssueSearch { expand: parameters?.expand, properties: parameters?.properties, fieldsByKeys: parameters?.fieldsByKeys, + failFast: parameters?.failFast, }, }; return this.client.sendRequest(config, callback); } - /** * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). * @@ -218,29 +215,40 @@ export class IssueSearch { url: '/rest/api/2/search', method: 'POST', data: { + expand: parameters?.expand, + fields: parameters?.fields, + fieldsByKeys: parameters?.fieldsByKeys, jql: parameters?.jql, - startAt: parameters?.startAt, maxResults: parameters?.maxResults, - fields: parameters?.fields, - validateQuery: parameters?.validateQuery, - expand: parameters?.expand, properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, + startAt: parameters?.startAt, + validateQuery: parameters?.validateQuery, }, }; return this.client.sendRequest(config, callback); } - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately - * visible in the returned search results. + * Provide an estimated count of the issues that match the [JQL](https://confluence.atlassian.com/x/egORLQ). Recent + * updates might not be immediately visible in the returned output. This endpoint requires JQL to be bounded. + * + * This operation can be accessed anonymously. * - * If you need [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) - * consistency, you can utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: * - * If the JQL query expression is too large to be encoded as a query parameter, use the - * [POST](#searchforissuesusingjqlenhancedsearchpost) version of this resource. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async countIssues( + parameters: Parameters.CountIssues | undefined, + callback: Callback, + ): Promise; + /** + * Provide an estimated count of the issues that match the [JQL](https://confluence.atlassian.com/x/egORLQ). Recent + * updates might not be immediately visible in the returned output. This endpoint requires JQL to be bounded. * * This operation can be accessed anonymously. * @@ -252,21 +260,112 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async searchForIssuesUsingJqlEnhancedSearch( - parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch | undefined, + async countIssues(parameters?: Parameters.CountIssues, callback?: never): Promise; + async countIssues( + parameters?: Parameters.CountIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/search/approximate-count', + method: 'POST', + data: { + jql: parameters?.jql, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Searches for IDs of issues using [JQL](https://confluence.atlassian.com/x/egORLQ). + * + * Use the [Search](#api-rest-api-2-search-post) endpoint if you need to fetch more than just issue IDs. The Search + * endpoint returns more information, but may take much longer to respond to requests. This is because it uses a + * different mechanism for ordering results than this endpoint and doesn't provide the total number of results for + * your query. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesIds( + parameters: Parameters.SearchForIssuesIds | undefined, callback: Callback, ): Promise; /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately - * visible in the returned search results. + * Searches for IDs of issues using [JQL](https://confluence.atlassian.com/x/egORLQ). + * + * Use the [Search](#api-rest-api-2-search-post) endpoint if you need to fetch more than just issue IDs. The Search + * endpoint returns more information, but may take much longer to respond to requests. This is because it uses a + * different mechanism for ordering results than this endpoint and doesn't provide the total number of results for + * your query. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: * - * If you need [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) - * consistency, you can utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesIds( + parameters?: Parameters.SearchForIssuesIds, + callback?: never, + ): Promise; + async searchForIssuesIds( + parameters?: Parameters.SearchForIssuesIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/search/id', + method: 'POST', + data: { + jql: parameters?.jql, + maxResults: parameters?.maxResults, + nextPageToken: parameters?.nextPageToken, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately + * visible in the returned search results. If you need + * [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) consistency, you can + * utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. This operation can be accessed + * anonymously. * * If the JQL query expression is too large to be encoded as a query parameter, use the - * [POST](#searchforissuesusingjqlenhancedsearchpost) version of this resource. + * [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 searchAndReconsileIssuesUsingJql( + parameters: Parameters.SearchAndReconsileIssuesUsingJql | undefined, + callback: Callback, + ): Promise; + /** + * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately + * visible in the returned search results. If you need + * [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) consistency, you can + * utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. This operation can be accessed + * anonymously. + * + * If the JQL query expression is too large to be encoded as a query parameter, use the + * [POST](#api-rest-api-2-search-post) version of this resource. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues * are included in the response where the user has: @@ -276,12 +375,12 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async searchForIssuesUsingJqlEnhancedSearch( - parameters?: Parameters.SearchForIssuesUsingJqlEnhancedSearch, + async searchAndReconsileIssuesUsingJql( + parameters?: Parameters.SearchAndReconsileIssuesUsingJql, callback?: never, ): Promise; - async searchForIssuesUsingJqlEnhancedSearch( - parameters?: Parameters.SearchForIssuesUsingJqlEnhancedSearch, + async searchAndReconsileIssuesUsingJql( + parameters?: Parameters.SearchAndReconsileIssuesUsingJql, callback?: Callback, ): Promise { const config: RequestConfig = { @@ -302,17 +401,12 @@ export class IssueSearch { return this.client.sendRequest(config, callback); } - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * If you need [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) - * consistency, you can utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. - * - * There is a [GET](#searchforissuesusingjqlenhancedsearch) version of this resource that can be used for smaller JQL - * query expressions. - * - * This operation can be accessed anonymously. + * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately + * visible in the returned search results. If you need + * [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) consistency, you can + * utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. This operation can be accessed + * anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues * are included in the response where the user has: @@ -322,20 +416,16 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async searchForIssuesUsingJqlEnhancedSearchPost( - parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost | undefined, + async searchAndReconsileIssuesUsingJqlPost( + parameters: Parameters.SearchAndReconsileIssuesUsingJqlPost | undefined, callback: Callback, ): Promise; /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * If you need [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) - * consistency, you can utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. - * - * There is a [GET](#searchforissuesusingjqlenhancedsearch) version of this resource that can be used for smaller JQL - * query expressions. - * - * This operation can be accessed anonymously. + * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately + * visible in the returned search results. If you need + * [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) consistency, you can + * utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. This operation can be accessed + * anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues * are included in the response where the user has: @@ -345,26 +435,25 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async searchForIssuesUsingJqlEnhancedSearchPost( - parameters?: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, + async searchAndReconsileIssuesUsingJqlPost( + parameters?: Parameters.SearchAndReconsileIssuesUsingJqlPost, callback?: never, ): Promise; - async searchForIssuesUsingJqlEnhancedSearchPost( - parameters?: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, + async searchAndReconsileIssuesUsingJqlPost( + parameters?: Parameters.SearchAndReconsileIssuesUsingJqlPost, callback?: Callback, ): Promise { const config: RequestConfig = { - url: '/rest/api/2/search', + url: '/rest/api/2/search/jql', method: 'POST', data: { + expand: parameters?.expand, + fields: parameters?.fields, + fieldsByKeys: parameters?.fieldsByKeys, jql: parameters?.jql, - nextPageToken: parameters?.nextPageToken, maxResults: parameters?.maxResults, - fields: parameters?.fields, - expand: parameters?.expand, + nextPageToken: parameters?.nextPageToken, properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, - failFast: parameters?.failFast, reconcileIssues: parameters?.reconcileIssues, }, }; diff --git a/src/version2/issueTypes.ts b/src/version2/issueTypes.ts index 2de2fb3065..e230440c5f 100644 --- a/src/version2/issueTypes.ts +++ b/src/version2/issueTypes.ts @@ -6,7 +6,6 @@ import { RequestConfig } from '../requestConfig'; export class IssueTypes { constructor(private client: Client) {} - /** * Returns all issue types. * @@ -43,7 +42,6 @@ export class IssueTypes { return this.client.sendRequest(config, callback); } - /** * Creates an issue type and adds it to the default issue type scheme. * @@ -51,7 +49,7 @@ export class IssueTypes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueType( - parameters: Parameters.CreateIssueType, + parameters: Parameters.CreateIssueType | undefined, callback: Callback, ): Promise; /** @@ -61,26 +59,26 @@ export class IssueTypes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueType( - parameters: Parameters.CreateIssueType, + parameters?: Parameters.CreateIssueType, callback?: never, ): Promise; async createIssueType( - parameters: Parameters.CreateIssueType, + parameters?: Parameters.CreateIssueType, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/issuetype', method: 'POST', data: { - name: parameters.name, - description: parameters.description, - hierarchyLevel: parameters.hierarchyLevel, + description: parameters?.description, + hierarchyLevel: parameters?.hierarchyLevel, + name: parameters?.name, + type: parameters?.type, }, }; return this.client.sendRequest(config, callback); } - /** * Returns issue types for a project. * @@ -122,7 +120,6 @@ export class IssueTypes { return this.client.sendRequest(config, callback); } - /** * Returns an issue type. * @@ -133,7 +130,7 @@ export class IssueTypes { * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getIssueType( - parameters: Parameters.GetIssueType | string, + parameters: Parameters.GetIssueType, callback: Callback, ): Promise; /** @@ -145,24 +142,18 @@ export class IssueTypes { * 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 | string, - callback?: never, - ): Promise; - async getIssueType( - parameters: Parameters.GetIssueType | string, + parameters: Parameters.GetIssueType, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${id}`, + url: `/rest/api/2/issuetype/${parameters.id}`, method: 'GET', }; return this.client.sendRequest(config, callback); } - /** * Updates the issue type. * @@ -191,15 +182,14 @@ export class IssueTypes { url: `/rest/api/2/issuetype/${parameters.id}`, method: 'PUT', data: { - name: parameters.name, - description: parameters.description, avatarId: parameters.avatarId, + description: parameters.description, + name: parameters.name, }, }; 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 @@ -208,10 +198,7 @@ export class IssueTypes { * **[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; + 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 @@ -220,24 +207,18 @@ export class IssueTypes { * **[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; - + async deleteIssueType(parameters: Parameters.DeleteIssueType, callback?: never): Promise; + async deleteIssueType(parameters: Parameters.DeleteIssueType, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/issuetype/${id}`, + url: `/rest/api/2/issuetype/${parameters.id}`, method: 'DELETE', params: { - alternativeIssueTypeId: typeof parameters !== 'string' && parameters.alternativeIssueTypeId, + 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. @@ -247,7 +228,7 @@ export class IssueTypes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes | string, + parameters: Parameters.GetAlternativeIssueTypes, callback: Callback, ): Promise; /** @@ -259,23 +240,20 @@ export class IssueTypes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes | string, + parameters: Parameters.GetAlternativeIssueTypes, callback?: never, ): Promise; async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes | string, + parameters: Parameters.GetAlternativeIssueTypes, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${id}/alternatives`, + url: `/rest/api/2/issuetype/${parameters.id}/alternatives`, method: 'GET', }; return this.client.sendRequest(config, callback); } - /** * Loads an avatar for the issue type. * @@ -285,8 +263,9 @@ export class IssueTypes { * 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 + * 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 @@ -313,8 +292,9 @@ export class IssueTypes { * 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 + * 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 @@ -339,16 +319,11 @@ export class IssueTypes { const config: RequestConfig = { url: `/rest/api/2/issuetype/${parameters.id}/avatar2`, method: 'POST', - headers: { - 'X-Atlassian-Token': 'no-check', - 'Content-Type': parameters.mimeType, - }, params: { x: parameters.x, y: parameters.y, - size: parameters.size ?? 0, + size: parameters.size, }, - data: parameters.avatar, }; return this.client.sendRequest(config, callback); diff --git a/src/version2/issueWorklogs.ts b/src/version2/issueWorklogs.ts index a55422eab0..e73c433a88 100644 --- a/src/version2/issueWorklogs.ts +++ b/src/version2/issueWorklogs.ts @@ -6,10 +6,9 @@ import { RequestConfig } from '../requestConfig'; export class IssueWorklogs { constructor(private client: Client) {} - /** - * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and - * time. + * Returns worklogs for an issue (ordered by created time), starting from the oldest worklog or from the worklog + * started on or after a date and time. * * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). @@ -26,12 +25,12 @@ export class IssueWorklogs { * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ async getIssueWorklog( - parameters: Parameters.GetIssueWorklog | string, + 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. + * Returns worklogs for an issue (ordered by created time), starting from the oldest worklog or from the worklog + * started on or after a date and time. * * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). @@ -48,30 +47,27 @@ export class IssueWorklogs { * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ async getIssueWorklog( - parameters: Parameters.GetIssueWorklog | string, + parameters: Parameters.GetIssueWorklog, callback?: never, ): Promise; async getIssueWorklog( - parameters: Parameters.GetIssueWorklog | string, + parameters: Parameters.GetIssueWorklog, callback?: Callback, ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/worklog`, + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog`, method: 'GET', params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - startedAfter: typeof parameters !== 'string' && parameters.startedAfter, - startedBefore: typeof parameters !== 'string' && parameters.startedBefore, - expand: typeof parameters !== 'string' && parameters.expand, + startAt: 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. * @@ -117,25 +113,141 @@ export class IssueWorklogs { overrideEditableFlag: parameters.overrideEditableFlag, }, data: { - self: parameters.self, author: parameters.author, - updateAuthor: parameters.updateAuthor, comment: parameters.comment, created: parameters.created, - updated: parameters.updated, - visibility: parameters.visibility, - started: parameters.started, - timeSpent: parameters.timeSpent, - timeSpentSeconds: parameters.timeSpentSeconds, id: parameters.id, issueId: parameters.issueId, properties: parameters.properties, + self: parameters.self, + started: parameters.started, + timeSpent: parameters.timeSpent, + timeSpentSeconds: parameters.timeSpentSeconds, + updateAuthor: parameters.updateAuthor, + updated: parameters.updated, + visibility: parameters.visibility, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Deletes a list of worklogs from an issue. This is an experimental API with limitations: + * + * - You can't delete more than 5000 worklogs at once. + * - No notifications will be sent for deleted worklogs. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog. + * - If any worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async bulkDeleteWorklogs(parameters: Parameters.BulkDeleteWorklogs, callback: Callback): Promise; + /** + * Deletes a list of worklogs from an issue. This is an experimental API with limitations: + * + * - You can't delete more than 5000 worklogs at once. + * - No notifications will be sent for deleted worklogs. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog. + * - If any worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async bulkDeleteWorklogs(parameters: Parameters.BulkDeleteWorklogs, callback?: never): Promise; + async bulkDeleteWorklogs( + parameters: Parameters.BulkDeleteWorklogs, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog`, + method: 'DELETE', + params: { + adjustEstimate: parameters.adjustEstimate, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + data: { + ids: parameters.ids, }, }; return this.client.sendRequest(config, callback); } + /** + * Moves a list of worklogs from one issue to another. This is an experimental API with several limitations: + * + * - You can't move more than 5000 worklogs at once. + * - You can't move worklogs containing an attachment. + * - You can't move worklogs restricted by project roles. + * - No notifications will be sent for moved worklogs. + * - No webhooks or events will be sent for moved worklogs. + * - No issue history will be recorded for moved worklogs. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects containing the + * source and destination issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ and _Edit all worklogs_](https://confluence.atlassian.com/x/yodKLg)[project + * permission](https://confluence.atlassian.com/x/yodKLg) + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async bulkMoveWorklogs(parameters: Parameters.BulkMoveWorklogs, callback: Callback): Promise; + /** + * Moves a list of worklogs from one issue to another. This is an experimental API with several limitations: + * + * - You can't move more than 5000 worklogs at once. + * - You can't move worklogs containing an attachment. + * - You can't move worklogs restricted by project roles. + * - No notifications will be sent for moved worklogs. + * - No webhooks or events will be sent for moved worklogs. + * - No issue history will be recorded for moved worklogs. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects containing the + * source and destination issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ and _Edit all worklogs_](https://confluence.atlassian.com/x/yodKLg)[project + * permission](https://confluence.atlassian.com/x/yodKLg) + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async bulkMoveWorklogs(parameters: Parameters.BulkMoveWorklogs, callback?: never): Promise; + async bulkMoveWorklogs(parameters: Parameters.BulkMoveWorklogs, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/move`, + method: 'POST', + params: { + adjustEstimate: parameters.adjustEstimate, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + data: parameters.body, + }; + return this.client.sendRequest(config, callback); + } /** * Returns a worklog. * @@ -181,7 +293,6 @@ export class IssueWorklogs { return this.client.sendRequest(config, callback); } - /** * Updates a worklog. * @@ -234,19 +345,11 @@ export class IssueWorklogs { 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, - }, + data: parameters.body, }; return this.client.sendRequest(config, callback); } - /** * Deletes a worklog from an issue. * @@ -300,7 +403,6 @@ export class IssueWorklogs { return this.client.sendRequest(config, callback); } - /** * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. * @@ -349,7 +451,6 @@ export class IssueWorklogs { return this.client.sendRequest(config, callback); } - /** * Returns worklog details for a list of worklog IDs. * @@ -397,7 +498,6 @@ export class IssueWorklogs { return this.client.sendRequest(config, callback); } - /** * Returns a list of IDs and update timestamps for worklogs updated after a date and time. * diff --git a/src/version2/issues.ts b/src/version2/issues.ts index fb6c070718..4c4d8045d6 100644 --- a/src/version2/issues.ts +++ b/src/version2/issues.ts @@ -6,7 +6,63 @@ import { RequestConfig } from '../requestConfig'; export class Issues { constructor(private client: Client) {} + /** + * Bulk fetch changelogs for multiple issues and filter by fields + * + * Returns a paginated list of all changelogs for given issues sorted by changelog date and issue IDs, starting from + * the oldest changelog and smallest issue ID. + * + * Issues are identified by their ID or key, and optionally changelogs can be filtered by their field IDs. You can + * request the changelogs of up to 1000 issues and can filter them by up to 10 field IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects that the issues + * are in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issues. + */ + async getBulkChangelogs( + parameters: Parameters.GetBulkChangelogs | undefined, + callback: Callback, + ): Promise; + /** + * Bulk fetch changelogs for multiple issues and filter by fields + * + * Returns a paginated list of all changelogs for given issues sorted by changelog date and issue IDs, starting from + * the oldest changelog and smallest issue ID. + * + * Issues are identified by their ID or key, and optionally changelogs can be filtered by their field IDs. You can + * request the changelogs of up to 1000 issues and can filter them by up to 10 field IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects that the issues + * are in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issues. + */ + async getBulkChangelogs( + parameters?: Parameters.GetBulkChangelogs, + callback?: never, + ): Promise; + async getBulkChangelogs( + parameters?: Parameters.GetBulkChangelogs, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/changelog/bulkfetch', + method: 'POST', + data: { + fieldIds: parameters?.fieldIds, + issueIdsOrKeys: parameters?.issueIdsOrKeys, + maxResults: parameters?.maxResults, + nextPageToken: parameters?.nextPageToken, + }, + }; + return this.client.sendRequest(config, callback); + } /** * Returns all issue events. * @@ -29,7 +85,6 @@ export class Issues { 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 @@ -49,7 +104,10 @@ export class Issues { * 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; + async createIssue( + parameters: Parameters.CreateIssue | undefined, + 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 @@ -69,29 +127,28 @@ export class Issues { * 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?: never): Promise; async createIssue( - parameters: Parameters.CreateIssue, + parameters?: Parameters.CreateIssue, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/issue', method: 'POST', params: { - updateHistory: parameters.updateHistory, + updateHistory: parameters?.updateHistory, }, data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, + 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. @@ -114,10 +171,10 @@ export class Issues { * * **Signed-in users only:** This API can't be accessed anonymously. * - * **Rate limiting:** Only a single request per user can be active at any given time. + * **Rate limiting:** Only a single request per jira instance can be active at any given time. */ - async archiveIssuesAsync( - parameters: Parameters.ArchiveIssuesAsync, + async archiveIssuesAsync( + parameters: Parameters.ArchiveIssuesAsync | undefined, callback: Callback, ): Promise; /** @@ -142,24 +199,23 @@ export class Issues { * * **Signed-in users only:** This API can't be accessed anonymously. * - * **Rate limiting:** Only a single request per user can be active at any given time. + * **Rate limiting:** Only a single request per jira instance can be active at any given time. */ - async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; - async archiveIssuesAsync( - parameters: Parameters.ArchiveIssuesAsync, + 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, + 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. @@ -177,7 +233,7 @@ export class Issues { * **Signed-in users only:** This API can't be accessed anonymously. */ async archiveIssues( - parameters: Parameters.ArchiveIssues, + parameters: Parameters.ArchiveIssues | undefined, callback: Callback, ): Promise; /** @@ -196,22 +252,24 @@ export class Issues { * * **Signed-in users only:** This API can't be accessed anonymously. */ - async archiveIssues(parameters: Parameters.ArchiveIssues, callback?: never): Promise; async archiveIssues( - parameters: Parameters.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, + 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 @@ -269,12 +327,77 @@ export class Issues { return this.client.sendRequest(config, callback); } + /** + * Returns the details for a set of requested issues. You can request up to 100 issues. + * + * Each issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. + * + * Issues will be returned in ascending `id` order. If there are errors, Jira will return a list of issues which + * couldn't be fetched along with error messages. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkFetchIssues( + parameters: Parameters.BulkFetchIssues | undefined, + callback: Callback, + ): Promise; + /** + * Returns the details for a set of requested issues. You can request up to 100 issues. + * + * Each issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. + * + * Issues will be returned in ascending `id` order. If there are errors, Jira will return a list of issues which + * couldn't be fetched along with error messages. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkFetchIssues(parameters?: Parameters.BulkFetchIssues, callback?: never): Promise; + async bulkFetchIssues( + parameters?: Parameters.BulkFetchIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/bulkfetch', + method: 'POST', + data: { + expand: parameters?.expand, + fields: parameters?.fields, + fieldsByKeys: parameters?.fieldsByKeys, + issueIdsOrKeys: parameters?.issueIdsOrKeys, + properties: parameters?.properties, + }, + }; + return this.client.sendRequest(config, callback); + } /** * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each * issue type for the user. Use the information to populate the requests in [ Create * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). * + * Deprecated, see [Create Issue Meta Endpoint Deprecation + * Notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304). + * * The request can be restricted to specific projects or issue types using the query parameters. The response will * contain information for the valid projects, issue types, or project and issue type combinations requested. Note * that invalid project, issue type, or project and issue type combinations do not generate errors. @@ -293,6 +416,9 @@ export class Issues { * issue type for the user. Use the information to populate the requests in [ Create * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). * + * Deprecated, see [Create Issue Meta Endpoint Deprecation + * Notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304). + * * The request can be restricted to specific projects or issue types using the query parameters. The response will * contain information for the valid projects, issue types, or project and issue type combinations requested. Note * that invalid project, issue type, or project and issue type combinations do not generate errors. @@ -324,7 +450,131 @@ export class Issues { return this.client.sendRequest(config, callback); } + /** + * Returns a page of issue type metadata for a specified project. Use the information to populate the requests in [ + * Create issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMetaIssueTypes( + parameters: Parameters.GetCreateIssueMetaIssueTypes, + callback: Callback, + ): Promise; + /** + * Returns a page of issue type metadata for a specified project. Use the information to populate the requests in [ + * Create issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMetaIssueTypes( + parameters: Parameters.GetCreateIssueMetaIssueTypes, + callback?: never, + ): Promise; + async getCreateIssueMetaIssueTypes( + parameters: Parameters.GetCreateIssueMetaIssueTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/createmeta/${parameters.projectIdOrKey}/issuetypes`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Returns a page of field metadata for a specified project and issuetype id. Use the information to populate the + * requests in [ Create issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMetaIssueTypeId( + parameters: Parameters.GetCreateIssueMetaIssueTypeId, + callback: Callback, + ): Promise; + /** + * Returns a page of field metadata for a specified project and issuetype id. Use the information to populate the + * requests in [ Create issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMetaIssueTypeId( + parameters: Parameters.GetCreateIssueMetaIssueTypeId, + callback?: never, + ): Promise; + async getCreateIssueMetaIssueTypeId( + parameters: Parameters.GetCreateIssueMetaIssueTypeId, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/createmeta/${parameters.projectIdOrKey}/issuetypes/${parameters.issueTypeId}`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Returns all issues breaching and approaching per-issue limits. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) is required for the project the + * issues are in. Results may be incomplete otherwise + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueLimitReport( + parameters: Parameters.GetIssueLimitReport | undefined, + callback: Callback, + ): Promise; + /** + * Returns all issues breaching and approaching per-issue limits. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) is required for the project the + * issues are in. Results may be incomplete otherwise + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueLimitReport( + parameters?: Parameters.GetIssueLimitReport, + callback?: never, + ): Promise; + async getIssueLimitReport( + parameters?: Parameters.GetIssueLimitReport, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/limit/report', + method: 'GET', + params: { + isReturningKeys: parameters?.isReturningKeys, + }, + data: { + issuesApproachingLimitParams: parameters?.issuesApproachingLimitParams, + }, + }; + return this.client.sendRequest(config, callback); + } /** * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the * issue(s) unarchived in the process and the errors encountered, if any. @@ -342,7 +592,7 @@ export class Issues { * **Signed-in users only:** This API can't be accessed anonymously. */ async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, + parameters: Parameters.UnarchiveIssues | undefined, callback: Callback, ): Promise; /** @@ -362,24 +612,23 @@ export class Issues { * **Signed-in users only:** This API can't be accessed anonymously. */ async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, + parameters?: Parameters.UnarchiveIssues, callback?: never, ): Promise; async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, + parameters?: Parameters.UnarchiveIssues, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/issue/unarchive', method: 'PUT', data: { - issueIdsOrKeys: parameters.issueIdsOrKeys, + issueIdsOrKeys: parameters?.issueIdsOrKeys, }, }; return this.client.sendRequest(config, callback); } - /** * Returns the details for an issue. * @@ -396,7 +645,7 @@ export class Issues { * - 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; + async getIssue(parameters: Parameters.GetIssue, callback: Callback): Promise; /** * Returns the details for an issue. * @@ -413,30 +662,27 @@ export class Issues { * - 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; - + async getIssue(parameters: Parameters.GetIssue, callback?: never): Promise; + async getIssue(parameters: Parameters.GetIssue, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}`, + url: `/rest/api/2/issue/${parameters.issueIdOrKey}`, method: 'GET', params: { - fields: typeof parameters !== 'string' && parameters.fields, - fieldsByKeys: typeof parameters !== 'string' && parameters.fieldsByKeys, - expand: typeof parameters !== 'string' && parameters.expand, - properties: typeof parameters !== 'string' && parameters.properties, - updateHistory: typeof parameters !== 'string' && parameters.updateHistory, + fields: parameters.fields, + fieldsByKeys: parameters.fieldsByKeys, + expand: parameters.expand, + properties: parameters.properties, + updateHistory: parameters.updateHistory, + failFast: parameters.failFast, }, }; return this.client.sendRequest(config, callback); } - /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * Edits an issue. Issue properties may be updated as part of the edit. Please note that issue transition is not + * supported and is ignored here. To transition an issue, please use [Transition + * issue](#api-rest-api-2-issue-issueIdOrKey-transitions-post). * * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are * determined using [ Get edit issue metadata](#api-rest-api-2-issue-issueIdOrKey-editmeta-get). @@ -460,7 +706,9 @@ export class Issues { */ async editIssue(parameters: Parameters.EditIssue, callback: Callback): Promise; /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * Edits an issue. Issue properties may be updated as part of the edit. Please note that issue transition is not + * supported and is ignored here. To transition an issue, please use [Transition + * issue](#api-rest-api-2-issue-issueIdOrKey-transitions-post). * * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are * determined using [ Get edit issue metadata](#api-rest-api-2-issue-issueIdOrKey-editmeta-get). @@ -505,7 +753,6 @@ export class Issues { return this.client.sendRequest(config, callback); } - /** * Deletes an issue. * @@ -521,7 +768,7 @@ export class Issues { * - 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; + async deleteIssue(parameters: Parameters.DeleteIssue, callback: Callback): Promise; /** * Deletes an issue. * @@ -537,21 +784,18 @@ export class Issues { * - 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; - + async deleteIssue(parameters: Parameters.DeleteIssue, callback?: never): Promise; + async deleteIssue(parameters: Parameters.DeleteIssue, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}`, + url: `/rest/api/2/issue/${parameters.issueIdOrKey}`, method: 'DELETE', params: { - deleteSubtasks: typeof parameters !== 'string' && parameters.deleteSubtasks, + 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. @@ -614,7 +858,6 @@ export class Issues { 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. @@ -629,7 +872,7 @@ export class Issues { * to view the issue. */ async getChangeLogs( - parameters: Parameters.GetChangeLogs | string, + parameters: Parameters.GetChangeLogs, callback: Callback, ): Promise; /** @@ -645,28 +888,22 @@ export class Issues { * - 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 | string, - callback?: never, - ): Promise; - async getChangeLogs( - parameters: Parameters.GetChangeLogs | string, + parameters: Parameters.GetChangeLogs, callback?: Callback, ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/changelog`, + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/changelog`, method: 'GET', params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; return this.client.sendRequest(config, callback); } - /** * Returns changelogs for an issue specified by a list of changelog IDs. * @@ -713,7 +950,6 @@ export class Issues { 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). @@ -767,7 +1003,7 @@ export class Issues { * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. */ async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta | string, + parameters: Parameters.GetEditIssueMeta, callback: Callback, ): Promise; /** @@ -823,27 +1059,24 @@ export class Issues { * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. */ async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta | string, + parameters: Parameters.GetEditIssueMeta, callback?: never, ): Promise; async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta | string, + parameters: Parameters.GetEditIssueMeta, callback?: Callback, ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/editmeta`, + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/editmeta`, method: 'GET', params: { - overrideScreenSecurity: typeof parameters !== 'string' && parameters.overrideScreenSecurity, - overrideEditableFlag: typeof parameters !== 'string' && parameters.overrideEditableFlag, + 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. * @@ -881,7 +1114,6 @@ export class Issues { 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. @@ -903,7 +1135,7 @@ export class Issues { * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. */ async getTransitions( - parameters: Parameters.GetTransitions | string, + parameters: Parameters.GetTransitions, callback: Callback, ): Promise; /** @@ -926,31 +1158,25 @@ export class Issues { * 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 | string, - callback?: never, - ): Promise; - async getTransitions( - parameters: Parameters.GetTransitions | string, + parameters: Parameters.GetTransitions, callback?: Callback, ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/transitions`, + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/transitions`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, - transitionId: typeof parameters !== 'string' && parameters.transitionId, - skipRemoteOnlyCondition: typeof parameters !== 'string' && parameters.skipRemoteOnlyCondition, - includeUnavailableTransitions: typeof parameters !== 'string' && parameters.includeUnavailableTransitions, - sortByOpsBarAndStatus: typeof parameters !== 'string' && parameters.sortByOpsBarAndStatus, + expand: 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. * @@ -1000,7 +1226,6 @@ export class Issues { 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. @@ -1017,8 +1242,8 @@ export class Issues { * * **Rate limiting:** Only a single request can be active at any given time. */ - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues, + async exportArchivedIssues( + parameters: Parameters.ExportArchivedIssues | undefined, callback: Callback, ): Promise; /** @@ -1037,23 +1262,23 @@ export class Issues { * * **Rate limiting:** Only a single request can be active at any given time. */ - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues, + async exportArchivedIssues( + parameters?: Parameters.ExportArchivedIssues, callback?: never, ): Promise; - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues, + 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, + archivedBy: parameters?.archivedBy, + archivedDateRange: parameters?.archivedDateRange, + issueTypes: parameters?.issueTypes, + projects: parameters?.projects, + reporters: parameters?.reporters, }, }; diff --git a/src/version2/jiraExpressions.ts b/src/version2/jiraExpressions.ts index c14a691f38..0d41729966 100644 --- a/src/version2/jiraExpressions.ts +++ b/src/version2/jiraExpressions.ts @@ -6,7 +6,6 @@ import { RequestConfig } from '../requestConfig'; export class JiraExpressions { constructor(private client: Client) {} - /** * Analyses and validates Jira expressions. * @@ -46,14 +45,13 @@ export class JiraExpressions { check: parameters?.check, }, data: { - expressions: parameters?.expressions, contextVariables: parameters?.contextVariables, + expressions: parameters?.expressions, }, }; return this.client.sendRequest(config, callback); } - /** * Evaluates a Jira expression and returns its value. * @@ -106,8 +104,9 @@ export class JiraExpressions { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue. Permission to access Jira Software is - * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + * example, different users may see different comments on the same issue.\ + * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or + * fields (for example, `issue.sprint`). */ async evaluateJiraExpression( parameters: Parameters.EvaluateJiraExpression | undefined, @@ -165,8 +164,9 @@ export class JiraExpressions { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue. Permission to access Jira Software is - * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + * example, different users may see different comments on the same issue.\ + * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or + * fields (for example, `issue.sprint`). */ async evaluateJiraExpression( parameters?: Parameters.EvaluateJiraExpression, @@ -183,14 +183,13 @@ export class JiraExpressions { expand: parameters?.expand, }, data: { - expression: parameters?.expression, context: parameters?.context, + expression: parameters?.expression, }, }; return this.client.sendRequest(config, callback); } - /** * Evaluates a Jira expression and returns its value. The difference between this and `eval` is that this endpoint * uses the enhanced search API when evaluating JQL queries. This API is eventually consistent, unlike the strongly @@ -212,7 +211,7 @@ export class JiraExpressions { * 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 + * 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. @@ -247,11 +246,12 @@ export class JiraExpressions { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue. Permission to access Jira Software is - * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + * example, different users may see different comments on the same issue.\ + * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or + * fields (for example, `issue.sprint`). */ - async evaluateJiraExpressionUsingEnhancedSearch( - parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch | undefined, + async evaluateJSISJiraExpression( + parameters: Parameters.EvaluateJSISJiraExpression | undefined, callback: Callback, ): Promise; /** @@ -275,7 +275,7 @@ export class JiraExpressions { * 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 + * 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. @@ -310,15 +310,16 @@ export class JiraExpressions { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue. Permission to access Jira Software is - * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + * example, different users may see different comments on the same issue.\ + * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or + * fields (for example, `issue.sprint`). */ - async evaluateJiraExpressionUsingEnhancedSearch( - parameters?: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, + async evaluateJSISJiraExpression( + parameters?: Parameters.EvaluateJSISJiraExpression, callback?: never, ): Promise; - async evaluateJiraExpressionUsingEnhancedSearch( - parameters?: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, + async evaluateJSISJiraExpression( + parameters?: Parameters.EvaluateJSISJiraExpression, callback?: Callback, ): Promise { const config: RequestConfig = { @@ -328,8 +329,8 @@ export class JiraExpressions { expand: parameters?.expand, }, data: { - expression: parameters?.expression, context: parameters?.context, + expression: parameters?.expression, }, }; diff --git a/src/version2/jiraSettings.ts b/src/version2/jiraSettings.ts index 6bf6c5f525..55e8c4fdd0 100644 --- a/src/version2/jiraSettings.ts +++ b/src/version2/jiraSettings.ts @@ -6,7 +6,6 @@ import { RequestConfig } from '../requestConfig'; export class JiraSettings { constructor(private client: Client) {} - /** * Returns all application properties or an application property. * @@ -51,7 +50,6 @@ export class JiraSettings { 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** @@ -78,7 +76,6 @@ export class JiraSettings { 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 @@ -88,18 +85,17 @@ export class JiraSettings { * * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). * - * | Key | Description | Default value | - * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | - * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | - * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | - * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | - * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | - * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | - * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | - * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | - * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | - * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | - * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | + * | Key | Description | Default value | + * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | + * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | + * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | + * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | + * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | + * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | + * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | + * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | + * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | + * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | * * #### Look and feel * @@ -148,18 +144,17 @@ export class JiraSettings { * * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). * - * | Key | Description | Default value | - * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | - * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | - * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | - * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | - * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | - * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | - * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | - * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | - * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | - * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | - * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | + * | Key | Description | Default value | + * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | + * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | + * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | + * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | + * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | + * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | + * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | + * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | + * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | + * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | * * #### Look and feel * @@ -211,7 +206,6 @@ export class JiraSettings { 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 diff --git a/src/version2/jqlFunctionsApps.ts b/src/version2/jqlFunctionsApps.ts index ca755861d9..36e424f332 100644 --- a/src/version2/jqlFunctionsApps.ts +++ b/src/version2/jqlFunctionsApps.ts @@ -13,6 +13,9 @@ export class JqlFunctionsApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This * API is only accessible to apps and apps can only inspect their own functions. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getPrecomputations( parameters: Parameters.GetPrecomputations | undefined, @@ -24,6 +27,9 @@ export class JqlFunctionsApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This * API is only accessible to apps and apps can only inspect their own functions. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getPrecomputations( parameters?: Parameters.GetPrecomputations, @@ -41,18 +47,19 @@ export class JqlFunctionsApps { 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. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updatePrecomputations( parameters: Parameters.UpdatePrecomputations | undefined, @@ -63,6 +70,9 @@ export class JqlFunctionsApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** An API * for apps to update their own precomputations. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; async updatePrecomputations( @@ -72,11 +82,59 @@ export class JqlFunctionsApps { const config: RequestConfig = { url: '/rest/api/2/jql/function/computation', method: 'POST', + params: { + skipNotFoundPrecomputations: parameters?.skipNotFoundPrecomputations, + }, data: { values: parameters?.values, }, }; + return this.client.sendRequest(config, callback); + } + /** + * Returns function precomputations by IDs, along with information about when they were created, updated, and last + * used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This + * API is only accessible to apps and apps can only inspect their own functions. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. + */ + async getPrecomputationsByID( + parameters: Parameters.GetPrecomputationsByID | undefined, + callback: Callback, + ): Promise; + /** + * Returns function precomputations by IDs, along with information about when they were created, updated, and last + * used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This + * API is only accessible to apps and apps can only inspect their own functions. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. + */ + async getPrecomputationsByID( + parameters?: Parameters.GetPrecomputationsByID, + callback?: never, + ): Promise; + async getPrecomputationsByID( + parameters?: Parameters.GetPrecomputationsByID, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/function/computation/search', + method: 'POST', + params: { + orderBy: parameters?.orderBy, + }, + data: { + precomputationIDs: parameters?.precomputationIDs, + }, + }; + return this.client.sendRequest(config, callback); } } diff --git a/src/version2/models/addAtlassianTeamRequest.ts b/src/version2/models/addAtlassianTeamRequest.ts new file mode 100644 index 0000000000..61b43a6018 --- /dev/null +++ b/src/version2/models/addAtlassianTeamRequest.ts @@ -0,0 +1,12 @@ +export interface AddAtlassianTeamRequest { + /** The capacity for the Atlassian team. */ + capacity?: number; + /** The Atlassian team ID. */ + id: string; + /** The ID of the issue source for the Atlassian team. */ + issueSourceId?: number; + /** The planning style for the Atlassian team. This must be "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the Atlassian team. */ + sprintLength?: number; +} diff --git a/src/version2/models/addNotificationsDetails.ts b/src/version2/models/addNotificationsDetails.ts new file mode 100644 index 0000000000..388d257615 --- /dev/null +++ b/src/version2/models/addNotificationsDetails.ts @@ -0,0 +1,7 @@ +import { NotificationSchemeEventDetails } from './notificationSchemeEventDetails'; + +/** Details of notifications which should be added to the notification scheme. */ +export interface AddNotificationsDetails { + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents: NotificationSchemeEventDetails[]; +} diff --git a/src/version2/models/addSecuritySchemeLevelsRequestBean.ts b/src/version2/models/addSecuritySchemeLevelsRequestBean.ts new file mode 100644 index 0000000000..02ddf9eeea --- /dev/null +++ b/src/version2/models/addSecuritySchemeLevelsRequestBean.ts @@ -0,0 +1,6 @@ +import { SecuritySchemeLevelBean } from './securitySchemeLevelBean'; + +export interface AddSecuritySchemeLevelsRequestBean { + /** The list of scheme levels which should be added to the security scheme. */ + levels?: SecuritySchemeLevelBean[]; +} diff --git a/src/version2/models/appWorkflowTransitionRule.ts b/src/version2/models/appWorkflowTransitionRule.ts new file mode 100644 index 0000000000..7ff8733caa --- /dev/null +++ b/src/version2/models/appWorkflowTransitionRule.ts @@ -0,0 +1,12 @@ +import { RuleConfiguration } from './ruleConfiguration'; +import { WorkflowTransition } from './workflowTransition'; + +/** A workflow transition rule. */ +export interface AppWorkflowTransitionRule { + configuration: RuleConfiguration; + /** The ID of the transition rule. */ + id: string; + /** The key of the rule, as defined in the Connect or the Forge app descriptor. */ + key: string; + transition?: WorkflowTransition; +} diff --git a/src/version2/models/approvalConfiguration.ts b/src/version2/models/approvalConfiguration.ts new file mode 100644 index 0000000000..fbbf35694d --- /dev/null +++ b/src/version2/models/approvalConfiguration.ts @@ -0,0 +1,30 @@ +/** The approval configuration of a status within a workflow. Applies only to Jira Service Management approvals. */ +export interface ApprovalConfiguration { + /** Whether the approval configuration is active. */ + active: 'true' | 'false' | string; + /** + * How the required approval count is calculated. It may be configured to require a specific number of approvals, or + * approval by a percentage of approvers. If the approvers source field is Approver groups, you can configure how + * many approvals per group are required for the request to be approved. The number will be the same across all + * groups. + */ + conditionType: 'number' | 'percent' | 'numberPerPrincipal' | string; + /** + * The number or percentage of approvals required for a request to be approved. If `conditionType` is `number`, the + * value must be 20 or less. If `conditionType` is `percent`, the value must be 100 or less. + */ + conditionValue: string; + /** A list of roles that should be excluded as possible approvers. */ + exclude?: 'assignee' | 'reporter' | string; + /** The custom field ID of the "Approvers" or "Approver Groups" field. */ + fieldId: string; + /** + * The custom field ID of the field used to pre-populate the Approver field. Only supports the "Affected Services" + * field. + */ + prePopulatedFieldId?: string; + /** The numeric ID of the transition to be executed if the request is approved. */ + transitionApproved: string; + /** The numeric ID of the transition to be executed if the request is declined. */ + transitionRejected: string; +} diff --git a/src/version2/models/archiveIssueAsyncRequest.ts b/src/version2/models/archiveIssueAsyncRequest.ts new file mode 100644 index 0000000000..279fc9a2a4 --- /dev/null +++ b/src/version2/models/archiveIssueAsyncRequest.ts @@ -0,0 +1,3 @@ +export interface ArchiveIssueAsyncRequest { + jql?: string; +} diff --git a/src/version2/models/archivedIssuesFilterRequest.ts b/src/version2/models/archivedIssuesFilterRequest.ts new file mode 100644 index 0000000000..587b7006b3 --- /dev/null +++ b/src/version2/models/archivedIssuesFilterRequest.ts @@ -0,0 +1,14 @@ +import { DateRangeFilterRequest } from './dateRangeFilterRequest'; + +/** Details of a filter for exporting archived issues. */ +export interface ArchivedIssuesFilterRequest { + /** List archived issues archived by a specified account ID. */ + archivedBy?: string[]; + archivedDateRange?: DateRangeFilterRequest; + /** 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/models/associateSecuritySchemeWithProjectDetails.ts b/src/version2/models/associateSecuritySchemeWithProjectDetails.ts new file mode 100644 index 0000000000..0996334170 --- /dev/null +++ b/src/version2/models/associateSecuritySchemeWithProjectDetails.ts @@ -0,0 +1,11 @@ +import { OldToNewSecurityLevelMappingsBean } from './oldToNewSecurityLevelMappingsBean'; + +/** Issue security scheme, project, and remapping details. */ +export interface AssociateSecuritySchemeWithProjectDetails { + /** The list of scheme levels which should be remapped to new levels of the issue security scheme. */ + oldToNewSecurityLevelMappings?: OldToNewSecurityLevelMappingsBean[]; + /** 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/models/attachmentArchive.ts b/src/version2/models/attachmentArchive.ts new file mode 100644 index 0000000000..16593d530a --- /dev/null +++ b/src/version2/models/attachmentArchive.ts @@ -0,0 +1,8 @@ +import { AttachmentArchiveEntry } from './attachmentArchiveEntry'; + +export interface AttachmentArchive { + entries?: AttachmentArchiveEntry[]; + moreAvailable?: boolean; + totalEntryCount?: number; + totalNumberOfEntriesAvailable?: number; +} diff --git a/src/version2/models/bulkChangelog.ts b/src/version2/models/bulkChangelog.ts new file mode 100644 index 0000000000..f3c04ce9e2 --- /dev/null +++ b/src/version2/models/bulkChangelog.ts @@ -0,0 +1,12 @@ +import { IssueChangeLog } from './issueChangeLog'; + +/** A page of changelogs which is designed to handle multiple issues */ +export interface BulkChangelog { + /** The list of issues changelogs. */ + issueChangeLogs?: IssueChangeLog[]; + /** + * Continuation token to fetch the next page. If this result represents the last or the only page, this token will + * be null. + */ + nextPageToken?: string; +} diff --git a/src/version2/models/bulkChangelogRequest.ts b/src/version2/models/bulkChangelogRequest.ts new file mode 100644 index 0000000000..b6162735ac --- /dev/null +++ b/src/version2/models/bulkChangelogRequest.ts @@ -0,0 +1,11 @@ +/** Request bean for bulk changelog retrieval */ +export interface BulkChangelogRequest { + /** List of field IDs to filter changelogs */ + fieldIds?: string[]; + /** List of issue IDs/keys to fetch changelogs for */ + issueIdsOrKeys: string[]; + /** The maximum number of items to return per page */ + maxResults?: number; + /** The cursor for pagination */ + nextPageToken?: string; +} diff --git a/src/version2/models/bulkContextualConfiguration.ts b/src/version2/models/bulkContextualConfiguration.ts new file mode 100644 index 0000000000..e175ae50a8 --- /dev/null +++ b/src/version2/models/bulkContextualConfiguration.ts @@ -0,0 +1,13 @@ +/** Details of the contextual configuration for a custom field. */ +export interface BulkContextualConfiguration { + /** The field configuration. */ + configuration?: {}; + /** The ID of the custom field. */ + customFieldId: string; + /** The ID of the field context the configuration is associated with. */ + fieldContextId: string; + /** The ID of the configuration. */ + id: string; + /** The field value schema. */ + schema?: {}; +} diff --git a/src/version2/models/bulkEditActionError.ts b/src/version2/models/bulkEditActionError.ts new file mode 100644 index 0000000000..7807624cac --- /dev/null +++ b/src/version2/models/bulkEditActionError.ts @@ -0,0 +1,7 @@ +/** Errors of bulk edit action. */ +export interface BulkEditActionError { + /** The error messages. */ + errorMessages: string[]; + /** The errors. */ + errors: {}; +} diff --git a/src/version2/models/bulkEditShareableEntityRequest.ts b/src/version2/models/bulkEditShareableEntityRequest.ts new file mode 100644 index 0000000000..09e8ba5124 --- /dev/null +++ b/src/version2/models/bulkEditShareableEntityRequest.ts @@ -0,0 +1,14 @@ +import { BulkChangeOwnerDetails } from './bulkChangeOwnerDetails'; +import { PermissionDetails } from './permissionDetails'; + +/** Details of a request to bulk edit shareable entity. */ +export interface BulkEditShareableEntityRequest { + /** Allowed action for bulk edit shareable entity */ + action: 'changeOwner' | 'changePermission' | 'addPermission' | 'removePermission' | 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/models/bulkFetchIssueRequest.ts b/src/version2/models/bulkFetchIssueRequest.ts new file mode 100644 index 0000000000..779749f5d7 --- /dev/null +++ b/src/version2/models/bulkFetchIssueRequest.ts @@ -0,0 +1,43 @@ +export interface BulkFetchIssueRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about issues in the response. Note that, unlike the majority of instances where `expand` is + * specified, `expand` is defined as a list of values. The expand options are: + * + * `renderedFields` Returns field values rendered in HTML format. `names` Returns the display name of each field. + * `schema` Returns the schema describing a field type. `transitions` Returns all possible transitions for the + * issue. `operations` Returns all possible operations for the issue. `editmeta` Returns information about how each + * field can be edited. `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the + * most recent. `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array + * containing each version of a field's value, with the highest numbered item representing the most recent version. + */ + expand?: string[]; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to + * exclude. + * + * The default is `*navigable`. + * + * Examples: + * + * `summary,comment` Returns the summary and comments fields only. `-description` Returns all navigable (default) + * fields except description. `*all,-comment` Returns all fields except comments. + * + * Multiple `fields` parameters can be included in a request. + * + * Note: All navigable fields are returned by default. This differs from [GET issue](#api-rest-api-2-issue-issueIdOrKey-get) where the default is all fields. + */ + fields?: string[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; + /** An array of issue IDs or issue keys to fetch. You can mix issue IDs and keys in the same query. */ + issueIdsOrKeys: string[]; + /** + * A list of issue property keys of issue properties to be included in the results. A maximum of 5 issue property + * keys can be specified. + */ + properties?: string[]; +} diff --git a/src/version2/models/bulkIssue.ts b/src/version2/models/bulkIssue.ts new file mode 100644 index 0000000000..43ffd98971 --- /dev/null +++ b/src/version2/models/bulkIssue.ts @@ -0,0 +1,14 @@ +import { IssueError } from './issueError'; +import { IssueBean } from './issueBean'; + +/** The list of requested issues & fields. */ +export interface BulkIssue { + /** + * When Jira can't return an issue enumerated in a request due to a retriable error or payload constraint, we'll + * return the respective issue ID with a corresponding error message. This list is empty when there are no errors + * Issues which aren't found or that the user doesn't have permission to view won't be returned in this list. + */ + issueErrors?: IssueError[]; + /** The list of issues. */ + issues?: IssueBean[]; +} diff --git a/src/version2/models/changeFilterOwner.ts b/src/version2/models/changeFilterOwner.ts new file mode 100644 index 0000000000..b068a585db --- /dev/null +++ b/src/version2/models/changeFilterOwner.ts @@ -0,0 +1,5 @@ +/** The account ID of the new owner. */ +export interface ChangeFilterOwner { + /** The account ID of the new owner. */ + accountId: string; +} diff --git a/src/version2/models/columnRequestBody.ts b/src/version2/models/columnRequestBody.ts new file mode 100644 index 0000000000..3bb0b3123c --- /dev/null +++ b/src/version2/models/columnRequestBody.ts @@ -0,0 +1,3 @@ +export interface ColumnRequestBody { + columns?: string[]; +} diff --git a/src/version2/models/component.ts b/src/version2/models/component.ts new file mode 100644 index 0000000000..d41a2c219f --- /dev/null +++ b/src/version2/models/component.ts @@ -0,0 +1,8 @@ +export interface Component { + ari?: string; + description?: string; + id?: string; + metadata?: {}; + name?: string; + self?: string; +} diff --git a/src/version2/models/compoundClause.ts b/src/version2/models/compoundClause.ts new file mode 100644 index 0000000000..06b402f55a --- /dev/null +++ b/src/version2/models/compoundClause.ts @@ -0,0 +1,14 @@ +import { JqlQueryClause } from './jqlQueryClause'; + +/** + * A JQL query clause that consists of nested clauses. For example, `(labels in (urgent, blocker) OR lastCommentedBy = + * currentUser()). Note that, where nesting is not defined, the parser nests JQL clauses based on the operator + * precedence. For example, "A OR B AND C" is parsed as "(A OR B) AND C". See Setting the precedence of operators for + * more information about precedence in JQL queries.` + */ +export interface CompoundClause { + /** The list of nested clauses. */ + clauses: JqlQueryClause[]; + /** The operator between the clauses. */ + operator: 'and' | 'or' | 'not' | string; +} diff --git a/src/version2/models/configurationsListParameters.ts b/src/version2/models/configurationsListParameters.ts new file mode 100644 index 0000000000..0ded35d16e --- /dev/null +++ b/src/version2/models/configurationsListParameters.ts @@ -0,0 +1,5 @@ +/** List of custom fields identifiers which will be used to filter configurations */ +export interface ConfigurationsListParameters { + /** List of IDs or keys of the custom fields. It can be a mix of IDs and keys in the same query. */ + fieldIdsOrKeys: string[]; +} diff --git a/src/version2/models/context.ts b/src/version2/models/context.ts new file mode 100644 index 0000000000..638cbfe41c --- /dev/null +++ b/src/version2/models/context.ts @@ -0,0 +1,10 @@ +import { Scope } from './scope'; + +/** A context. */ +export interface Context { + /** The ID of the context. */ + id?: number; + /** The name of the context. */ + name?: string; + scope?: Scope; +} diff --git a/src/version2/models/createCrossProjectReleaseRequest.ts b/src/version2/models/createCrossProjectReleaseRequest.ts new file mode 100644 index 0000000000..ad86f7182f --- /dev/null +++ b/src/version2/models/createCrossProjectReleaseRequest.ts @@ -0,0 +1,6 @@ +export interface CreateCrossProjectReleaseRequest { + /** The cross-project release name. */ + name: string; + /** The IDs of the releases to include in the cross-project release. */ + releaseIds?: number[]; +} diff --git a/src/version2/models/createCustomFieldRequest.ts b/src/version2/models/createCustomFieldRequest.ts new file mode 100644 index 0000000000..08f438709f --- /dev/null +++ b/src/version2/models/createCustomFieldRequest.ts @@ -0,0 +1,6 @@ +export interface CreateCustomFieldRequest { + /** The custom field ID. */ + customFieldId: number; + /** Allows filtering issues based on their values for the custom field. */ + filter?: boolean; +} diff --git a/src/version2/models/createDateFieldRequest.ts b/src/version2/models/createDateFieldRequest.ts new file mode 100644 index 0000000000..8c70d94eb2 --- /dev/null +++ b/src/version2/models/createDateFieldRequest.ts @@ -0,0 +1,6 @@ +export interface CreateDateFieldRequest { + /** A date custom field ID. This is required if the type is "DateCustomField". */ + dateCustomFieldId?: number; + /** The date field type. This must be "DueDate", "TargetStartDate", "TargetEndDate" or "DateCustomField". */ + type: 'DueDate' | 'TargetStartDate' | 'TargetEndDate' | 'DateCustomField' | string; +} diff --git a/src/version2/models/createExclusionRulesRequest.ts b/src/version2/models/createExclusionRulesRequest.ts new file mode 100644 index 0000000000..88a7aca6eb --- /dev/null +++ b/src/version2/models/createExclusionRulesRequest.ts @@ -0,0 +1,14 @@ +export interface CreateExclusionRulesRequest { + /** The IDs of the issues to exclude from the plan. */ + issueIds?: number[]; + /** The IDs of the issue types to exclude from the plan. */ + issueTypeIds?: number[]; + /** Issues completed this number of days ago will be excluded from the plan. */ + numberOfDaysToShowCompletedIssues?: number; + /** The IDs of the releases to exclude from the plan. */ + releaseIds?: number[]; + /** The IDs of the work status categories to exclude from the plan. */ + workStatusCategoryIds?: number[]; + /** The IDs of the work statuses to exclude from the plan. */ + workStatusIds?: number[]; +} diff --git a/src/version2/models/createIssueSourceRequest.ts b/src/version2/models/createIssueSourceRequest.ts new file mode 100644 index 0000000000..d5f08ed651 --- /dev/null +++ b/src/version2/models/createIssueSourceRequest.ts @@ -0,0 +1,9 @@ +export interface CreateIssueSourceRequest { + /** The issue source type. This must be "Board", "Project" or "Filter". */ + type: 'Board' | 'Project' | 'Filter' | string; + /** + * The issue source value. This must be a board ID if the type is "Board", a project ID if the type is "Project" or + * a filter ID if the type is "Filter". + */ + value: number; +} diff --git a/src/version2/models/createPermissionHolderRequest.ts b/src/version2/models/createPermissionHolderRequest.ts new file mode 100644 index 0000000000..1e0ab09af0 --- /dev/null +++ b/src/version2/models/createPermissionHolderRequest.ts @@ -0,0 +1,9 @@ +export interface CreatePermissionHolderRequest { + /** The permission holder type. This must be "Group" or "AccountId". */ + type: 'Group' | 'AccountId' | string; + /** + * The permission holder value. This must be a group name if the type is "Group" or an account ID if the type is + * "AccountId". + */ + value: string; +} diff --git a/src/version2/models/createPermissionRequest.ts b/src/version2/models/createPermissionRequest.ts new file mode 100644 index 0000000000..0ce59481d7 --- /dev/null +++ b/src/version2/models/createPermissionRequest.ts @@ -0,0 +1,7 @@ +import { CreatePermissionHolderRequest } from './createPermissionHolderRequest'; + +export interface CreatePermissionRequest { + holder?: CreatePermissionHolderRequest; + /** The permission type. This must be "View" or "Edit". */ + type: 'View' | 'Edit' | string; +} diff --git a/src/version2/models/createPlanOnlyTeamRequest.ts b/src/version2/models/createPlanOnlyTeamRequest.ts new file mode 100644 index 0000000000..f53a44b781 --- /dev/null +++ b/src/version2/models/createPlanOnlyTeamRequest.ts @@ -0,0 +1,14 @@ +export interface CreatePlanOnlyTeamRequest { + /** The capacity for the plan-only team. */ + capacity?: number; + /** The ID of the issue source for the plan-only team. */ + issueSourceId?: number; + /** The account IDs of the plan-only team members. */ + memberAccountIds?: string[]; + /** The plan-only team name. */ + name: string; + /** The planning style for the plan-only team. This must be "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the plan-only team. */ + sprintLength?: number; +} diff --git a/src/version2/models/createPlanRequest.ts b/src/version2/models/createPlanRequest.ts new file mode 100644 index 0000000000..c567101c93 --- /dev/null +++ b/src/version2/models/createPlanRequest.ts @@ -0,0 +1,23 @@ +import { CreateCrossProjectReleaseRequest } from './createCrossProjectReleaseRequest'; +import { CreateCustomFieldRequest } from './createCustomFieldRequest'; +import { CreateExclusionRulesRequest } from './createExclusionRulesRequest'; +import { CreateIssueSourceRequest } from './createIssueSourceRequest'; +import { CreatePermissionRequest } from './createPermissionRequest'; +import { CreateSchedulingRequest } from './createSchedulingRequest'; + +export interface CreatePlanRequest { + /** The cross-project releases to include in the plan. */ + crossProjectReleases?: CreateCrossProjectReleaseRequest[]; + /** The custom fields for the plan. */ + customFields?: CreateCustomFieldRequest[]; + exclusionRules?: CreateExclusionRulesRequest; + /** The issue sources to include in the plan. */ + issueSources: CreateIssueSourceRequest[]; + /** The account ID of the plan lead. */ + leadAccountId?: string; + /** The plan name. */ + name: string; + /** The permissions for the plan. */ + permissions?: CreatePermissionRequest[]; + scheduling?: CreateSchedulingRequest; +} diff --git a/src/version2/models/createPrioritySchemeDetails.ts b/src/version2/models/createPrioritySchemeDetails.ts new file mode 100644 index 0000000000..48059e0c6c --- /dev/null +++ b/src/version2/models/createPrioritySchemeDetails.ts @@ -0,0 +1,16 @@ +import { PriorityMapping } from './priorityMapping'; + +/** Details of a new priority scheme */ +export interface CreatePrioritySchemeDetails { + /** The ID of the default priority for the priority scheme. */ + defaultPriorityId: number; + /** The description of the priority scheme. */ + description?: string; + mappings?: PriorityMapping; + /** The name of the priority scheme. Must be unique. */ + name: string; + /** The IDs of priorities in the scheme. */ + priorityIds: number[]; + /** The IDs of projects that will use the priority scheme. */ + projectIds?: number[]; +} diff --git a/src/version2/models/createSchedulingRequest.ts b/src/version2/models/createSchedulingRequest.ts new file mode 100644 index 0000000000..400b3c9e1f --- /dev/null +++ b/src/version2/models/createSchedulingRequest.ts @@ -0,0 +1,12 @@ +import { CreateDateFieldRequest } from './createDateFieldRequest'; + +export interface CreateSchedulingRequest { + /** The dependencies for the plan. This must be "Sequential" or "Concurrent". */ + dependencies?: 'Sequential' | 'Concurrent' | string; + endDate?: CreateDateFieldRequest; + /** The estimation unit for the plan. This must be "StoryPoints", "Days" or "Hours". */ + estimation: 'StoryPoints' | 'Days' | 'Hours' | string; + /** The inferred dates for the plan. This must be "None", "SprintDates" or "ReleaseDates". */ + inferredDates?: 'None' | 'SprintDates' | 'ReleaseDates' | string; + startDate?: CreateDateFieldRequest; +} diff --git a/src/version2/models/customFieldContextDefaultValueCascadingOption.ts b/src/version2/models/customFieldContextDefaultValueCascadingOption.ts new file mode 100644 index 0000000000..d3e7b9987e --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueCascadingOption.ts @@ -0,0 +1,10 @@ +/** The default value for a cascading select custom field. */ +export interface CustomFieldContextDefaultValueCascadingOption { + /** The ID of the default cascading option. */ + cascadingOptionId?: string; + /** The ID of the context. */ + contextId: string; + /** The ID of the default option. */ + optionId: string; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueDate.ts b/src/version2/models/customFieldContextDefaultValueDate.ts new file mode 100644 index 0000000000..6f2852e760 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueDate.ts @@ -0,0 +1,8 @@ +/** The default value for a Date custom field. */ +export interface CustomFieldContextDefaultValueDate { + /** The default date in ISO format. Ignored if `useCurrent` is true. */ + date?: string; + type: string; + /** Whether to use the current date. */ + useCurrent?: boolean; +} diff --git a/src/version2/models/customFieldContextDefaultValueDateTime.ts b/src/version2/models/customFieldContextDefaultValueDateTime.ts new file mode 100644 index 0000000000..f0a5a8a195 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueDateTime.ts @@ -0,0 +1,8 @@ +/** The default value for a date time custom field. */ +export interface CustomFieldContextDefaultValueDateTime { + /** The default date-time in ISO format. Ignored if `useCurrent` is true. */ + dateTime?: string; + type: string; + /** Whether to use the current date. */ + useCurrent?: boolean; +} diff --git a/src/version2/models/customFieldContextDefaultValueFloat.ts b/src/version2/models/customFieldContextDefaultValueFloat.ts new file mode 100644 index 0000000000..f44a487fd2 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueFloat.ts @@ -0,0 +1,6 @@ +/** Default value for a float (number) custom field. */ +export interface CustomFieldContextDefaultValueFloat { + /** The default floating-point number. */ + number: number; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueForgeDateTimeField.ts b/src/version2/models/customFieldContextDefaultValueForgeDateTimeField.ts new file mode 100644 index 0000000000..f64ffda2f6 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueForgeDateTimeField.ts @@ -0,0 +1,10 @@ +/** The default value for a Forge date time custom field. */ +export interface CustomFieldContextDefaultValueForgeDateTimeField { + /** The ID of the context. */ + contextId: string; + /** The default date-time in ISO format. Ignored if `useCurrent` is true. */ + dateTime?: string; + type: string; + /** Whether to use the current date. */ + useCurrent?: boolean; +} diff --git a/src/version2/models/customFieldContextDefaultValueForgeGroupField.ts b/src/version2/models/customFieldContextDefaultValueForgeGroupField.ts new file mode 100644 index 0000000000..a39d619e2f --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueForgeGroupField.ts @@ -0,0 +1,8 @@ +/** The default value for a Forge group custom field. */ +export interface CustomFieldContextDefaultValueForgeGroupField { + /** The ID of the context. */ + contextId: string; + /** The ID of the the default group. */ + groupId: string; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueForgeMultiGroupField.ts b/src/version2/models/customFieldContextDefaultValueForgeMultiGroupField.ts new file mode 100644 index 0000000000..56fcdd1a55 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueForgeMultiGroupField.ts @@ -0,0 +1,8 @@ +/** The default value for a Forge collection of groups custom field. */ +export interface CustomFieldContextDefaultValueForgeMultiGroupField { + /** The ID of the context. */ + contextId: string; + /** The IDs of the default groups. */ + groupIds: string[]; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueForgeMultiStringField.ts b/src/version2/models/customFieldContextDefaultValueForgeMultiStringField.ts new file mode 100644 index 0000000000..be184841e3 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueForgeMultiStringField.ts @@ -0,0 +1,6 @@ +/** The default text for a Forge collection of strings custom field. */ +export interface CustomFieldContextDefaultValueForgeMultiStringField { + type: string; + /** List of string values. The maximum length for a value is 254 characters. */ + values?: string[]; +} diff --git a/src/version2/models/customFieldContextDefaultValueForgeMultiUserField.ts b/src/version2/models/customFieldContextDefaultValueForgeMultiUserField.ts new file mode 100644 index 0000000000..fba166ccef --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueForgeMultiUserField.ts @@ -0,0 +1,8 @@ +/** Defaults for a Forge collection of users custom field. */ +export interface CustomFieldContextDefaultValueForgeMultiUserField { + /** The IDs of the default users. */ + accountIds: string[]; + /** The ID of the context. */ + contextId: string; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueForgeNumberField.ts b/src/version2/models/customFieldContextDefaultValueForgeNumberField.ts new file mode 100644 index 0000000000..817d0ac8c0 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueForgeNumberField.ts @@ -0,0 +1,8 @@ +/** Default value for a Forge number custom field. */ +export interface CustomFieldContextDefaultValueForgeNumberField { + /** The ID of the context. */ + contextId: string; + /** The default floating-point number. */ + number: number; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueForgeObjectField.ts b/src/version2/models/customFieldContextDefaultValueForgeObjectField.ts new file mode 100644 index 0000000000..1374a24fe9 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueForgeObjectField.ts @@ -0,0 +1,6 @@ +/** The default value for a Forge object custom field. */ +export interface CustomFieldContextDefaultValueForgeObjectField { + /** The default JSON object. */ + object?: {}; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueForgeStringField.ts b/src/version2/models/customFieldContextDefaultValueForgeStringField.ts new file mode 100644 index 0000000000..23bf54106c --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueForgeStringField.ts @@ -0,0 +1,8 @@ +/** The default text for a Forge string custom field. */ +export interface CustomFieldContextDefaultValueForgeStringField { + /** The ID of the context. */ + contextId: string; + /** The default text. The maximum length is 254 characters. */ + text?: string; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueForgeUserField.ts b/src/version2/models/customFieldContextDefaultValueForgeUserField.ts new file mode 100644 index 0000000000..780bda329c --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueForgeUserField.ts @@ -0,0 +1,11 @@ +import { UserFilter } from './userFilter'; + +/** Defaults for a Forge user custom field. */ +export interface CustomFieldContextDefaultValueForgeUserField { + /** The ID of the default user. */ + accountId: string; + /** The ID of the context. */ + contextId: string; + type: string; + userFilter: UserFilter; +} diff --git a/src/version2/models/customFieldContextDefaultValueLabels.ts b/src/version2/models/customFieldContextDefaultValueLabels.ts new file mode 100644 index 0000000000..2d5e8bc0aa --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueLabels.ts @@ -0,0 +1,6 @@ +/** Default value for a labels custom field. */ +export interface CustomFieldContextDefaultValueLabels { + /** The default labels value. */ + labels: string[]; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueMultiUserPicker.ts b/src/version2/models/customFieldContextDefaultValueMultiUserPicker.ts new file mode 100644 index 0000000000..ac6ed10851 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueMultiUserPicker.ts @@ -0,0 +1,8 @@ +/** The default value for a User Picker (multiple) custom field. */ +export interface CustomFieldContextDefaultValueMultiUserPicker { + /** The IDs of the default users. */ + accountIds: string[]; + /** The ID of the context. */ + contextId: string; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueMultipleGroupPicker.ts b/src/version2/models/customFieldContextDefaultValueMultipleGroupPicker.ts new file mode 100644 index 0000000000..481e6bf2da --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueMultipleGroupPicker.ts @@ -0,0 +1,8 @@ +/** The default value for a multiple group picker custom field. */ +export interface CustomFieldContextDefaultValueMultipleGroupPicker { + /** The ID of the context. */ + contextId: string; + /** The IDs of the default groups. */ + groupIds: string[]; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueMultipleOption.ts b/src/version2/models/customFieldContextDefaultValueMultipleOption.ts new file mode 100644 index 0000000000..7bbaeb6385 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueMultipleOption.ts @@ -0,0 +1,8 @@ +/** The default value for a multi-select custom field. */ +export interface CustomFieldContextDefaultValueMultipleOption { + /** The ID of the context. */ + contextId: string; + /** The list of IDs of the default options. */ + optionIds: string[]; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueMultipleVersionPicker.ts b/src/version2/models/customFieldContextDefaultValueMultipleVersionPicker.ts new file mode 100644 index 0000000000..e7f0ed58c1 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueMultipleVersionPicker.ts @@ -0,0 +1,11 @@ +/** The default value for a multiple version picker custom field. */ +export interface CustomFieldContextDefaultValueMultipleVersionPicker { + type: string; + /** The IDs of the default versions. */ + versionIds: string[]; + /** + * The order the pickable versions are displayed in. If not provided, the released-first order is used. Available + * version orders are `"releasedFirst"` and `"unreleasedFirst"`. + */ + versionOrder?: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueProject.ts b/src/version2/models/customFieldContextDefaultValueProject.ts new file mode 100644 index 0000000000..f7593301af --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueProject.ts @@ -0,0 +1,8 @@ +/** The default value for a project custom field. */ +export interface CustomFieldContextDefaultValueProject { + /** The ID of the context. */ + contextId: string; + /** The ID of the default project. */ + projectId: string; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueReadOnly.ts b/src/version2/models/customFieldContextDefaultValueReadOnly.ts new file mode 100644 index 0000000000..27b0c151cf --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueReadOnly.ts @@ -0,0 +1,6 @@ +/** The default text for a read only custom field. */ +export interface CustomFieldContextDefaultValueReadOnly { + /** The default text. The maximum length is 255 characters. */ + text?: string; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueSingleGroupPicker.ts b/src/version2/models/customFieldContextDefaultValueSingleGroupPicker.ts new file mode 100644 index 0000000000..35fc9554ec --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueSingleGroupPicker.ts @@ -0,0 +1,8 @@ +/** The default value for a group picker custom field. */ +export interface CustomFieldContextDefaultValueSingleGroupPicker { + /** The ID of the context. */ + contextId: string; + /** The ID of the the default group. */ + groupId: string; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueSingleOption.ts b/src/version2/models/customFieldContextDefaultValueSingleOption.ts new file mode 100644 index 0000000000..63d25b6e77 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueSingleOption.ts @@ -0,0 +1,8 @@ +/** The default value for a single select custom field. */ +export interface CustomFieldContextDefaultValueSingleOption { + /** The ID of the context. */ + contextId: string; + /** The ID of the default option. */ + optionId: string; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueSingleVersionPicker.ts b/src/version2/models/customFieldContextDefaultValueSingleVersionPicker.ts new file mode 100644 index 0000000000..e3b6d83762 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueSingleVersionPicker.ts @@ -0,0 +1,11 @@ +/** The default value for a version picker custom field. */ +export interface CustomFieldContextDefaultValueSingleVersionPicker { + type: string; + /** The ID of the default version. */ + versionId: string; + /** + * The order the pickable versions are displayed in. If not provided, the released-first order is used. Available + * version orders are `"releasedFirst"` and `"unreleasedFirst"`. + */ + versionOrder?: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueTextArea.ts b/src/version2/models/customFieldContextDefaultValueTextArea.ts new file mode 100644 index 0000000000..10907b7b73 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueTextArea.ts @@ -0,0 +1,6 @@ +/** The default text for a text area custom field. */ +export interface CustomFieldContextDefaultValueTextArea { + /** The default text. The maximum length is 32767 characters. */ + text?: string; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueTextField.ts b/src/version2/models/customFieldContextDefaultValueTextField.ts new file mode 100644 index 0000000000..a5c8505e49 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueTextField.ts @@ -0,0 +1,6 @@ +/** The default text for a text custom field. */ +export interface CustomFieldContextDefaultValueTextField { + /** The default text. The maximum length is 254 characters. */ + text?: string; + type: string; +} diff --git a/src/version2/models/customFieldContextDefaultValueURL.ts b/src/version2/models/customFieldContextDefaultValueURL.ts new file mode 100644 index 0000000000..b6eea91276 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueURL.ts @@ -0,0 +1,8 @@ +/** The default value for a URL custom field. */ +export interface CustomFieldContextDefaultValueURL { + /** The ID of the context. */ + contextId: string; + type: string; + /** The default URL. */ + url: string; +} diff --git a/src/version2/models/customFieldContextSingleUserPickerDefaults.ts b/src/version2/models/customFieldContextSingleUserPickerDefaults.ts new file mode 100644 index 0000000000..ba2e248b68 --- /dev/null +++ b/src/version2/models/customFieldContextSingleUserPickerDefaults.ts @@ -0,0 +1,11 @@ +import { UserFilter } from './userFilter'; + +/** Defaults for a User Picker (single) custom field. */ +export interface CustomFieldContextSingleUserPickerDefaults { + /** The ID of the default user. */ + accountId: string; + /** The ID of the context. */ + contextId: string; + type: string; + userFilter: UserFilter; +} diff --git a/src/version2/models/dataClassificationLevels.ts b/src/version2/models/dataClassificationLevels.ts new file mode 100644 index 0000000000..d921e59834 --- /dev/null +++ b/src/version2/models/dataClassificationLevels.ts @@ -0,0 +1,7 @@ +import { DataClassificationTagBean } from './dataClassificationTagBean'; + +/** The data classification. */ +export interface DataClassificationLevels { + /** The data classifications. */ + classifications?: DataClassificationTagBean[]; +} diff --git a/src/version2/models/dataClassificationTag.ts b/src/version2/models/dataClassificationTag.ts new file mode 100644 index 0000000000..672de56a1c --- /dev/null +++ b/src/version2/models/dataClassificationTag.ts @@ -0,0 +1,17 @@ +/** The data classification. */ +export interface DataClassificationTag { + /** The color of the data classification object. */ + color?: string; + /** The description of the data classification object. */ + description?: string; + /** The guideline of the data classification object. */ + guideline?: string; + /** The ID of the data classification object. */ + id: string; + /** The name of the data classification object. */ + name?: string; + /** The rank of the data classification object. */ + rank?: number; + /** The status of the data classification object. */ + status: string; +} diff --git a/src/version2/models/dateRangeFilterRequest.ts b/src/version2/models/dateRangeFilterRequest.ts new file mode 100644 index 0000000000..dd99ddba60 --- /dev/null +++ b/src/version2/models/dateRangeFilterRequest.ts @@ -0,0 +1,7 @@ +/** List issues archived within a specified date range. */ +export interface DateRangeFilterRequest { + /** List issues archived after a specified date, passed in the YYYY-MM-DD format. */ + dateAfter: string; + /** List issues archived before a specified date provided in the YYYY-MM-DD format. */ + dateBefore: string; +} diff --git a/src/version2/models/deleteAndReplaceVersion.ts b/src/version2/models/deleteAndReplaceVersion.ts new file mode 100644 index 0000000000..12f3dbc47c --- /dev/null +++ b/src/version2/models/deleteAndReplaceVersion.ts @@ -0,0 +1,13 @@ +import { CustomFieldReplacement } from './customFieldReplacement'; + +export interface DeleteAndReplaceVersion { + /** + * An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the + * deleted version. + */ + customFieldReplacementList?: CustomFieldReplacement[]; + /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. */ + moveAffectedIssuesTo?: number; + /** The ID of the version to update `fixVersion` to when the field contains the deleted version. */ + moveFixIssuesTo?: number; +} diff --git a/src/version2/models/deprecatedWorkflow.ts b/src/version2/models/deprecatedWorkflow.ts new file mode 100644 index 0000000000..21f2dcd556 --- /dev/null +++ b/src/version2/models/deprecatedWorkflow.ts @@ -0,0 +1,23 @@ +import { Scope } from './scope'; + +/** Details about a workflow. */ +export interface DeprecatedWorkflow { + default?: boolean; + /** The description of the workflow. */ + description?: string; + /** The datetime the workflow was last modified. */ + lastModifiedDate?: 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. + */ + lastModifiedUser?: string; + /** The account ID of the user that last modified the workflow. */ + lastModifiedUserAccountId?: string; + /** The name of the workflow. */ + name?: string; + scope?: Scope; + /** The number of steps included in the workflow. */ + steps?: number; +} diff --git a/src/version2/models/detailedErrorCollection.ts b/src/version2/models/detailedErrorCollection.ts new file mode 100644 index 0000000000..c1a1c02cfa --- /dev/null +++ b/src/version2/models/detailedErrorCollection.ts @@ -0,0 +1,11 @@ +export interface DetailedErrorCollection { + /** Map of objects representing additional details for an error */ + details?: {}; + /** The list of error messages produced by this operation. For example, "input parameter 'key' must be provided" */ + errorMessages?: string[]; + /** + * The list of errors by parameter returned by the operation. For example,"projectKey": "Project keys must start + * with an uppercase letter, followed by one or more uppercase alphanumeric characters." + */ + errors?: {}; +} diff --git a/src/version2/models/duplicatePlanRequest.ts b/src/version2/models/duplicatePlanRequest.ts new file mode 100644 index 0000000000..3d5c98beaf --- /dev/null +++ b/src/version2/models/duplicatePlanRequest.ts @@ -0,0 +1,4 @@ +export interface DuplicatePlanRequest { + /** The plan name. */ + name: string; +} diff --git a/src/version2/models/errorCollections.ts b/src/version2/models/errorCollections.ts new file mode 100644 index 0000000000..4a60d4d40e --- /dev/null +++ b/src/version2/models/errorCollections.ts @@ -0,0 +1 @@ +export interface ErrorCollections {} diff --git a/src/version2/models/errorMessage.ts b/src/version2/models/errorMessage.ts new file mode 100644 index 0000000000..45c1efb997 --- /dev/null +++ b/src/version2/models/errorMessage.ts @@ -0,0 +1,4 @@ +export interface ErrorMessage { + /** The error message. */ + message: string; +} diff --git a/src/version2/models/evaluateMetaData.ts b/src/version2/models/evaluateMetaData.ts new file mode 100644 index 0000000000..c636542ad3 --- /dev/null +++ b/src/version2/models/evaluateMetaData.ts @@ -0,0 +1,11 @@ +import { JiraExpressionsComplexityBean } from './jiraExpressionsComplexityBean'; +import { JExpEvaluateIssuesMetaBean } from './jExpEvaluateIssuesMetaBean'; + +/** + * Contains information about the expression evaluation. This bean will be replacing + * `JiraExpressionEvaluationMetaDataBean` bean as part of new `evaluate` endpoint + */ +export interface EvaluateMetaData { + complexity?: JiraExpressionsComplexityBean; + issues?: JExpEvaluateIssuesMetaBean; +} diff --git a/src/version2/models/evaluatedJiraExpression.ts b/src/version2/models/evaluatedJiraExpression.ts new file mode 100644 index 0000000000..3c4ce1a643 --- /dev/null +++ b/src/version2/models/evaluatedJiraExpression.ts @@ -0,0 +1,16 @@ +import { JExpEvaluateMetaDataBean } from './jExpEvaluateMetaDataBean'; + +/** + * The result of evaluating a Jira expression.This bean will be replacing `JiraExpressionResultBean` bean as part of new + * evaluate endpoint + */ +export interface EvaluatedJiraExpression { + meta?: JExpEvaluateMetaDataBean; + /** + * The value of the evaluated expression. It may be a primitive JSON value or a Jira REST API object. (Some + * expressions do not produce any meaningful results—for example, an expression that returns a lambda function—if + * that's the case a simple string representation is returned. These string representations should not be relied + * upon and may change without notice.) + */ + value: {}; +} diff --git a/src/version2/models/expandPrioritySchemeBean.ts b/src/version2/models/expandPrioritySchemeBean.ts new file mode 100644 index 0000000000..68732ded03 --- /dev/null +++ b/src/version2/models/expandPrioritySchemeBean.ts @@ -0,0 +1,9 @@ +/** A priority scheme with less fields to be used in for an API expand response. */ +export interface ExpandPrioritySchemeBean { + /** The ID of the priority scheme. */ + id?: string; + /** The name of the priority scheme. */ + name?: string; + /** The URL of the priority scheme. */ + self?: string; +} diff --git a/src/version2/models/expandPrioritySchemePage.ts b/src/version2/models/expandPrioritySchemePage.ts new file mode 100644 index 0000000000..eecfa3eb8f --- /dev/null +++ b/src/version2/models/expandPrioritySchemePage.ts @@ -0,0 +1,5 @@ +export interface ExpandPrioritySchemePage { + maxResults?: number; + startAt?: number; + total?: number; +} diff --git a/src/version2/models/exportArchivedIssuesTaskProgressResponse.ts b/src/version2/models/exportArchivedIssuesTaskProgressResponse.ts new file mode 100644 index 0000000000..527bbade2d --- /dev/null +++ b/src/version2/models/exportArchivedIssuesTaskProgressResponse.ts @@ -0,0 +1,9 @@ +/** The response for status request for a running/completed export task. */ +export interface ExportArchivedIssuesTaskProgressResponse { + fileUrl?: string; + payload?: string; + progress?: number; + status?: string; + submittedTime?: string; + taskId?: string; +} diff --git a/src/version2/models/fieldChangedClause.ts b/src/version2/models/fieldChangedClause.ts new file mode 100644 index 0000000000..8f4c282ea2 --- /dev/null +++ b/src/version2/models/fieldChangedClause.ts @@ -0,0 +1,15 @@ +import { JqlQueryField } from './jqlQueryField'; +import { JqlQueryClauseTimePredicate } from './jqlQueryClauseTimePredicate'; + +/** + * A clause that asserts whether a field was changed. For example, `status CHANGED AFTER startOfMonth(-1M)`.See + * [CHANGED](https://confluence.atlassian.com/x/dgiiLQ#Advancedsearching-operatorsreference-CHANGEDCHANGED) for more + * information about the CHANGED operator. + */ +export interface FieldChangedClause { + field: JqlQueryField; + /** The operator applied to the field. */ + operator: 'changed' | string; + /** The list of time predicates. */ + predicates: JqlQueryClauseTimePredicate[]; +} diff --git a/src/version2/models/fieldCreateMetadata.ts b/src/version2/models/fieldCreateMetadata.ts new file mode 100644 index 0000000000..93e6db0c19 --- /dev/null +++ b/src/version2/models/fieldCreateMetadata.ts @@ -0,0 +1,26 @@ +import { JsonTypeBean } from './jsonTypeBean'; + +/** The metadata describing an issue field for createmeta. */ +export interface FieldCreateMetadata { + /** The list of values allowed in the field. */ + allowedValues?: {}[]; + /** The URL that can be used to automatically complete the field. */ + autoCompleteUrl?: string; + /** The configuration properties. */ + configuration?: {}; + /** The default value of the field. */ + defaultValue?: {}; + /** The field id. */ + fieldId: string; + /** Whether the field has a default value. */ + hasDefaultValue?: boolean; + /** The key of the field. */ + key: string; + /** The name of the field. */ + name: string; + /** The list of operations that can be performed on the field. */ + operations: string[]; + /** Whether the field is required. */ + required: boolean; + schema?: JsonTypeBean; +} diff --git a/src/version2/models/fieldUpdateOperation.ts b/src/version2/models/fieldUpdateOperation.ts new file mode 100644 index 0000000000..53fccfcb65 --- /dev/null +++ b/src/version2/models/fieldUpdateOperation.ts @@ -0,0 +1,13 @@ +/** Details of an operation to perform on a field. */ +export interface FieldUpdateOperation { + /** The value to add to the field. */ + add?: {}; + /** The field value to copy from another issue. */ + copy?: {}; + /** The value to edit in the field. */ + edit?: {}; + /** The value to removed from the field. */ + remove?: {}; + /** The value to set in the field. */ + set?: {}; +} diff --git a/src/version2/models/fieldValueClause.ts b/src/version2/models/fieldValueClause.ts new file mode 100644 index 0000000000..257141b296 --- /dev/null +++ b/src/version2/models/fieldValueClause.ts @@ -0,0 +1,10 @@ +import { JqlQueryField } from './jqlQueryField'; +import { JqlQueryClauseOperand } from './jqlQueryClauseOperand'; + +/** A clause that asserts the current value of a field. For example, `summary ~ test`. */ +export interface FieldValueClause { + field: JqlQueryField; + operand: JqlQueryClauseOperand; + /** The operator between the field and operand. */ + operator: '=' | '!=' | '>' | '<' | '>=' | '<=' | 'in' | 'not in' | '~' | '~=' | 'is' | 'is not' | string; +} diff --git a/src/version2/models/fieldWasClause.ts b/src/version2/models/fieldWasClause.ts new file mode 100644 index 0000000000..f58a2e3b9b --- /dev/null +++ b/src/version2/models/fieldWasClause.ts @@ -0,0 +1,17 @@ +import { JqlQueryField } from './jqlQueryField'; +import { JqlQueryClauseOperand } from './jqlQueryClauseOperand'; +import { JqlQueryClauseTimePredicate } from './jqlQueryClauseTimePredicate'; + +/** + * A clause that asserts a previous value of a field. For example, `status WAS "Resolved" BY currentUser() BEFORE + * "2019/02/02"`. See [WAS](https://confluence.atlassian.com/x/dgiiLQ#Advancedsearching-operatorsreference-WASWAS) for + * more information about the WAS operator. + */ +export interface FieldWasClause { + field: JqlQueryField; + operand: JqlQueryClauseOperand; + /** The operator between the field and operand. */ + operator: 'was' | 'was in' | 'was not in' | 'was not' | string; + /** The list of time predicates. */ + predicates: JqlQueryClauseTimePredicate[]; +} diff --git a/src/version2/models/functionOperand.ts b/src/version2/models/functionOperand.ts new file mode 100644 index 0000000000..9110746b76 --- /dev/null +++ b/src/version2/models/functionOperand.ts @@ -0,0 +1,12 @@ +/** + * An operand that is a function. See [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/dwiiLQ) for more information about JQL functions. + */ +export interface FunctionOperand { + /** The list of function arguments. */ + arguments: string[]; + /** Encoded operand, which can be used directly in a JQL query. */ + encodedOperand?: string; + /** The name of the function. */ + function: string; +} diff --git a/src/version2/models/getAtlassianTeamResponse.ts b/src/version2/models/getAtlassianTeamResponse.ts new file mode 100644 index 0000000000..ad60480d52 --- /dev/null +++ b/src/version2/models/getAtlassianTeamResponse.ts @@ -0,0 +1,12 @@ +export interface GetAtlassianTeamResponse { + /** The capacity for the Atlassian team. */ + capacity?: number; + /** The Atlassian team ID. */ + id: string; + /** The ID of the issue source for the Atlassian team. */ + issueSourceId?: number; + /** The planning style for the Atlassian team. This is "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the Atlassian team. */ + sprintLength?: number; +} diff --git a/src/version2/models/getCrossProjectReleaseResponse.ts b/src/version2/models/getCrossProjectReleaseResponse.ts new file mode 100644 index 0000000000..4e41368cc5 --- /dev/null +++ b/src/version2/models/getCrossProjectReleaseResponse.ts @@ -0,0 +1,6 @@ +export interface GetCrossProjectReleaseResponse { + /** The cross-project release name. */ + name?: string; + /** The IDs of the releases included in the cross-project release. */ + releaseIds?: number[]; +} diff --git a/src/version2/models/getCustomFieldResponse.ts b/src/version2/models/getCustomFieldResponse.ts new file mode 100644 index 0000000000..8ac304ff9b --- /dev/null +++ b/src/version2/models/getCustomFieldResponse.ts @@ -0,0 +1,6 @@ +export interface GetCustomFieldResponse { + /** The custom field ID. */ + customFieldId: number; + /** Allows filtering issues based on their values for the custom field. */ + filter?: boolean; +} diff --git a/src/version2/models/getDateFieldResponse.ts b/src/version2/models/getDateFieldResponse.ts new file mode 100644 index 0000000000..d2293240a8 --- /dev/null +++ b/src/version2/models/getDateFieldResponse.ts @@ -0,0 +1,6 @@ +export interface GetDateFieldResponse { + /** A date custom field ID. This is returned if the type is "DateCustomField". */ + dateCustomFieldId?: number; + /** The date field type. This is "DueDate", "TargetStartDate", "TargetEndDate" or "DateCustomField". */ + type: 'DueDate' | 'TargetStartDate' | 'TargetEndDate' | 'DateCustomField' | string; +} diff --git a/src/version2/models/getExclusionRulesResponse.ts b/src/version2/models/getExclusionRulesResponse.ts new file mode 100644 index 0000000000..c2852ef738 --- /dev/null +++ b/src/version2/models/getExclusionRulesResponse.ts @@ -0,0 +1,14 @@ +export interface GetExclusionRulesResponse { + /** The IDs of the issues excluded from the plan. */ + issueIds?: number[]; + /** The IDs of the issue types excluded from the plan. */ + issueTypeIds?: number[]; + /** Issues completed this number of days ago are excluded from the plan. */ + numberOfDaysToShowCompletedIssues: number; + /** The IDs of the releases excluded from the plan. */ + releaseIds?: number[]; + /** The IDs of the work status categories excluded from the plan. */ + workStatusCategoryIds?: number[]; + /** The IDs of the work statuses excluded from the plan. */ + workStatusIds?: number[]; +} diff --git a/src/version2/models/getIssueSourceResponse.ts b/src/version2/models/getIssueSourceResponse.ts new file mode 100644 index 0000000000..fd864bf6ad --- /dev/null +++ b/src/version2/models/getIssueSourceResponse.ts @@ -0,0 +1,9 @@ +export interface GetIssueSourceResponse { + /** The issue source type. This is "Board", "Project" or "Filter". */ + type: 'Board' | 'Project' | 'Filter' | 'Custom' | string; + /** + * The issue source value. This is a board ID if the type is "Board", a project ID if the type is "Project" or a + * filter ID if the type is "Filter". + */ + value: number; +} diff --git a/src/version2/models/getPermissionHolderResponse.ts b/src/version2/models/getPermissionHolderResponse.ts new file mode 100644 index 0000000000..4d44c9cb87 --- /dev/null +++ b/src/version2/models/getPermissionHolderResponse.ts @@ -0,0 +1,9 @@ +export interface GetPermissionHolderResponse { + /** The permission holder type. This is "Group" or "AccountId". */ + type: 'Group' | 'AccountId' | string; + /** + * The permission holder value. This is a group name if the type is "Group" or an account ID if the type is + * "AccountId". + */ + value: string; +} diff --git a/src/version2/models/getPermissionResponse.ts b/src/version2/models/getPermissionResponse.ts new file mode 100644 index 0000000000..c778b582bc --- /dev/null +++ b/src/version2/models/getPermissionResponse.ts @@ -0,0 +1,7 @@ +import { GetPermissionHolderResponse } from './getPermissionHolderResponse'; + +export interface GetPermissionResponse { + holder?: GetPermissionHolderResponse; + /** The permission type. This is "View" or "Edit". */ + type: 'View' | 'Edit' | string; +} diff --git a/src/version2/models/getPlanOnlyTeamResponse.ts b/src/version2/models/getPlanOnlyTeamResponse.ts new file mode 100644 index 0000000000..5dd4cf00e0 --- /dev/null +++ b/src/version2/models/getPlanOnlyTeamResponse.ts @@ -0,0 +1,16 @@ +export interface GetPlanOnlyTeamResponse { + /** The capacity for the plan-only team. */ + capacity?: number; + /** The plan-only team ID. */ + id: number; + /** The ID of the issue source for the plan-only team. */ + issueSourceId?: number; + /** The account IDs of the plan-only team members. */ + memberAccountIds?: string[]; + /** The plan-only team name. */ + name: string; + /** The planning style for the plan-only team. This is "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the plan-only team. */ + sprintLength?: number; +} diff --git a/src/version2/models/getPlanResponseForPage.ts b/src/version2/models/getPlanResponseForPage.ts new file mode 100644 index 0000000000..63a774a14f --- /dev/null +++ b/src/version2/models/getPlanResponseForPage.ts @@ -0,0 +1,12 @@ +import { GetIssueSourceResponse } from './getIssueSourceResponse'; + +export interface GetPlanResponseForPage { + /** The plan ID. */ + id: string; + /** The issue sources included in the plan. */ + issueSources?: GetIssueSourceResponse[]; + /** The plan name. */ + name: string; + /** The plan status. This is "Active", "Trashed" or "Archived". */ + status: 'Active' | 'Trashed' | 'Archived' | string; +} diff --git a/src/version2/models/getSchedulingResponse.ts b/src/version2/models/getSchedulingResponse.ts new file mode 100644 index 0000000000..8a284167f7 --- /dev/null +++ b/src/version2/models/getSchedulingResponse.ts @@ -0,0 +1,12 @@ +import { GetDateFieldResponse } from './getDateFieldResponse'; + +export interface GetSchedulingResponse { + /** The dependencies for the plan. This is "Sequential" or "Concurrent". */ + dependencies: 'Sequential' | 'Concurrent' | string; + endDate?: GetDateFieldResponse; + /** The estimation unit for the plan. This is "StoryPoints", "Days" or "Hours". */ + estimation: 'StoryPoints' | 'Days' | 'Hours' | string; + /** The inferred dates for the plan. This is "None", "SprintDates" or "ReleaseDates". */ + inferredDates: 'None' | 'SprintDates' | 'ReleaseDates' | string; + startDate?: GetDateFieldResponse; +} diff --git a/src/version2/models/getTeamResponseForPage.ts b/src/version2/models/getTeamResponseForPage.ts new file mode 100644 index 0000000000..6d49ebff03 --- /dev/null +++ b/src/version2/models/getTeamResponseForPage.ts @@ -0,0 +1,8 @@ +export interface GetTeamResponseForPage { + /** The team ID. */ + id: string; + /** The team name. This is returned if the type is "PlanOnly". */ + name?: string; + /** The team type. This is "PlanOnly" or "Atlassian". */ + type: 'PlanOnly' | 'Atlassian' | string; +} diff --git a/src/version2/models/healthCheckResult.ts b/src/version2/models/healthCheckResult.ts new file mode 100644 index 0000000000..2e0eaecec8 --- /dev/null +++ b/src/version2/models/healthCheckResult.ts @@ -0,0 +1,9 @@ +/** Jira instance health check results. Deprecated and no longer returned. */ +export interface HealthCheckResult { + /** The description of the Jira health check item. */ + description?: string; + /** The name of the Jira health check item. */ + name?: string; + /** Whether the Jira health check item passed or failed. */ + passed?: boolean; +} diff --git a/src/version2/models/iconBean.ts b/src/version2/models/iconBean.ts new file mode 100644 index 0000000000..9d78ec9dbd --- /dev/null +++ b/src/version2/models/iconBean.ts @@ -0,0 +1,9 @@ +/** An icon. */ +export interface IconBean { + /** The URL of the tooltip, used only for a status icon. */ + link?: string; + /** The title of the icon, for use as a tooltip on the icon. */ + title?: string; + /** The URL of a 16x16 pixel icon. */ + url16x16?: string; +} diff --git a/src/version2/models/idSearchRequest.ts b/src/version2/models/idSearchRequest.ts new file mode 100644 index 0000000000..4f15da0140 --- /dev/null +++ b/src/version2/models/idSearchRequest.ts @@ -0,0 +1,8 @@ +export interface IdSearchRequest { + /** A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. Order by clauses are not allowed. */ + jql?: string; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** The continuation token to fetch the next page. This token is provided by the response of this endpoint. */ + nextPageToken?: string; +} diff --git a/src/version2/models/idSearchResults.ts b/src/version2/models/idSearchResults.ts new file mode 100644 index 0000000000..596045fb5c --- /dev/null +++ b/src/version2/models/idSearchResults.ts @@ -0,0 +1,10 @@ +/** Result of your JQL search. Returns a list of issue IDs and a token to fetch the next page if one exists. */ +export interface IdSearchResults { + /** The list of issue IDs found by the search. */ + issueIds?: number[]; + /** + * Continuation token to fetch the next page. If this result represents the last or the only page this token will be + * null. + */ + nextPageToken?: string; +} diff --git a/src/version2/models/inputStreamSource.ts b/src/version2/models/inputStreamSource.ts new file mode 100644 index 0000000000..544620ac1e --- /dev/null +++ b/src/version2/models/inputStreamSource.ts @@ -0,0 +1,3 @@ +export interface InputStreamSource { + inputStream?: {}; +} diff --git a/src/version2/models/issueArchivalSyncRequest.ts b/src/version2/models/issueArchivalSyncRequest.ts new file mode 100644 index 0000000000..937b587102 --- /dev/null +++ b/src/version2/models/issueArchivalSyncRequest.ts @@ -0,0 +1,4 @@ +/** List of Issue Ids Or Keys that are to be archived or unarchived */ +export interface IssueArchivalSyncRequest { + issueIdsOrKeys?: string[]; +} diff --git a/src/version2/models/issueChangeLog.ts b/src/version2/models/issueChangeLog.ts new file mode 100644 index 0000000000..cab78f577e --- /dev/null +++ b/src/version2/models/issueChangeLog.ts @@ -0,0 +1,9 @@ +import { Changelog } from './changelog'; + +/** List of changelogs that belong to single issue */ +export interface IssueChangeLog { + /** List of changelogs that belongs to given issueId. */ + changeHistories?: Changelog[]; + /** The ID of the issue. */ + issueId?: string; +} diff --git a/src/version2/models/issueError.ts b/src/version2/models/issueError.ts new file mode 100644 index 0000000000..e48a85799f --- /dev/null +++ b/src/version2/models/issueError.ts @@ -0,0 +1,7 @@ +/** Describes the error that occurred when retrieving data for a particular issue. */ +export interface IssueError { + /** The error that occurred when fetching this issue. */ + errorMessage?: string; + /** The ID of the issue. */ + id?: string; +} diff --git a/src/version2/models/issueLimitReport.ts b/src/version2/models/issueLimitReport.ts new file mode 100644 index 0000000000..df5798701a --- /dev/null +++ b/src/version2/models/issueLimitReport.ts @@ -0,0 +1,8 @@ +export interface IssueLimitReport { + /** A list of ids of issues approaching the limit and their field count */ + issuesApproachingLimit?: {}; + /** A list of ids of issues breaching the limit and their field count */ + issuesBreachingLimit?: {}; + /** The fields and their defined limits */ + limits?: {}; +} diff --git a/src/version2/models/issueLimitReportRequest.ts b/src/version2/models/issueLimitReportRequest.ts new file mode 100644 index 0000000000..4ea1c52f19 --- /dev/null +++ b/src/version2/models/issueLimitReportRequest.ts @@ -0,0 +1,9 @@ +export interface IssueLimitReportRequest { + /** + * A list of fields and their respective approaching limit threshold. Required for querying issues approaching + * limits. Optional for querying issues breaching limits. Accepted fields are: `comment`, `worklog`, `attachment`, + * `remoteIssueLinks`, and `issuelinks`. Example: `{"issuesApproachingLimitParams": {"comment": 4500, "attachment": + * 1800}}` + */ + issuesApproachingLimitParams?: {}; +} diff --git a/src/version2/models/jQLCount.ts b/src/version2/models/jQLCount.ts new file mode 100644 index 0000000000..a3270ef92a --- /dev/null +++ b/src/version2/models/jQLCount.ts @@ -0,0 +1,4 @@ +export interface JQLCount { + /** Number of issues matching JQL query. */ + count?: number; +} diff --git a/src/version2/models/jQLCountRequest.ts b/src/version2/models/jQLCountRequest.ts new file mode 100644 index 0000000000..3eb6cce3be --- /dev/null +++ b/src/version2/models/jQLCountRequest.ts @@ -0,0 +1,7 @@ +export interface JQLCountRequest { + /** + * A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a + * bounded query. A bounded query is a query with a search restriction. + */ + jql?: string; +} diff --git a/src/version2/models/jiraExpressionEvaluateRequest.ts b/src/version2/models/jiraExpressionEvaluateRequest.ts new file mode 100644 index 0000000000..420c826247 --- /dev/null +++ b/src/version2/models/jiraExpressionEvaluateRequest.ts @@ -0,0 +1,11 @@ +import { JiraExpressionEvaluateContextBean } from './jiraExpressionEvaluateContextBean'; + +/** + * The request to evaluate a Jira expression. This bean will be replacing `JiraExpressionEvaluateRequest` as part of new + * `evaluate` endpoint + */ +export interface JiraExpressionEvaluateRequest { + context?: JiraExpressionEvaluateContextBean; + /** The Jira expression to evaluate. */ + expression: string; +} diff --git a/src/version2/models/jqlFunctionPrecomputationGetByIdRequest.ts b/src/version2/models/jqlFunctionPrecomputationGetByIdRequest.ts new file mode 100644 index 0000000000..f9afb489d9 --- /dev/null +++ b/src/version2/models/jqlFunctionPrecomputationGetByIdRequest.ts @@ -0,0 +1,4 @@ +/** Request to fetch precomputations by ID. */ +export interface JqlFunctionPrecomputationGetByIdRequest { + precomputationIDs?: string[]; +} diff --git a/src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts b/src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts new file mode 100644 index 0000000000..e74d35e280 --- /dev/null +++ b/src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts @@ -0,0 +1,9 @@ +import { JqlFunctionPrecomputationBean } from './jqlFunctionPrecomputationBean'; + +/** Get precomputations by ID response. */ +export interface JqlFunctionPrecomputationGetByIdResponse { + /** List of precomputations that were not found. */ + notFoundPrecomputationIDs?: string[]; + /** The list of precomputations. */ + precomputations?: JqlFunctionPrecomputationBean[]; +} diff --git a/src/version2/models/jqlFunctionPrecomputationUpdateBean.ts b/src/version2/models/jqlFunctionPrecomputationUpdateBean.ts new file mode 100644 index 0000000000..49f25515bb --- /dev/null +++ b/src/version2/models/jqlFunctionPrecomputationUpdateBean.ts @@ -0,0 +1,12 @@ +/** Precomputation id and its new value. */ +export interface JqlFunctionPrecomputationUpdateBean { + /** + * The error message to be displayed to the user if the given function clause is no longer valid during + * recalculation of the precomputation. + */ + error?: string; + /** The id of the precomputation to update. */ + id: string; + /** The new value of the precomputation. */ + value?: string; +} diff --git a/src/version2/models/jqlFunctionPrecomputationUpdateErrorResponse.ts b/src/version2/models/jqlFunctionPrecomputationUpdateErrorResponse.ts new file mode 100644 index 0000000000..2a01b7fae7 --- /dev/null +++ b/src/version2/models/jqlFunctionPrecomputationUpdateErrorResponse.ts @@ -0,0 +1,7 @@ +/** Error response returned updating JQL Function precomputations fails. */ +export interface JqlFunctionPrecomputationUpdateErrorResponse { + /** The list of error messages produced by this operation. */ + errorMessages?: string[]; + /** List of precomputations that were not found. */ + notFoundPrecomputationIDs?: string[]; +} diff --git a/src/version2/models/jqlFunctionPrecomputationUpdateResponse.ts b/src/version2/models/jqlFunctionPrecomputationUpdateResponse.ts new file mode 100644 index 0000000000..8e1167ec5e --- /dev/null +++ b/src/version2/models/jqlFunctionPrecomputationUpdateResponse.ts @@ -0,0 +1,8 @@ +/** Result of updating JQL Function precomputations. */ +export interface JqlFunctionPrecomputationUpdateResponse { + /** + * List of precomputations that were not found and skipped. Only returned if the request passed + * skipNotFoundPrecomputations=true. + */ + notFoundPrecomputationIDs?: string[]; +} diff --git a/src/version2/models/jqlQueryClauseOperand.ts b/src/version2/models/jqlQueryClauseOperand.ts new file mode 100644 index 0000000000..a36b3d3711 --- /dev/null +++ b/src/version2/models/jqlQueryClauseOperand.ts @@ -0,0 +1,2 @@ +/** Details of an operand in a JQL clause. */ +export interface JqlQueryClauseOperand {} diff --git a/src/version2/models/jqlQueryClauseTimePredicate.ts b/src/version2/models/jqlQueryClauseTimePredicate.ts new file mode 100644 index 0000000000..8c96a238ca --- /dev/null +++ b/src/version2/models/jqlQueryClauseTimePredicate.ts @@ -0,0 +1,8 @@ +import { JqlQueryClauseOperand } from './jqlQueryClauseOperand'; + +/** A time predicate for a temporal JQL clause. */ +export interface JqlQueryClauseTimePredicate { + operand: JqlQueryClauseOperand; + /** The operator between the field and the operand. */ + operator: 'before' | 'after' | 'from' | 'to' | 'on' | 'during' | 'by' | string; +} diff --git a/src/version2/models/jqlQueryUnitaryOperand.ts b/src/version2/models/jqlQueryUnitaryOperand.ts new file mode 100644 index 0000000000..1812693776 --- /dev/null +++ b/src/version2/models/jqlQueryUnitaryOperand.ts @@ -0,0 +1,2 @@ +/** An operand that can be part of a list operand. */ +export interface JqlQueryUnitaryOperand {} diff --git a/src/version2/models/jsonNode.ts b/src/version2/models/jsonNode.ts new file mode 100644 index 0000000000..402169b828 --- /dev/null +++ b/src/version2/models/jsonNode.ts @@ -0,0 +1,38 @@ +export interface JsonNode { + array?: boolean; + bigDecimal?: boolean; + bigInteger?: boolean; + bigIntegerValue?: number; + binary?: boolean; + binaryValue?: string[]; + boolean?: boolean; + booleanValue?: boolean; + containerNode?: boolean; + decimalValue?: number; + double?: boolean; + doubleValue?: number; + elements?: {}; + fieldNames?: {}; + fields?: {}; + floatingPointNumber?: boolean; + int?: boolean; + intValue?: number; + integralNumber?: boolean; + long?: boolean; + longValue?: number; + missingNode?: boolean; + null?: boolean; + number?: boolean; + numberType?: 'INT' | 'LONG' | 'BIG_INTEGER' | 'FLOAT' | 'DOUBLE' | 'BIG_DECIMAL' | string; + numberValue?: number; + object?: boolean; + pojo?: boolean; + textValue?: string; + textual?: boolean; + valueAsBoolean?: boolean; + valueAsDouble?: number; + valueAsInt?: number; + valueAsLong?: number; + valueAsText?: string; + valueNode?: boolean; +} diff --git a/src/version2/models/keywordOperand.ts b/src/version2/models/keywordOperand.ts new file mode 100644 index 0000000000..f844cf12d3 --- /dev/null +++ b/src/version2/models/keywordOperand.ts @@ -0,0 +1,9 @@ +/** + * An operand that is a JQL keyword. See [Advanced searching - keywords + * reference](https://confluence.atlassian.com/jiracorecloud/advanced-searching-keywords-reference-765593717.html#Advancedsearching-keywordsreference-EMPTYEMPTY) + * for more information about operand keywords. + */ +export interface KeywordOperand { + /** The keyword that is the operand value. */ + keyword: 'empty' | string; +} diff --git a/src/version2/models/legacyJackson1ListAttachment.ts b/src/version2/models/legacyJackson1ListAttachment.ts new file mode 100644 index 0000000000..aef6d4e25a --- /dev/null +++ b/src/version2/models/legacyJackson1ListAttachment.ts @@ -0,0 +1 @@ +export interface LegacyJackson1ListAttachment {} diff --git a/src/version2/models/legacyJackson1ListColumnItem.ts b/src/version2/models/legacyJackson1ListColumnItem.ts new file mode 100644 index 0000000000..4489873dcf --- /dev/null +++ b/src/version2/models/legacyJackson1ListColumnItem.ts @@ -0,0 +1 @@ +export interface LegacyJackson1ListColumnItem {} diff --git a/src/version2/models/legacyJackson1ListIssueEvent.ts b/src/version2/models/legacyJackson1ListIssueEvent.ts new file mode 100644 index 0000000000..239cd18c9f --- /dev/null +++ b/src/version2/models/legacyJackson1ListIssueEvent.ts @@ -0,0 +1 @@ +export interface LegacyJackson1ListIssueEvent {} diff --git a/src/version2/models/legacyJackson1ListIssueTypeWithStatus.ts b/src/version2/models/legacyJackson1ListIssueTypeWithStatus.ts new file mode 100644 index 0000000000..5129b62c62 --- /dev/null +++ b/src/version2/models/legacyJackson1ListIssueTypeWithStatus.ts @@ -0,0 +1 @@ +export interface LegacyJackson1ListIssueTypeWithStatus {} diff --git a/src/version2/models/legacyJackson1ListProject.ts b/src/version2/models/legacyJackson1ListProject.ts new file mode 100644 index 0000000000..273240c3b8 --- /dev/null +++ b/src/version2/models/legacyJackson1ListProject.ts @@ -0,0 +1 @@ +export interface LegacyJackson1ListProject {} diff --git a/src/version2/models/legacyJackson1ListProjectComponent.ts b/src/version2/models/legacyJackson1ListProjectComponent.ts new file mode 100644 index 0000000000..2cf6f56abf --- /dev/null +++ b/src/version2/models/legacyJackson1ListProjectComponent.ts @@ -0,0 +1 @@ +export interface LegacyJackson1ListProjectComponent {} diff --git a/src/version2/models/legacyJackson1ListProjectRoleDetails.ts b/src/version2/models/legacyJackson1ListProjectRoleDetails.ts new file mode 100644 index 0000000000..de21f62f62 --- /dev/null +++ b/src/version2/models/legacyJackson1ListProjectRoleDetails.ts @@ -0,0 +1 @@ +export interface LegacyJackson1ListProjectRoleDetails {} diff --git a/src/version2/models/legacyJackson1ListProjectType.ts b/src/version2/models/legacyJackson1ListProjectType.ts new file mode 100644 index 0000000000..b5bb55c23c --- /dev/null +++ b/src/version2/models/legacyJackson1ListProjectType.ts @@ -0,0 +1 @@ +export interface LegacyJackson1ListProjectType {} diff --git a/src/version2/models/legacyJackson1ListUserMigrationBean.ts b/src/version2/models/legacyJackson1ListUserMigrationBean.ts new file mode 100644 index 0000000000..2af6f38943 --- /dev/null +++ b/src/version2/models/legacyJackson1ListUserMigrationBean.ts @@ -0,0 +1 @@ +export interface LegacyJackson1ListUserMigrationBean {} diff --git a/src/version2/models/legacyJackson1ListVersion.ts b/src/version2/models/legacyJackson1ListVersion.ts new file mode 100644 index 0000000000..6c157ff0a3 --- /dev/null +++ b/src/version2/models/legacyJackson1ListVersion.ts @@ -0,0 +1 @@ +export interface LegacyJackson1ListVersion {} diff --git a/src/version2/models/legacyJackson1ListWorklog.ts b/src/version2/models/legacyJackson1ListWorklog.ts new file mode 100644 index 0000000000..8adb45b1fe --- /dev/null +++ b/src/version2/models/legacyJackson1ListWorklog.ts @@ -0,0 +1 @@ +export interface LegacyJackson1ListWorklog {} diff --git a/src/version2/models/listOperand.ts b/src/version2/models/listOperand.ts new file mode 100644 index 0000000000..5006ebb59b --- /dev/null +++ b/src/version2/models/listOperand.ts @@ -0,0 +1,9 @@ +import { JqlQueryUnitaryOperand } from './jqlQueryUnitaryOperand'; + +/** An operand that is a list of values. */ +export interface ListOperand { + /** Encoded operand, which can be used directly in a JQL query. */ + encodedOperand?: string; + /** The list of operand values. */ + values: JqlQueryUnitaryOperand[]; +} diff --git a/src/version2/models/mappingsByIssueTypeOverride.ts b/src/version2/models/mappingsByIssueTypeOverride.ts new file mode 100644 index 0000000000..570d8dfde5 --- /dev/null +++ b/src/version2/models/mappingsByIssueTypeOverride.ts @@ -0,0 +1,13 @@ +import { WorkflowAssociationStatusMapping } from './workflowAssociationStatusMapping'; + +/** + * Overrides, for the selected issue types, any status mappings provided in `statusMappingsByWorkflows`. Status mappings + * are required when the new workflow for an issue type doesn't contain all statuses that the old workflow has. Status + * mappings can be provided by a combination of `statusMappingsByWorkflows` and `statusMappingsByIssueTypeOverride`. + */ +export interface MappingsByIssueTypeOverride { + /** The ID of the issue type for this mapping. */ + issueTypeId: string; + /** The list of status mappings. */ + statusMappings: WorkflowAssociationStatusMapping[]; +} diff --git a/src/version2/models/mappingsByWorkflow.ts b/src/version2/models/mappingsByWorkflow.ts new file mode 100644 index 0000000000..484dcec961 --- /dev/null +++ b/src/version2/models/mappingsByWorkflow.ts @@ -0,0 +1,15 @@ +import { WorkflowAssociationStatusMapping } from './workflowAssociationStatusMapping'; + +/** + * The status mappings by workflows. Status mappings are required when the new workflow for an issue type doesn't + * contain all statuses that the old workflow has. Status mappings can be provided by a combination of + * `statusMappingsByWorkflows` and `statusMappingsByIssueTypeOverride`. + */ +export interface MappingsByWorkflow { + /** The ID of the new workflow. */ + newWorkflowId: string; + /** The ID of the old workflow. */ + oldWorkflowId: string; + /** The list of status mappings. */ + statusMappings: WorkflowAssociationStatusMapping[]; +} diff --git a/src/version2/models/multipartFile.ts b/src/version2/models/multipartFile.ts new file mode 100644 index 0000000000..08378b1336 --- /dev/null +++ b/src/version2/models/multipartFile.ts @@ -0,0 +1,12 @@ +import { Resource } from './resource'; + +export interface MultipartFile { + bytes?: string[]; + contentType?: string; + empty?: boolean; + inputStream?: {}; + name?: string; + originalFilename?: string; + resource?: Resource; + size?: number; +} diff --git a/src/version2/models/notificationSchemeAndProjectMappingJsonBean.ts b/src/version2/models/notificationSchemeAndProjectMappingJsonBean.ts new file mode 100644 index 0000000000..823402184f --- /dev/null +++ b/src/version2/models/notificationSchemeAndProjectMappingJsonBean.ts @@ -0,0 +1,4 @@ +export interface NotificationSchemeAndProjectMappingJsonBean { + notificationSchemeId?: string; + projectId?: string; +} diff --git a/src/version2/models/oldToNewSecurityLevelMappingsBean.ts b/src/version2/models/oldToNewSecurityLevelMappingsBean.ts new file mode 100644 index 0000000000..d056a80e88 --- /dev/null +++ b/src/version2/models/oldToNewSecurityLevelMappingsBean.ts @@ -0,0 +1,6 @@ +export interface OldToNewSecurityLevelMappingsBean { + /** The new issue security level ID. Providing null will clear the assigned old level from issues. */ + newLevelId: string; + /** The old issue security level ID. Providing null will remap all issues without any assigned levels. */ + oldLevelId: string; +} diff --git a/src/version2/models/pageBean2ComponentJsonBean.ts b/src/version2/models/pageBean2ComponentJsonBean.ts new file mode 100644 index 0000000000..02483674b7 --- /dev/null +++ b/src/version2/models/pageBean2ComponentJsonBean.ts @@ -0,0 +1,19 @@ +import { ComponentJsonBean } from './componentJsonBean'; + +/** A page of items. */ +export interface PageBean2ComponentJsonBean { + /** 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?: ComponentJsonBean[]; +} diff --git a/src/version2/models/pageBeanFieldConfigurationDetails.ts b/src/version2/models/pageBeanFieldConfigurationDetails.ts new file mode 100644 index 0000000000..874778303f --- /dev/null +++ b/src/version2/models/pageBeanFieldConfigurationDetails.ts @@ -0,0 +1,19 @@ +import { FieldConfigurationDetails } from './fieldConfigurationDetails'; + +/** A page of items. */ +export interface PageBeanFieldConfigurationDetails { + /** 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?: FieldConfigurationDetails[]; +} diff --git a/src/version2/models/pageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects.ts b/src/version2/models/pageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects.ts new file mode 100644 index 0000000000..48c7df0b4d --- /dev/null +++ b/src/version2/models/pageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects.ts @@ -0,0 +1,19 @@ +import { PrioritySchemeWithPaginatedPrioritiesAndProjects } from './prioritySchemeWithPaginatedPrioritiesAndProjects'; + +/** A page of items. */ +export interface PageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects { + /** 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?: PrioritySchemeWithPaginatedPrioritiesAndProjects[]; +} diff --git a/src/version2/models/pageBeanPriorityWithSequence.ts b/src/version2/models/pageBeanPriorityWithSequence.ts new file mode 100644 index 0000000000..8a98202c17 --- /dev/null +++ b/src/version2/models/pageBeanPriorityWithSequence.ts @@ -0,0 +1,19 @@ +import { PriorityWithSequence } from './priorityWithSequence'; + +/** A page of items. */ +export interface PageBeanPriorityWithSequence { + /** 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?: PriorityWithSequence[]; +} diff --git a/src/version2/models/pageBeanUiModificationDetails.ts b/src/version2/models/pageBeanUiModificationDetails.ts new file mode 100644 index 0000000000..71f2248a2d --- /dev/null +++ b/src/version2/models/pageBeanUiModificationDetails.ts @@ -0,0 +1,19 @@ +import { UiModificationDetails } from './uiModificationDetails'; + +/** A page of items. */ +export interface PageBeanUiModificationDetails { + /** 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?: UiModificationDetails[]; +} diff --git a/src/version2/models/pageBulkContextualConfiguration.ts b/src/version2/models/pageBulkContextualConfiguration.ts new file mode 100644 index 0000000000..3c931a1436 --- /dev/null +++ b/src/version2/models/pageBulkContextualConfiguration.ts @@ -0,0 +1,19 @@ +import { BulkContextualConfiguration } from './bulkContextualConfiguration'; + +/** A page of items. */ +export interface PageBulkContextualConfiguration { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: BulkContextualConfiguration[]; +} diff --git a/src/version2/models/pageContext.ts b/src/version2/models/pageContext.ts new file mode 100644 index 0000000000..c310224a7b --- /dev/null +++ b/src/version2/models/pageContext.ts @@ -0,0 +1,19 @@ +import { Context } from './context'; + +/** A page of items. */ +export interface PageContext { + /** 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?: Context[]; +} diff --git a/src/version2/models/pageOfCreateMetaIssueTypeWithField.ts b/src/version2/models/pageOfCreateMetaIssueTypeWithField.ts new file mode 100644 index 0000000000..3e5ce43d55 --- /dev/null +++ b/src/version2/models/pageOfCreateMetaIssueTypeWithField.ts @@ -0,0 +1,14 @@ +import { FieldCreateMetadata } from './fieldCreateMetadata'; + +/** A page of CreateMetaIssueType with Field. */ +export interface PageOfCreateMetaIssueTypeWithField { + /** The collection of FieldCreateMetaBeans. */ + fields?: FieldCreateMetadata[]; + /** The maximum number of items to return per page. */ + maxResults?: number; + results?: FieldCreateMetadata[]; + /** The index of the first item returned. */ + startAt?: number; + /** The total number of items in all pages. */ + total?: number; +} diff --git a/src/version2/models/pageOfCreateMetaIssueTypes.ts b/src/version2/models/pageOfCreateMetaIssueTypes.ts new file mode 100644 index 0000000000..42b514a7ed --- /dev/null +++ b/src/version2/models/pageOfCreateMetaIssueTypes.ts @@ -0,0 +1,14 @@ +import { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata'; + +/** A page of CreateMetaIssueTypes. */ +export interface PageOfCreateMetaIssueTypes { + createMetaIssueType?: IssueTypeIssueCreateMetadata[]; + /** The list of CreateMetaIssueType. */ + issueTypes?: IssueTypeIssueCreateMetadata[]; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The total number of items in all pages. */ + total?: number; +} diff --git a/src/version2/models/pageWithCursorGetPlanResponseForPage.ts b/src/version2/models/pageWithCursorGetPlanResponseForPage.ts new file mode 100644 index 0000000000..7b6c103ded --- /dev/null +++ b/src/version2/models/pageWithCursorGetPlanResponseForPage.ts @@ -0,0 +1,10 @@ +import { GetPlanResponseForPage } from './getPlanResponseForPage'; + +export interface PageWithCursorGetPlanResponseForPage { + cursor?: string; + last?: boolean; + nextPageCursor?: string; + size?: number; + total?: number; + values?: GetPlanResponseForPage[]; +} diff --git a/src/version2/models/pageWithCursorGetTeamResponseForPage.ts b/src/version2/models/pageWithCursorGetTeamResponseForPage.ts new file mode 100644 index 0000000000..015c2316bd --- /dev/null +++ b/src/version2/models/pageWithCursorGetTeamResponseForPage.ts @@ -0,0 +1,10 @@ +import { GetTeamResponseForPage } from './getTeamResponseForPage'; + +export interface PageWithCursorGetTeamResponseForPage { + cursor?: string; + last?: boolean; + nextPageCursor?: string; + size?: number; + total?: number; + values?: GetTeamResponseForPage[]; +} diff --git a/src/version2/models/paginatedResponseComment.ts b/src/version2/models/paginatedResponseComment.ts new file mode 100644 index 0000000000..f8aba6db01 --- /dev/null +++ b/src/version2/models/paginatedResponseComment.ts @@ -0,0 +1,8 @@ +import { Comment } from './comment'; + +export interface PaginatedResponseComment { + maxResults?: number; + results?: Comment[]; + startAt?: number; + total?: number; +} diff --git a/src/version2/models/paginatedResponseFieldCreateMetadata.ts b/src/version2/models/paginatedResponseFieldCreateMetadata.ts new file mode 100644 index 0000000000..a6c84ef7e7 --- /dev/null +++ b/src/version2/models/paginatedResponseFieldCreateMetadata.ts @@ -0,0 +1,8 @@ +import { FieldCreateMetadata } from './fieldCreateMetadata'; + +export interface PaginatedResponseFieldCreateMetadata { + maxResults?: number; + results?: FieldCreateMetadata[]; + startAt?: number; + total?: number; +} diff --git a/src/version2/models/paginatedResponseIssueTypeIssueCreateMetadata.ts b/src/version2/models/paginatedResponseIssueTypeIssueCreateMetadata.ts new file mode 100644 index 0000000000..6f6c6fff39 --- /dev/null +++ b/src/version2/models/paginatedResponseIssueTypeIssueCreateMetadata.ts @@ -0,0 +1,8 @@ +import { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata'; + +export interface PaginatedResponseIssueTypeIssueCreateMetadata { + maxResults?: number; + results?: IssueTypeIssueCreateMetadata[]; + startAt?: number; + total?: number; +} diff --git a/src/version2/models/plan.ts b/src/version2/models/plan.ts new file mode 100644 index 0000000000..2b42c63d0c --- /dev/null +++ b/src/version2/models/plan.ts @@ -0,0 +1,29 @@ +import { GetCrossProjectReleaseResponse } from './getCrossProjectReleaseResponse'; +import { GetCustomFieldResponse } from './getCustomFieldResponse'; +import { GetExclusionRulesResponse } from './getExclusionRulesResponse'; +import { GetIssueSourceResponse } from './getIssueSourceResponse'; +import { GetPermissionResponse } from './getPermissionResponse'; +import { GetSchedulingResponse } from './getSchedulingResponse'; + +export interface Plan { + /** The cross-project releases included in the plan. */ + crossProjectReleases?: GetCrossProjectReleaseResponse[]; + /** The custom fields for the plan. */ + customFields?: GetCustomFieldResponse[]; + exclusionRules?: GetExclusionRulesResponse; + /** The plan ID. */ + id: number; + /** The issue sources included in the plan. */ + issueSources?: GetIssueSourceResponse[]; + /** The date when the plan was last saved in UTC. */ + lastSaved?: string; + /** The account ID of the plan lead. */ + leadAccountId?: string; + /** The plan name. */ + name?: string; + /** The permissions for the plan. */ + permissions?: GetPermissionResponse[]; + scheduling?: GetSchedulingResponse; + /** The plan status. This is "Active", "Trashed" or "Archived". */ + status: 'Active' | 'Trashed' | 'Archived' | string; +} diff --git a/src/version2/models/priorityMapping.ts b/src/version2/models/priorityMapping.ts new file mode 100644 index 0000000000..5141c9dd63 --- /dev/null +++ b/src/version2/models/priorityMapping.ts @@ -0,0 +1,18 @@ +/** Mapping of issue priorities for changes in priority schemes. */ +export interface PriorityMapping { + /** + * The mapping of priorities for issues being migrated **into** this priority scheme. Key is the old priority ID, + * value is the new priority ID (must exist in this priority scheme). + * + * E.g. The current priority scheme has priority ID `10001`. Issues with priority ID `10000` are being migrated into this priority scheme will need mapping to new priorities. The `in` mapping would be `{"10000": 10001}`. + */ + in?: {}; + /** + * The mapping of priorities for issues being migrated **out of** this priority scheme. Key is the old priority ID + * (must exist in this priority scheme), value is the new priority ID (must exist in the default priority scheme). + * Required for updating an existing priority scheme. Not used when creating a new priority scheme. + * + * E.g. The current priority scheme has priority ID `10001`. Issues with priority ID `10001` are being migrated out of this priority scheme will need mapping to new priorities. The `out` mapping would be `{"10001": 10000}`. + */ + out?: {}; +} diff --git a/src/version2/models/prioritySchemeChangesWithoutMappings.ts b/src/version2/models/prioritySchemeChangesWithoutMappings.ts new file mode 100644 index 0000000000..51c1ea7e02 --- /dev/null +++ b/src/version2/models/prioritySchemeChangesWithoutMappings.ts @@ -0,0 +1,4 @@ +export interface PrioritySchemeChangesWithoutMappings { + /** Affected entity ids. */ + ids: number[]; +} diff --git a/src/version2/models/prioritySchemeId.ts b/src/version2/models/prioritySchemeId.ts new file mode 100644 index 0000000000..7438ba3bde --- /dev/null +++ b/src/version2/models/prioritySchemeId.ts @@ -0,0 +1,8 @@ +import { TaskProgressBeanJsonNode } from './taskProgressBeanJsonNode'; + +/** The ID of a priority scheme. */ +export interface PrioritySchemeId { + /** The ID of the priority scheme. */ + id?: string; + task?: TaskProgressBeanJsonNode; +} diff --git a/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts b/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts new file mode 100644 index 0000000000..3ec69d654b --- /dev/null +++ b/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts @@ -0,0 +1,20 @@ +import { PageBeanPriorityWithSequence } from './pageBeanPriorityWithSequence'; +import { PageBeanProjectDetails } from './pageBeanProjectDetails'; + +/** A priority scheme with paginated priorities and projects. */ +export interface PrioritySchemeWithPaginatedPrioritiesAndProjects { + default?: boolean; + /** The ID of the default issue priority. */ + defaultPriorityId?: string; + /** The description of the priority scheme */ + description?: string; + /** The ID of the priority scheme. */ + id: string; + isDefault?: boolean; + /** The name of the priority scheme */ + name: string; + priorities?: PageBeanPriorityWithSequence; + projects?: PageBeanProjectDetails; + /** The URL of the priority scheme. */ + self?: string; +} diff --git a/src/version2/models/priorityWithSequence.ts b/src/version2/models/priorityWithSequence.ts new file mode 100644 index 0000000000..8012f612ad --- /dev/null +++ b/src/version2/models/priorityWithSequence.ts @@ -0,0 +1,19 @@ +/** An issue priority with sequence information. */ +export interface PriorityWithSequence { + /** The description of the issue priority. */ + description?: string; + /** The URL of the icon for the issue priority. */ + iconUrl?: string; + /** The ID of the issue priority. */ + id?: string; + /** Whether this priority is the default. */ + isDefault?: boolean; + /** The name of the issue priority. */ + name?: string; + /** The URL of the issue priority. */ + self?: string; + /** The sequence of the issue priority. */ + sequence?: string; + /** The color used to indicate the issue priority. */ + statusColor?: string; +} diff --git a/src/version2/models/projectDataPolicies.ts b/src/version2/models/projectDataPolicies.ts new file mode 100644 index 0000000000..22bbb2d14e --- /dev/null +++ b/src/version2/models/projectDataPolicies.ts @@ -0,0 +1,7 @@ +import { ProjectWithDataPolicy } from './projectWithDataPolicy'; + +/** Details about data policies for a list of projects. */ +export interface ProjectDataPolicies { + /** List of projects with data policies. */ + projectDataPolicies?: ProjectWithDataPolicy[]; +} diff --git a/src/version2/models/projectDataPolicy.ts b/src/version2/models/projectDataPolicy.ts new file mode 100644 index 0000000000..4a8b013ea6 --- /dev/null +++ b/src/version2/models/projectDataPolicy.ts @@ -0,0 +1,5 @@ +/** Details about data policy. */ +export interface ProjectDataPolicy { + /** Whether the project contains any content inaccessible to the requesting application. */ + anyContentBlocked?: boolean; +} diff --git a/src/version2/models/projectFeatureState.ts b/src/version2/models/projectFeatureState.ts new file mode 100644 index 0000000000..fdc702b106 --- /dev/null +++ b/src/version2/models/projectFeatureState.ts @@ -0,0 +1,5 @@ +/** Details of the feature state. */ +export interface ProjectFeatureState { + /** The feature state. */ + state?: 'ENABLED' | 'DISABLED' | 'COMING_SOON' | string; +} diff --git a/src/version2/models/projectUsage.ts b/src/version2/models/projectUsage.ts new file mode 100644 index 0000000000..2cc468d44c --- /dev/null +++ b/src/version2/models/projectUsage.ts @@ -0,0 +1,5 @@ +/** The project. */ +export interface ProjectUsage { + /** The project ID. */ + id?: string; +} diff --git a/src/version2/models/projectUsagePage.ts b/src/version2/models/projectUsagePage.ts new file mode 100644 index 0000000000..f018c8e7b1 --- /dev/null +++ b/src/version2/models/projectUsagePage.ts @@ -0,0 +1,9 @@ +import { ProjectUsage } from './projectUsage'; + +/** A page of projects. */ +export interface ProjectUsagePage { + /** Page token for the next page of project usages. */ + nextPageToken?: string; + /** The list of projects. */ + values?: ProjectUsage[]; +} diff --git a/src/version2/models/projectWithDataPolicy.ts b/src/version2/models/projectWithDataPolicy.ts new file mode 100644 index 0000000000..99830d5726 --- /dev/null +++ b/src/version2/models/projectWithDataPolicy.ts @@ -0,0 +1,8 @@ +import { ProjectDataPolicy } from './projectDataPolicy'; + +/** Details about data policies for a project. */ +export interface ProjectWithDataPolicy { + dataPolicy?: ProjectDataPolicy; + /** The project ID. */ + id?: number; +} diff --git a/src/version2/models/publishDraftWorkflowScheme.ts b/src/version2/models/publishDraftWorkflowScheme.ts new file mode 100644 index 0000000000..13a785c311 --- /dev/null +++ b/src/version2/models/publishDraftWorkflowScheme.ts @@ -0,0 +1,7 @@ +import { StatusMapping } from './statusMapping'; + +/** Details about the status mappings for publishing a draft workflow scheme. */ +export interface PublishDraftWorkflowScheme { + /** Mappings of statuses to new statuses for issue types. */ + statusMappings?: StatusMapping[]; +} diff --git a/src/version2/models/removeOptionFromIssuesResult.ts b/src/version2/models/removeOptionFromIssuesResult.ts new file mode 100644 index 0000000000..cf18ad7c2f --- /dev/null +++ b/src/version2/models/removeOptionFromIssuesResult.ts @@ -0,0 +1,9 @@ +import { SimpleErrorCollection } from './simpleErrorCollection'; + +export interface RemoveOptionFromIssuesResult { + errors?: SimpleErrorCollection; + /** The IDs of the modified issues. */ + modifiedIssues?: number[]; + /** The IDs of the unchanged issues, those issues where errors prevent modification. */ + unmodifiedIssues?: number[]; +} diff --git a/src/version2/models/requiredMappingByIssueType.ts b/src/version2/models/requiredMappingByIssueType.ts new file mode 100644 index 0000000000..3d85f836c5 --- /dev/null +++ b/src/version2/models/requiredMappingByIssueType.ts @@ -0,0 +1,7 @@ +/** The list of required status mappings by issue type. */ +export interface RequiredMappingByIssueType { + /** The ID of the issue type. */ + issueTypeId?: string; + /** The status IDs requiring mapping. */ + statusIds?: string[]; +} diff --git a/src/version2/models/requiredMappingByWorkflows.ts b/src/version2/models/requiredMappingByWorkflows.ts new file mode 100644 index 0000000000..b30e14666e --- /dev/null +++ b/src/version2/models/requiredMappingByWorkflows.ts @@ -0,0 +1,9 @@ +/** The list of required status mappings by workflow. */ +export interface RequiredMappingByWorkflows { + /** The ID of the source workflow. */ + sourceWorkflowId?: string; + /** The status IDs requiring mapping. */ + statusIds?: string[]; + /** The ID of the target workflow. */ + targetWorkflowId?: string; +} diff --git a/src/version2/models/resolutionJsonBean.ts b/src/version2/models/resolutionJsonBean.ts new file mode 100644 index 0000000000..de2b4ae16e --- /dev/null +++ b/src/version2/models/resolutionJsonBean.ts @@ -0,0 +1,8 @@ +export interface ResolutionJsonBean { + default?: boolean; + description?: string; + iconUrl?: string; + id?: string; + name?: string; + self?: string; +} diff --git a/src/version2/models/resource.ts b/src/version2/models/resource.ts new file mode 100644 index 0000000000..d9fdf765b2 --- /dev/null +++ b/src/version2/models/resource.ts @@ -0,0 +1,10 @@ +export interface Resource { + description?: string; + file?: string; + filename?: string; + inputStream?: {}; + open?: boolean; + readable?: boolean; + uri?: string; + url?: string; +} diff --git a/src/version2/models/searchAndReconcileRequest.ts b/src/version2/models/searchAndReconcileRequest.ts new file mode 100644 index 0000000000..e4aeb1e63c --- /dev/null +++ b/src/version2/models/searchAndReconcileRequest.ts @@ -0,0 +1,63 @@ +export interface SearchAndReconcileRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about issues in the response. Note that, unlike the majority of instances where `expand` is + * specified, `expand` is defined as a comma-delimited string of values. The expand options are: + * + * `renderedFields` Returns field values rendered in HTML format. `names` Returns the display name of each field. + * `schema` Returns the schema describing a field type. `transitions` Returns all possible transitions for the + * issue. `operations` Returns all possible operations for the issue. `editmeta` Returns information about how each + * field can be edited. `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the + * most recent. `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array + * containing each version of a field's value, with the highest numbered item representing the most recent version. + * + * Examples: `"names,changelog"` Returns the display name of each field as well as a list of recent updates to an issue. + */ + expand?: string; + /** + * A list of fields to return for each issue. Use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * `*all` Returns all fields. `*navigable` Returns navigable fields. `id` Returns only issue IDs. Any issue field, + * prefixed with a dash to exclude. + * + * The default is `id`. + * + * Examples: + * + * `summary,comment` Returns the summary and comments fields only. `*all,-comment` Returns all fields except + * comments. + * + * Multiple `fields` parameters can be included in a request. + * + * Note: By default, this resource returns IDs only. This differs from [GET issue](#api-rest-api-2-issue-issueIdOrKey-get) where the default is all fields. + */ + fields?: string[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; + /** + * A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a + * bounded query. A bounded query is a query with a search restriction. + * + * Example of an unbounded query: `order by key desc`. Example of a bounded query: `assignee = currentUser() order + * by key`. + * + * Additionally, `orderBy` clause can contain a maximum of 7 fields. + */ + jql?: string; + /** + * The maximum number of items to return per page. To manage page size, API may return fewer items per page where a + * large number of fields are requested. The greatest number of items returned per page is achieved when requesting + * `id` or `key` only. It returns max 5000 issues. + */ + maxResults?: number; + /** + * The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. Use the + * `nextPageToken` to fetch the next page of issues. + */ + nextPageToken?: string; + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties?: string[]; + /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids. All issues must exist. */ + reconcileIssues?: number[]; +} diff --git a/src/version2/models/searchAutoCompleteFilter.ts b/src/version2/models/searchAutoCompleteFilter.ts new file mode 100644 index 0000000000..05f16e5b6b --- /dev/null +++ b/src/version2/models/searchAutoCompleteFilter.ts @@ -0,0 +1,7 @@ +/** Details of how to filter and list search auto complete information. */ +export interface SearchAutoCompleteFilter { + /** Include collapsed fields for fields that have non-unique names. */ + includeCollapsedFields?: boolean; + /** List of project IDs used to filter the visible field details returned. */ + projectIds?: number[]; +} diff --git a/src/version2/models/securitySchemeLevelBean.ts b/src/version2/models/securitySchemeLevelBean.ts new file mode 100644 index 0000000000..8ad66a6b50 --- /dev/null +++ b/src/version2/models/securitySchemeLevelBean.ts @@ -0,0 +1,12 @@ +import { SecuritySchemeLevelMemberBean } from './securitySchemeLevelMemberBean'; + +export interface SecuritySchemeLevelBean { + /** 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?: SecuritySchemeLevelMemberBean[]; + /** The name of the issue security scheme level. Must be unique. */ + name: string; +} diff --git a/src/version2/models/securitySchemeLevelMemberBean.ts b/src/version2/models/securitySchemeLevelMemberBean.ts new file mode 100644 index 0000000000..d3b213e4f6 --- /dev/null +++ b/src/version2/models/securitySchemeLevelMemberBean.ts @@ -0,0 +1,6 @@ +export interface SecuritySchemeLevelMemberBean { + /** The value corresponding to the specified member type. */ + parameter?: string; + /** The issue security level member type, e.g `reporter`, `group`, `user`, `projectrole`, `applicationRole`. */ + type: string; +} diff --git a/src/version2/models/serviceManagementNavigationInfo.ts b/src/version2/models/serviceManagementNavigationInfo.ts new file mode 100644 index 0000000000..0a39a90dc6 --- /dev/null +++ b/src/version2/models/serviceManagementNavigationInfo.ts @@ -0,0 +1,5 @@ +export interface ServiceManagementNavigationInfo { + queueCategory?: string; + queueId?: number; + queueName?: string; +} diff --git a/src/version2/models/serviceRegistry.ts b/src/version2/models/serviceRegistry.ts new file mode 100644 index 0000000000..d46bfa2b86 --- /dev/null +++ b/src/version2/models/serviceRegistry.ts @@ -0,0 +1,15 @@ +import { ServiceRegistryTier } from './serviceRegistryTier'; + +export interface ServiceRegistry { + /** Service description */ + description?: string; + /** Service ID */ + id?: string; + /** Service name */ + name?: string; + /** Organization ID */ + organizationId?: string; + /** Service revision */ + revision?: string; + serviceTier?: ServiceRegistryTier; +} diff --git a/src/version2/models/serviceRegistryTier.ts b/src/version2/models/serviceRegistryTier.ts new file mode 100644 index 0000000000..b9f2ff9ca8 --- /dev/null +++ b/src/version2/models/serviceRegistryTier.ts @@ -0,0 +1,12 @@ +export interface ServiceRegistryTier { + /** Tier description */ + description?: string; + /** Tier ID */ + id?: string; + /** Tier level */ + level?: number; + /** Tier name */ + name?: string; + /** Name key of the tier */ + nameKey?: string; +} diff --git a/src/version2/models/simpleErrorCollection.ts b/src/version2/models/simpleErrorCollection.ts new file mode 100644 index 0000000000..bd7bfa5910 --- /dev/null +++ b/src/version2/models/simpleErrorCollection.ts @@ -0,0 +1,10 @@ +export interface SimpleErrorCollection { + /** The list of error messages produced by this operation. For example, "input parameter 'key' must be provided" */ + errorMessages?: string[]; + /** + * The list of errors by parameter returned by the operation. For example,"projectKey": "Project keys must start + * with an uppercase letter, followed by one or more uppercase alphanumeric characters." + */ + errors?: {}; + httpStatusCode?: number; +} diff --git a/src/version2/models/simpleUsage.ts b/src/version2/models/simpleUsage.ts new file mode 100644 index 0000000000..b1ddd95231 --- /dev/null +++ b/src/version2/models/simpleUsage.ts @@ -0,0 +1,7 @@ +/** Represents a usage of an entity by a project ID and related issue type IDs. */ +export interface SimpleUsage { + /** The issue type IDs for the usage. */ + issueTypeIds: string[]; + /** The project ID for the usage. */ + projectId: string; +} diff --git a/src/version2/models/simplifiedHierarchyLevel.ts b/src/version2/models/simplifiedHierarchyLevel.ts new file mode 100644 index 0000000000..8d7639167e --- /dev/null +++ b/src/version2/models/simplifiedHierarchyLevel.ts @@ -0,0 +1,39 @@ +export interface SimplifiedHierarchyLevel { + /** + * The ID of the level above this one in the hierarchy. This property is deprecated, see [Change notice: Removing + * hierarchy level IDs from next-gen + * APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). + */ + aboveLevelId?: number; + /** + * The ID of the level below this one in the hierarchy. This property is deprecated, see [Change notice: Removing + * hierarchy level IDs from next-gen + * APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). + */ + belowLevelId?: number; + /** + * The external UUID of the hierarchy level. This property is deprecated, see [Change notice: Removing hierarchy + * level IDs from next-gen + * APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). + */ + externalUuid?: string; + hierarchyLevelNumber?: number; + /** + * The ID of the hierarchy level. This property is deprecated, see [Change notice: Removing hierarchy level IDs from + * next-gen + * APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). + */ + id?: number; + /** The issue types available in this hierarchy level. */ + issueTypeIds?: number[]; + /** The level of this item in the hierarchy. */ + level?: number; + /** The name of this hierarchy level. */ + name?: string; + /** + * The ID of the project configuration. This property is deprecated, see [Change oticen: Removing hierarchy level + * IDs from next-gen + * APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). + */ + projectConfigurationId?: number; +} diff --git a/src/version2/models/softwareNavigationInfo.ts b/src/version2/models/softwareNavigationInfo.ts new file mode 100644 index 0000000000..1af9968010 --- /dev/null +++ b/src/version2/models/softwareNavigationInfo.ts @@ -0,0 +1,6 @@ +export interface SoftwareNavigationInfo { + boardId?: number; + boardName?: string; + simpleBoard?: boolean; + totalBoardsInProject?: number; +} diff --git a/src/version2/models/statusMetadata.ts b/src/version2/models/statusMetadata.ts new file mode 100644 index 0000000000..f6eaa22aaf --- /dev/null +++ b/src/version2/models/statusMetadata.ts @@ -0,0 +1,9 @@ +/** The details of the statuses in the associated workflows. */ +export interface StatusMetadata { + /** The category of the status. */ + category?: 'TODO' | 'IN_PROGRESS' | 'DONE' | string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; +} diff --git a/src/version2/models/statusProjectIssueTypeUsage.ts b/src/version2/models/statusProjectIssueTypeUsage.ts new file mode 100644 index 0000000000..3141919ee9 --- /dev/null +++ b/src/version2/models/statusProjectIssueTypeUsage.ts @@ -0,0 +1,5 @@ +/** The list of issue types. */ +export interface StatusProjectIssueTypeUsage { + /** The issue type ID. */ + id?: string; +} diff --git a/src/version2/models/statusProjectIssueTypeUsageDTO.ts b/src/version2/models/statusProjectIssueTypeUsageDTO.ts new file mode 100644 index 0000000000..73397025c5 --- /dev/null +++ b/src/version2/models/statusProjectIssueTypeUsageDTO.ts @@ -0,0 +1,10 @@ +import { StatusProjectIssueTypeUsagePage } from './statusProjectIssueTypeUsagePage'; + +/** The issue types using this status in a project. */ +export interface StatusProjectIssueTypeUsageDTO { + issueTypes?: StatusProjectIssueTypeUsagePage; + /** The project ID. */ + projectId?: string; + /** The status ID. */ + statusId?: string; +} diff --git a/src/version2/models/statusProjectIssueTypeUsagePage.ts b/src/version2/models/statusProjectIssueTypeUsagePage.ts new file mode 100644 index 0000000000..b273c4e6c2 --- /dev/null +++ b/src/version2/models/statusProjectIssueTypeUsagePage.ts @@ -0,0 +1,9 @@ +import { StatusProjectIssueTypeUsage } from './statusProjectIssueTypeUsage'; + +/** A page of issue types. */ +export interface StatusProjectIssueTypeUsagePage { + /** Page token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of issue types. */ + values?: StatusProjectIssueTypeUsage[]; +} diff --git a/src/version2/models/statusProjectUsage.ts b/src/version2/models/statusProjectUsage.ts new file mode 100644 index 0000000000..10f8b53619 --- /dev/null +++ b/src/version2/models/statusProjectUsage.ts @@ -0,0 +1,5 @@ +/** The project. */ +export interface StatusProjectUsage { + /** The project ID. */ + id?: string; +} diff --git a/src/version2/models/statusProjectUsageDTO.ts b/src/version2/models/statusProjectUsageDTO.ts new file mode 100644 index 0000000000..315a9377ed --- /dev/null +++ b/src/version2/models/statusProjectUsageDTO.ts @@ -0,0 +1,8 @@ +import { StatusProjectUsagePage } from './statusProjectUsagePage'; + +/** The projects using this status. */ +export interface StatusProjectUsageDTO { + projects?: StatusProjectUsagePage; + /** The status ID. */ + statusId?: string; +} diff --git a/src/version2/models/statusProjectUsagePage.ts b/src/version2/models/statusProjectUsagePage.ts new file mode 100644 index 0000000000..5a9583f815 --- /dev/null +++ b/src/version2/models/statusProjectUsagePage.ts @@ -0,0 +1,9 @@ +import { StatusProjectUsage } from './statusProjectUsage'; + +/** A page of projects. */ +export interface StatusProjectUsagePage { + /** Page token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of projects. */ + values?: StatusProjectUsage[]; +} diff --git a/src/version2/models/statusWorkflowUsageDTO.ts b/src/version2/models/statusWorkflowUsageDTO.ts new file mode 100644 index 0000000000..bad0f5011d --- /dev/null +++ b/src/version2/models/statusWorkflowUsageDTO.ts @@ -0,0 +1,8 @@ +import { StatusWorkflowUsagePage } from './statusWorkflowUsagePage'; + +/** Workflows using the status. */ +export interface StatusWorkflowUsageDTO { + /** The status ID. */ + statusId?: string; + workflows?: StatusWorkflowUsagePage; +} diff --git a/src/version2/models/statusWorkflowUsagePage.ts b/src/version2/models/statusWorkflowUsagePage.ts new file mode 100644 index 0000000000..6d358d8517 --- /dev/null +++ b/src/version2/models/statusWorkflowUsagePage.ts @@ -0,0 +1,9 @@ +import { StatusWorkflowUsageWorkflow } from './statusWorkflowUsageWorkflow'; + +/** A page of workflows. */ +export interface StatusWorkflowUsagePage { + /** Page token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of statuses. */ + values?: StatusWorkflowUsageWorkflow[]; +} diff --git a/src/version2/models/statusWorkflowUsageWorkflow.ts b/src/version2/models/statusWorkflowUsageWorkflow.ts new file mode 100644 index 0000000000..3e860725b5 --- /dev/null +++ b/src/version2/models/statusWorkflowUsageWorkflow.ts @@ -0,0 +1,5 @@ +/** The worflow. */ +export interface StatusWorkflowUsageWorkflow { + /** The workflow ID. */ + id?: string; +} diff --git a/src/version2/models/statusesPerWorkflow.ts b/src/version2/models/statusesPerWorkflow.ts new file mode 100644 index 0000000000..d4b31c1b71 --- /dev/null +++ b/src/version2/models/statusesPerWorkflow.ts @@ -0,0 +1,9 @@ +/** The statuses associated with each workflow. */ +export interface StatusesPerWorkflow { + /** The ID of the initial status for the workflow. */ + initialStatusId?: string; + /** The status IDs associated with the workflow. */ + statuses?: string[]; + /** The ID of the workflow. */ + workflowId?: string; +} diff --git a/src/version2/models/streamingResponseBody.ts b/src/version2/models/streamingResponseBody.ts new file mode 100644 index 0000000000..82da8e10cb --- /dev/null +++ b/src/version2/models/streamingResponseBody.ts @@ -0,0 +1 @@ +export interface StreamingResponseBody {} diff --git a/src/version2/models/stringList.ts b/src/version2/models/stringList.ts new file mode 100644 index 0000000000..1a49a7f9a1 --- /dev/null +++ b/src/version2/models/stringList.ts @@ -0,0 +1 @@ +export interface StringList {} diff --git a/src/version2/models/suggestedMappingsForPrioritiesRequestBean.ts b/src/version2/models/suggestedMappingsForPrioritiesRequestBean.ts new file mode 100644 index 0000000000..9102196ab0 --- /dev/null +++ b/src/version2/models/suggestedMappingsForPrioritiesRequestBean.ts @@ -0,0 +1,7 @@ +/** Details of changes to a priority scheme's priorities that require suggested priority mappings. */ +export interface SuggestedMappingsForPrioritiesRequestBean { + /** The ids of priorities being removed from the scheme. */ + add?: number[]; + /** The ids of priorities being removed from the scheme. */ + remove?: number[]; +} diff --git a/src/version2/models/suggestedMappingsForProjectsRequestBean.ts b/src/version2/models/suggestedMappingsForProjectsRequestBean.ts new file mode 100644 index 0000000000..50b3d45b90 --- /dev/null +++ b/src/version2/models/suggestedMappingsForProjectsRequestBean.ts @@ -0,0 +1,5 @@ +/** Details of changes to a priority scheme's projects that require suggested priority mappings. */ +export interface SuggestedMappingsForProjectsRequestBean { + /** The ids of projects being added to the scheme. */ + add?: number[]; +} diff --git a/src/version2/models/suggestedMappingsRequest.ts b/src/version2/models/suggestedMappingsRequest.ts new file mode 100644 index 0000000000..4606cbcddb --- /dev/null +++ b/src/version2/models/suggestedMappingsRequest.ts @@ -0,0 +1,14 @@ +import { SuggestedMappingsForPrioritiesRequestBean } from './suggestedMappingsForPrioritiesRequestBean'; +import { SuggestedMappingsForProjectsRequestBean } from './suggestedMappingsForProjectsRequestBean'; + +/** Details of changes to a priority scheme that require suggested priority mappings. */ +export interface SuggestedMappingsRequest { + /** The maximum number of results that could be on the page. */ + maxResults?: number; + priorities?: SuggestedMappingsForPrioritiesRequestBean; + projects?: SuggestedMappingsForProjectsRequestBean; + /** The id of the priority scheme. */ + schemeId?: number; + /** The index of the first item returned on the page. */ + startAt?: number; +} diff --git a/src/version2/models/taskProgressNode.ts b/src/version2/models/taskProgressNode.ts new file mode 100644 index 0000000000..d49fa81446 --- /dev/null +++ b/src/version2/models/taskProgressNode.ts @@ -0,0 +1,30 @@ +import { JsonNode } from './jsonNode'; + +/** Details about a task. */ +export interface TaskProgressNode { + /** The description of the task. */ + description?: string; + /** The execution time of the task, in milliseconds. */ + elapsedRuntime: number; + /** A timestamp recording when the task was finished. */ + finished?: number; + /** The ID of the task. */ + id: string; + /** A timestamp recording when the task progress was last updated. */ + lastUpdate: number; + /** Information about the progress of the task. */ + message?: string; + /** The progress of the task, as a percentage complete. */ + progress: number; + result?: JsonNode; + /** The URL of the task. */ + self: string; + /** A timestamp recording when the task was started. */ + started?: number; + /** The status of the task. */ + status: 'ENQUEUED' | 'RUNNING' | 'COMPLETE' | 'FAILED' | 'CANCEL_REQUESTED' | 'CANCELLED' | 'DEAD' | string; + /** A timestamp recording when the task was submitted. */ + submitted: number; + /** The ID of the user who submitted the task. */ + submittedBy: number; +} diff --git a/src/version2/models/taskProgressRemoveOptionFromIssuesResult.ts b/src/version2/models/taskProgressRemoveOptionFromIssuesResult.ts new file mode 100644 index 0000000000..4d8a7b38b4 --- /dev/null +++ b/src/version2/models/taskProgressRemoveOptionFromIssuesResult.ts @@ -0,0 +1,30 @@ +import { RemoveOptionFromIssuesResult } from './removeOptionFromIssuesResult'; + +/** Details about a task. */ +export interface TaskProgressRemoveOptionFromIssuesResult { + /** The description of the task. */ + description?: string; + /** The execution time of the task, in milliseconds. */ + elapsedRuntime: number; + /** A timestamp recording when the task was finished. */ + finished?: number; + /** The ID of the task. */ + id: string; + /** A timestamp recording when the task progress was last updated. */ + lastUpdate: number; + /** Information about the progress of the task. */ + message?: string; + /** The progress of the task, as a percentage complete. */ + progress: number; + result?: RemoveOptionFromIssuesResult; + /** The URL of the task. */ + self: string; + /** A timestamp recording when the task was started. */ + started?: number; + /** The status of the task. */ + status: 'ENQUEUED' | 'RUNNING' | 'COMPLETE' | 'FAILED' | 'CANCEL_REQUESTED' | 'CANCELLED' | 'DEAD' | string; + /** A timestamp recording when the task was submitted. */ + submitted: number; + /** The ID of the user who submitted the task. */ + submittedBy: number; +} diff --git a/src/version2/models/updateDefaultProjectClassification.ts b/src/version2/models/updateDefaultProjectClassification.ts new file mode 100644 index 0000000000..70ce9a4184 --- /dev/null +++ b/src/version2/models/updateDefaultProjectClassification.ts @@ -0,0 +1,5 @@ +/** The request for updating the default project classification level. */ +export interface UpdateDefaultProjectClassification { + /** The ID of the project classification. */ + id: string; +} diff --git a/src/version2/models/updateDefaultScreenScheme.ts b/src/version2/models/updateDefaultScreenScheme.ts new file mode 100644 index 0000000000..fb40becb7d --- /dev/null +++ b/src/version2/models/updateDefaultScreenScheme.ts @@ -0,0 +1,5 @@ +/** The ID of a screen scheme. */ +export interface UpdateDefaultScreenScheme { + /** The ID of the screen scheme. */ + screenSchemeId: string; +} diff --git a/src/version2/models/updateIssueSecuritySchemeRequestBean.ts b/src/version2/models/updateIssueSecuritySchemeRequestBean.ts new file mode 100644 index 0000000000..2166c011d2 --- /dev/null +++ b/src/version2/models/updateIssueSecuritySchemeRequestBean.ts @@ -0,0 +1,6 @@ +export interface UpdateIssueSecuritySchemeRequestBean { + /** The description of the security scheme scheme. */ + description?: string; + /** The name of the security scheme scheme. Must be unique. */ + name?: string; +} diff --git a/src/version2/models/updatePrioritiesInSchemeRequest.ts b/src/version2/models/updatePrioritiesInSchemeRequest.ts new file mode 100644 index 0000000000..43fcd0e551 --- /dev/null +++ b/src/version2/models/updatePrioritiesInSchemeRequest.ts @@ -0,0 +1,7 @@ +import { PrioritySchemeChangesWithoutMappings } from './prioritySchemeChangesWithoutMappings'; + +/** Update priorities in a scheme */ +export interface UpdatePrioritiesInSchemeRequest { + add?: PrioritySchemeChangesWithoutMappings; + remove?: PrioritySchemeChangesWithoutMappings; +} diff --git a/src/version2/models/updatePrioritySchemeRequest.ts b/src/version2/models/updatePrioritySchemeRequest.ts new file mode 100644 index 0000000000..6ec61d28c6 --- /dev/null +++ b/src/version2/models/updatePrioritySchemeRequest.ts @@ -0,0 +1,16 @@ +import { PriorityMapping } from './priorityMapping'; +import { UpdatePrioritiesInSchemeRequestBean } from './updatePrioritiesInSchemeRequestBean'; +import { UpdateProjectsInSchemeRequestBean } from './updateProjectsInSchemeRequestBean'; + +/** Details of a priority scheme. */ +export interface UpdatePrioritySchemeRequest { + /** The default priority of the scheme. */ + defaultPriorityId?: number; + /** The description of the priority scheme. */ + description?: string; + mappings?: PriorityMapping; + /** The name of the priority scheme. Must be unique. */ + name?: string; + priorities?: UpdatePrioritiesInSchemeRequestBean; + projects?: UpdateProjectsInSchemeRequestBean; +} diff --git a/src/version2/models/updatePrioritySchemeResponse.ts b/src/version2/models/updatePrioritySchemeResponse.ts new file mode 100644 index 0000000000..51f1d1b977 --- /dev/null +++ b/src/version2/models/updatePrioritySchemeResponse.ts @@ -0,0 +1,8 @@ +import { PrioritySchemeWithPaginatedPrioritiesAndProjects } from './prioritySchemeWithPaginatedPrioritiesAndProjects'; +import { TaskProgressBeanJsonNode } from './taskProgressBeanJsonNode'; + +/** Details of the updated priority scheme. */ +export interface UpdatePrioritySchemeResponse { + priorityScheme?: PrioritySchemeWithPaginatedPrioritiesAndProjects; + task?: TaskProgressBeanJsonNode; +} diff --git a/src/version2/models/updateProjectsInSchemeRequest.ts b/src/version2/models/updateProjectsInSchemeRequest.ts new file mode 100644 index 0000000000..2269174ee8 --- /dev/null +++ b/src/version2/models/updateProjectsInSchemeRequest.ts @@ -0,0 +1,7 @@ +import { PrioritySchemeChangesWithoutMappings } from './prioritySchemeChangesWithoutMappings'; + +/** Update projects in a scheme */ +export interface UpdateProjectsInSchemeRequest { + add?: PrioritySchemeChangesWithoutMappings; + remove?: PrioritySchemeChangesWithoutMappings; +} diff --git a/src/version2/models/userColumnRequestBody.ts b/src/version2/models/userColumnRequestBody.ts new file mode 100644 index 0000000000..bd4b83b298 --- /dev/null +++ b/src/version2/models/userColumnRequestBody.ts @@ -0,0 +1,3 @@ +export interface UserColumnRequestBody { + columns?: string[]; +} diff --git a/src/version2/models/userFilter.ts b/src/version2/models/userFilter.ts new file mode 100644 index 0000000000..5f806065d9 --- /dev/null +++ b/src/version2/models/userFilter.ts @@ -0,0 +1,15 @@ +/** Filter for a User Picker (single) custom field. */ +export interface UserFilter { + /** Whether the filter is enabled. */ + enabled: boolean; + /** + * User groups autocomplete suggestion users must belong to. If not provided, the default values are used. A maximum + * of 10 groups can be provided. + */ + groups?: string[]; + /** + * Roles that autocomplete suggestion users must belong to. If not provided, the default values are used. A maximum + * of 10 roles can be provided. + */ + roleIds?: number[]; +} diff --git a/src/version2/models/userPermission.ts b/src/version2/models/userPermission.ts new file mode 100644 index 0000000000..216d02c846 --- /dev/null +++ b/src/version2/models/userPermission.ts @@ -0,0 +1,26 @@ +/** Details of a permission and its availability to a user. */ +export interface UserPermission { + /** + * Indicate whether the permission key is deprecated. Note that deprecated keys cannot be used in the `permissions + * parameter of Get my permissions. Deprecated keys are not returned by Get all permissions.` + */ + deprecatedKey?: boolean; + /** The description of the permission. */ + description?: string; + /** Whether the permission is available to the user in the queried context. */ + havePermission?: boolean; + /** + * The ID of the permission. Either `id` or `key` must be specified. Use [Get all + * permissions](#api-rest-api-2-permissions-get) to get the list of permissions. + */ + id?: string; + /** + * The key of the permission. Either `id` or `key` must be specified. Use [Get all + * permissions](#api-rest-api-2-permissions-get) to get the list of permissions. + */ + key?: string; + /** The name of the permission. */ + name?: string; + /** The type of the permission. */ + type?: 'GLOBAL' | 'PROJECT' | string; +} diff --git a/src/version2/models/valueOperand.ts b/src/version2/models/valueOperand.ts new file mode 100644 index 0000000000..1858981057 --- /dev/null +++ b/src/version2/models/valueOperand.ts @@ -0,0 +1,7 @@ +/** An operand that is a user-provided value. */ +export interface ValueOperand { + /** Encoded value, which can be used directly in a JQL query. */ + encodedValue?: string; + /** The operand value. */ + value: string; +} diff --git a/src/version2/models/versionApprover.ts b/src/version2/models/versionApprover.ts new file mode 100644 index 0000000000..2a4b447c5a --- /dev/null +++ b/src/version2/models/versionApprover.ts @@ -0,0 +1,11 @@ +/** Contains details about a version approver. */ +export interface VersionApprover { + /** The Atlassian account ID of the approver. */ + accountId?: string; + /** A description of why the user is declining the approval. */ + declineReason?: string; + /** A description of what the user is approving within the specified version. */ + description?: string; + /** The status of the approval, which can be _PENDING_, _APPROVED_, or _DECLINED_ */ + status?: string; +} diff --git a/src/version2/models/versionRelatedWork.ts b/src/version2/models/versionRelatedWork.ts new file mode 100644 index 0000000000..99383823a8 --- /dev/null +++ b/src/version2/models/versionRelatedWork.ts @@ -0,0 +1,19 @@ +/** Associated related work to a version */ +export interface VersionRelatedWork { + /** The category of the related work */ + category: string; + /** The ID of the issue associated with the related work (if there is one). Cannot be updated via the Rest API. */ + issueId?: number; + /** + * The id of the related work. For the native release note related work item, this will be null, and Rest API does + * not support updating it. + */ + relatedWorkId?: string; + /** The title of the related work */ + title?: string; + /** + * The URL of the related work. Will be null for the native release note related work item, but is otherwise + * required. + */ + url?: string; +} diff --git a/src/version2/models/workManagementNavigationInfo.ts b/src/version2/models/workManagementNavigationInfo.ts new file mode 100644 index 0000000000..e041f077c1 --- /dev/null +++ b/src/version2/models/workManagementNavigationInfo.ts @@ -0,0 +1,3 @@ +export interface WorkManagementNavigationInfo { + boardName?: string; +} diff --git a/src/version2/models/workflowAssociationStatusMapping.ts b/src/version2/models/workflowAssociationStatusMapping.ts new file mode 100644 index 0000000000..17d5e22fe6 --- /dev/null +++ b/src/version2/models/workflowAssociationStatusMapping.ts @@ -0,0 +1,7 @@ +/** The list of status mappings. */ +export interface WorkflowAssociationStatusMapping { + /** The ID of the status in the new workflow. */ + newStatusId: string; + /** The ID of the status in the old workflow that isn't present in the new workflow. */ + oldStatusId: string; +} diff --git a/src/version2/models/workflowCompoundCondition.ts b/src/version2/models/workflowCompoundCondition.ts new file mode 100644 index 0000000000..63d2031948 --- /dev/null +++ b/src/version2/models/workflowCompoundCondition.ts @@ -0,0 +1,10 @@ +import { WorkflowCondition } from './workflowCondition'; + +/** A compound workflow transition rule condition. This object returns `nodeType` as `compound`. */ +export interface WorkflowCompoundCondition { + /** The list of workflow conditions. */ + conditions: WorkflowCondition[]; + nodeType: string; + /** The compound condition operator. */ + operator: 'AND' | 'OR' | string; +} diff --git a/src/version2/models/workflowCreateResponse.ts b/src/version2/models/workflowCreateResponse.ts index 1600d3ce86..5cfbe3e791 100644 --- a/src/version2/models/workflowCreateResponse.ts +++ b/src/version2/models/workflowCreateResponse.ts @@ -1,7 +1,12 @@ import { JiraWorkflow } from './jiraWorkflow'; import { JiraWorkflowStatus } from './jiraWorkflowStatus'; -/** Details of the created workflows and statuses. */ +/** + * Represents the response after creating workflows and statuses. + * + * @deprecated This interface is deprecated and will be removed in a future version. Use {@link WorkflowCreate} instead + * for handling workflow creation responses. + */ export interface WorkflowCreateResponse { /** List of created statuses. */ statuses?: JiraWorkflowStatus[]; diff --git a/src/version2/models/workflowCreateValidateRequest.ts b/src/version2/models/workflowCreateValidateRequest.ts new file mode 100644 index 0000000000..b695dffb99 --- /dev/null +++ b/src/version2/models/workflowCreateValidateRequest.ts @@ -0,0 +1,7 @@ +import { WorkflowCreateRequest } from './workflowCreateRequest'; +import { ValidationOptionsForCreate } from './validationOptionsForCreate'; + +export interface WorkflowCreateValidateRequest { + payload: WorkflowCreateRequest; + validationOptions?: ValidationOptionsForCreate; +} diff --git a/src/version2/models/workflowIDs.ts b/src/version2/models/workflowIDs.ts new file mode 100644 index 0000000000..113fc5afe1 --- /dev/null +++ b/src/version2/models/workflowIDs.ts @@ -0,0 +1,7 @@ +/** The classic workflow identifiers. */ +export interface WorkflowIDs { + /** The entity ID of the workflow. */ + entityId?: string; + /** The name of the workflow. */ + name: string; +} diff --git a/src/version2/models/workflowMetadataAndIssueTypeRestModel.ts b/src/version2/models/workflowMetadataAndIssueTypeRestModel.ts new file mode 100644 index 0000000000..b418fdf196 --- /dev/null +++ b/src/version2/models/workflowMetadataAndIssueTypeRestModel.ts @@ -0,0 +1,8 @@ +import { WorkflowMetadataRestModel } from './workflowMetadataRestModel'; + +/** The workflow metadata and issue type IDs which use this workflow. */ +export interface WorkflowMetadataAndIssueTypeRestModel { + /** The list of issue type IDs for the mapping. */ + issueTypeIds: string[]; + workflow: WorkflowMetadataRestModel; +} diff --git a/src/version2/models/workflowMetadataRestModel.ts b/src/version2/models/workflowMetadataRestModel.ts new file mode 100644 index 0000000000..480f13505f --- /dev/null +++ b/src/version2/models/workflowMetadataRestModel.ts @@ -0,0 +1,20 @@ +import { SimpleUsage } from './simpleUsage'; +import { DocumentVersion } from './documentVersion'; + +/** Workflow metadata and usage detail. */ +export interface WorkflowMetadataRestModel { + /** The description of the workflow. */ + description: string; + /** The ID of the workflow. */ + id: string; + /** The name of the workflow. */ + name: string; + /** + * Deprecated. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) for details. + * + * Use the optional `workflows.usages` expand to get additional information about the projects and issue types associated with the workflows in the workflow scheme. + */ + usage: SimpleUsage[]; + version: DocumentVersion; +} diff --git a/src/version2/models/workflowProjectIssueTypeUsage.ts b/src/version2/models/workflowProjectIssueTypeUsage.ts new file mode 100644 index 0000000000..9e5e7f3ec1 --- /dev/null +++ b/src/version2/models/workflowProjectIssueTypeUsage.ts @@ -0,0 +1,5 @@ +/** The issue type. */ +export interface WorkflowProjectIssueTypeUsage { + /** The ID of the issue type. */ + id?: string; +} diff --git a/src/version2/models/workflowProjectIssueTypeUsageDTO.ts b/src/version2/models/workflowProjectIssueTypeUsageDTO.ts new file mode 100644 index 0000000000..fa23a7595e --- /dev/null +++ b/src/version2/models/workflowProjectIssueTypeUsageDTO.ts @@ -0,0 +1,10 @@ +import { WorkflowProjectIssueTypeUsagePage } from './workflowProjectIssueTypeUsagePage'; + +/** Issue types associated with the workflow for a project. */ +export interface WorkflowProjectIssueTypeUsageDTO { + issueTypes?: WorkflowProjectIssueTypeUsagePage; + /** The ID of the project. */ + projectId?: string; + /** The ID of the workflow. */ + workflowId?: string; +} diff --git a/src/version2/models/workflowProjectIssueTypeUsagePage.ts b/src/version2/models/workflowProjectIssueTypeUsagePage.ts new file mode 100644 index 0000000000..33efc451d8 --- /dev/null +++ b/src/version2/models/workflowProjectIssueTypeUsagePage.ts @@ -0,0 +1,9 @@ +import { WorkflowProjectIssueTypeUsage } from './workflowProjectIssueTypeUsage'; + +/** A page of issue types. */ +export interface WorkflowProjectIssueTypeUsagePage { + /** Token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of issue types. */ + values?: WorkflowProjectIssueTypeUsage[]; +} diff --git a/src/version2/models/workflowProjectUsageDTO.ts b/src/version2/models/workflowProjectUsageDTO.ts new file mode 100644 index 0000000000..1d3d2b1d13 --- /dev/null +++ b/src/version2/models/workflowProjectUsageDTO.ts @@ -0,0 +1,8 @@ +import { ProjectUsagePage } from './projectUsagePage'; + +/** Projects using the workflow. */ +export interface WorkflowProjectUsageDTO { + projects?: ProjectUsagePage; + /** The workflow ID. */ + workflowId?: string; +} diff --git a/src/version2/models/workflowReadRequest.ts b/src/version2/models/workflowReadRequest.ts new file mode 100644 index 0000000000..2740a5abd3 --- /dev/null +++ b/src/version2/models/workflowReadRequest.ts @@ -0,0 +1,10 @@ +import { ProjectAndIssueTypePair } from './projectAndIssueTypePair'; + +export interface WorkflowReadRequest { + /** The list of projects and issue types to query. */ + projectAndIssueTypes?: ProjectAndIssueTypePair[]; + /** The list of workflow IDs to query. */ + workflowIds?: string[]; + /** The list of workflow names to query. */ + workflowNames?: string[]; +} diff --git a/src/version2/models/workflowSchemeAssociation.ts b/src/version2/models/workflowSchemeAssociation.ts new file mode 100644 index 0000000000..9e119c9edb --- /dev/null +++ b/src/version2/models/workflowSchemeAssociation.ts @@ -0,0 +1,7 @@ +/** The explicit association between issue types and a workflow in a workflow scheme. */ +export interface WorkflowSchemeAssociation { + /** The issue types assigned to the workflow. */ + issueTypeIds: string[]; + /** The ID of the workflow. */ + workflowId: string; +} diff --git a/src/version2/models/workflowSchemeProjectUsageDTO.ts b/src/version2/models/workflowSchemeProjectUsageDTO.ts new file mode 100644 index 0000000000..bab88bd26f --- /dev/null +++ b/src/version2/models/workflowSchemeProjectUsageDTO.ts @@ -0,0 +1,8 @@ +import { ProjectUsagePage } from './projectUsagePage'; + +/** Projects using the workflow scheme. */ +export interface WorkflowSchemeProjectUsageDTO { + projects?: ProjectUsagePage; + /** The workflow scheme ID. */ + workflowSchemeId?: string; +} diff --git a/src/version2/models/workflowSchemeReadRequest.ts b/src/version2/models/workflowSchemeReadRequest.ts new file mode 100644 index 0000000000..448fe7361e --- /dev/null +++ b/src/version2/models/workflowSchemeReadRequest.ts @@ -0,0 +1,7 @@ +/** The workflow scheme read request body. */ +export interface WorkflowSchemeReadRequest { + /** The list of project IDs to query. */ + projectIds?: string[]; + /** The list of workflow scheme IDs to query. */ + workflowSchemeIds?: string[]; +} diff --git a/src/version2/models/workflowSchemeReadResponse.ts b/src/version2/models/workflowSchemeReadResponse.ts new file mode 100644 index 0000000000..55fef69680 --- /dev/null +++ b/src/version2/models/workflowSchemeReadResponse.ts @@ -0,0 +1,27 @@ +import { WorkflowMetadataRestModel } from './workflowMetadataRestModel'; +import { WorkflowScope } from './workflowScope'; +import { DocumentVersion } from './documentVersion'; +import { WorkflowMetadataAndIssueTypeRestModel } from './workflowMetadataAndIssueTypeRestModel'; + +export interface WorkflowSchemeReadResponse { + defaultWorkflow?: WorkflowMetadataRestModel; + /** The description of the workflow scheme. */ + description?: string; + /** The ID of the workflow scheme. */ + id: string; + /** The name of the workflow scheme. */ + name: string; + /** + * Deprecated. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) for details. + * + * The IDs of projects using the workflow scheme. + */ + projectIdsUsingScheme?: string[]; + scope: WorkflowScope; + /** Indicates if there's an [asynchronous task](#async-operations) for this workflow scheme. */ + taskId?: string; + version: DocumentVersion; + /** Mappings from workflows to issue types. */ + workflowsForIssueTypes: WorkflowMetadataAndIssueTypeRestModel[]; +} diff --git a/src/version2/models/workflowSchemeUpdateRequest.ts b/src/version2/models/workflowSchemeUpdateRequest.ts new file mode 100644 index 0000000000..2f670c0bc5 --- /dev/null +++ b/src/version2/models/workflowSchemeUpdateRequest.ts @@ -0,0 +1,36 @@ +import { MappingsByIssueTypeOverride } from './mappingsByIssueTypeOverride'; +import { MappingsByWorkflow } from './mappingsByWorkflow'; +import { DocumentVersion } from './documentVersion'; +import { WorkflowSchemeAssociation } from './workflowSchemeAssociation'; + +/** The update workflow scheme payload. */ +export interface WorkflowSchemeUpdateRequest { + /** + * The ID of the workflow for issue types without having a mapping defined in this workflow scheme. Only used in + * global-scoped workflow schemes. If the `defaultWorkflowId` isn't specified, this is set to _Jira Workflow + * (jira)_. + */ + defaultWorkflowId?: string; + /** The new description for this workflow scheme. */ + description: string; + /** The ID of this workflow scheme. */ + id: string; + /** The new name for this workflow scheme. */ + name: string; + /** + * Overrides, for the selected issue types, any status mappings provided in `statusMappingsByWorkflows`. Status + * mappings are required when the new workflow for an issue type doesn't contain all statuses that the old workflow + * has. Status mappings can be provided by a combination of `statusMappingsByWorkflows` and + * `statusMappingsByIssueTypeOverride`. + */ + statusMappingsByIssueTypeOverride?: MappingsByIssueTypeOverride[]; + /** + * The status mappings by workflows. Status mappings are required when the new workflow for an issue type doesn't + * contain all statuses that the old workflow has. Status mappings can be provided by a combination of + * `statusMappingsByWorkflows` and `statusMappingsByIssueTypeOverride`. + */ + statusMappingsByWorkflows?: MappingsByWorkflow[]; + version: DocumentVersion; + /** Mappings from workflows to issue types. */ + workflowsForIssueTypes?: WorkflowSchemeAssociation[]; +} diff --git a/src/version2/models/workflowSchemeUpdateRequiredMappingsRequest.ts b/src/version2/models/workflowSchemeUpdateRequiredMappingsRequest.ts new file mode 100644 index 0000000000..ccde824efa --- /dev/null +++ b/src/version2/models/workflowSchemeUpdateRequiredMappingsRequest.ts @@ -0,0 +1,14 @@ +import { WorkflowSchemeAssociation } from './workflowSchemeAssociation'; + +/** The request payload to get the required mappings for updating a workflow scheme. */ +export interface WorkflowSchemeUpdateRequiredMappingsRequest { + /** + * The ID of the new default workflow for this workflow scheme. Only used in global-scoped workflow schemes. If it + * isn't specified, is set to _Jira Workflow (jira)_. + */ + defaultWorkflowId?: string; + /** The ID of the workflow scheme. */ + id: string; + /** The new workflow to issue type mappings for this workflow scheme. */ + workflowsForIssueTypes: WorkflowSchemeAssociation[]; +} diff --git a/src/version2/models/workflowSchemeUpdateRequiredMappingsResponse.ts b/src/version2/models/workflowSchemeUpdateRequiredMappingsResponse.ts new file mode 100644 index 0000000000..c0ca2ff563 --- /dev/null +++ b/src/version2/models/workflowSchemeUpdateRequiredMappingsResponse.ts @@ -0,0 +1,15 @@ +import { RequiredMappingByIssueType } from './requiredMappingByIssueType'; +import { RequiredMappingByWorkflows } from './requiredMappingByWorkflows'; +import { StatusMetadata } from './statusMetadata'; +import { StatusesPerWorkflow } from './statusesPerWorkflow'; + +export interface WorkflowSchemeUpdateRequiredMappingsResponse { + /** The list of required status mappings by issue type. */ + statusMappingsByIssueTypes?: RequiredMappingByIssueType[]; + /** The list of required status mappings by workflow. */ + statusMappingsByWorkflows?: RequiredMappingByWorkflows[]; + /** The details of the statuses in the associated workflows. */ + statuses?: StatusMetadata[]; + /** The statuses associated with each workflow. */ + statusesPerWorkflow?: StatusesPerWorkflow[]; +} diff --git a/src/version2/models/workflowSchemeUsage.ts b/src/version2/models/workflowSchemeUsage.ts new file mode 100644 index 0000000000..a6b0fe9530 --- /dev/null +++ b/src/version2/models/workflowSchemeUsage.ts @@ -0,0 +1,5 @@ +/** The worflow scheme. */ +export interface WorkflowSchemeUsage { + /** The workflow scheme ID. */ + id?: string; +} diff --git a/src/version2/models/workflowSchemeUsageDTO.ts b/src/version2/models/workflowSchemeUsageDTO.ts new file mode 100644 index 0000000000..9d660e5b61 --- /dev/null +++ b/src/version2/models/workflowSchemeUsageDTO.ts @@ -0,0 +1,8 @@ +import { WorkflowSchemeUsagePage } from './workflowSchemeUsagePage'; + +/** Workflow schemes using the workflow. */ +export interface WorkflowSchemeUsageDTO { + /** The workflow ID. */ + workflowId?: string; + workflowSchemes?: WorkflowSchemeUsagePage; +} diff --git a/src/version2/models/workflowSchemeUsagePage.ts b/src/version2/models/workflowSchemeUsagePage.ts new file mode 100644 index 0000000000..5b883978f6 --- /dev/null +++ b/src/version2/models/workflowSchemeUsagePage.ts @@ -0,0 +1,9 @@ +import { WorkflowSchemeUsage } from './workflowSchemeUsage'; + +/** A page of workflow schemes. */ +export interface WorkflowSchemeUsagePage { + /** Token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of workflow schemes. */ + values?: WorkflowSchemeUsage[]; +} diff --git a/src/version2/models/workflowSearchResponse.ts b/src/version2/models/workflowSearchResponse.ts new file mode 100644 index 0000000000..966016a32a --- /dev/null +++ b/src/version2/models/workflowSearchResponse.ts @@ -0,0 +1,22 @@ +import { JiraWorkflowStatus } from './jiraWorkflowStatus'; +import { JiraWorkflow } from './jiraWorkflow'; + +/** Page of items, including workflows and related statuses. */ +export interface WorkflowSearchResponse { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** List of statuses. */ + statuses?: JiraWorkflowStatus[]; + /** The number of items returned. */ + total?: number; + /** List of workflows. */ + values?: JiraWorkflow[]; +} diff --git a/src/version2/models/workflowSimpleCondition.ts b/src/version2/models/workflowSimpleCondition.ts new file mode 100644 index 0000000000..1a36a97ca0 --- /dev/null +++ b/src/version2/models/workflowSimpleCondition.ts @@ -0,0 +1,8 @@ +/** A workflow transition rule condition. This object returns `nodeType` as `simple`. */ +export interface WorkflowSimpleCondition { + /** EXPERIMENTAL. The configuration of the transition rule. */ + configuration?: {}; + nodeType: string; + /** The type of the transition rule. */ + type: string; +} diff --git a/src/version2/models/workflowTransitionLinks.ts b/src/version2/models/workflowTransitionLinks.ts new file mode 100644 index 0000000000..a6cb549dbe --- /dev/null +++ b/src/version2/models/workflowTransitionLinks.ts @@ -0,0 +1,9 @@ +/** The statuses the transition can start from, and the mapping of ports between the statuses. */ +export interface WorkflowTransitionLinks { + /** The port that the transition starts from. */ + fromPort?: number; + /** The status that the transition starts from. */ + fromStatusReference?: string; + /** The port that the transition goes to. */ + toPort?: number; +} diff --git a/src/version2/models/workflowUpdateResponse.ts b/src/version2/models/workflowUpdateResponse.ts index 57e60d99dd..cc83d63384 100644 --- a/src/version2/models/workflowUpdateResponse.ts +++ b/src/version2/models/workflowUpdateResponse.ts @@ -1,6 +1,12 @@ import { JiraWorkflow } from './jiraWorkflow'; import { JiraWorkflowStatus } from './jiraWorkflowStatus'; +/** + * Represents the response after updating a workflow. + * + * @deprecated This interface is deprecated and will be removed in a future version. Use {@link WorkflowUpdate} instead, + * which is the preferred way to handle workflow updates. + */ export interface WorkflowUpdateResponse { /** List of updated statuses. */ statuses?: JiraWorkflowStatus[]; diff --git a/src/version2/models/workflowUpdateValidateRequest.ts b/src/version2/models/workflowUpdateValidateRequest.ts new file mode 100644 index 0000000000..8fcd81fead --- /dev/null +++ b/src/version2/models/workflowUpdateValidateRequest.ts @@ -0,0 +1,7 @@ +import { WorkflowUpdateRequest } from './workflowUpdateRequest'; +import { ValidationOptionsForUpdate } from './validationOptionsForUpdate'; + +export interface WorkflowUpdateValidateRequest { + payload: WorkflowUpdateRequest; + validationOptions?: ValidationOptionsForUpdate; +} diff --git a/src/version2/models/workflowUsages.ts b/src/version2/models/workflowUsages.ts new file mode 100644 index 0000000000..1bc87e808c --- /dev/null +++ b/src/version2/models/workflowUsages.ts @@ -0,0 +1,12 @@ +/** + * Deprecated. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) + * for details.* + * + * The workflows that use this status. Only available if the `workflowUsages` expand is requested. + */ +export interface WorkflowUsages { + /** Workflow ID. */ + workflowId?: string; + /** Workflow name. */ + workflowName?: string; +} diff --git a/src/version2/models/worklogsMoveRequest.ts b/src/version2/models/worklogsMoveRequest.ts new file mode 100644 index 0000000000..212d9419a7 --- /dev/null +++ b/src/version2/models/worklogsMoveRequest.ts @@ -0,0 +1,6 @@ +export interface WorklogsMoveRequest { + /** A list of worklog IDs. */ + ids?: number[]; + /** The issue id or key of the destination issue */ + issueIdOrKey?: string; +} diff --git a/src/version2/models/workspaceDataPolicy.ts b/src/version2/models/workspaceDataPolicy.ts new file mode 100644 index 0000000000..cc0f7bcebb --- /dev/null +++ b/src/version2/models/workspaceDataPolicy.ts @@ -0,0 +1,5 @@ +/** Details about data policy. */ +export interface WorkspaceDataPolicy { + /** Whether the workspace contains any content inaccessible to the requesting application. */ + anyContentBlocked?: boolean; +} diff --git a/src/version2/myself.ts b/src/version2/myself.ts index 47e97ed7da..7876132dc0 100644 --- a/src/version2/myself.ts +++ b/src/version2/myself.ts @@ -6,7 +6,6 @@ import { RequestConfig } from '../requestConfig'; export class Myself { constructor(private client: Client) {} - /** * Returns the value of a preference of the current user. * @@ -17,6 +16,14 @@ export class Myself { * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the * instance. * + * These system preferences keys will be deprecated by 15/07/2024. You can still retrieve these keys, but it will not + * have any impact on Notification behaviour. + * + * - _user.notifications.watcher_ Whether the user gets notified when they are watcher. + * - _user.notifications.assignee_ Whether the user gets notified when they are assignee. + * - _user.notifications.reporter_ Whether the user gets notified when they are reporter. + * - _user.notifications.mentions_ Whether the user gets notified when they are mentions. + * * Use [ Update a user * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) * from the user management REST API to manage timezone and locale instead. @@ -24,7 +31,7 @@ export class Myself { * **[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; + async getPreference(parameters: Parameters.GetPreference, callback: Callback): Promise; /** * Returns the value of a preference of the current user. * @@ -35,6 +42,14 @@ export class Myself { * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the * instance. * + * These system preferences keys will be deprecated by 15/07/2024. You can still retrieve these keys, but it will not + * have any impact on Notification behaviour. + * + * - _user.notifications.watcher_ Whether the user gets notified when they are watcher. + * - _user.notifications.assignee_ Whether the user gets notified when they are assignee. + * - _user.notifications.reporter_ Whether the user gets notified when they are reporter. + * - _user.notifications.mentions_ Whether the user gets notified when they are mentions. + * * Use [ Update a user * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) * from the user management REST API to manage timezone and locale instead. @@ -42,8 +57,11 @@ export class Myself { * **[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 { + 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', @@ -54,25 +72,32 @@ export class Myself { 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. + * - _user.notifiy.own.changes_ Whether the user gets notified of their own changes. * * Note that these keys are deprecated: * * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. * + * These system preferences keys will be deprecated by 15/07/2024. You can still use these keys to create arbitrary + * preferences, but it will not have any impact on Notification behaviour. + * + * - _user.notifications.watcher_ Whether the user gets notified when they are watcher. + * - _user.notifications.assignee_ Whether the user gets notified when they are assignee. + * - _user.notifications.reporter_ Whether the user gets notified when they are reporter. + * - _user.notifications.mentions_ Whether the user gets notified when they are mentions. + * * Use [ Update a user * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) * from the user management REST API to manage timezone and locale instead. @@ -87,18 +112,26 @@ export class Myself { * following keys define system preferences that can be set or created: * * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. - * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. * Defaults to `true`. * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By * default, not set: the user takes the instance autowatch setting. + * - _user.notifiy.own.changes_ Whether the user gets notified of their own changes. * * Note that these keys are deprecated: * * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. * + * These system preferences keys will be deprecated by 15/07/2024. You can still use these keys to create arbitrary + * preferences, but it will not have any impact on Notification behaviour. + * + * - _user.notifications.watcher_ Whether the user gets notified when they are watcher. + * - _user.notifications.assignee_ Whether the user gets notified when they are assignee. + * - _user.notifications.reporter_ Whether the user gets notified when they are reporter. + * - _user.notifications.mentions_ Whether the user gets notified when they are mentions. + * * Use [ Update a user * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) * from the user management REST API to manage timezone and locale instead. @@ -111,18 +144,13 @@ export class Myself { 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. * @@ -166,7 +194,6 @@ export class Myself { return this.client.sendRequest(config, callback); } - /** * Returns the locale for the user. * @@ -199,7 +226,69 @@ export class Myself { return this.client.sendRequest(config, callback); } + /** + * Deprecated, 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 instead. + * + * Sets the locale of the user. The locale must be one supported by the instance of Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async setLocale(parameters: Parameters.SetLocale | undefined, callback: Callback): Promise; + /** + * Deprecated, 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 instead. + * + * Sets the locale of the user. The locale must be one supported by the instance of Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async setLocale(parameters?: Parameters.SetLocale, callback?: never): Promise; + async setLocale(parameters?: Parameters.SetLocale, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/mypreferences/locale', + method: 'PUT', + data: { + locale: parameters?.locale, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Deprecated, 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 instead. + * + * Deletes the locale of the user, which restores the default setting. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async deleteLocale(callback: Callback): Promise; + /** + * Deprecated, 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 instead. + * + * Deletes the locale of the user, which restores the default setting. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async deleteLocale(callback?: never): Promise; + async deleteLocale(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/mypreferences/locale', + method: 'DELETE', + }; + return this.client.sendRequest(config, callback); + } /** * Returns details for the current user. * diff --git a/src/version2/parameters/addAtlassianTeam.ts b/src/version2/parameters/addAtlassianTeam.ts new file mode 100644 index 0000000000..6563e62556 --- /dev/null +++ b/src/version2/parameters/addAtlassianTeam.ts @@ -0,0 +1,6 @@ +import { AddAtlassianTeamRequest } from '../models'; + +export interface AddAtlassianTeam extends AddAtlassianTeamRequest { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version2/parameters/addNotifications.ts b/src/version2/parameters/addNotifications.ts new file mode 100644 index 0000000000..2678cd06c1 --- /dev/null +++ b/src/version2/parameters/addNotifications.ts @@ -0,0 +1,6 @@ +import { AddNotificationsDetails } from '../models'; + +export interface AddNotifications extends AddNotificationsDetails { + /** The ID of the notification scheme. */ + id: string; +} diff --git a/src/version2/parameters/archivePlan.ts b/src/version2/parameters/archivePlan.ts new file mode 100644 index 0000000000..250cc9759f --- /dev/null +++ b/src/version2/parameters/archivePlan.ts @@ -0,0 +1,4 @@ +export interface ArchivePlan { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version2/parameters/bulkDeleteWorklogs.ts b/src/version2/parameters/bulkDeleteWorklogs.ts new file mode 100644 index 0000000000..ef7dcab89e --- /dev/null +++ b/src/version2/parameters/bulkDeleteWorklogs.ts @@ -0,0 +1,19 @@ +import { WorklogIdsRequestBean } from '../models'; + +export interface BulkDeleteWorklogs extends WorklogIdsRequestBean { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * Defines how to update the issue's time estimate, the options are: + * + * `leave` Leaves the estimate unchanged. `auto` Reduces the estimate by the aggregate value of `timeSpent` across + * all worklogs being deleted. + */ + adjustEstimate?: 'leave' | 'auto' | string; + /** + * Whether the work log entries should be removed to the issue even if the issue is not editable, because + * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with + * admin permission can use this flag. + */ + overrideEditableFlag?: boolean; +} diff --git a/src/version2/parameters/bulkFetchIssues.ts b/src/version2/parameters/bulkFetchIssues.ts new file mode 100644 index 0000000000..c9c19ef59b --- /dev/null +++ b/src/version2/parameters/bulkFetchIssues.ts @@ -0,0 +1,3 @@ +import { BulkFetchIssueRequestBean } from '../models'; + +export interface BulkFetchIssues extends BulkFetchIssueRequestBean {} diff --git a/src/version2/parameters/bulkMoveWorklogs.ts b/src/version2/parameters/bulkMoveWorklogs.ts new file mode 100644 index 0000000000..7d34cefb2b --- /dev/null +++ b/src/version2/parameters/bulkMoveWorklogs.ts @@ -0,0 +1,18 @@ +import { WorklogsMoveRequestBean } from '../models'; + +export interface BulkMoveWorklogs extends WorklogsMoveRequestBean { + issueIdOrKey: string; + /** + * Defines how to update the issues' time estimate, the options are: + * + * `leave` Leaves the estimate unchanged. `auto` Reduces the estimate by the aggregate value of `timeSpent` across + * all worklogs being moved in the source issue, and increases it in the destination issue. + */ + adjustEstimate?: 'leave' | 'auto' | string; + /** + * Whether the work log entry should be moved to and from the issues even if the issues are not editable, because + * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with + * admin permission can use this flag. + */ + overrideEditableFlag?: boolean; +} diff --git a/src/version2/parameters/bulkSetIssuesPropertiesList.ts b/src/version2/parameters/bulkSetIssuesPropertiesList.ts new file mode 100644 index 0000000000..aa5aeba721 --- /dev/null +++ b/src/version2/parameters/bulkSetIssuesPropertiesList.ts @@ -0,0 +1,3 @@ +import { IssueEntityProperties } from '../models'; + +export interface BulkSetIssuesPropertiesList extends IssueEntityProperties {} diff --git a/src/version2/parameters/countIssues.ts b/src/version2/parameters/countIssues.ts new file mode 100644 index 0000000000..8652b1c269 --- /dev/null +++ b/src/version2/parameters/countIssues.ts @@ -0,0 +1,3 @@ +import { JQLCountRequestBean } from '../models'; + +export interface CountIssues extends JQLCountRequestBean {} diff --git a/src/version2/parameters/createPlan.ts b/src/version2/parameters/createPlan.ts new file mode 100644 index 0000000000..bd032ad93d --- /dev/null +++ b/src/version2/parameters/createPlan.ts @@ -0,0 +1,6 @@ +import { CreatePlanRequest } from '../models'; + +export interface CreatePlan extends CreatePlanRequest { + /** Whether to accept group IDs instead of group names. Group names are deprecated. */ + useGroupId?: boolean; +} diff --git a/src/version2/parameters/createPlanOnlyTeam.ts b/src/version2/parameters/createPlanOnlyTeam.ts new file mode 100644 index 0000000000..29915aabce --- /dev/null +++ b/src/version2/parameters/createPlanOnlyTeam.ts @@ -0,0 +1,6 @@ +import { CreatePlanOnlyTeamRequest } from '../models'; + +export interface CreatePlanOnlyTeam extends CreatePlanOnlyTeamRequest { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version2/parameters/createPriorityScheme.ts b/src/version2/parameters/createPriorityScheme.ts new file mode 100644 index 0000000000..0b4d135d0e --- /dev/null +++ b/src/version2/parameters/createPriorityScheme.ts @@ -0,0 +1,3 @@ +import { CreatePrioritySchemeDetails } from '../models'; + +export interface CreatePriorityScheme extends CreatePrioritySchemeDetails {} diff --git a/src/version2/parameters/createRelatedWork.ts b/src/version2/parameters/createRelatedWork.ts new file mode 100644 index 0000000000..e3c0616741 --- /dev/null +++ b/src/version2/parameters/createRelatedWork.ts @@ -0,0 +1,5 @@ +import { VersionRelatedWork } from '../models'; + +export interface CreateRelatedWork extends VersionRelatedWork { + id: string; +} diff --git a/src/version2/parameters/deleteForgeAppProperty.ts b/src/version2/parameters/deleteForgeAppProperty.ts new file mode 100644 index 0000000000..62c8e6f4fc --- /dev/null +++ b/src/version2/parameters/deleteForgeAppProperty.ts @@ -0,0 +1,4 @@ +export interface DeleteForgeAppProperty { + /** The key of the property. */ + propertyKey: string; +} diff --git a/src/version2/parameters/deletePlanOnlyTeam.ts b/src/version2/parameters/deletePlanOnlyTeam.ts new file mode 100644 index 0000000000..d87ea6bd4b --- /dev/null +++ b/src/version2/parameters/deletePlanOnlyTeam.ts @@ -0,0 +1,6 @@ +export interface DeletePlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the plan-only team. */ + planOnlyTeamId: number; +} diff --git a/src/version2/parameters/deletePriority.ts b/src/version2/parameters/deletePriority.ts new file mode 100644 index 0000000000..224cd5fc3d --- /dev/null +++ b/src/version2/parameters/deletePriority.ts @@ -0,0 +1,4 @@ +export interface DeletePriority { + /** The ID of the issue priority. */ + id: string; +} diff --git a/src/version2/parameters/deletePriorityScheme.ts b/src/version2/parameters/deletePriorityScheme.ts new file mode 100644 index 0000000000..3ac3ff970c --- /dev/null +++ b/src/version2/parameters/deletePriorityScheme.ts @@ -0,0 +1,4 @@ +export interface DeletePriorityScheme { + /** The priority scheme ID. */ + schemeId: number; +} diff --git a/src/version2/parameters/deleteRelatedWork.ts b/src/version2/parameters/deleteRelatedWork.ts new file mode 100644 index 0000000000..2980e8f2e5 --- /dev/null +++ b/src/version2/parameters/deleteRelatedWork.ts @@ -0,0 +1,6 @@ +export interface DeleteRelatedWork { + /** The ID of the version that the target related work belongs to. */ + versionId: string; + /** The ID of the related work to delete. */ + relatedWorkId: string; +} diff --git a/src/version2/parameters/deleteVersion.ts b/src/version2/parameters/deleteVersion.ts new file mode 100644 index 0000000000..823015b79b --- /dev/null +++ b/src/version2/parameters/deleteVersion.ts @@ -0,0 +1,14 @@ +export interface DeleteVersion { + /** The ID of the version. */ + id: string; + /** + * The ID of the version to update `fixVersion` to when the field contains the deleted version. The replacement + * version must be in the same project as the version being deleted and cannot be the version being deleted. + */ + moveFixIssuesTo?: string; + /** + * The ID of the version to update `affectedVersion` to when the field contains the deleted version. The replacement + * version must be in the same project as the version being deleted and cannot be the version being deleted. + */ + moveAffectedIssuesTo?: string; +} diff --git a/src/version2/parameters/duplicatePlan.ts b/src/version2/parameters/duplicatePlan.ts new file mode 100644 index 0000000000..10a25d70f8 --- /dev/null +++ b/src/version2/parameters/duplicatePlan.ts @@ -0,0 +1,6 @@ +import { DuplicatePlanRequest } from '../models'; + +export interface DuplicatePlan extends DuplicatePlanRequest { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version2/parameters/evaluateJSISJiraExpression.ts b/src/version2/parameters/evaluateJSISJiraExpression.ts new file mode 100644 index 0000000000..3dc1122bb4 --- /dev/null +++ b/src/version2/parameters/evaluateJSISJiraExpression.ts @@ -0,0 +1,13 @@ +import { JiraExpressionEvaluateRequestBean } from '../models'; + +export interface EvaluateJSISJiraExpression extends JiraExpressionEvaluateRequestBean { + /** + * 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/findComponentsForProjects.ts b/src/version2/parameters/findComponentsForProjects.ts new file mode 100644 index 0000000000..018417db88 --- /dev/null +++ b/src/version2/parameters/findComponentsForProjects.ts @@ -0,0 +1,19 @@ +export interface FindComponentsForProjects { + /** The project IDs and/or project keys (case sensitive). */ + projectIdsOrKeys?: string[]; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * `description` Sorts by the component description. `name` Sorts by component name. + */ + orderBy?: 'description' | '-description' | '+description' | 'name' | '-name' | '+name' | string; + /** + * Filter the results using a literal string. Components with a matching `name` or `description` are returned (case + * insensitive). + */ + query?: string; +} diff --git a/src/version2/parameters/findUserKeysByQuery.ts b/src/version2/parameters/findUserKeysByQuery.ts index 14b12d1fd0..b6c92aef83 100644 --- a/src/version2/parameters/findUserKeysByQuery.ts +++ b/src/version2/parameters/findUserKeysByQuery.ts @@ -3,6 +3,12 @@ export interface FindUserKeysByQuery { query: string; /** The index of the first item to return in a page of results (page offset). */ startAt?: number; - /** The maximum number of items to return per page. */ + /** + * The maximum number of items to return per page. + * + * @deprecated Use `maxResult` instead. + */ maxResults?: number; + /** The maximum number of items to return per page. */ + maxResult?: number; } diff --git a/src/version2/parameters/getAllProjects.ts b/src/version2/parameters/getAllProjects.ts new file mode 100644 index 0000000000..0ddbc6f4a6 --- /dev/null +++ b/src/version2/parameters/getAllProjects.ts @@ -0,0 +1,19 @@ +export interface GetAllProjects { + /** + * 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. Expanded options include: + * + * `description` Returns the project description. `issueTypes` Returns all issue types associated with the project. + * `lead` Returns information about the project lead. `projectKeys` Returns all project keys associated with the + * project. + */ + expand?: string; + /** + * Returns the user's most recently accessed projects. You may specify the number of results to return up to a + * maximum of 20. If access is anonymous, then the recently accessed projects are based on the current HTTP + * session. + */ + recent?: number; + /** A list of project properties to return for the project. This parameter accepts a comma-separated list. */ + properties?: string[]; +} diff --git a/src/version2/parameters/getAllUserDataClassificationLevels.ts b/src/version2/parameters/getAllUserDataClassificationLevels.ts new file mode 100644 index 0000000000..eb477fbdde --- /dev/null +++ b/src/version2/parameters/getAllUserDataClassificationLevels.ts @@ -0,0 +1,6 @@ +export interface GetAllUserDataClassificationLevels { + /** Optional set of statuses to filter by. */ + status?: ('PUBLISHED' | 'ARCHIVED' | 'DRAFT' | string)[]; + /** Ordering of the results by a given field. If not provided, values will not be sorted. */ + orderBy?: 'rank' | '-rank' | '+rank' | string; +} diff --git a/src/version2/parameters/getAllWorkflows.ts b/src/version2/parameters/getAllWorkflows.ts new file mode 100644 index 0000000000..17dd630238 --- /dev/null +++ b/src/version2/parameters/getAllWorkflows.ts @@ -0,0 +1,4 @@ +export interface GetAllWorkflows { + /** The name of the workflow to be returned. Only one workflow can be specified. */ + workflowName?: string; +} diff --git a/src/version2/parameters/getApproximateApplicationLicenseCount.ts b/src/version2/parameters/getApproximateApplicationLicenseCount.ts new file mode 100644 index 0000000000..0730b432a6 --- /dev/null +++ b/src/version2/parameters/getApproximateApplicationLicenseCount.ts @@ -0,0 +1,4 @@ +export interface GetApproximateApplicationLicenseCount { + /** The ID of the application, represents a specific version of Jira. */ + applicationKey: 'jira-core' | 'jira-product-discovery' | 'jira-software' | 'jira-servicedesk' | string; +} diff --git a/src/version2/parameters/getAtlassianTeam.ts b/src/version2/parameters/getAtlassianTeam.ts new file mode 100644 index 0000000000..b3bc42a2b5 --- /dev/null +++ b/src/version2/parameters/getAtlassianTeam.ts @@ -0,0 +1,6 @@ +export interface GetAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the Atlassian team. */ + atlassianTeamId: string; +} diff --git a/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts b/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts new file mode 100644 index 0000000000..e576614d09 --- /dev/null +++ b/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts @@ -0,0 +1,12 @@ +export interface GetAvailablePrioritiesByPriorityScheme { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: string; + /** The maximum number of items to return per page. */ + maxResults?: string; + /** The string to query priorities on by name. */ + query?: string; + /** The priority scheme ID. */ + schemeId: string; + /** A list of priority IDs to exclude from the results. */ + exclude?: string[]; +} diff --git a/src/version2/parameters/getBulkChangelogs.ts b/src/version2/parameters/getBulkChangelogs.ts new file mode 100644 index 0000000000..662e69d8da --- /dev/null +++ b/src/version2/parameters/getBulkChangelogs.ts @@ -0,0 +1,3 @@ +import { BulkChangelogRequestBean } from '../models'; + +export interface GetBulkChangelogs extends BulkChangelogRequestBean {} diff --git a/src/version2/parameters/getBulkScreenTabs.ts b/src/version2/parameters/getBulkScreenTabs.ts new file mode 100644 index 0000000000..6f8227f85a --- /dev/null +++ b/src/version2/parameters/getBulkScreenTabs.ts @@ -0,0 +1,16 @@ +export interface GetBulkScreenTabs { + /** + * The list of screen IDs. To include multiple screen IDs, provide an ampersand-separated list. For example, + * `screenId=10000&screenId=10001`. + */ + screenId?: number[]; + /** + * The list of tab IDs. To include multiple tab IDs, provide an ampersand-separated list. For example, + * `tabId=10000&tabId=10001`. + */ + tabId?: number[]; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. The maximum number is 100, */ + maxResult?: number; +} diff --git a/src/version2/parameters/getContextsForFieldDeprecated.ts b/src/version2/parameters/getContextsForFieldDeprecated.ts new file mode 100644 index 0000000000..dd7bb2e45c --- /dev/null +++ b/src/version2/parameters/getContextsForFieldDeprecated.ts @@ -0,0 +1,8 @@ +export interface GetContextsForFieldDeprecated { + /** The ID of the field to return contexts for. */ + 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/getCreateIssueMetaIssueTypeId.ts b/src/version2/parameters/getCreateIssueMetaIssueTypeId.ts new file mode 100644 index 0000000000..6195fc1f49 --- /dev/null +++ b/src/version2/parameters/getCreateIssueMetaIssueTypeId.ts @@ -0,0 +1,10 @@ +export interface GetCreateIssueMetaIssueTypeId { + /** The ID or key of the project. */ + projectIdOrKey: string; + /** The issuetype ID. */ + issueTypeId: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getCreateIssueMetaIssueTypes.ts b/src/version2/parameters/getCreateIssueMetaIssueTypes.ts new file mode 100644 index 0000000000..dc20e141b5 --- /dev/null +++ b/src/version2/parameters/getCreateIssueMetaIssueTypes.ts @@ -0,0 +1,8 @@ +export interface GetCreateIssueMetaIssueTypes { + /** The ID or key of the project. */ + projectIdOrKey: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getCustomFieldsConfigurations.ts b/src/version2/parameters/getCustomFieldsConfigurations.ts new file mode 100644 index 0000000000..0bfd3a001d --- /dev/null +++ b/src/version2/parameters/getCustomFieldsConfigurations.ts @@ -0,0 +1,34 @@ +import { ConfigurationsListParameters } from '../models'; + +export interface GetCustomFieldsConfigurations extends ConfigurationsListParameters { + /** + * The list of configuration IDs. To include multiple configurations, separate IDs with an ampersand: + * `id=10000&id=10001`. Can't be provided with `fieldContextId`, `issueId`, `projectKeyOrId`, or `issueTypeId`. + */ + id?: number[]; + /** + * The list of field context IDs. To include multiple field contexts, separate IDs with an ampersand: + * `fieldContextId=10000&fieldContextId=10001`. Can't be provided with `id`, `issueId`, `projectKeyOrId`, or + * `issueTypeId`. + */ + fieldContextId?: number[]; + /** + * The ID of the issue to filter results by. If the issue doesn't exist, an empty list is returned. Can't be + * provided with `projectKeyOrId`, or `issueTypeId`. + */ + issueId?: number; + /** + * The ID or key of the project to filter results by. Must be provided with `issueTypeId`. Can't be provided with + * `issueId`. + */ + projectKeyOrId?: string; + /** + * The ID of the issue type to filter results by. Must be provided with `projectKeyOrId`. Can't be provided with + * `issueId`. + */ + issueTypeId?: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getDefaultProjectClassification.ts b/src/version2/parameters/getDefaultProjectClassification.ts new file mode 100644 index 0000000000..cf8683da7a --- /dev/null +++ b/src/version2/parameters/getDefaultProjectClassification.ts @@ -0,0 +1,4 @@ +export interface GetDefaultProjectClassification { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; +} diff --git a/src/version2/parameters/getGroup.ts b/src/version2/parameters/getGroup.ts new file mode 100644 index 0000000000..e34e5efada --- /dev/null +++ b/src/version2/parameters/getGroup.ts @@ -0,0 +1,11 @@ +export interface GetGroup { + /** + * 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; + /** List of fields to expand. */ + expand?: string; +} diff --git a/src/version2/parameters/getIssueLimitReport.ts b/src/version2/parameters/getIssueLimitReport.ts new file mode 100644 index 0000000000..288f038e99 --- /dev/null +++ b/src/version2/parameters/getIssueLimitReport.ts @@ -0,0 +1,10 @@ +import { IssueLimitReportRequest } from '../models'; + +export interface GetIssueLimitReport extends IssueLimitReportRequest { + /** + * Return issue keys instead of issue ids in the response. + * + * Usage: Add `?isReturningKeys=true` to the end of the path to request issue keys. + */ + isReturningKeys?: boolean; +} diff --git a/src/version2/parameters/getPlan.ts b/src/version2/parameters/getPlan.ts new file mode 100644 index 0000000000..9ed1b0df18 --- /dev/null +++ b/src/version2/parameters/getPlan.ts @@ -0,0 +1,6 @@ +export interface GetPlan { + /** The ID of the plan. */ + planId: number; + /** Whether to return group IDs instead of group names. Group names are deprecated. */ + useGroupId?: boolean; +} diff --git a/src/version2/parameters/getPlanOnlyTeam.ts b/src/version2/parameters/getPlanOnlyTeam.ts new file mode 100644 index 0000000000..f48b73a426 --- /dev/null +++ b/src/version2/parameters/getPlanOnlyTeam.ts @@ -0,0 +1,6 @@ +export interface GetPlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the plan-only team. */ + planOnlyTeamId: number; +} diff --git a/src/version2/parameters/getPlans.ts b/src/version2/parameters/getPlans.ts new file mode 100644 index 0000000000..2633d4c9e8 --- /dev/null +++ b/src/version2/parameters/getPlans.ts @@ -0,0 +1,10 @@ +export interface GetPlans { + /** Whether to include trashed plans in the results. */ + includeTrashed?: boolean; + /** Whether to include archived plans in the results. */ + includeArchived?: boolean; + /** The cursor to start from. If not provided, the first page will be returned. */ + cursor?: string; + /** The maximum number of plans to return per page. The maximum value is 50. The default value is 50. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getPolicies.ts b/src/version2/parameters/getPolicies.ts new file mode 100644 index 0000000000..afba75fdec --- /dev/null +++ b/src/version2/parameters/getPolicies.ts @@ -0,0 +1,4 @@ +export interface GetPolicies { + /** A list of project identifiers. This parameter accepts a comma-separated list. */ + ids?: string; +} diff --git a/src/version2/parameters/getPrecomputationsByID.ts b/src/version2/parameters/getPrecomputationsByID.ts new file mode 100644 index 0000000000..e0edd4b2df --- /dev/null +++ b/src/version2/parameters/getPrecomputationsByID.ts @@ -0,0 +1,11 @@ +import { JqlFunctionPrecomputationGetByIdRequest } from '../models'; + +export interface GetPrecomputationsByID extends JqlFunctionPrecomputationGetByIdRequest { + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * `functionKey` Sorts by the functionKey. `used` Sorts by the used timestamp. `created` Sorts by the created + * timestamp. `updated` Sorts by the updated timestamp. + */ + orderBy?: string; +} diff --git a/src/version2/parameters/getPrioritiesByPriorityScheme.ts b/src/version2/parameters/getPrioritiesByPriorityScheme.ts new file mode 100644 index 0000000000..76d7512d9c --- /dev/null +++ b/src/version2/parameters/getPrioritiesByPriorityScheme.ts @@ -0,0 +1,8 @@ +export interface GetPrioritiesByPriorityScheme { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: string; + /** The maximum number of items to return per page. */ + maxResults?: string; + /** The priority scheme ID. */ + schemeId: string; +} diff --git a/src/version2/parameters/getPrioritySchemes.ts b/src/version2/parameters/getPrioritySchemes.ts new file mode 100644 index 0000000000..9ea7155e7c --- /dev/null +++ b/src/version2/parameters/getPrioritySchemes.ts @@ -0,0 +1,28 @@ +export interface GetPrioritySchemes { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: string; + /** The maximum number of items to return per page. */ + maxResults?: string; + /** + * A set of priority IDs to filter by. To include multiple IDs, provide an ampersand-separated list. For example, + * `priorityId=10000&priorityId=10001`. + */ + priorityId?: number[]; + /** + * A set of priority scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `schemeId=10000&schemeId=10001`. + */ + schemeId?: number[]; + /** The name of scheme to search for. */ + schemeName?: string; + /** Whether only the default priority is returned. */ + onlyDefault?: boolean; + /** The ordering to return the priority schemes by. */ + orderBy?: 'name' | '+name' | '-name' | string; + /** + * A comma separated list of additional information to return. "priorities" will return priorities associated with + * the priority scheme. "projects" will return projects associated with the priority scheme. + * `expand=priorities,projects`. + */ + expand?: string; +} diff --git a/src/version2/parameters/getProjectIssueTypeUsagesForStatus.ts b/src/version2/parameters/getProjectIssueTypeUsagesForStatus.ts new file mode 100644 index 0000000000..80deab4e9d --- /dev/null +++ b/src/version2/parameters/getProjectIssueTypeUsagesForStatus.ts @@ -0,0 +1,10 @@ +export interface GetProjectIssueTypeUsagesForStatus { + /** The statusId to fetch issue type usages for */ + statusId: string; + /** The projectId to fetch issue type usages for */ + projectId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getProjectUsagesForStatus.ts b/src/version2/parameters/getProjectUsagesForStatus.ts new file mode 100644 index 0000000000..0e8913c901 --- /dev/null +++ b/src/version2/parameters/getProjectUsagesForStatus.ts @@ -0,0 +1,8 @@ +export interface GetProjectUsagesForStatus { + /** The statusId to fetch project usages for */ + statusId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getProjectUsagesForWorkflow.ts b/src/version2/parameters/getProjectUsagesForWorkflow.ts new file mode 100644 index 0000000000..e70544f1f4 --- /dev/null +++ b/src/version2/parameters/getProjectUsagesForWorkflow.ts @@ -0,0 +1,8 @@ +export interface GetProjectUsagesForWorkflow { + /** The workflow ID */ + workflowId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getProjectUsagesForWorkflowScheme.ts b/src/version2/parameters/getProjectUsagesForWorkflowScheme.ts new file mode 100644 index 0000000000..0266959608 --- /dev/null +++ b/src/version2/parameters/getProjectUsagesForWorkflowScheme.ts @@ -0,0 +1,8 @@ +export interface GetProjectUsagesForWorkflowScheme { + /** The workflow scheme ID */ + workflowSchemeId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getProjectsByPriorityScheme.ts b/src/version2/parameters/getProjectsByPriorityScheme.ts new file mode 100644 index 0000000000..6bbbf10e42 --- /dev/null +++ b/src/version2/parameters/getProjectsByPriorityScheme.ts @@ -0,0 +1,12 @@ +export interface GetProjectsByPriorityScheme { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: string; + /** The maximum number of items to return per page. */ + maxResults?: string; + /** The project IDs to filter by. For example, `projectId=10000&projectId=10001`. */ + projectId?: number[]; + /** The priority scheme ID. */ + schemeId: string; + /** The string to query projects on by name. */ + query?: string; +} diff --git a/src/version2/parameters/getRelatedWork.ts b/src/version2/parameters/getRelatedWork.ts new file mode 100644 index 0000000000..b6388182d0 --- /dev/null +++ b/src/version2/parameters/getRelatedWork.ts @@ -0,0 +1,4 @@ +export interface GetRelatedWork { + /** The ID of the version. */ + id: string; +} diff --git a/src/version2/parameters/getResolution.ts b/src/version2/parameters/getResolution.ts new file mode 100644 index 0000000000..13eba23264 --- /dev/null +++ b/src/version2/parameters/getResolution.ts @@ -0,0 +1,4 @@ +export interface GetResolution { + /** The ID of the issue resolution value. */ + id: string; +} diff --git a/src/version2/parameters/getTeams.ts b/src/version2/parameters/getTeams.ts new file mode 100644 index 0000000000..289f646714 --- /dev/null +++ b/src/version2/parameters/getTeams.ts @@ -0,0 +1,8 @@ +export interface GetTeams { + /** The ID of the plan. */ + planId: number; + /** The cursor to start from. If not provided, the first page will be returned. */ + cursor?: string; + /** The maximum number of plan teams to return per page. The maximum value is 50. The default value is 50. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getWorkflowProjectIssueTypeUsages.ts b/src/version2/parameters/getWorkflowProjectIssueTypeUsages.ts new file mode 100644 index 0000000000..42ce81e475 --- /dev/null +++ b/src/version2/parameters/getWorkflowProjectIssueTypeUsages.ts @@ -0,0 +1,10 @@ +export interface GetWorkflowProjectIssueTypeUsages { + /** The workflow ID */ + workflowId: string; + /** The project ID */ + projectId: number; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getWorkflowSchemeUsagesForWorkflow.ts b/src/version2/parameters/getWorkflowSchemeUsagesForWorkflow.ts new file mode 100644 index 0000000000..dae488d332 --- /dev/null +++ b/src/version2/parameters/getWorkflowSchemeUsagesForWorkflow.ts @@ -0,0 +1,8 @@ +export interface GetWorkflowSchemeUsagesForWorkflow { + /** The workflow ID */ + workflowId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getWorkflowUsagesForStatus.ts b/src/version2/parameters/getWorkflowUsagesForStatus.ts new file mode 100644 index 0000000000..cdfb21d971 --- /dev/null +++ b/src/version2/parameters/getWorkflowUsagesForStatus.ts @@ -0,0 +1,8 @@ +export interface GetWorkflowUsagesForStatus { + /** The statusId to fetch workflow usages for */ + statusId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/putForgeAppProperty.ts b/src/version2/parameters/putForgeAppProperty.ts new file mode 100644 index 0000000000..7a584bc7e9 --- /dev/null +++ b/src/version2/parameters/putForgeAppProperty.ts @@ -0,0 +1,4 @@ +export interface PutForgeAppProperty { + /** The key of the property. */ + propertyKey: string; +} diff --git a/src/version2/parameters/readWorkflowSchemes.ts b/src/version2/parameters/readWorkflowSchemes.ts new file mode 100644 index 0000000000..85984b43fe --- /dev/null +++ b/src/version2/parameters/readWorkflowSchemes.ts @@ -0,0 +1,14 @@ +import { WorkflowSchemeReadRequest } from '../models'; + +export interface ReadWorkflowSchemes extends WorkflowSchemeReadRequest { + /** + * Deprecated. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) for details. + * + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `workflows.usages` Returns the project and issue types that each workflow in the workflow scheme is associated + * with. + */ + expand?: string; +} diff --git a/src/version2/parameters/removeAtlassianTeam.ts b/src/version2/parameters/removeAtlassianTeam.ts new file mode 100644 index 0000000000..02650c1553 --- /dev/null +++ b/src/version2/parameters/removeAtlassianTeam.ts @@ -0,0 +1,6 @@ +export interface RemoveAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the Atlassian team. */ + atlassianTeamId: string; +} diff --git a/src/version2/parameters/removeDefaultProjectClassification.ts b/src/version2/parameters/removeDefaultProjectClassification.ts new file mode 100644 index 0000000000..103f00b406 --- /dev/null +++ b/src/version2/parameters/removeDefaultProjectClassification.ts @@ -0,0 +1,4 @@ +export interface RemoveDefaultProjectClassification { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; +} diff --git a/src/version2/parameters/replaceCustomFieldOption.ts b/src/version2/parameters/replaceCustomFieldOption.ts new file mode 100644 index 0000000000..aa7b88be53 --- /dev/null +++ b/src/version2/parameters/replaceCustomFieldOption.ts @@ -0,0 +1,12 @@ +export interface ReplaceCustomFieldOption { + /** The ID of the option that will replace the currently selected option. */ + replaceWith?: number; + /** A JQL query that specifies the issues to be updated. For example, _project=10000_. */ + jql?: string; + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the option to be deselected. */ + optionId: number; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/searchAndReconsileIssuesUsingJql.ts b/src/version2/parameters/searchAndReconsileIssuesUsingJql.ts new file mode 100644 index 0000000000..730c48f43d --- /dev/null +++ b/src/version2/parameters/searchAndReconsileIssuesUsingJql.ts @@ -0,0 +1,65 @@ +export interface SearchAndReconsileIssuesUsingJql { + /** + * A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a + * bounded query. A bounded query is a query with a search restriction. + * + * Example of an unbounded query: `order by key desc`. Example of a bounded query: `assignee = currentUser() order + * by key`. + * + * Additionally, `orderBy` clause can contain a maximum of 7 fields. + */ + jql?: string; + /** + * The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. Use the + * `nextPageToken` to fetch the next page of issues. + */ + nextPageToken?: string; + /** + * The maximum number of items to return per page. To manage page size, API may return fewer items per page where a + * large number of fields are requested. The greatest number of items returned per page is achieved when requesting + * `id` or `key` only. It returns max 5000 issues. + */ + maxResults?: number; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * `*all` Returns all fields. `*navigable` Returns navigable fields. `id` Returns only issue IDs. Any issue field, + * prefixed with a minus to exclude. + * + * The default is `id`. + * + * Examples: + * + * `summary,comment` Returns only the summary and comments fields 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: By default, this resource returns IDs only. 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. Note that, unlike the majority of instances where `expand` is + * specified, `expand` is defined as a comma-delimited string of values. The expand options are: + * + * `renderedFields` Returns field values rendered in HTML format. `names` Returns the display name of each field. + * `schema` Returns the schema describing a field type. `transitions` Returns all possible transitions for the + * issue. `operations` Returns all possible operations for the issue. `editmeta` Returns information about how each + * field can be edited. `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the + * most recent. `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array + * containing each version of a field's value, with the highest numbered item representing the most recent version. + * + * Examples: `"names,changelog"` Returns the display name of each field as well as a list of recent updates to an issue. + */ + expand?: string; + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties?: string[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; + /** Fail this request early if we can't retrieve all field data. */ + failFast?: boolean; + /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids. All issues must exist. */ + reconcileIssues?: number[]; +} diff --git a/src/version2/parameters/searchAndReconsileIssuesUsingJqlPost.ts b/src/version2/parameters/searchAndReconsileIssuesUsingJqlPost.ts new file mode 100644 index 0000000000..f839145d60 --- /dev/null +++ b/src/version2/parameters/searchAndReconsileIssuesUsingJqlPost.ts @@ -0,0 +1,3 @@ +import { SearchAndReconcileRequestBean } from '../models'; + +export interface SearchAndReconsileIssuesUsingJqlPost extends SearchAndReconcileRequestBean {} diff --git a/src/version2/parameters/searchForIssuesIds.ts b/src/version2/parameters/searchForIssuesIds.ts new file mode 100644 index 0000000000..9127fa13c0 --- /dev/null +++ b/src/version2/parameters/searchForIssuesIds.ts @@ -0,0 +1,3 @@ +import { IdSearchRequestBean } from '../models'; + +export interface SearchForIssuesIds extends IdSearchRequestBean {} diff --git a/src/version2/parameters/searchWorkflows.ts b/src/version2/parameters/searchWorkflows.ts new file mode 100644 index 0000000000..b0c6e94475 --- /dev/null +++ b/src/version2/parameters/searchWorkflows.ts @@ -0,0 +1,25 @@ +export interface SearchWorkflows { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `values.transitions` Returns the transitions that each workflow is associated with. + */ + expand?: string; + /** String used to perform a case-insensitive partial match with workflow name. */ + queryString?: string; + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * `name` Sorts by workflow name. `created` Sorts by create time. `updated` Sorts by update time. + */ + orderBy?: string; + /** The scope of the workflow. Global for company-managed projects and Project for team-managed projects. */ + scope?: string; + /** Filters active and inactive workflows. */ + isActive?: boolean; +} diff --git a/src/version2/parameters/services.ts b/src/version2/parameters/services.ts new file mode 100644 index 0000000000..296a9d0439 --- /dev/null +++ b/src/version2/parameters/services.ts @@ -0,0 +1,4 @@ +export interface Services { + /** The ID of the services (the strings starting with "b:" need to be decoded in Base64). */ + serviceIds: string[]; +} diff --git a/src/version2/parameters/setLocale.ts b/src/version2/parameters/setLocale.ts new file mode 100644 index 0000000000..b4a9b9c8b2 --- /dev/null +++ b/src/version2/parameters/setLocale.ts @@ -0,0 +1,3 @@ +import { Locale } from '../models'; + +export interface SetLocale extends Locale {} diff --git a/src/version2/parameters/suggestedPrioritiesForMappings.ts b/src/version2/parameters/suggestedPrioritiesForMappings.ts new file mode 100644 index 0000000000..d24049c5ce --- /dev/null +++ b/src/version2/parameters/suggestedPrioritiesForMappings.ts @@ -0,0 +1,3 @@ +import { SuggestedMappingsRequestBean } from '../models'; + +export interface SuggestedPrioritiesForMappings extends SuggestedMappingsRequestBean {} diff --git a/src/version2/parameters/trashPlan.ts b/src/version2/parameters/trashPlan.ts new file mode 100644 index 0000000000..e960cc100a --- /dev/null +++ b/src/version2/parameters/trashPlan.ts @@ -0,0 +1,4 @@ +export interface TrashPlan { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version2/parameters/updateAtlassianTeam.ts b/src/version2/parameters/updateAtlassianTeam.ts new file mode 100644 index 0000000000..d5a9fb9dfe --- /dev/null +++ b/src/version2/parameters/updateAtlassianTeam.ts @@ -0,0 +1,6 @@ +export interface UpdateAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the Atlassian team. */ + atlassianTeamId: string; +} diff --git a/src/version2/parameters/updateDefaultProjectClassification.ts b/src/version2/parameters/updateDefaultProjectClassification.ts new file mode 100644 index 0000000000..dc4ae8e91a --- /dev/null +++ b/src/version2/parameters/updateDefaultProjectClassification.ts @@ -0,0 +1,6 @@ +import { UpdateDefaultProjectClassificationBean } from '../models'; + +export interface UpdateDefaultProjectClassification extends UpdateDefaultProjectClassificationBean { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; +} diff --git a/src/version2/parameters/updatePlan.ts b/src/version2/parameters/updatePlan.ts new file mode 100644 index 0000000000..0f21fc0003 --- /dev/null +++ b/src/version2/parameters/updatePlan.ts @@ -0,0 +1,6 @@ +export interface UpdatePlan { + /** The ID of the plan. */ + planId: number; + /** Whether to accept group IDs instead of group names. Group names are deprecated. */ + useGroupId?: boolean; +} diff --git a/src/version2/parameters/updatePlanOnlyTeam.ts b/src/version2/parameters/updatePlanOnlyTeam.ts new file mode 100644 index 0000000000..7e4b3b5820 --- /dev/null +++ b/src/version2/parameters/updatePlanOnlyTeam.ts @@ -0,0 +1,6 @@ +export interface UpdatePlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the plan-only team. */ + planOnlyTeamId: number; +} diff --git a/src/version2/parameters/updatePriorityScheme.ts b/src/version2/parameters/updatePriorityScheme.ts new file mode 100644 index 0000000000..a43e200c25 --- /dev/null +++ b/src/version2/parameters/updatePriorityScheme.ts @@ -0,0 +1,6 @@ +import { UpdatePrioritySchemeRequestBean } from '../models'; + +export interface UpdatePriorityScheme extends UpdatePrioritySchemeRequestBean { + /** The ID of the priority scheme. */ + schemeId: number; +} diff --git a/src/version2/parameters/updateRelatedWork.ts b/src/version2/parameters/updateRelatedWork.ts new file mode 100644 index 0000000000..4d0d5a170b --- /dev/null +++ b/src/version2/parameters/updateRelatedWork.ts @@ -0,0 +1,6 @@ +import { VersionRelatedWork } from '../models'; + +export interface UpdateRelatedWork extends VersionRelatedWork { + /** The ID of the version to update the related work on. For the related work id, pass it to the input JSON. */ + id: string; +} diff --git a/src/version2/parameters/updateSchemes.ts b/src/version2/parameters/updateSchemes.ts new file mode 100644 index 0000000000..7f9610918f --- /dev/null +++ b/src/version2/parameters/updateSchemes.ts @@ -0,0 +1,3 @@ +import { WorkflowSchemeUpdateRequest } from '../models'; + +export interface UpdateSchemes extends WorkflowSchemeUpdateRequest {} diff --git a/src/version2/parameters/updateWorkflowSchemeMappings.ts b/src/version2/parameters/updateWorkflowSchemeMappings.ts new file mode 100644 index 0000000000..de0323e16e --- /dev/null +++ b/src/version2/parameters/updateWorkflowSchemeMappings.ts @@ -0,0 +1,3 @@ +import { WorkflowSchemeUpdateRequiredMappingsRequest } from '../models'; + +export interface UpdateWorkflowSchemeMappings extends WorkflowSchemeUpdateRequiredMappingsRequest {} diff --git a/src/version2/permissionSchemes.ts b/src/version2/permissionSchemes.ts index ed13243b0e..23d978d498 100644 --- a/src/version2/permissionSchemes.ts +++ b/src/version2/permissionSchemes.ts @@ -6,7 +6,6 @@ import { RequestConfig } from '../requestConfig'; export class PermissionSchemes { constructor(private client: Client) {} - /** * Returns all permission schemes. * @@ -20,8 +19,9 @@ export class PermissionSchemes { * The `holder` object contains information about the user or group being granted the permission. For example, the * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and - * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the - * following properties: + * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. + * + * The `holder` object is defined by the following properties: * * - `type` Identifies the user or group (see the list of types below). * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the @@ -130,8 +130,9 @@ export class PermissionSchemes { * The `holder` object contains information about the user or group being granted the permission. For example, the * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and - * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the - * following properties: + * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. + * + * The `holder` object is defined by the following properties: * * - `type` Identifies the user or group (see the list of types below). * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the @@ -241,7 +242,6 @@ export class PermissionSchemes { 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. @@ -274,15 +274,11 @@ export class PermissionSchemes { params: { expand: parameters?.expand, }, - data: { - ...parameters, - expand: undefined, - }, + data: parameters?.body, }; return this.client.sendRequest(config, callback); } - /** * Returns a permission scheme. * @@ -290,7 +286,7 @@ export class PermissionSchemes { * Permission to access Jira. */ async getPermissionScheme( - parameters: Parameters.GetPermissionScheme | string, + parameters: Parameters.GetPermissionScheme, callback: Callback, ): Promise; /** @@ -300,26 +296,23 @@ export class PermissionSchemes { * Permission to access Jira. */ async getPermissionScheme( - parameters: Parameters.GetPermissionScheme | string, + parameters: Parameters.GetPermissionScheme, callback?: never, ): Promise; async getPermissionScheme( - parameters: Parameters.GetPermissionScheme | string, + parameters: Parameters.GetPermissionScheme, callback?: Callback, ): Promise { - const schemeId = typeof parameters === 'string' ? parameters : parameters.schemeId; - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${schemeId}`, + url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: parameters.expand, }, }; return this.client.sendRequest(config, callback); } - /** * Updates a permission scheme. Below are some important things to note when using this resource: * @@ -374,16 +367,11 @@ export class PermissionSchemes { params: { expand: parameters.expand, }, - data: { - ...parameters, - schemeId: undefined, - expand: undefined, - }, + data: parameters.body, }; return this.client.sendRequest(config, callback); } - /** * Deletes a permission scheme. * @@ -412,7 +400,6 @@ export class PermissionSchemes { return this.client.sendRequest(config, callback); } - /** * Returns all permission grants for a permission scheme. * @@ -447,7 +434,6 @@ export class PermissionSchemes { return this.client.sendRequest(config, callback); } - /** * Creates a permission grant in a permission scheme. * @@ -479,16 +465,15 @@ export class PermissionSchemes { expand: parameters.expand, }, data: { - id: parameters.id, - self: parameters.self, holder: parameters.holder, + id: parameters.id, permission: parameters.permission, + self: parameters.self, }, }; return this.client.sendRequest(config, callback); } - /** * Returns a permission grant. * @@ -523,7 +508,6 @@ export class PermissionSchemes { 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. diff --git a/src/version2/permissions.ts b/src/version2/permissions.ts index e74c241564..c3f4d594a2 100644 --- a/src/version2/permissions.ts +++ b/src/version2/permissions.ts @@ -6,7 +6,6 @@ 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. @@ -28,6 +27,12 @@ export class Permissions { * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they * would not have EDIT_ISSUES permission for that issue. * + * For [Jira Service Management project + * permissions](https://support.atlassian.com/jira-cloud-administration/docs/customize-jira-service-management-permissions/), + * this will be evaluated similarly to a user in the customer portal. For example, if the BROWSE_PROJECTS permission + * is granted to Service Project Customer - Portal Access, any users with access to the customer portal will have the + * BROWSE_PROJECTS permission. + * * Global permissions are unaffected by context. * * This operation can be accessed anonymously. @@ -59,6 +64,12 @@ export class Permissions { * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they * would not have EDIT_ISSUES permission for that issue. * + * For [Jira Service Management project + * permissions](https://support.atlassian.com/jira-cloud-administration/docs/customize-jira-service-management-permissions/), + * this will be evaluated similarly to a user in the customer portal. For example, if the BROWSE_PROJECTS permission + * is granted to Service Project Customer - Portal Access, any users with access to the customer portal will have the + * BROWSE_PROJECTS permission. + * * Global permissions are unaffected by context. * * This operation can be accessed anonymously. @@ -90,7 +101,6 @@ export class Permissions { return this.client.sendRequest(config, callback); } - /** * Returns all permissions, including: * @@ -98,8 +108,9 @@ export class Permissions { * - Project permissions. * - Global permissions added by plugins. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAllPermissions(callback: Callback): Promise; /** @@ -109,8 +120,9 @@ export class Permissions { * - Project permissions. * - Global permissions added by plugins. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAllPermissions(callback?: never): Promise; async getAllPermissions(callback?: Callback): Promise { @@ -121,7 +133,6 @@ export class Permissions { return this.client.sendRequest(config, callback); } - /** * Returns: * @@ -139,6 +150,11 @@ export class Permissions { * `projectPermissions.issues` are ignored. * - Empty strings in `projectPermissions.permissions` are ignored. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - **Classic**: `read:jira-work` + * - **Granular**: `read:permission:jira` + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -168,6 +184,11 @@ export class Permissions { * `projectPermissions.issues` are ignored. * - Empty strings in `projectPermissions.permissions` are ignored. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - **Classic**: `read:jira-work` + * - **Granular**: `read:permission:jira` + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -188,15 +209,14 @@ export class Permissions { url: '/rest/api/2/permissions/check', method: 'POST', data: { - projectPermissions: parameters?.projectPermissions, - globalPermissions: parameters?.globalPermissions, accountId: parameters?.accountId, + globalPermissions: parameters?.globalPermissions, + projectPermissions: parameters?.projectPermissions, }, }; return this.client.sendRequest(config, callback); } - /** * Returns all the projects where the user is granted a list of project permissions. * diff --git a/src/version2/plans.ts b/src/version2/plans.ts new file mode 100644 index 0000000000..9b8f8f8527 --- /dev/null +++ b/src/version2/plans.ts @@ -0,0 +1,292 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class Plans { + constructor(private client: Client) {} + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of plans. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlans( + parameters: Parameters.GetPlans | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of plans. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlans( + parameters?: Parameters.GetPlans, + callback?: never, + ): Promise; + async getPlans( + parameters?: Parameters.GetPlans, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/plans/plan', + method: 'GET', + params: { + includeTrashed: parameters?.includeTrashed, + includeArchived: parameters?.includeArchived, + cursor: parameters?.cursor, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Creates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlan(parameters: Parameters.CreatePlan | undefined, callback: Callback): Promise; + /** + * Creates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlan(parameters?: Parameters.CreatePlan, callback?: never): Promise; + async createPlan(parameters?: Parameters.CreatePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/plans/plan', + method: 'POST', + params: { + useGroupId: parameters?.useGroupId, + }, + data: { + crossProjectReleases: parameters?.crossProjectReleases, + customFields: parameters?.customFields, + exclusionRules: parameters?.exclusionRules, + issueSources: parameters?.issueSources, + leadAccountId: parameters?.leadAccountId, + name: parameters?.name, + permissions: parameters?.permissions, + scheduling: parameters?.scheduling, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Returns a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlan(parameters: Parameters.GetPlan, callback: Callback): Promise; + /** + * Returns a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlan(parameters: Parameters.GetPlan, callback?: never): Promise; + async getPlan(parameters: Parameters.GetPlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}`, + method: 'GET', + params: { + useGroupId: parameters.useGroupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Updates any of the following details of a plan using [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - LeadAccountId + * - Scheduling + * + * - Estimation with StoryPoints, Days or Hours as possible values + * - StartDate + * + * - Type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values + * - DateCustomFieldId + * - EndDate + * + * - Type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values + * - DateCustomFieldId + * - InferredDates with None, SprintDates or ReleaseDates as possible values + * - Dependencies with Sequential or Concurrent as possible values + * - IssueSources + * + * - Type with Board, Project or Filter as possible values + * - Value + * - ExclusionRules + * + * - NumberOfDaysToShowCompletedIssues + * - IssueIds + * - WorkStatusIds + * - WorkStatusCategoryIds + * - IssueTypeIds + * - ReleaseIds + * - CrossProjectReleases + * + * - Name + * - ReleaseIds + * - CustomFields + * + * - CustomFieldId + * - Filter + * - Permissions + * + * - Type with View or Edit as possible values + * - Holder + * + * - Type with Group or AccountId as possible values + * - Value + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan" endpoint to find + * out the order of array elements._ + */ + async updatePlan(parameters: Parameters.UpdatePlan, callback: Callback): Promise; + /** + * Updates any of the following details of a plan using [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - LeadAccountId + * - Scheduling + * + * - Estimation with StoryPoints, Days or Hours as possible values + * - StartDate + * + * - Type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values + * - DateCustomFieldId + * - EndDate + * + * - Type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values + * - DateCustomFieldId + * - InferredDates with None, SprintDates or ReleaseDates as possible values + * - Dependencies with Sequential or Concurrent as possible values + * - IssueSources + * + * - Type with Board, Project or Filter as possible values + * - Value + * - ExclusionRules + * + * - NumberOfDaysToShowCompletedIssues + * - IssueIds + * - WorkStatusIds + * - WorkStatusCategoryIds + * - IssueTypeIds + * - ReleaseIds + * - CrossProjectReleases + * + * - Name + * - ReleaseIds + * - CustomFields + * + * - CustomFieldId + * - Filter + * - Permissions + * + * - Type with View or Edit as possible values + * - Holder + * + * - Type with Group or AccountId as possible values + * - Value + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan" endpoint to find + * out the order of array elements._ + */ + async updatePlan(parameters: Parameters.UpdatePlan, callback?: never): Promise; + async updatePlan(parameters: Parameters.UpdatePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}`, + method: 'PUT', + params: { + useGroupId: parameters.useGroupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Archives a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archivePlan(parameters: Parameters.ArchivePlan, callback: Callback): Promise; + /** + * Archives a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archivePlan(parameters: Parameters.ArchivePlan, callback?: never): Promise; + async archivePlan(parameters: Parameters.ArchivePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/archive`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + /** + * Duplicates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async duplicatePlan(parameters: Parameters.DuplicatePlan, callback: Callback): Promise; + /** + * Duplicates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async duplicatePlan(parameters: Parameters.DuplicatePlan, callback?: never): Promise; + async duplicatePlan(parameters: Parameters.DuplicatePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/duplicate`, + method: 'POST', + data: { + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Moves a plan to trash. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashPlan(parameters: Parameters.TrashPlan, callback: Callback): Promise; + /** + * Moves a plan to trash. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashPlan(parameters: Parameters.TrashPlan, callback?: never): Promise; + async trashPlan(parameters: Parameters.TrashPlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/trash`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/prioritySchemes.ts b/src/version2/prioritySchemes.ts new file mode 100644 index 0000000000..643bdf5ee3 --- /dev/null +++ b/src/version2/prioritySchemes.ts @@ -0,0 +1,320 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class PrioritySchemes { + constructor(private client: Client) {} + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priority schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritySchemes( + parameters: Parameters.GetPrioritySchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priority schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritySchemes( + parameters?: Parameters.GetPrioritySchemes, + callback?: never, + ): Promise; + async getPrioritySchemes( + parameters?: Parameters.GetPrioritySchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priorityscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + priorityId: parameters?.priorityId, + schemeId: parameters?.schemeId, + schemeName: parameters?.schemeName, + onlyDefault: parameters?.onlyDefault, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Creates a new priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPriorityScheme( + parameters: Parameters.CreatePriorityScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates a new priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPriorityScheme( + parameters?: Parameters.CreatePriorityScheme, + callback?: never, + ): Promise; + async createPriorityScheme( + parameters?: Parameters.CreatePriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priorityscheme', + method: 'POST', + data: { + defaultPriorityId: parameters?.defaultPriorityId, + description: parameters?.description, + mappings: parameters?.mappings, + name: parameters?.name, + priorityIds: parameters?.priorityIds, + projectIds: parameters?.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities that would require mapping, given a change in priorities or projects associated with a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async suggestedPrioritiesForMappings( + parameters: Parameters.SuggestedPrioritiesForMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities that would require mapping, given a change in priorities or projects associated with a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async suggestedPrioritiesForMappings( + parameters?: Parameters.SuggestedPrioritiesForMappings, + callback?: never, + ): Promise; + async suggestedPrioritiesForMappings( + parameters?: Parameters.SuggestedPrioritiesForMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priorityscheme/mappings', + method: 'POST', + data: { + maxResults: parameters?.maxResults, + priorities: parameters?.priorities, + projects: parameters?.projects, + schemeId: parameters?.schemeId, + startAt: parameters?.startAt, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities available for adding to a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAvailablePrioritiesByPriorityScheme( + parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities available for adding to a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAvailablePrioritiesByPriorityScheme( + parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, + callback?: never, + ): Promise; + async getAvailablePrioritiesByPriorityScheme( + parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priorityscheme/priorities/available', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + query: parameters.query, + schemeId: parameters.schemeId, + exclude: parameters.exclude, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Updates a priority scheme. This includes its details, the lists of priorities and projects in it + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePriorityScheme( + parameters: Parameters.UpdatePriorityScheme, + callback: Callback, + ): Promise; + /** + * Updates a priority scheme. This includes its details, the lists of priorities and projects in it + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePriorityScheme( + parameters: Parameters.UpdatePriorityScheme, + callback?: never, + ): Promise; + async updatePriorityScheme( + parameters: Parameters.UpdatePriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/priorityscheme/${parameters.schemeId}`, + method: 'PUT', + data: { + defaultPriorityId: parameters.defaultPriorityId, + description: parameters.description, + mappings: parameters.mappings, + name: parameters.name, + priorities: parameters.priorities, + projects: parameters.projects, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Deletes a priority scheme. + * + * This operation is only available for priority schemes without any associated projects. Any associated projects must + * be removed from the priority scheme before this operation can be performed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriorityScheme( + parameters: Parameters.DeletePriorityScheme, + callback: Callback, + ): Promise; + /** + * Deletes a priority scheme. + * + * This operation is only available for priority schemes without any associated projects. Any associated projects must + * be removed from the priority scheme before this operation can be performed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriorityScheme(parameters: Parameters.DeletePriorityScheme, callback?: never): Promise; + async deletePriorityScheme( + parameters: Parameters.DeletePriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/priorityscheme/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritiesByPriorityScheme( + parameters: Parameters.GetPrioritiesByPriorityScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritiesByPriorityScheme( + parameters: Parameters.GetPrioritiesByPriorityScheme, + callback?: never, + ): Promise; + async getPrioritiesByPriorityScheme( + parameters: Parameters.GetPrioritiesByPriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/priorityscheme/${parameters.schemeId}/priorities`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * projects by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectsByPriorityScheme( + parameters: Parameters.GetProjectsByPriorityScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * projects by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectsByPriorityScheme( + parameters: Parameters.GetProjectsByPriorityScheme, + callback?: never, + ): Promise; + async getProjectsByPriorityScheme( + parameters: Parameters.GetProjectsByPriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/priorityscheme/${parameters.schemeId}/projects`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + query: parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectClassificationLevels.ts b/src/version2/projectClassificationLevels.ts new file mode 100644 index 0000000000..1b2fb798cd --- /dev/null +++ b/src/version2/projectClassificationLevels.ts @@ -0,0 +1,119 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class ProjectClassificationLevels { + constructor(private client: Client) {} + /** + * Returns the default data classification for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultProjectClassification( + parameters: Parameters.GetDefaultProjectClassification, + callback: Callback, + ): Promise; + /** + * Returns the default data classification for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultProjectClassification( + parameters: Parameters.GetDefaultProjectClassification, + callback?: never, + ): Promise; + async getDefaultProjectClassification( + parameters: Parameters.GetDefaultProjectClassification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/classification-level/default`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + /** + * Updates the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultProjectClassification( + parameters: Parameters.UpdateDefaultProjectClassification, + callback: Callback, + ): Promise; + /** + * Updates the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultProjectClassification( + parameters: Parameters.UpdateDefaultProjectClassification, + callback?: never, + ): Promise; + async updateDefaultProjectClassification( + parameters: Parameters.UpdateDefaultProjectClassification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/classification-level/default`, + method: 'PUT', + data: { + id: parameters.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Remove the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeDefaultProjectClassification( + parameters: Parameters.RemoveDefaultProjectClassification, + callback: Callback, + ): Promise; + /** + * Remove the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeDefaultProjectClassification( + parameters: Parameters.RemoveDefaultProjectClassification, + callback?: never, + ): Promise; + async removeDefaultProjectClassification( + parameters: Parameters.RemoveDefaultProjectClassification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/classification-level/default`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectComponents.ts b/src/version2/projectComponents.ts index 3d54a1b08a..6aac6dad19 100644 --- a/src/version2/projectComponents.ts +++ b/src/version2/projectComponents.ts @@ -6,9 +6,53 @@ import { RequestConfig } from '../requestConfig'; export class ProjectComponents { constructor(private client: Client) {} + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * components in a project, including global (Compass) components when applicable. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async findComponentsForProjects( + parameters: Parameters.FindComponentsForProjects | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * components in a project, including global (Compass) components when applicable. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async findComponentsForProjects( + parameters?: Parameters.FindComponentsForProjects, + callback?: never, + ): Promise; + async findComponentsForProjects( + parameters?: Parameters.FindComponentsForProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/component', + method: 'GET', + params: { + projectIdsOrKeys: parameters?.projectIdsOrKeys, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + orderBy: parameters?.orderBy, + query: parameters?.query, + }, + }; + return this.client.sendRequest(config, callback); + } /** - * Creates a component. Use components to provide containers for issues within a project. + * Creates a component. Use components to provide containers for issues within a project. Use components to provide + * containers for issues within a project. * * This operation can be accessed anonymously. * @@ -17,11 +61,12 @@ export class ProjectComponents { * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createComponent( - parameters: Parameters.CreateComponent, + parameters: Parameters.CreateComponent | undefined, callback: Callback, ): Promise; /** - * Creates a component. Use components to provide containers for issues within a project. + * Creates a component. Use components to provide containers for issues within a project. Use components to provide + * containers for issues within a project. * * This operation can be accessed anonymously. * @@ -30,37 +75,38 @@ export class ProjectComponents { * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createComponent( - parameters: Parameters.CreateComponent, + parameters?: Parameters.CreateComponent, callback?: never, ): Promise; async createComponent( - parameters: Parameters.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, + ari: parameters?.ari, + assignee: parameters?.assignee, + assigneeType: parameters?.assigneeType, + description: parameters?.description, + id: parameters?.id, + isAssigneeTypeValid: parameters?.isAssigneeTypeValid, + lead: parameters?.lead, + leadAccountId: parameters?.leadAccountId, + leadUserName: parameters?.leadUserName, + metadata: parameters?.metadata, + name: parameters?.name, + project: parameters?.project, + projectId: parameters?.projectId, + realAssignee: parameters?.realAssignee, + realAssigneeType: parameters?.realAssigneeType, + self: parameters?.self, }, }; return this.client.sendRequest(config, callback); } - /** * Returns a component. * @@ -70,7 +116,7 @@ export class ProjectComponents { * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. */ async getComponent( - parameters: Parameters.GetComponent | string, + parameters: Parameters.GetComponent, callback: Callback, ): Promise; /** @@ -81,24 +127,18 @@ export class ProjectComponents { * **[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, callback?: never): Promise; async getComponent( - parameters: Parameters.GetComponent | string, - callback?: never, - ): Promise; - async getComponent( - parameters: Parameters.GetComponent | string, + parameters: Parameters.GetComponent, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/component/${id}`, + url: `/rest/api/2/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. @@ -134,19 +174,11 @@ export class ProjectComponents { 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, - }, + data: parameters.body, }; return this.client.sendRequest(config, callback); } - /** * Deletes a component. * @@ -156,10 +188,7 @@ export class ProjectComponents { * _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; + async deleteComponent(parameters: Parameters.DeleteComponent, callback: Callback): Promise; /** * Deletes a component. * @@ -169,33 +198,32 @@ export class ProjectComponents { * _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; - + async deleteComponent(parameters: Parameters.DeleteComponent, callback?: never): Promise; + async deleteComponent(parameters: Parameters.DeleteComponent, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/component/${id}`, + url: `/rest/api/2/component/${parameters.id}`, method: 'DELETE', params: { - moveIssuesTo: typeof parameters !== 'string' && parameters.moveIssuesTo, + moveIssuesTo: parameters.moveIssuesTo, }, }; return this.client.sendRequest(config, callback); } - /** * Returns the counts of issues assigned to the component. * * This operation can be accessed anonymously. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - **Classic**: `read:jira-work` + * - **Granular**: `read:field:jira`, `read:project.component:jira` + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues | string, + parameters: Parameters.GetComponentRelatedIssues, callback: Callback, ): Promise; /** @@ -203,31 +231,36 @@ export class ProjectComponents { * * This operation can be accessed anonymously. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - **Classic**: `read:jira-work` + * - **Granular**: `read:field:jira`, `read:project.component:jira` + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues | string, + parameters: Parameters.GetComponentRelatedIssues, callback?: never, ): Promise; async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues | string, + parameters: Parameters.GetComponentRelatedIssues, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/component/${id}/relatedIssueCounts`, + url: `/rest/api/2/component/${parameters.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. * + * If your project uses Compass components, this API will return a list of Compass components that are linked to + * issues in that project. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse @@ -242,6 +275,9 @@ export class ProjectComponents { * components in a project. See the [Get project components](#api-rest-api-2-project-projectIdOrKey-components-get) * resource if you want to get a full list of versions without pagination. * + * If your project uses Compass components, this API will return a list of Compass components that are linked to + * issues in that project. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse @@ -262,25 +298,28 @@ export class ProjectComponents { startAt: parameters.startAt, maxResults: parameters.maxResults, orderBy: parameters.orderBy, + componentSource: parameters.componentSource, 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. * + * If your project uses Compass components, this API will return a paginated list of Compass components that are + * linked to issues in that project. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectComponents( - parameters: Parameters.GetProjectComponents | string, + parameters: Parameters.GetProjectComponents, callback: Callback, ): Promise; /** @@ -288,24 +327,28 @@ export class ProjectComponents { * paginated](#api-rest-api-2-project-projectIdOrKey-component-get) resource if you want to get a full list of * components with pagination. * + * If your project uses Compass components, this API will return a paginated list of Compass components that are + * linked to issues in that project. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectComponents( - parameters: Parameters.GetProjectComponents | string, + parameters: Parameters.GetProjectComponents, callback?: never, ): Promise; async getProjectComponents( - parameters: Parameters.GetProjectComponents | string, + parameters: Parameters.GetProjectComponents, callback?: Callback, ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/components`, + url: `/rest/api/2/project/${parameters.projectIdOrKey}/components`, method: 'GET', + params: { + componentSource: parameters.componentSource, + }, }; return this.client.sendRequest(config, callback); diff --git a/src/version2/projectEmail.ts b/src/version2/projectEmail.ts index cd2f9cd8ef..477013da8f 100644 --- a/src/version2/projectEmail.ts +++ b/src/version2/projectEmail.ts @@ -6,7 +6,6 @@ import { RequestConfig } from '../requestConfig'; export class ProjectEmail { constructor(private client: Client) {} - /** * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). * @@ -14,7 +13,7 @@ export class ProjectEmail { * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, + parameters: Parameters.GetProjectEmail, callback: Callback, ): Promise; /** @@ -24,30 +23,28 @@ export class ProjectEmail { * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, + parameters: Parameters.GetProjectEmail, callback?: never, ): Promise; async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, + parameters: Parameters.GetProjectEmail, callback?: Callback, ): Promise { - const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; - const config: RequestConfig = { - url: `/rest/api/2/project/${projectId}/email`, + url: `/rest/api/2/project/${parameters.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. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission.](https://confluence.atlassian.com/x/yodKLg) */ async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback: Callback): Promise; /** @@ -55,8 +52,9 @@ export class ProjectEmail { * * If `emailAddress` is an empty string, the default email address is restored. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission.](https://confluence.atlassian.com/x/yodKLg) */ async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback?: never): Promise; async updateProjectEmail( diff --git a/src/version2/projectRoles.ts b/src/version2/projectRoles.ts index 7317e23330..c32cd7636d 100644 --- a/src/version2/projectRoles.ts +++ b/src/version2/projectRoles.ts @@ -6,10 +6,10 @@ import { RequestConfig } from '../requestConfig'; export class ProjectRoles { constructor(private client: Client) {} - /** - * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and - * self URL for each role. + * Returns a list of [project + * roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) for the project + * returning the name and self URL for each role. * * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project * roles](#api-rest-api-2-role-get) for more information. @@ -20,13 +20,11 @@ export class ProjectRoles { * _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; + async getProjectRoles(parameters: Parameters.GetProjectRoles, callback: Callback): Promise; /** - * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and - * self URL for each role. + * Returns a list of [project + * roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) for the project + * returning the name and self URL for each role. * * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project * roles](#api-rest-api-2-role-get) for more information. @@ -37,24 +35,18 @@ export class ProjectRoles { * _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, + async getProjectRoles(parameters: Parameters.GetProjectRoles, callback?: never): Promise; + async getProjectRoles( + parameters: Parameters.GetProjectRoles, callback?: Callback, ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/role`, + url: `/rest/api/2/project/${parameters.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. @@ -102,10 +94,9 @@ export class ProjectRoles { 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. + * Returns all [project roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) and + * the details for each role. Note that the list of project roles is common to all projects. * * This operation can be accessed anonymously. * @@ -114,12 +105,12 @@ export class ProjectRoles { * permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, + parameters: Parameters.GetProjectRoleDetails, callback: Callback, ): Promise; /** - * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the - * list of project roles is common to all projects. + * Returns all [project roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) and + * the details for each role. Note that the list of project roles is common to all projects. * * This operation can be accessed anonymously. * @@ -128,36 +119,33 @@ export class ProjectRoles { * permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, + parameters: Parameters.GetProjectRoleDetails, callback?: never, ): Promise; async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, + parameters: Parameters.GetProjectRoleDetails, callback?: Callback, ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/roledetails`, + url: `/rest/api/2/project/${parameters.projectIdOrKey}/roledetails`, method: 'GET', params: { - currentMember: typeof parameters !== 'string' && parameters.currentMember, - excludeConnectAddons: typeof parameters !== 'string' && parameters.excludeConnectAddons, + currentMember: parameters.currentMember, + excludeConnectAddons: 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](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) are a flexible + * way to to associate users and groups with projects. In Jira Cloud, the list of project roles is shared globally + * with all projects, but each project can have a different set of actors associated with it (unlike groups, which + * have the same membership throughout all Jira applications). * * Project roles are used in [permission schemes](#api-rest-api-2-permissionscheme-get), [email notification * schemes](#api-rest-api-2-notificationscheme-get), [issue security @@ -170,7 +158,7 @@ export class ProjectRoles { * with a project role. * * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * members](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/#Specifying-'default-members'-for-a-project-role) * of the project role or set at the project level: * * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default @@ -187,10 +175,10 @@ export class ProjectRoles { * * ### About project roles * - * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with - * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have - * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira - * applications). + * [Project roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) are a flexible + * way to to associate users and groups with projects. In Jira Cloud, the list of project roles is shared globally + * with all projects, but each project can have a different set of actors associated with it (unlike groups, which + * have the same membership throughout all Jira applications). * * Project roles are used in [permission schemes](#api-rest-api-2-permissionscheme-get), [email notification * schemes](#api-rest-api-2-notificationscheme-get), [issue security @@ -203,7 +191,7 @@ export class ProjectRoles { * with a project role. * * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * members](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/#Specifying-'default-members'-for-a-project-role) * of the project role or set at the project level: * * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default @@ -223,7 +211,6 @@ export class ProjectRoles { 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 @@ -236,7 +223,7 @@ export class ProjectRoles { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createProjectRole( - parameters: Parameters.CreateProjectRole, + parameters: Parameters.CreateProjectRole | undefined, callback: Callback, ): Promise; /** @@ -251,25 +238,24 @@ export class ProjectRoles { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createProjectRole( - parameters: Parameters.CreateProjectRole, + parameters?: Parameters.CreateProjectRole, callback?: never, ): Promise; async createProjectRole( - parameters: Parameters.CreateProjectRole, + parameters?: Parameters.CreateProjectRole, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/role', method: 'POST', data: { - name: parameters.name, - description: parameters.description, + description: parameters?.description, + name: parameters?.name, }, }; 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. @@ -278,7 +264,7 @@ export class ProjectRoles { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, + parameters: Parameters.GetProjectRoleById, callback: Callback, ): Promise; /** @@ -289,23 +275,20 @@ export class ProjectRoles { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, + parameters: Parameters.GetProjectRoleById, callback?: never, ): Promise; async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, + parameters: Parameters.GetProjectRoleById, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/role/${id}`, + url: `/rest/api/2/role/${parameters.id}`, method: 'GET', }; return this.client.sendRequest(config, callback); } - /** * Updates either the project role's name or its description. * @@ -340,14 +323,13 @@ export class ProjectRoles { url: `/rest/api/2/role/${parameters.id}`, method: 'POST', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; 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. * @@ -376,14 +358,13 @@ export class ProjectRoles { url: `/rest/api/2/role/${parameters.id}`, method: 'PUT', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; 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. @@ -391,10 +372,7 @@ export class ProjectRoles { * **[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; + async deleteProjectRole(parameters: Parameters.DeleteProjectRole, 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. @@ -402,18 +380,16 @@ export class ProjectRoles { * **[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, callback?: never): Promise; async deleteProjectRole( - parameters: Parameters.DeleteProjectRole | string, + parameters: Parameters.DeleteProjectRole, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/role/${id}`, + url: `/rest/api/2/role/${parameters.id}`, method: 'DELETE', params: { - swap: typeof parameters !== 'string' && parameters.swap, + swap: parameters.swap, }, }; diff --git a/src/version2/projectVersions.ts b/src/version2/projectVersions.ts index e182c4d8d1..60532214cf 100644 --- a/src/version2/projectVersions.ts +++ b/src/version2/projectVersions.ts @@ -6,7 +6,6 @@ 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 @@ -18,7 +17,7 @@ export class ProjectVersions { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, + parameters: Parameters.GetProjectVersionsPaginated, callback: Callback, ): Promise; /** @@ -32,31 +31,28 @@ export class ProjectVersions { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, + parameters: Parameters.GetProjectVersionsPaginated, callback?: never, ): Promise; async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, + parameters: Parameters.GetProjectVersionsPaginated, callback?: Callback, ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/version`, + url: `/rest/api/2/project/${parameters.projectIdOrKey}/version`, method: 'GET', params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - orderBy: typeof parameters !== 'string' && parameters.orderBy, - query: typeof parameters !== 'string' && parameters.query, - status: typeof parameters !== 'string' && parameters.status, - expand: typeof parameters !== 'string' && parameters.expand, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + orderBy: parameters.orderBy, + query: parameters.query, + status: parameters.status, + expand: 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 @@ -68,7 +64,7 @@ export class ProjectVersions { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, + parameters: Parameters.GetProjectVersions, callback: Callback, ): Promise; /** @@ -82,26 +78,23 @@ export class ProjectVersions { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, + parameters: Parameters.GetProjectVersions, callback?: never, ): Promise; async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, + parameters: Parameters.GetProjectVersions, callback?: Callback, ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/versions`, + url: `/rest/api/2/project/${parameters.projectIdOrKey}/versions`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: parameters.expand, }, }; return this.client.sendRequest(config, callback); } - /** * Creates a project version. * @@ -111,7 +104,10 @@ export class ProjectVersions { * _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; + async createVersion( + parameters: Parameters.CreateVersion | undefined, + callback: Callback, + ): Promise; /** * Creates a project version. * @@ -121,37 +117,39 @@ export class ProjectVersions { * _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?: never): Promise; async createVersion( - parameters: Parameters.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, + approvers: parameters?.approvers, + archived: parameters?.archived, + description: parameters?.description, + driver: parameters?.driver, + expand: parameters?.expand, + id: parameters?.id, + issuesStatusForFixVersion: parameters?.issuesStatusForFixVersion, + moveUnfixedIssuesTo: parameters?.moveUnfixedIssuesTo, + name: parameters?.name, + operations: parameters?.operations, + overdue: parameters?.overdue, + project: parameters?.project, + projectId: parameters?.projectId, + releaseDate: parameters?.releaseDate, + released: parameters?.released, + self: parameters?.self, + startDate: parameters?.startDate, + userReleaseDate: parameters?.userReleaseDate, + userStartDate: parameters?.userStartDate, }, }; return this.client.sendRequest(config, callback); } - /** * Returns a project version. * @@ -160,10 +158,7 @@ export class ProjectVersions { * **[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; + async getVersion(parameters: Parameters.GetVersion, callback: Callback): Promise; /** * Returns a project version. * @@ -172,24 +167,18 @@ export class ProjectVersions { * **[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; - + async getVersion(parameters: Parameters.GetVersion, callback?: never): Promise; + async getVersion(parameters: Parameters.GetVersion, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/version/${id}`, + url: `/rest/api/2/version/${parameters.id}`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: parameters.expand, }, }; return this.client.sendRequest(config, callback); } - /** * Updates a project version. * @@ -217,22 +206,59 @@ export class ProjectVersions { 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, - }, + data: parameters.body, }; return this.client.sendRequest(config, callback); } + /** + * Deletes a project version. + * + * Deprecated, use [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) that supports swapping + * version values in custom fields, in addition to the swapping for `fixVersion` and `affectedVersion` provided in + * this resource. + * + * Alternative versions can be provided to update issues that use the deleted version in `fixVersion` or + * `affectedVersion`. If alternatives are not provided, occurrences of `fixVersion` and `affectedVersion` that contain + * the deleted version are cleared. + * + * 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 deleteVersion(parameters: Parameters.DeleteVersion, callback: Callback): Promise; + /** + * Deletes a project version. + * + * Deprecated, use [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) that supports swapping + * version values in custom fields, in addition to the swapping for `fixVersion` and `affectedVersion` provided in + * this resource. + * + * Alternative versions can be provided to update issues that use the deleted version in `fixVersion` or + * `affectedVersion`. If alternatives are not provided, occurrences of `fixVersion` and `affectedVersion` that contain + * the deleted version are cleared. + * + * 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 deleteVersion(parameters: Parameters.DeleteVersion, callback?: never): Promise; + async deleteVersion(parameters: Parameters.DeleteVersion, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}`, + method: 'DELETE', + params: { + moveFixIssuesTo: parameters.moveFixIssuesTo, + moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, + }, + }; + 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`. @@ -269,7 +295,6 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } - /** * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. * @@ -300,7 +325,6 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } - /** * Returns the following counts for a version: * @@ -314,7 +338,7 @@ export class ProjectVersions { * projects_ project permission for the project that contains the version. */ async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, + parameters: Parameters.GetVersionRelatedIssues, callback: Callback, ): Promise; /** @@ -330,23 +354,151 @@ export class ProjectVersions { * projects_ project permission for the project that contains the version. */ async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, + parameters: Parameters.GetVersionRelatedIssues, callback?: never, ): Promise; async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, + parameters: Parameters.GetVersionRelatedIssues, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}/relatedIssueCounts`, + method: 'GET', + }; + return this.client.sendRequest(config, callback); + } + /** + * Returns related work items for the given version id. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. + */ + async getRelatedWork( + parameters: Parameters.GetRelatedWork, + callback: Callback, + ): Promise; + /** + * Returns related work items for the given version id. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. + */ + async getRelatedWork( + parameters: Parameters.GetRelatedWork, + callback?: never, + ): Promise; + async getRelatedWork( + parameters: Parameters.GetRelatedWork, + callback?: Callback, + ): Promise { const config: RequestConfig = { - url: `/rest/api/2/version/${id}/relatedIssueCounts`, + url: `/rest/api/2/version/${parameters.id}/relatedwork`, method: 'GET', }; return this.client.sendRequest(config, callback); } + /** + * Creates a related work for the given version. You can only create a generic link type of related works via this + * API. relatedWorkId will be auto-generated UUID, that does not need to be provided. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async createRelatedWork( + parameters: Parameters.CreateRelatedWork, + callback: Callback, + ): Promise; + /** + * Creates a related work for the given version. You can only create a generic link type of related works via this + * API. relatedWorkId will be auto-generated UUID, that does not need to be provided. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async createRelatedWork( + parameters: Parameters.CreateRelatedWork, + callback?: never, + ): Promise; + async createRelatedWork( + parameters: Parameters.CreateRelatedWork, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}/relatedwork`, + method: 'POST', + data: { + category: parameters.category, + issueId: parameters.issueId, + relatedWorkId: parameters.relatedWorkId, + title: parameters.title, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** + * Updates the given related work. You can only update generic link related works via Rest APIs. Any archived version + * related works can't be edited. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async updateRelatedWork( + parameters: Parameters.UpdateRelatedWork, + callback: Callback, + ): Promise; + /** + * Updates the given related work. You can only update generic link related works via Rest APIs. Any archived version + * related works can't be edited. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async updateRelatedWork( + parameters: Parameters.UpdateRelatedWork, + callback?: never, + ): Promise; + async updateRelatedWork( + parameters: Parameters.UpdateRelatedWork, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}/relatedwork`, + method: 'PUT', + data: { + category: parameters.category, + issueId: parameters.issueId, + relatedWorkId: parameters.relatedWorkId, + title: parameters.title, + url: parameters.url, + }, + }; + return this.client.sendRequest(config, callback); + } /** * Deletes a project version. * @@ -390,15 +542,14 @@ export class ProjectVersions { url: `/rest/api/2/version/${parameters.id}/removeAndSwap`, method: 'POST', data: { - moveFixIssuesTo: parameters.moveFixIssuesTo, - moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, customFieldReplacementList: parameters.customFieldReplacementList, + moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, + moveFixIssuesTo: parameters.moveFixIssuesTo, }, }; return this.client.sendRequest(config, callback); } - /** * Returns counts of the issues and unresolved issues for the project version. * @@ -408,7 +559,7 @@ export class ProjectVersions { * projects_ project permission for the project that contains the version. */ async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, + parameters: Parameters.GetVersionUnresolvedIssues, callback: Callback, ): Promise; /** @@ -420,20 +571,51 @@ export class ProjectVersions { * projects_ project permission for the project that contains the version. */ async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, + parameters: Parameters.GetVersionUnresolvedIssues, callback?: never, ): Promise; async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, + parameters: Parameters.GetVersionUnresolvedIssues, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { - url: `/rest/api/2/version/${id}/unresolvedIssueCount`, + url: `/rest/api/2/version/${parameters.id}/unresolvedIssueCount`, method: 'GET', }; + return this.client.sendRequest(config, callback); + } + /** + * Deletes the given related work for the given version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async deleteRelatedWork(parameters: Parameters.DeleteRelatedWork, callback: Callback): Promise; + /** + * Deletes the given related work for the given version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async deleteRelatedWork(parameters: Parameters.DeleteRelatedWork, callback?: never): Promise; + async deleteRelatedWork( + parameters: Parameters.DeleteRelatedWork, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.versionId}/relatedwork/${parameters.relatedWorkId}`, + method: 'DELETE', + }; + return this.client.sendRequest(config, callback); } } diff --git a/src/version2/projects.ts b/src/version2/projects.ts index 00becfb48e..acc991379b 100644 --- a/src/version2/projects.ts +++ b/src/version2/projects.ts @@ -6,15 +6,55 @@ import { RequestConfig } from '../requestConfig'; export class Projects { constructor(private client: Client) {} + /** + * Returns all projects visible to the user. Deprecated, use [ Get projects + * paginated](#api-rest-api-2-project-search-get) that supports search and pagination. + * + * 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 _Browse Projects_ or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getAllProjects( + parameters: Parameters.GetAllProjects | undefined, + callback: Callback, + ): Promise; + /** + * Returns all projects visible to the user. Deprecated, use [ Get projects + * paginated](#api-rest-api-2-project-search-get) that supports search and pagination. + * + * 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 _Browse Projects_ or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getAllProjects(parameters?: Parameters.GetAllProjects, callback?: never): Promise; + async getAllProjects( + parameters?: Parameters.GetAllProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/project', + method: 'GET', + params: { + expand: parameters?.expand, + recent: parameters?.recent, + properties: parameters?.properties, + }, + }; + return this.client.sendRequest(config, callback); + } /** * Creates a project based on a project type template, as shown in the following table: * - * | Project Type Key | Project Template Key | - * | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | - * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | - * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | + * | Project Type Key | Project Template Key | + * | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | + * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-blank-project-business`, `com.atlassian.servicedesk:simplified-blank-project-it`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | + * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | * * The project types are available according to the installed Jira features as follows: * @@ -31,17 +71,17 @@ export class Projects { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createProject( - parameters: Parameters.CreateProject, + parameters: Parameters.CreateProject | undefined, 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` | + * | Project Type Key | Project Template Key | + * | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | + * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-blank-project-business`, `com.atlassian.servicedesk:simplified-blank-project-it`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | + * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | * * The project types are available according to the installed Jira features as follows: * @@ -58,40 +98,40 @@ export class Projects { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createProject( - parameters: Parameters.CreateProject, + parameters?: Parameters.CreateProject, callback?: never, ): Promise; async createProject( - parameters: Parameters.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, + 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, + lead: parameters?.lead, + 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. * @@ -133,7 +173,6 @@ export class Projects { 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. @@ -191,7 +230,6 @@ export class Projects { return this.client.sendRequest(config, callback); } - /** * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. * @@ -200,10 +238,7 @@ export class Projects { * **[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; + async getProject(parameters: Parameters.GetProject, callback: Callback): Promise; /** * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. * @@ -212,25 +247,19 @@ export class Projects { * **[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; - + async getProject(parameters: Parameters.GetProject, callback?: never): Promise; + async getProject(parameters: Parameters.GetProject, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}`, + url: `/rest/api/2/project/${parameters.projectIdOrKey}`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, - properties: typeof parameters !== 'string' && parameters.properties, + expand: parameters.expand, + properties: parameters.properties, }, }; return this.client.sendRequest(config, callback); } - /** * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. * @@ -272,19 +301,18 @@ export class Projects { description: parameters.description, issueSecurityScheme: parameters.issueSecurityScheme, key: parameters.key, + lead: parameters.lead, leadAccountId: parameters.leadAccountId, name: parameters.name, notificationScheme: parameters.notificationScheme, permissionScheme: parameters.permissionScheme, - projectTemplateKey: parameters.projectTemplateKey, - projectTypeKey: parameters.projectTypeKey, + releasedProjectKeys: parameters.releasedProjectKeys, url: parameters.url, }, }; return this.client.sendRequest(config, callback); } - /** * Deletes a project. * @@ -294,7 +322,7 @@ export class 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 deleteProject(parameters: Parameters.DeleteProject | string, callback: Callback): Promise; + async deleteProject(parameters: Parameters.DeleteProject, callback: Callback): Promise; /** * Deletes a project. * @@ -304,24 +332,18 @@ export class 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 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; - + async deleteProject(parameters: Parameters.DeleteProject, callback?: never): Promise; + async deleteProject(parameters: Parameters.DeleteProject, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}`, + url: `/rest/api/2/project/${parameters.projectIdOrKey}`, method: 'DELETE', params: { - enableUndo: typeof parameters !== 'string' && parameters.enableUndo, + enableUndo: 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. @@ -329,7 +351,7 @@ export class 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 archiveProject(parameters: Parameters.ArchiveProject | string, callback: Callback): Promise; + async archiveProject(parameters: Parameters.ArchiveProject, 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. @@ -337,21 +359,15 @@ export class 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 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; - + async archiveProject(parameters: Parameters.ArchiveProject, callback?: never): Promise; + async archiveProject(parameters: Parameters.ArchiveProject, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/archive`, + url: `/rest/api/2/project/${parameters.projectIdOrKey}/archive`, method: 'POST', }; return this.client.sendRequest(config, callback); } - /** * Deletes a project asynchronously. * @@ -366,7 +382,7 @@ export class Projects { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, + parameters: Parameters.DeleteProjectAsynchronously, callback: Callback, ): Promise; /** @@ -383,23 +399,20 @@ export class Projects { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, + parameters: Parameters.DeleteProjectAsynchronously, callback?: never, ): Promise; async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, + parameters: Parameters.DeleteProjectAsynchronously, callback?: Callback, ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/delete`, + url: `/rest/api/2/project/${parameters.projectIdOrKey}/delete`, method: 'POST', }; return this.client.sendRequest(config, callback); } - /** * Restores a project that has been archived or placed in the Jira recycle bin. * @@ -409,7 +422,7 @@ export class 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; + async restore(parameters: Parameters.Restore, callback: Callback): Promise; /** * Restores a project that has been archived or placed in the Jira recycle bin. * @@ -419,21 +432,15 @@ export class 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; - + async restore(parameters: Parameters.Restore, callback?: never): Promise; + async restore(parameters: Parameters.Restore, callback?: Callback): Promise { const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/restore`, + url: `/rest/api/2/project/${parameters.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. @@ -444,7 +451,7 @@ export class Projects { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, + parameters: Parameters.GetAllStatuses, callback: Callback, ): Promise; /** @@ -457,23 +464,20 @@ export class Projects { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, + parameters: Parameters.GetAllStatuses, callback?: never, ): Promise; async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, + parameters: Parameters.GetAllStatuses, callback?: Callback, ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/statuses`, + url: `/rest/api/2/project/${parameters.projectIdOrKey}/statuses`, method: 'GET', }; return this.client.sendRequest(config, callback); } - /** * Get the issue type hierarchy for a next-gen project. * @@ -489,7 +493,7 @@ export class Projects { * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getHierarchy( - parameters: Parameters.GetHierarchy | string, + parameters: Parameters.GetHierarchy, callback: Callback, ): Promise; /** @@ -507,23 +511,20 @@ export class Projects { * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getHierarchy( - parameters: Parameters.GetHierarchy | string, + parameters: Parameters.GetHierarchy, callback?: never, ): Promise; async getHierarchy( - parameters: Parameters.GetHierarchy | string, + parameters: Parameters.GetHierarchy, callback?: Callback, ): Promise { - const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; - const config: RequestConfig = { - url: `/rest/api/2/project/${projectId}/hierarchy`, + url: `/rest/api/2/project/${parameters.projectId}/hierarchy`, method: 'GET', }; return this.client.sendRequest(config, callback); } - /** * Gets a [notification scheme](https://confluence.atlassian.com/x/8YdKLg) associated with the project. * @@ -532,7 +533,7 @@ export class Projects { * permission](https://confluence.atlassian.com/x/yodKLg). */ async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject | string, + parameters: Parameters.GetNotificationSchemeForProject, callback: Callback, ): Promise; /** @@ -543,20 +544,18 @@ export class Projects { * permission](https://confluence.atlassian.com/x/yodKLg). */ async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject | string, + parameters: Parameters.GetNotificationSchemeForProject, callback?: never, ): Promise; async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject | string, + parameters: Parameters.GetNotificationSchemeForProject, callback?: Callback, ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - const config: RequestConfig = { - url: `/rest/api/2/project/${projectKeyOrId}/notificationscheme`, + url: `/rest/api/2/project/${parameters.projectKeyOrId}/notificationscheme`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: parameters.expand, }, }; diff --git a/src/version2/screenTabs.ts b/src/version2/screenTabs.ts index e11f823845..8617cc52bf 100644 --- a/src/version2/screenTabs.ts +++ b/src/version2/screenTabs.ts @@ -7,6 +7,43 @@ import { RequestConfig } from '../requestConfig'; export class ScreenTabs { constructor(private client: Client) {} + /** + * Returns the list of tabs for a bulk of screens. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBulkScreenTabs( + parameters: Parameters.GetBulkScreenTabs | undefined, + callback: Callback, + ): Promise; + /** + * Returns the list of tabs for a bulk of screens. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBulkScreenTabs(parameters?: Parameters.GetBulkScreenTabs, callback?: never): Promise; + async getBulkScreenTabs( + parameters?: Parameters.GetBulkScreenTabs, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/screens/tabs', + method: 'GET', + params: { + screenId: parameters?.screenId, + tabId: parameters?.tabId, + startAt: parameters?.startAt, + maxResult: parameters?.maxResult, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Returns the list of tabs for a screen. * diff --git a/src/version2/serviceRegistry.ts b/src/version2/serviceRegistry.ts new file mode 100644 index 0000000000..37b9f92701 --- /dev/null +++ b/src/version2/serviceRegistry.ts @@ -0,0 +1,38 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class ServiceRegistry { + constructor(private client: Client) {} + + /** + * Retrieve the attributes of given service registries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request and the servicesIds belong to the tenant you are requesting + */ + async services(parameters: Parameters.Services, callback: Callback): Promise; + /** + * Retrieve the attributes of given service registries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request and the servicesIds belong to the tenant you are requesting + */ + async services(parameters: Parameters.Services, callback?: never): Promise; + async services( + parameters: Parameters.Services, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/service-registry', + method: 'GET', + params: { + serviceIds: parameters.serviceIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/status.ts b/src/version2/status.ts index 5760598e3c..ed86523238 100644 --- a/src/version2/status.ts +++ b/src/version2/status.ts @@ -193,4 +193,82 @@ export class Status { return this.client.sendRequest(config, callback); } + + /** Returns a page of issue types in a project using a given status. */ + async getProjectIssueTypeUsagesForStatus( + parameters: Parameters.GetProjectIssueTypeUsagesForStatus, + callback: Callback, + ): Promise; + /** Returns a page of issue types in a project using a given status. */ + async getProjectIssueTypeUsagesForStatus( + parameters: Parameters.GetProjectIssueTypeUsagesForStatus, + callback?: never, + ): Promise; + async getProjectIssueTypeUsagesForStatus( + parameters: Parameters.GetProjectIssueTypeUsagesForStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/statuses/${parameters.statusId}/project/${parameters.projectId}/issueTypeUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of projects using a given status. */ + async getProjectUsagesForStatus( + parameters: Parameters.GetProjectUsagesForStatus, + callback: Callback, + ): Promise; + /** Returns a page of projects using a given status. */ + async getProjectUsagesForStatus( + parameters: Parameters.GetProjectUsagesForStatus, + callback?: never, + ): Promise; + async getProjectUsagesForStatus( + parameters: Parameters.GetProjectUsagesForStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/statuses/${parameters.statusId}/projectUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of workflows using a given status. */ + async getWorkflowUsagesForStatus( + parameters: Parameters.GetWorkflowUsagesForStatus, + callback: Callback, + ): Promise; + /** Returns a page of workflows using a given status. */ + async getWorkflowUsagesForStatus( + parameters: Parameters.GetWorkflowUsagesForStatus, + callback?: never, + ): Promise; + async getWorkflowUsagesForStatus( + parameters: Parameters.GetWorkflowUsagesForStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/statuses/${parameters.statusId}/workflowUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version2/tasks.ts b/src/version2/tasks.ts index eed3373915..4f1df0dcb3 100644 --- a/src/version2/tasks.ts +++ b/src/version2/tasks.ts @@ -15,6 +15,10 @@ export class Tasks { * operation that created the task for details. Task details are not permanently retained. As of September 2019, * details are retained for 14 days although this period may change without notice. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - `read:jira-work` + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either * of: * @@ -33,6 +37,10 @@ export class Tasks { * operation that created the task for details. Task details are not permanently retained. As of September 2019, * details are retained for 14 days although this period may change without notice. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - `read:jira-work` + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either * of: * diff --git a/src/version2/teamsInPlan.ts b/src/version2/teamsInPlan.ts new file mode 100644 index 0000000000..8939971c3f --- /dev/null +++ b/src/version2/teamsInPlan.ts @@ -0,0 +1,322 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class TeamsInPlan { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * plan-only and Atlassian teams in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTeams( + parameters: Parameters.GetTeams, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * plan-only and Atlassian teams in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTeams( + parameters: Parameters.GetTeams, + callback?: never, + ): Promise; + async getTeams( + parameters: Parameters.GetTeams, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team`, + method: 'GET', + params: { + cursor: parameters.cursor, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds an existing Atlassian team to a plan and configures their plannning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addAtlassianTeam(parameters: Parameters.AddAtlassianTeam, callback: Callback): Promise; + /** + * Adds an existing Atlassian team to a plan and configures their plannning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addAtlassianTeam(parameters: Parameters.AddAtlassianTeam, callback?: never): Promise; + async addAtlassianTeam(parameters: Parameters.AddAtlassianTeam, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/atlassian`, + method: 'POST', + data: { + capacity: parameters.capacity, + id: parameters.id, + issueSourceId: parameters.issueSourceId, + planningStyle: parameters.planningStyle, + sprintLength: parameters.sprintLength, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns planning settings for an Atlassian team in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAtlassianTeam( + parameters: Parameters.GetAtlassianTeam, + callback: Callback, + ): Promise; + /** + * Returns planning settings for an Atlassian team in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAtlassianTeam( + parameters: Parameters.GetAtlassianTeam, + callback?: never, + ): Promise; + async getAtlassianTeam( + parameters: Parameters.GetAtlassianTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates any of the following planning settings of an Atlassian team in a plan using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get Atlassian team in plan" + * endpoint to find out the order of array elements._ + */ + async updateAtlassianTeam(parameters: Parameters.UpdateAtlassianTeam, callback: Callback): Promise; + /** + * Updates any of the following planning settings of an Atlassian team in a plan using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get Atlassian team in plan" + * endpoint to find out the order of array elements._ + */ + async updateAtlassianTeam(parameters: Parameters.UpdateAtlassianTeam, callback?: never): Promise; + async updateAtlassianTeam( + parameters: Parameters.UpdateAtlassianTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes an Atlassian team from a plan and deletes their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeAtlassianTeam(parameters: Parameters.RemoveAtlassianTeam, callback: Callback): Promise; + /** + * Removes an Atlassian team from a plan and deletes their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeAtlassianTeam(parameters: Parameters.RemoveAtlassianTeam, callback?: never): Promise; + async removeAtlassianTeam( + parameters: Parameters.RemoveAtlassianTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a plan-only team and configures their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlanOnlyTeam( + parameters: Parameters.CreatePlanOnlyTeam, + callback: Callback, + ): Promise; + /** + * Creates a plan-only team and configures their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlanOnlyTeam(parameters: Parameters.CreatePlanOnlyTeam, callback?: never): Promise; + async createPlanOnlyTeam( + parameters: Parameters.CreatePlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/planonly`, + method: 'POST', + data: { + capacity: parameters.capacity, + issueSourceId: parameters.issueSourceId, + memberAccountIds: parameters.memberAccountIds, + name: parameters.name, + planningStyle: parameters.planningStyle, + sprintLength: parameters.sprintLength, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns planning settings for a plan-only team. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlanOnlyTeam( + parameters: Parameters.GetPlanOnlyTeam, + callback: Callback, + ): Promise; + /** + * Returns planning settings for a plan-only team. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlanOnlyTeam( + parameters: Parameters.GetPlanOnlyTeam, + callback?: never, + ): Promise; + async getPlanOnlyTeam( + parameters: Parameters.GetPlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates any of the following planning settings of a plan-only team using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * - MemberAccountIds + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan-only team" + * endpoint to find out the order of array elements._ + */ + async updatePlanOnlyTeam(parameters: Parameters.UpdatePlanOnlyTeam, callback: Callback): Promise; + /** + * Updates any of the following planning settings of a plan-only team using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * - MemberAccountIds + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan-only team" + * endpoint to find out the order of array elements._ + */ + async updatePlanOnlyTeam(parameters: Parameters.UpdatePlanOnlyTeam, callback?: never): Promise; + async updatePlanOnlyTeam( + parameters: Parameters.UpdatePlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a plan-only team and their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePlanOnlyTeam(parameters: Parameters.DeletePlanOnlyTeam, callback: Callback): Promise; + /** + * Deletes a plan-only team and their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePlanOnlyTeam(parameters: Parameters.DeletePlanOnlyTeam, callback?: never): Promise; + async deletePlanOnlyTeam( + parameters: Parameters.DeletePlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/uIModificationsApps.ts b/src/version2/uIModificationsApps.ts index 98b23035e0..ec3dd88769 100644 --- a/src/version2/uIModificationsApps.ts +++ b/src/version2/uIModificationsApps.ts @@ -11,6 +11,9 @@ export class UIModificationsApps { * Gets UI modifications. UI modifications can only be retrieved by Forge apps. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getUiModifications( parameters: Parameters.GetUiModifications | undefined, @@ -20,6 +23,9 @@ export class UIModificationsApps { * Gets UI modifications. UI modifications can only be retrieved by Forge apps. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getUiModifications( parameters?: Parameters.GetUiModifications, @@ -45,13 +51,17 @@ export class UIModificationsApps { /** * Creates a UI modification. UI modification can only be created by Forge apps. * - * Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. + * Each app can define up to 3000 UI modifications. Each UI modification can define up to 1000 contexts. The same + * context can be assigned to maximum 100 UI modifications. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * * - _None_ if the UI modification is created without contexts. * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the * UI modification is created with contexts. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async createUiModification( parameters: Parameters.CreateUiModification, @@ -60,13 +70,17 @@ export class UIModificationsApps { /** * Creates a UI modification. UI modification can only be created by Forge apps. * - * Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. + * Each app can define up to 3000 UI modifications. Each UI modification can define up to 1000 contexts. The same + * context can be assigned to maximum 100 UI modifications. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * * - _None_ if the UI modification is created without contexts. * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the * UI modification is created with contexts. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async createUiModification( parameters: Parameters.CreateUiModification, @@ -93,13 +107,17 @@ export class UIModificationsApps { /** * Updates a UI modification. UI modification can only be updated by Forge apps. * - * Each UI modification can define up to 1000 contexts. + * Each UI modification can define up to 1000 contexts. The same context can be assigned to maximum 100 UI + * modifications. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * * - _None_ if the UI modification is created without contexts. * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the * UI modification is created with contexts. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateUiModification( parameters: Parameters.UpdateUiModification, @@ -108,13 +126,17 @@ export class UIModificationsApps { /** * Updates a UI modification. UI modification can only be updated by Forge apps. * - * Each UI modification can define up to 1000 contexts. + * Each UI modification can define up to 1000 contexts. The same context can be assigned to maximum 100 UI + * modifications. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * * - _None_ if the UI modification is created without contexts. * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the * UI modification is created with contexts. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateUiModification(parameters: Parameters.UpdateUiModification, callback?: never): Promise; async updateUiModification( @@ -125,10 +147,10 @@ export class UIModificationsApps { url: `/rest/api/2/uiModifications/${parameters.uiModificationId}`, method: 'PUT', data: { - name: parameters.name, - description: parameters.description, - data: parameters.data, contexts: parameters.contexts, + data: parameters.data, + description: parameters.description, + name: parameters.name, }, }; @@ -140,6 +162,9 @@ export class UIModificationsApps { * only be deleted by Forge apps. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async deleteUiModification( parameters: Parameters.DeleteUiModification | string, @@ -150,6 +175,9 @@ export class UIModificationsApps { * only be deleted by Forge apps. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async deleteUiModification( parameters: Parameters.DeleteUiModification | string, diff --git a/src/version2/userSearch.ts b/src/version2/userSearch.ts index 854f517631..b5c7314cbe 100644 --- a/src/version2/userSearch.ts +++ b/src/version2/userSearch.ts @@ -75,9 +75,9 @@ export class UserSearch { * assigned to: * * - A new issue, by providing the `projectKeyOrId`. - * - An updated issue, by providing the `issueKey`. - * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in - * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in + * - An updated issue, by providing the `issueKey` or `issueId`. + * - To an issue during a transition (workflow action), by providing the `issueKey` or `issueId` and the transition id + * in `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in * the `expand` parameter of [ Get issue](#api-rest-api-2-issue-issueIdOrKey-get). * * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is @@ -92,8 +92,9 @@ export class UserSearch { * the user's email address is hidden. See the [Profile visibility * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Assign issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) */ async findAssignableUsers( parameters: Parameters.FindAssignableUsers | undefined, @@ -104,9 +105,9 @@ export class UserSearch { * assigned to: * * - A new issue, by providing the `projectKeyOrId`. - * - An updated issue, by providing the `issueKey`. - * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in - * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in + * - An updated issue, by providing the `issueKey` or `issueId`. + * - To an issue during a transition (workflow action), by providing the `issueKey` or `issueId` and the transition id + * in `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in * the `expand` parameter of [ Get issue](#api-rest-api-2-issue-issueIdOrKey-get). * * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is @@ -121,8 +122,9 @@ export class UserSearch { * the user's email address is hidden. See the [Profile visibility * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Assign issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) */ async findAssignableUsers( parameters?: Parameters.FindAssignableUsers, @@ -142,6 +144,7 @@ export class UserSearch { accountId: parameters?.accountId, project: parameters?.project, issueKey: parameters?.issueKey, + issueId: parameters?.issueId, startAt: parameters?.startAt, maxResults: parameters?.maxResults, actionDescriptorId: parameters?.actionDescriptorId, @@ -303,7 +306,7 @@ export class UserSearch { } /** - * Returns a list of users that match the search string and property. + * Returns a list of active users that match the search string and property. * * This operation first applies a filter to match the search string and property, and then takes the filtered users in * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the @@ -325,7 +328,7 @@ export class UserSearch { callback: Callback, ): Promise; /** - * Returns a list of users that match the search string and property. + * Returns a list of active users that match the search string and property. * * This operation first applies a filter to match the search string and property, and then takes the filtered users in * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the @@ -382,7 +385,9 @@ export class UserSearch { * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. For example, + * if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible + * to use `[location].office.city is "Sydney"` to match the user. * * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined * using the `AND` and `OR` operators to form more complex queries. For example: @@ -415,7 +420,9 @@ export class UserSearch { * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. For example, + * if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible + * to use `[location].office.city is "Sydney"` to match the user. * * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined * using the `AND` and `OR` operators to form more complex queries. For example: @@ -462,7 +469,9 @@ export class UserSearch { * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. For example, + * if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible + * to use `[location].office.city is "Sydney"` to match the user. * * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined * using the `AND` and `OR` operators to form more complex queries. For example: @@ -495,7 +504,9 @@ export class UserSearch { * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. For example, + * if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible + * to use `[location].office.city is "Sydney"` to match the user. * * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined * using the `AND` and `OR` operators to form more complex queries. For example: @@ -516,7 +527,7 @@ export class UserSearch { params: { query: parameters.query, startAt: parameters.startAt, - maxResults: parameters.maxResults, + maxResult: parameters.maxResult || parameters.maxResults, }, }; diff --git a/src/version2/users.ts b/src/version2/users.ts index 942b398e76..47e7f1647a 100644 --- a/src/version2/users.ts +++ b/src/version2/users.ts @@ -18,7 +18,7 @@ export class Users { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getUser(parameters: Parameters.GetUser | undefined, callback: Callback): Promise; + async getUser(parameters: Parameters.GetUser, callback: Callback): Promise; /** * Returns a user. * @@ -29,14 +29,14 @@ export class Users { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getUser(parameters?: Parameters.GetUser, callback?: never): Promise; - async getUser(parameters?: Parameters.GetUser, callback?: Callback): Promise { + async getUser(parameters: Parameters.GetUser, callback?: never): Promise; + async getUser(parameters: Parameters.GetUser, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/2/user', method: 'GET', params: { - accountId: parameters?.accountId, - expand: parameters?.expand, + accountId: parameters.accountId, + expand: parameters.expand, }, }; @@ -234,44 +234,31 @@ export class Users { * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns * are removed. * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` - * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. * - Permission to access Jira, to set the calling user's columns. */ - async setUserColumns( - parameters: Parameters.SetUserColumns | undefined, - callback: Callback, - ): Promise; + async setUserColumns(parameters: Parameters.SetUserColumns, callback: Callback): Promise; /** * Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns * are removed. * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` - * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. * - Permission to access Jira, to set the calling user's columns. */ - async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: never): Promise; - async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: Callback): Promise { + async setUserColumns(parameters: Parameters.SetUserColumns, callback?: never): Promise; + async setUserColumns(parameters: Parameters.SetUserColumns, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/2/user/columns', method: 'PUT', params: { - accountId: parameters?.accountId, + accountId: parameters.accountId, }, - data: parameters?.columns, + data: parameters.columns, }; return this.client.sendRequest(config, callback); @@ -311,16 +298,20 @@ export class Users { } /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * Returns a user's email address regardless of the user's profile visibility settings. For Connect apps, this API is + * only available to apps approved by Atlassian, according to these * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * For Forge apps, this API only supports access via asApp() requests. */ async getUserEmail( parameters: Parameters.GetUserEmail | string, callback: Callback, ): Promise; /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * Returns a user's email address regardless of the user's profile visibility settings. For Connect apps, this API is + * only available to apps approved by Atlassian, according to these * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * For Forge apps, this API only supports access via asApp() requests. */ async getUserEmail( parameters: Parameters.GetUserEmail | string, @@ -344,16 +335,20 @@ export class Users { } /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * Returns a user's email address regardless of the user's profile visibility settings. For Connect apps, this API is + * only available to apps approved by Atlassian, according to these * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * For Forge apps, this API only supports access via asApp() requests. */ async getUserEmailBulk( parameters: Parameters.GetUserEmailBulk | string, callback: Callback, ): Promise; /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * Returns a user's email address regardless of the user's profile visibility settings. For Connect apps, this API is + * only available to apps approved by Atlassian, according to these * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * For Forge apps, this API only supports access via asApp() requests. */ async getUserEmailBulk( parameters: Parameters.GetUserEmailBulk | string, diff --git a/src/version2/workflowSchemes.ts b/src/version2/workflowSchemes.ts index ef9f340fe3..b4aa751240 100644 --- a/src/version2/workflowSchemes.ts +++ b/src/version2/workflowSchemes.ts @@ -92,6 +92,137 @@ export class WorkflowSchemes { return this.client.sendRequest(config, callback); } + /** + * Returns a list of workflow schemes by providing workflow scheme IDs or project IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflow schemes + * - _Administer projects_ project permissions to access project-scoped workflow schemes + */ + async readWorkflowSchemes( + parameters: Parameters.ReadWorkflowSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of workflow schemes by providing workflow scheme IDs or project IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflow schemes + * - _Administer projects_ project permissions to access project-scoped workflow schemes + */ + async readWorkflowSchemes( + parameters?: Parameters.ReadWorkflowSchemes, + callback?: never, + ): Promise; + async readWorkflowSchemes( + parameters?: Parameters.ReadWorkflowSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme/read', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + projectIds: parameters?.projectIds, + workflowSchemeIds: parameters?.workflowSchemeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates company-managed and team-managed project workflow schemes. This API doesn't have a concept of draft, so any + * changes made to a workflow scheme are immediately available. When changing the available statuses for issue types, + * an [asynchronous task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations) + * migrates the issues as defined in the provided mappings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to update all, including global-scoped, workflow schemes. + * - _Administer projects_ project permission to update project-scoped workflow schemes. + */ + async updateSchemes(parameters: Parameters.UpdateSchemes, callback: Callback): Promise; + /** + * Updates company-managed and team-managed project workflow schemes. This API doesn't have a concept of draft, so any + * changes made to a workflow scheme are immediately available. When changing the available statuses for issue types, + * an [asynchronous task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations) + * migrates the issues as defined in the provided mappings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to update all, including global-scoped, workflow schemes. + * - _Administer projects_ project permission to update project-scoped workflow schemes. + */ + async updateSchemes(parameters: Parameters.UpdateSchemes, callback?: never): Promise; + async updateSchemes(parameters: Parameters.UpdateSchemes, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme/update', + method: 'POST', + data: { + defaultWorkflowId: parameters?.defaultWorkflowId, + description: parameters?.description, + id: parameters?.id, + name: parameters?.name, + statusMappingsByIssueTypeOverride: parameters?.statusMappingsByIssueTypeOverride, + statusMappingsByWorkflows: parameters?.statusMappingsByWorkflows, + version: parameters?.version, + workflowsForIssueTypes: parameters?.workflowsForIssueTypes, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets the required status mappings for the desired changes to a workflow scheme. The results are provided per issue + * type and workflow. When updating a workflow scheme, status mappings can be provided per issue type, per workflow, + * or both. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ permission to update all, including global-scoped, workflow schemes. + * - _Administer projects_ project permission to update project-scoped workflow schemes. + */ + async updateWorkflowSchemeMappings( + parameters: Parameters.UpdateWorkflowSchemeMappings, + callback: Callback, + ): Promise; + /** + * Gets the required status mappings for the desired changes to a workflow scheme. The results are provided per issue + * type and workflow. When updating a workflow scheme, status mappings can be provided per issue type, per workflow, + * or both. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ permission to update all, including global-scoped, workflow schemes. + * - _Administer projects_ project permission to update project-scoped workflow schemes. + */ + async updateWorkflowSchemeMappings( + parameters: Parameters.UpdateWorkflowSchemeMappings, + callback?: never, + ): Promise; + async updateWorkflowSchemeMappings( + parameters: Parameters.UpdateWorkflowSchemeMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme/update/mappings', + method: 'POST', + data: { + defaultWorkflowId: parameters?.defaultWorkflowId, + id: parameters?.id, + workflowsForIssueTypes: parameters?.workflowsForIssueTypes, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Returns a workflow scheme. * @@ -593,4 +724,30 @@ export class WorkflowSchemes { return this.client.sendRequest(config, callback); } + + /** Returns a page of projects using a given workflow scheme. */ + async getProjectUsagesForWorkflowScheme( + parameters: Parameters.GetProjectUsagesForWorkflowScheme, + callback: Callback, + ): Promise; + /** Returns a page of projects using a given workflow scheme. */ + async getProjectUsagesForWorkflowScheme( + parameters: Parameters.GetProjectUsagesForWorkflowScheme, + callback?: never, + ): Promise; + async getProjectUsagesForWorkflowScheme( + parameters: Parameters.GetProjectUsagesForWorkflowScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.workflowSchemeId}/projectUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version2/workflows.ts b/src/version2/workflows.ts index 1b56d74854..73c043b116 100644 --- a/src/version2/workflows.ts +++ b/src/version2/workflows.ts @@ -9,7 +9,11 @@ export class Workflows { constructor(private client: Client) {} /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. + * Creates a workflow. You can define transition rules using the shapes detailed in the following sections. If no + * transitional rules are specified the default system transition rules are used. Note: This only applies to + * company-managed scoped workflows. Use [bulk create + * workflows](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflows-create-post) + * to create both team and company-managed scoped workflows. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -19,7 +23,11 @@ export class Workflows { callback: Callback, ): Promise; /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. + * Creates a workflow. You can define transition rules using the shapes detailed in the following sections. If no + * transitional rules are specified the default system transition rules are used. Note: This only applies to + * company-managed scoped workflows. Use [bulk create + * workflows](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflows-create-post) + * to create both team and company-managed scoped workflows. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -140,6 +148,84 @@ export class Workflows { return this.client.sendRequest(config, callback); } + /** Returns a page of issue types using a given workflow within a project. */ + async getWorkflowProjectIssueTypeUsages( + parameters: Parameters.GetWorkflowProjectIssueTypeUsages, + callback: Callback, + ): Promise; + /** Returns a page of issue types using a given workflow within a project. */ + async getWorkflowProjectIssueTypeUsages( + parameters: Parameters.GetWorkflowProjectIssueTypeUsages, + callback?: never, + ): Promise; + async getWorkflowProjectIssueTypeUsages( + parameters: Parameters.GetWorkflowProjectIssueTypeUsages, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/${parameters.workflowId}/project/${parameters.projectId}/issueTypeUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of projects using a given workflow. */ + async getProjectUsagesForWorkflow( + parameters: Parameters.GetProjectUsagesForWorkflow, + callback: Callback, + ): Promise; + /** Returns a page of projects using a given workflow. */ + async getProjectUsagesForWorkflow( + parameters: Parameters.GetProjectUsagesForWorkflow, + callback?: never, + ): Promise; + async getProjectUsagesForWorkflow( + parameters: Parameters.GetProjectUsagesForWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/${parameters.workflowId}/projectUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of workflow schemes using a given workflow. */ + async getWorkflowSchemeUsagesForWorkflow( + parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, + callback: Callback, + ): Promise; + /** Returns a page of workflow schemes using a given workflow. */ + async getWorkflowSchemeUsagesForWorkflow( + parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, + callback?: never, + ): Promise; + async getWorkflowSchemeUsagesForWorkflow( + parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/${parameters.workflowId}/workflowSchemes`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Returns a list of workflows and related statuses by providing workflow names, workflow IDs, or project and issue * types. @@ -174,6 +260,8 @@ export class Workflows { method: 'POST', params: { expand: parameters.expand, + useTransitionLinksFormat: parameters.useTransitionLinksFormat, + useApprovalConfiguration: parameters.useApprovalConfiguration, }, data: { projectAndIssueTypes: parameters.projectAndIssueTypes, @@ -188,7 +276,7 @@ export class Workflows { /** * Get the list of workflow capabilities for a specific workflow using either the workflow ID, or the project and * issue type ID pair. The response includes the scope of the workflow, defined as global/project-based, and a list of - * project types that the workflow is scoped to. It also includes all rules organized into their broad categories + * project types that the workflow is scoped to. It also includes all rules organised into their broad categories * (conditions, validators, actions, triggers, screens) as well as the source location (Atlassian-provided, Connect, * Forge). * @@ -204,7 +292,7 @@ export class Workflows { /** * Get the list of workflow capabilities for a specific workflow using either the workflow ID, or the project and * issue type ID pair. The response includes the scope of the workflow, defined as global/project-based, and a list of - * project types that the workflow is scoped to. It also includes all rules organized into their broad categories + * project types that the workflow is scoped to. It also includes all rules organised into their broad categories * (conditions, validators, actions, triggers, screens) as well as the source location (Atlassian-provided, Connect, * Forge). * @@ -242,7 +330,7 @@ export class Workflows { * - _Administer Jira_ project permission to create all, including global-scoped, workflows * - _Administer projects_ project permissions to create project-scoped workflows */ - async createWorkflows( + async createWorkflows( parameters: Parameters.CreateWorkflows, callback: Callback, ): Promise; @@ -254,11 +342,11 @@ export class Workflows { * - _Administer Jira_ project permission to create all, including global-scoped, workflows * - _Administer projects_ project permissions to create project-scoped workflows */ - async createWorkflows( + async createWorkflows( parameters: Parameters.CreateWorkflows, callback?: never, ): Promise; - async createWorkflows( + async createWorkflows( parameters: Parameters.CreateWorkflows, callback?: Callback, ): Promise { @@ -315,6 +403,57 @@ export class Workflows { return this.client.sendRequest(config, callback); } + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of global + * and project workflows. If workflow names are specified in query string, details of those workflows are returned. + * Otherwise, all workflows are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows + */ + async searchWorkflows( + parameters: Parameters.SearchWorkflows | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of global + * and project workflows. If workflow names are specified in query string, details of those workflows are returned. + * Otherwise, all workflows are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows + */ + async searchWorkflows( + parameters?: Parameters.SearchWorkflows, + callback?: never, + ): Promise; + async searchWorkflows( + parameters?: Parameters.SearchWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflows/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + expand: parameters?.expand, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + scope: parameters?.scope, + isActive: parameters?.isActive, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Update workflows and related statuses. * @@ -323,7 +462,7 @@ export class Workflows { * - _Administer Jira_ project permission to create all, including global-scoped, workflows * - _Administer projects_ project permissions to create project-scoped workflows */ - async updateWorkflows( + async updateWorkflows( parameters: Parameters.UpdateWorkflows, callback: Callback, ): Promise; @@ -335,11 +474,11 @@ export class Workflows { * - _Administer Jira_ project permission to create all, including global-scoped, workflows * - _Administer projects_ project permissions to create project-scoped workflows */ - async updateWorkflows( + async updateWorkflows( parameters: Parameters.UpdateWorkflows, callback?: never, ): Promise; - async updateWorkflows( + async updateWorkflows( parameters: Parameters.UpdateWorkflows, callback?: Callback, ): Promise { diff --git a/src/version3/models/index.ts b/src/version3/models/index.ts index 324e5e5c17..25a6121df5 100644 --- a/src/version3/models/index.ts +++ b/src/version3/models/index.ts @@ -1,3 +1,4 @@ +export * from './workflowSchemeProjectUsage'; export * from './updateDefaultProjectClassification'; export * from './workflowUpdateRequest'; export * from './mappingsByIssueTypeOverride'; diff --git a/src/version3/models/projectUsage.ts b/src/version3/models/projectUsage.ts new file mode 100644 index 0000000000..2cc468d44c --- /dev/null +++ b/src/version3/models/projectUsage.ts @@ -0,0 +1,5 @@ +/** The project. */ +export interface ProjectUsage { + /** The project ID. */ + id?: string; +} diff --git a/src/version3/models/projectUsagePage.ts b/src/version3/models/projectUsagePage.ts new file mode 100644 index 0000000000..f018c8e7b1 --- /dev/null +++ b/src/version3/models/projectUsagePage.ts @@ -0,0 +1,9 @@ +import { ProjectUsage } from './projectUsage'; + +/** A page of projects. */ +export interface ProjectUsagePage { + /** Page token for the next page of project usages. */ + nextPageToken?: string; + /** The list of projects. */ + values?: ProjectUsage[]; +} diff --git a/src/version3/models/workflowSchemeProjectUsage.ts b/src/version3/models/workflowSchemeProjectUsage.ts new file mode 100644 index 0000000000..525818ea3b --- /dev/null +++ b/src/version3/models/workflowSchemeProjectUsage.ts @@ -0,0 +1,8 @@ +import { ProjectUsagePage } from './projectUsagePage'; + +/** Projects using the workflow scheme. */ +export interface WorkflowSchemeProjectUsage { + projects?: ProjectUsagePage; + /** The workflow scheme ID. */ + workflowSchemeId?: string; +} diff --git a/src/version3/parameters/getProjectUsagesForWorkflowScheme.ts b/src/version3/parameters/getProjectUsagesForWorkflowScheme.ts new file mode 100644 index 0000000000..0266959608 --- /dev/null +++ b/src/version3/parameters/getProjectUsagesForWorkflowScheme.ts @@ -0,0 +1,8 @@ +export interface GetProjectUsagesForWorkflowScheme { + /** The workflow scheme ID */ + workflowSchemeId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getUser.ts b/src/version3/parameters/getUser.ts index 6d17d114ed..935f89a6d9 100644 --- a/src/version3/parameters/getUser.ts +++ b/src/version3/parameters/getUser.ts @@ -5,15 +5,15 @@ export interface GetUser { */ accountId?: string; /** - * This parameter is no longer available. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) - * for details. + * @deprecated This parameter is no longer available. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) + * for details. */ username?: string; /** - * This parameter is no longer available. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) - * for details. + * @deprecated This parameter is no longer available. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) + * for details. */ key?: string; /** diff --git a/src/version3/parameters/index.ts b/src/version3/parameters/index.ts index 88cff2064c..18217f0a09 100644 --- a/src/version3/parameters/index.ts +++ b/src/version3/parameters/index.ts @@ -1,3 +1,4 @@ +export * from './getProjectUsagesForWorkflowScheme'; export * from './deletePlanOnlyTeam'; export * from './updatePlanOnlyTeam'; export * from './getPlanOnlyTeam'; diff --git a/src/version3/parameters/removeUser.ts b/src/version3/parameters/removeUser.ts index 9a94e575af..0cb0db148e 100644 --- a/src/version3/parameters/removeUser.ts +++ b/src/version3/parameters/removeUser.ts @@ -5,15 +5,15 @@ export interface RemoveUser { */ accountId: string; /** - * This parameter is no longer available. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. + * @deprecated This parameter is no longer available. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. */ username?: string; /** - * This parameter is no longer available. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. + * @deprecated This parameter is no longer available. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. */ key?: string; } diff --git a/src/version3/parameters/resetUserColumns.ts b/src/version3/parameters/resetUserColumns.ts index db5e050077..55e573ad27 100644 --- a/src/version3/parameters/resetUserColumns.ts +++ b/src/version3/parameters/resetUserColumns.ts @@ -5,9 +5,9 @@ export interface ResetUserColumns { */ accountId?: string; /** - * This parameter is no longer available. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. + * @deprecated This parameter is no longer available. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. */ username?: string; } diff --git a/src/version3/status.ts b/src/version3/status.ts index 5a5e0ec726..c197607757 100644 --- a/src/version3/status.ts +++ b/src/version3/status.ts @@ -6,7 +6,6 @@ import { RequestConfig } from '../requestConfig'; export class Status { constructor(private client: Client) {} - /** * Returns a list of the statuses specified by one or more status IDs. * @@ -16,7 +15,7 @@ export class Status { * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) */ async getStatusesById( - parameters: Parameters.GetStatusesById | string, + parameters: Parameters.GetStatusesById, callback: Callback, ): Promise; /** @@ -27,28 +26,22 @@ export class Status { * - _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, callback?: never): Promise; async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback?: never, - ): Promise; - async getStatusesById( - parameters: Parameters.GetStatusesById | string, + parameters: Parameters.GetStatusesById, 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, + expand: parameters.expand, + id: parameters.id, }, }; return this.client.sendRequest(config, callback); } - /** * Creates statuses for a global or project scope. * @@ -58,7 +51,7 @@ export class Status { * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) */ async createStatuses( - parameters: Parameters.CreateStatuses, + parameters: Parameters.CreateStatuses | undefined, callback: Callback, ): Promise; /** @@ -69,23 +62,22 @@ export class Status { * - _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?: never): Promise; async createStatuses( - parameters: Parameters.CreateStatuses, + parameters?: Parameters.CreateStatuses, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/statuses', method: 'POST', data: { - scope: parameters.scope, - statuses: parameters.statuses, + scope: parameters?.scope, + statuses: parameters?.statuses, }, }; return this.client.sendRequest(config, callback); } - /** * Updates statuses by ID. * @@ -94,7 +86,10 @@ export class Status { * - _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; + async updateStatuses( + parameters: Parameters.UpdateStatuses | undefined, + callback: Callback, + ): Promise; /** * Updates statuses by ID. * @@ -103,19 +98,18 @@ export class Status { * - _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 { + 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, + statuses: parameters?.statuses, }, }; return this.client.sendRequest(config, callback); } - /** * Deletes statuses by ID. * @@ -124,10 +118,7 @@ export class Status { * - _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; + async deleteStatusesById(parameters: Parameters.DeleteStatusesById, callback: Callback): Promise; /** * Deletes statuses by ID. * @@ -136,24 +127,21 @@ export class Status { * - _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, callback?: never): Promise; async deleteStatusesById( - parameters: Parameters.DeleteStatusesById | string, + parameters: Parameters.DeleteStatusesById, callback?: Callback, ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - const config: RequestConfig = { url: '/rest/api/3/statuses', method: 'DELETE', params: { - id, + id: parameters.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. @@ -191,6 +179,83 @@ export class Status { }, }; + return this.client.sendRequest(config, callback); + } + /** Returns a page of issue types in a project using a given status. */ + async getProjectIssueTypeUsagesForStatus( + parameters: Parameters.GetProjectIssueTypeUsagesForStatus, + callback: Callback, + ): Promise; + /** Returns a page of issue types in a project using a given status. */ + async getProjectIssueTypeUsagesForStatus( + parameters: Parameters.GetProjectIssueTypeUsagesForStatus, + callback?: never, + ): Promise; + async getProjectIssueTypeUsagesForStatus( + parameters: Parameters.GetProjectIssueTypeUsagesForStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/statuses/${parameters.statusId}/project/${parameters.projectId}/issueTypeUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of projects using a given status. */ + async getProjectUsagesForStatus( + parameters: Parameters.GetProjectUsagesForStatus, + callback: Callback, + ): Promise; + /** Returns a page of projects using a given status. */ + async getProjectUsagesForStatus( + parameters: Parameters.GetProjectUsagesForStatus, + callback?: never, + ): Promise; + async getProjectUsagesForStatus( + parameters: Parameters.GetProjectUsagesForStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/statuses/${parameters.statusId}/projectUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of workflows using a given status. */ + async getWorkflowUsagesForStatus( + parameters: Parameters.GetWorkflowUsagesForStatus, + callback: Callback, + ): Promise; + /** Returns a page of workflows using a given status. */ + async getWorkflowUsagesForStatus( + parameters: Parameters.GetWorkflowUsagesForStatus, + callback?: never, + ): Promise; + async getWorkflowUsagesForStatus( + parameters: Parameters.GetWorkflowUsagesForStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/statuses/${parameters.statusId}/workflowUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + return this.client.sendRequest(config, callback); } } diff --git a/src/version3/users.ts b/src/version3/users.ts index 1e4d017f20..523c21c3f0 100644 --- a/src/version3/users.ts +++ b/src/version3/users.ts @@ -18,7 +18,7 @@ export class Users { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getUser(parameters: Parameters.GetUser | undefined, callback: Callback): Promise; + async getUser(parameters: Parameters.GetUser, callback: Callback): Promise; /** * Returns a user. * @@ -29,16 +29,16 @@ export class Users { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getUser(parameters?: Parameters.GetUser, callback?: never): Promise; - async getUser(parameters?: Parameters.GetUser, callback?: Callback): Promise { + async getUser(parameters: Parameters.GetUser, callback?: never): Promise; + async getUser(parameters: Parameters.GetUser, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/3/user', method: 'GET', params: { - accountId: parameters?.accountId, - username: parameters?.username, - key: parameters?.key, - expand: parameters?.expand, + accountId: parameters.accountId, + username: parameters.username, + key: parameters.key, + expand: parameters.expand, }, }; @@ -234,44 +234,31 @@ export class Users { * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns * are removed. * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/3/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` - * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. * - Permission to access Jira, to set the calling user's columns. */ - async setUserColumns( - parameters: Parameters.SetUserColumns | undefined, - callback: Callback, - ): Promise; + async setUserColumns(parameters: Parameters.SetUserColumns, callback: Callback): Promise; /** * Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns * are removed. * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/3/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` - * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. * - Permission to access Jira, to set the calling user's columns. */ - async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: never): Promise; - async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: Callback): Promise { + async setUserColumns(parameters: Parameters.SetUserColumns, callback?: never): Promise; + async setUserColumns(parameters: Parameters.SetUserColumns, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/3/user/columns', method: 'PUT', params: { - accountId: parameters?.accountId, + accountId: parameters.accountId, }, - data: parameters?.columns, + data: parameters.columns, }; return this.client.sendRequest(config, callback); diff --git a/src/version3/workflowSchemes.ts b/src/version3/workflowSchemes.ts index 4cd18fb25b..9e02f56897 100644 --- a/src/version3/workflowSchemes.ts +++ b/src/version3/workflowSchemes.ts @@ -721,4 +721,30 @@ export class WorkflowSchemes { return this.client.sendRequest(config, callback); } + + /** Returns a page of projects using a given workflow scheme. */ + async getProjectUsagesForWorkflowScheme( + parameters: Parameters.GetProjectUsagesForWorkflowScheme, + callback: Callback, + ): Promise; + /** Returns a page of projects using a given workflow scheme. */ + async getProjectUsagesForWorkflowScheme( + parameters: Parameters.GetProjectUsagesForWorkflowScheme, + callback?: never, + ): Promise; + async getProjectUsagesForWorkflowScheme( + parameters: Parameters.GetProjectUsagesForWorkflowScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.workflowSchemeId}/projectUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version3/workflows.ts b/src/version3/workflows.ts index ce30980b56..61b1578005 100644 --- a/src/version3/workflows.ts +++ b/src/version3/workflows.ts @@ -144,6 +144,84 @@ export class Workflows { return this.client.sendRequest(config, callback); } + /** Returns a page of issue types using a given workflow within a project. */ + async getWorkflowProjectIssueTypeUsages( + parameters: Parameters.GetWorkflowProjectIssueTypeUsages, + callback: Callback, + ): Promise; + /** Returns a page of issue types using a given workflow within a project. */ + async getWorkflowProjectIssueTypeUsages( + parameters: Parameters.GetWorkflowProjectIssueTypeUsages, + callback?: never, + ): Promise; + async getWorkflowProjectIssueTypeUsages( + parameters: Parameters.GetWorkflowProjectIssueTypeUsages, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/${parameters.workflowId}/project/${parameters.projectId}/issueTypeUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of projects using a given workflow. */ + async getProjectUsagesForWorkflow( + parameters: Parameters.GetProjectUsagesForWorkflow, + callback: Callback, + ): Promise; + /** Returns a page of projects using a given workflow. */ + async getProjectUsagesForWorkflow( + parameters: Parameters.GetProjectUsagesForWorkflow, + callback?: never, + ): Promise; + async getProjectUsagesForWorkflow( + parameters: Parameters.GetProjectUsagesForWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/${parameters.workflowId}/projectUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of workflow schemes using a given workflow. */ + async getWorkflowSchemeUsagesForWorkflow( + parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, + callback: Callback, + ): Promise; + /** Returns a page of workflow schemes using a given workflow. */ + async getWorkflowSchemeUsagesForWorkflow( + parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, + callback?: never, + ): Promise; + async getWorkflowSchemeUsagesForWorkflow( + parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/${parameters.workflowId}/workflowSchemes`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Returns a list of workflows and related statuses by providing workflow names, workflow IDs, or project and issue * types. @@ -320,6 +398,57 @@ export class Workflows { return this.client.sendRequest(config, callback); } + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of global + * and project workflows. If workflow names are specified in query string, details of those workflows are returned. + * Otherwise, all workflows are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows + */ + async searchWorkflows( + parameters: Parameters.SearchWorkflows | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of global + * and project workflows. If workflow names are specified in query string, details of those workflows are returned. + * Otherwise, all workflows are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows + */ + async searchWorkflows( + parameters?: Parameters.SearchWorkflows, + callback?: never, + ): Promise; + async searchWorkflows( + parameters?: Parameters.SearchWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflows/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + expand: parameters?.expand, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + scope: parameters?.scope, + isActive: parameters?.isActive, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Update workflows and related statuses. * From 6c234d1ad5ec2d6068890f569fbaedb0ad7ca54f Mon Sep 17 00:00:00 2001 From: Ness Li Date: Thu, 20 Feb 2025 19:03:51 +0000 Subject: [PATCH 02/10] Check and apply changes in Version3Client to Version2Client (#359) * fix: build error * chore: update unit test * fix: missing failFast in SearchAndReconcileRequest * fix: improvement to updateComment Forgot to clone the same improvement as addComment. * feat: v2 IssueBulkOperations * fix: apply the same improvement to v2 prioritySchemes * chore: remove unused import * fix: apply the same improvement as v3 `ProjectKeyAndNameValidation.getValidProjectName` from `unknown` to `string` for improved type safety and usability. * fix: Apply the same fix as v3 Improvement: Added the avatarId parameter to the IssuePriorities.createPriority method. This parameter will replace iconUrl starting March 16, 2025. The iconUrl parameter is now marked as deprecated. * fix: apply the same fix as v3 Improvement: Added the avatarId parameter to the IssuePriorities.updatePriority method. This parameter will replace iconUrl starting March 16, 2025. The iconUrl parameter is now marked as deprecated. * fix: apply the same fix as v3 Fix: Improved the Avatars.storeAvatar method * fix: apply the same fix as v3 Fix: Improved the IssueTypes.createIssueTypeAvatar method * fix: apply the same deprecation notes as v3 * fix: align v3 naming to v2 issueSearch and jiraExpression with enhanced search * Update readme.md 1. moved API token like to API token section 2. added description and link to PAT 3. moved Basic auth to bottom as it's the least preferred way to auth * fix: rollback changes on v2 Copied v3 feat to v2 by mistake * Update src/version2/parameters/getAvailableTransitions.ts add number support to issue ids or keys Co-authored-by: Vladislav Tupikin * Update src/version2/parameters/getBulkEditableFields.ts add number support to issueIdsOrKeys Co-authored-by: Vladislav Tupikin * fix: startAt and maxResults should be number * fix: wrong link to v3 in version 2 * fix: incorrect version in anchor * fix: revert changes on adding v3 only model * Update src/version3/parameters/searchWorkflows.ts Co-authored-by: Vladislav Tupikin * Update src/version3/parameters/searchWorkflows.ts Co-authored-by: Vladislav Tupikin * chore: revert changes on README.md move it to another PR * fix: update *DTO in v3 --------- Co-authored-by: Vladislav Tupikin --- src/version2/avatars.ts | 7 +- src/version2/dashboards.ts | 1 - src/version2/filters.ts | 9 +- src/version2/groups.ts | 4 +- src/version2/index.ts | 4 + src/version2/issueComments.ts | 20 ++- src/version2/issuePriorities.ts | 12 +- src/version2/issueSearch.ts | 119 +++++++------- src/version2/issueTypes.ts | 8 +- src/version2/issueWorklogs.ts | 11 +- src/version2/issues.ts | 78 ++-------- src/version2/jQL.ts | 4 +- src/version2/jiraExpressions.ts | 30 ++-- .../addSecuritySchemeLevelsRequestBean.ts | 6 - src/version2/models/bulkIssue.ts | 14 -- src/version2/models/createPriorityDetails.ts | 35 ++++- .../models/dataClassificationLevels.ts | 4 +- src/version2/models/evaluateMetaData.ts | 8 +- .../models/evaluatedJiraExpression.ts | 4 +- src/version2/models/fieldCreateMetadata.ts | 4 +- src/version2/models/filter.ts | 6 + src/version2/models/filterDetails.ts | 6 + src/version2/models/index.ts | 84 +++++++++- .../models/jiraExpressionEvaluateRequest.ts | 4 +- src/version2/models/jiraTimeTrackingField.ts | 3 + ...qlFunctionPrecomputationGetByIdResponse.ts | 4 +- .../pageBeanFieldConfigurationDetails.ts | 8 +- src/version2/models/prioritySchemeId.ts | 4 +- ...chemeWithPaginatedPrioritiesAndProjects.ts | 9 +- src/version2/models/projectComponent.ts | 4 + src/version2/models/ruleConfiguration.ts | 2 +- .../models/searchAndReconcileRequest.ts | 2 + src/version2/models/updatePriorityDetails.ts | 32 +++- .../models/updatePrioritySchemeRequest.ts | 8 +- .../models/updatePrioritySchemeResponse.ts | 4 +- src/version2/models/updateProjectDetails.ts | 45 +++--- src/version2/models/version.ts | 15 +- src/version2/models/webhook.ts | 2 +- src/version2/myself.ts | 6 +- src/version2/parameters/bulkDeleteWorklogs.ts | 4 +- src/version2/parameters/bulkFetchIssues.ts | 4 +- src/version2/parameters/bulkMoveWorklogs.ts | 10 +- src/version2/parameters/copyDashboard.ts | 5 + src/version2/parameters/countIssues.ts | 4 +- src/version2/parameters/createDashboard.ts | 5 + src/version2/parameters/deleteComment.ts | 1 + src/version2/parameters/editIssue.ts | 2 +- .../parameters/evaluateJSISJiraExpression.ts | 13 -- .../parameters/findAssignableUsers.ts | 2 + .../getAvailablePrioritiesByPriorityScheme.ts | 4 +- .../parameters/getAvailableTransitions.ts | 8 + src/version2/parameters/getBulkChangelogs.ts | 4 +- .../parameters/getBulkEditableFields.ts | 10 ++ .../parameters/getBulkOperationProgress.ts | 4 + .../parameters/getFiltersPaginated.ts | 6 + src/version2/parameters/getIssue.ts | 6 + .../getNotificationSchemeToProjectMappings.ts | 4 +- .../getPrioritiesByPriorityScheme.ts | 4 +- src/version2/parameters/getPrioritySchemes.ts | 4 +- .../parameters/getProjectComponents.ts | 8 + .../getProjectComponentsPaginated.ts | 8 + .../parameters/getProjectsByPriorityScheme.ts | 4 +- .../parameters/getSecurityLevelMembers.ts | 4 +- src/version2/parameters/getSecurityLevels.ts | 4 +- src/version2/parameters/index.ts | 69 ++++++++ src/version2/parameters/readWorkflows.ts | 18 ++- .../searchAndReconsileIssuesUsingJql.ts | 65 -------- .../searchAndReconsileIssuesUsingJqlPost.ts | 3 - src/version2/parameters/searchForIssuesIds.ts | 4 +- .../parameters/searchForIssuesUsingJql.ts | 6 + src/version2/parameters/searchPriorities.ts | 7 + .../searchProjectsUsingSecuritySchemes.ts | 4 +- .../parameters/searchSecuritySchemes.ts | 4 +- .../suggestedPrioritiesForMappings.ts | 4 +- src/version2/parameters/updateDashboard.ts | 5 + .../updateDefaultProjectClassification.ts | 4 +- .../parameters/updatePrecomputations.ts | 4 +- .../parameters/updatePriorityScheme.ts | 4 +- src/version2/permissionSchemes.ts | 11 +- src/version2/prioritySchemes.ts | 50 +++--- src/version2/projectClassificationLevels.ts | 1 - src/version2/projectComponents.ts | 16 +- src/version2/projectKeyAndNameValidation.ts | 6 +- src/version2/projectVersions.ts | 15 +- src/version2/projects.ts | 2 - src/version2/status.ts | 4 +- src/version2/workflowSchemes.ts | 22 +-- src/version2/workflowTransitionRules.ts | 4 +- src/version2/workflows.ts | 5 +- src/version3/models/index.ts | 146 ++++++++--------- .../models/statusProjectIssueTypeUsage.ts | 10 ++ .../models/statusProjectIssueTypeUsagePage.ts | 9 ++ src/version3/models/statusProjectUsage.ts | 8 + src/version3/models/statusProjectUsagePage.ts | 9 ++ src/version3/models/statusWorkflowUsage.ts | 8 + .../models/statusWorkflowUsagePage.ts | 9 ++ .../models/statusWorkflowUsageWorkflow.ts | 5 + .../models/workflowProjectIssueTypeUsage.ts | 10 ++ .../workflowProjectIssueTypeUsagePage.ts | 9 ++ src/version3/models/workflowProjectUsage.ts | 8 + src/version3/models/workflowSchemeUsage.ts | 8 + .../models/workflowSchemeUsagePage.ts | 9 ++ .../models/workflowSearchResponse.ts} | 13 +- .../getAvailablePrioritiesByPriorityScheme.ts | 4 +- .../getNotificationSchemeToProjectMappings.ts | 4 +- .../getPrioritiesByPriorityScheme.ts | 4 +- src/version3/parameters/getPrioritySchemes.ts | 4 +- .../getProjectIssueTypeUsagesForStatus.ts | 10 ++ .../parameters/getProjectUsagesForStatus.ts | 8 + .../parameters/getProjectUsagesForWorkflow.ts | 8 + .../parameters/getProjectsByPriorityScheme.ts | 4 +- .../parameters/getSecurityLevelMembers.ts | 4 +- src/version3/parameters/getSecurityLevels.ts | 4 +- .../getWorkflowProjectIssueTypeUsages.ts | 10 ++ .../getWorkflowSchemeUsagesForWorkflow.ts | 8 + .../parameters/getWorkflowUsagesForStatus.ts | 8 + src/version3/parameters/index.ts | 147 +++++++++--------- src/version3/parameters/searchPriorities.ts | 4 +- .../searchProjectsUsingSecuritySchemes.ts | 4 +- .../parameters/searchSecuritySchemes.ts | 4 +- src/version3/parameters/searchWorkflows.ts | 27 ++++ src/version3/status.ts | 18 +-- src/version3/workflows.ts | 18 +-- tests/unit/version2/issueSearch.test.ts | 7 +- tests/unit/version2/jiraExpressions.test.ts | 4 +- tests/unit/version2/projectVersions.test.ts | 2 + tests/unit/version3/issueSearch.test.ts | 2 +- 127 files changed, 1048 insertions(+), 629 deletions(-) delete mode 100644 src/version2/models/addSecuritySchemeLevelsRequestBean.ts delete mode 100644 src/version2/models/bulkIssue.ts create mode 100644 src/version2/models/jiraTimeTrackingField.ts delete mode 100644 src/version2/parameters/evaluateJSISJiraExpression.ts create mode 100644 src/version2/parameters/getAvailableTransitions.ts create mode 100644 src/version2/parameters/getBulkEditableFields.ts create mode 100644 src/version2/parameters/getBulkOperationProgress.ts delete mode 100644 src/version2/parameters/searchAndReconsileIssuesUsingJql.ts delete mode 100644 src/version2/parameters/searchAndReconsileIssuesUsingJqlPost.ts create mode 100644 src/version3/models/statusProjectIssueTypeUsage.ts create mode 100644 src/version3/models/statusProjectIssueTypeUsagePage.ts create mode 100644 src/version3/models/statusProjectUsage.ts create mode 100644 src/version3/models/statusProjectUsagePage.ts create mode 100644 src/version3/models/statusWorkflowUsage.ts create mode 100644 src/version3/models/statusWorkflowUsagePage.ts create mode 100644 src/version3/models/statusWorkflowUsageWorkflow.ts create mode 100644 src/version3/models/workflowProjectIssueTypeUsage.ts create mode 100644 src/version3/models/workflowProjectIssueTypeUsagePage.ts create mode 100644 src/version3/models/workflowProjectUsage.ts create mode 100644 src/version3/models/workflowSchemeUsage.ts create mode 100644 src/version3/models/workflowSchemeUsagePage.ts rename src/{version2/models/pageBean2ComponentJsonBean.ts => version3/models/workflowSearchResponse.ts} (55%) create mode 100644 src/version3/parameters/getProjectIssueTypeUsagesForStatus.ts create mode 100644 src/version3/parameters/getProjectUsagesForStatus.ts create mode 100644 src/version3/parameters/getProjectUsagesForWorkflow.ts create mode 100644 src/version3/parameters/getWorkflowProjectIssueTypeUsages.ts create mode 100644 src/version3/parameters/getWorkflowSchemeUsagesForWorkflow.ts create mode 100644 src/version3/parameters/getWorkflowUsagesForStatus.ts create mode 100644 src/version3/parameters/searchWorkflows.ts diff --git a/src/version2/avatars.ts b/src/version2/avatars.ts index 40011ccc30..621d4474a1 100644 --- a/src/version2/avatars.ts +++ b/src/version2/avatars.ts @@ -160,11 +160,16 @@ export class Avatars { const config: RequestConfig = { url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': parameters.mimeType, + }, params: { x: parameters.x, y: parameters.y, - size: parameters.size, + size: parameters.size ?? 0, }, + data: parameters.avatar, }; return this.client.sendRequest(config, callback); diff --git a/src/version2/dashboards.ts b/src/version2/dashboards.ts index 66f03ca4db..d1618c4192 100644 --- a/src/version2/dashboards.ts +++ b/src/version2/dashboards.ts @@ -197,7 +197,6 @@ export class Dashboards { params: { dashboardName: parameters?.dashboardName, accountId: parameters?.accountId, - owner: parameters?.owner, groupname: parameters?.groupname, groupId: parameters?.groupId, projectId: parameters?.projectId, diff --git a/src/version2/filters.ts b/src/version2/filters.ts index 97df20fbf2..8e4c9f28da 100644 --- a/src/version2/filters.ts +++ b/src/version2/filters.ts @@ -227,7 +227,6 @@ export class Filters { params: { filterName: parameters?.filterName, accountId: parameters?.accountId, - owner: parameters?.owner, groupname: parameters?.groupname, groupId: parameters?.groupId, projectId: parameters?.projectId, @@ -312,7 +311,13 @@ export class Filters { expand: parameters.expand, overrideSharePermissions: parameters.overrideSharePermissions, }, - data: parameters.body, + data: { + name: parameters.name, + description: parameters.description, + jql: parameters.jql, + favourite: parameters.favourite, + sharePermissions: parameters.sharePermissions, + }, }; return this.client.sendRequest(config, callback); diff --git a/src/version2/groups.ts b/src/version2/groups.ts index 57a4ad3f98..21c994b6c4 100644 --- a/src/version2/groups.ts +++ b/src/version2/groups.ts @@ -178,7 +178,7 @@ export class Groups { url: '/rest/api/2/group/user', method: 'POST', params: { - groupname: parameters?.groupname, + groupname: parameters?.groupName, groupId: parameters?.groupId, }, data: { @@ -276,13 +276,11 @@ export class Groups { url: '/rest/api/2/groups/picker', method: 'GET', params: { - accountId: parameters?.accountId, query: parameters?.query, exclude: parameters?.exclude, excludeId: parameters?.excludeId, maxResults: parameters?.maxResults, caseInsensitive: parameters?.caseInsensitive, - userName: parameters?.userName, }, }; diff --git a/src/version2/index.ts b/src/version2/index.ts index d185ac5960..d177fc664a 100644 --- a/src/version2/index.ts +++ b/src/version2/index.ts @@ -90,3 +90,7 @@ export * from './workflowStatuses'; export * from './workflowTransitionProperties'; export * from './workflowTransitionRules'; export * from './workflows'; + +export * from './client'; +export * as Version2Models from './models'; +export * as Version2Parameters from './parameters'; diff --git a/src/version2/issueComments.ts b/src/version2/issueComments.ts index d484f265ee..00e6e24298 100644 --- a/src/version2/issueComments.ts +++ b/src/version2/issueComments.ts @@ -147,18 +147,18 @@ export class IssueComments { expand: parameters.expand, }, data: { - author: parameters.author, - body: parameters.body, - created: parameters.created, + self: parameters.self, id: parameters.id, - jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, - jsdPublic: parameters.jsdPublic, - properties: parameters.properties, + author: parameters.author, + body: parameters.comment, renderedBody: parameters.renderedBody, - self: parameters.self, updateAuthor: parameters.updateAuthor, + created: parameters.created, updated: parameters.updated, visibility: parameters.visibility, + jsdPublic: parameters.jsdPublic, + jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, + properties: parameters.properties, }, }; @@ -251,7 +251,11 @@ export class IssueComments { overrideEditableFlag: parameters.overrideEditableFlag, expand: parameters.expand, }, - data: parameters.body, + data: { + body: parameters.comment, + visibility: parameters.visibility, + properties: parameters.properties, + }, }; return this.client.sendRequest(config, callback); diff --git a/src/version2/issuePriorities.ts b/src/version2/issuePriorities.ts index 2b7daf9921..4553305443 100644 --- a/src/version2/issuePriorities.ts +++ b/src/version2/issuePriorities.ts @@ -52,18 +52,18 @@ export class IssuePriorities { */ async createPriority(parameters?: Parameters.CreatePriority, callback?: never): Promise; async createPriority( - parameters?: Parameters.CreatePriority, + parameters: Parameters.CreatePriority, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/priority', method: 'POST', data: { - avatarId: parameters?.avatarId, - description: parameters?.description, - iconUrl: parameters?.iconUrl, - name: parameters?.name, - statusColor: parameters?.statusColor, + avatarId: parameters.avatarId, + description: parameters.description, + iconUrl: parameters.iconUrl, + name: parameters.name, + statusColor: parameters.statusColor, }, }; diff --git a/src/version2/issueSearch.ts b/src/version2/issueSearch.ts index a955671640..d6b9175aac 100644 --- a/src/version2/issueSearch.ts +++ b/src/version2/issueSearch.ts @@ -74,10 +74,7 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async matchIssues( - parameters: Parameters.MatchIssues | undefined, - callback: Callback, - ): Promise; + async matchIssues(parameters: Parameters.MatchIssues, callback: Callback): Promise; /** * Checks whether one or more issues would be returned by one or more JQL queries. * @@ -89,17 +86,17 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async matchIssues(parameters?: Parameters.MatchIssues, callback?: never): Promise; + async matchIssues(parameters: Parameters.MatchIssues, callback?: never): Promise; async matchIssues( - parameters?: Parameters.MatchIssues, + parameters: Parameters.MatchIssues, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/jql/match', method: 'POST', data: { - issueIds: parameters?.issueIds, - jqls: parameters?.jqls, + issueIds: parameters.issueIds, + jqls: parameters.jqls, }, }; @@ -122,7 +119,7 @@ export class IssueSearch { * to view the issue. */ async searchForIssuesUsingJql( - parameters: Parameters.SearchForIssuesUsingJql | undefined, + parameters: Parameters.SearchForIssuesUsingJql, callback: Callback, ): Promise; /** @@ -142,26 +139,26 @@ export class IssueSearch { * to view the issue. */ async searchForIssuesUsingJql( - parameters?: Parameters.SearchForIssuesUsingJql, + parameters: Parameters.SearchForIssuesUsingJql, callback?: never, ): Promise; async searchForIssuesUsingJql( - parameters?: Parameters.SearchForIssuesUsingJql, + parameters: Parameters.SearchForIssuesUsingJql, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/search', method: 'GET', params: { - jql: parameters?.jql, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - validateQuery: parameters?.validateQuery, - fields: parameters?.fields, - expand: parameters?.expand, - properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, - failFast: parameters?.failFast, + jql: parameters.jql, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + properties: parameters.properties, + fieldsByKeys: parameters.fieldsByKeys, + failFast: parameters.failFast, }, }; @@ -242,10 +239,7 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async countIssues( - parameters: Parameters.CountIssues | undefined, - callback: Callback, - ): Promise; + async countIssues(parameters: Parameters.CountIssues, callback: Callback): Promise; /** * Provide an estimated count of the issues that match the [JQL](https://confluence.atlassian.com/x/egORLQ). Recent * updates might not be immediately visible in the returned output. This endpoint requires JQL to be bounded. @@ -260,16 +254,16 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async countIssues(parameters?: Parameters.CountIssues, callback?: never): Promise; + async countIssues(parameters: Parameters.CountIssues, callback?: never): Promise; async countIssues( - parameters?: Parameters.CountIssues, + parameters: Parameters.CountIssues, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/search/approximate-count', method: 'POST', data: { - jql: parameters?.jql, + jql: parameters.jql, }, }; @@ -294,7 +288,7 @@ export class IssueSearch { * to view the issue. */ async searchForIssuesIds( - parameters: Parameters.SearchForIssuesIds | undefined, + parameters: Parameters.SearchForIssuesIds, callback: Callback, ): Promise; /** @@ -316,20 +310,20 @@ export class IssueSearch { * to view the issue. */ async searchForIssuesIds( - parameters?: Parameters.SearchForIssuesIds, + parameters: Parameters.SearchForIssuesIds, callback?: never, ): Promise; async searchForIssuesIds( - parameters?: Parameters.SearchForIssuesIds, + parameters: Parameters.SearchForIssuesIds, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/search/id', method: 'POST', data: { - jql: parameters?.jql, - maxResults: parameters?.maxResults, - nextPageToken: parameters?.nextPageToken, + jql: parameters.jql, + maxResults: parameters.maxResults, + nextPageToken: parameters.nextPageToken, }, }; @@ -353,8 +347,8 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async searchAndReconsileIssuesUsingJql( - parameters: Parameters.SearchAndReconsileIssuesUsingJql | undefined, + async searchForIssuesUsingJqlEnhancedSearch( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch | undefined, callback: Callback, ): Promise; /** @@ -375,27 +369,27 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async searchAndReconsileIssuesUsingJql( - parameters?: Parameters.SearchAndReconsileIssuesUsingJql, + async searchForIssuesUsingJqlEnhancedSearch( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch, callback?: never, ): Promise; - async searchAndReconsileIssuesUsingJql( - parameters?: Parameters.SearchAndReconsileIssuesUsingJql, + async searchForIssuesUsingJqlEnhancedSearch( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/search/jql', method: 'GET', params: { - jql: parameters?.jql, - nextPageToken: parameters?.nextPageToken, - maxResults: parameters?.maxResults, - fields: parameters?.fields, - expand: parameters?.expand, - properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, - failFast: parameters?.failFast, - reconcileIssues: parameters?.reconcileIssues, + jql: parameters.jql, + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + fields: parameters.fields, + expand: parameters.expand, + properties: parameters.properties, + fieldsByKeys: parameters.fieldsByKeys, + failFast: parameters.failFast, + reconcileIssues: parameters.reconcileIssues, }, }; @@ -416,8 +410,8 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async searchAndReconsileIssuesUsingJqlPost( - parameters: Parameters.SearchAndReconsileIssuesUsingJqlPost | undefined, + async searchForIssuesUsingJqlEnhancedSearchPost( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, callback: Callback, ): Promise; /** @@ -435,26 +429,27 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async searchAndReconsileIssuesUsingJqlPost( - parameters?: Parameters.SearchAndReconsileIssuesUsingJqlPost, + async searchForIssuesUsingJqlEnhancedSearchPost( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, callback?: never, ): Promise; - async searchAndReconsileIssuesUsingJqlPost( - parameters?: Parameters.SearchAndReconsileIssuesUsingJqlPost, + async searchForIssuesUsingJqlEnhancedSearchPost( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/search/jql', method: 'POST', data: { - expand: parameters?.expand, - fields: parameters?.fields, - fieldsByKeys: parameters?.fieldsByKeys, - jql: parameters?.jql, - maxResults: parameters?.maxResults, - nextPageToken: parameters?.nextPageToken, - properties: parameters?.properties, - reconcileIssues: parameters?.reconcileIssues, + jql: parameters.jql, + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + fields: parameters.fields, + expand: parameters.expand, + properties: parameters.properties, + fieldsByKeys: parameters.fieldsByKeys, + failFast: parameters.failFast, + reconcileIssues: parameters.reconcileIssues, }, }; diff --git a/src/version2/issueTypes.ts b/src/version2/issueTypes.ts index e230440c5f..67da4e4b78 100644 --- a/src/version2/issueTypes.ts +++ b/src/version2/issueTypes.ts @@ -73,7 +73,6 @@ export class IssueTypes { description: parameters?.description, hierarchyLevel: parameters?.hierarchyLevel, name: parameters?.name, - type: parameters?.type, }, }; @@ -319,11 +318,16 @@ export class IssueTypes { const config: RequestConfig = { url: `/rest/api/2/issuetype/${parameters.id}/avatar2`, method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': parameters.mimeType, + }, params: { x: parameters.x, y: parameters.y, - size: parameters.size, + size: parameters.size ?? 0, }, + data: parameters.avatar, }; return this.client.sendRequest(config, callback); diff --git a/src/version2/issueWorklogs.ts b/src/version2/issueWorklogs.ts index e73c433a88..6b63e6a349 100644 --- a/src/version2/issueWorklogs.ts +++ b/src/version2/issueWorklogs.ts @@ -243,7 +243,7 @@ export class IssueWorklogs { adjustEstimate: parameters.adjustEstimate, overrideEditableFlag: parameters.overrideEditableFlag, }, - data: parameters.body, + data: parameters.worklogs, }; return this.client.sendRequest(config, callback); @@ -345,7 +345,14 @@ export class IssueWorklogs { expand: parameters.expand, overrideEditableFlag: parameters.overrideEditableFlag, }, - data: parameters.body, + 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); diff --git a/src/version2/issues.ts b/src/version2/issues.ts index 4c4d8045d6..28f14adeee 100644 --- a/src/version2/issues.ts +++ b/src/version2/issues.ts @@ -154,9 +154,9 @@ export class Issues { * of the submitted request. * * You can use the [get - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-rest-api-2-task-taskid-get) * and [cancel - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-rest-api-2-task-taskid-cancel-post) * APIs to manage the request. * * **Note that:** @@ -173,7 +173,7 @@ export class Issues { * * **Rate limiting:** Only a single request per jira instance can be active at any given time. */ - async archiveIssuesAsync( + async archiveIssuesAsync( parameters: Parameters.ArchiveIssuesAsync | undefined, callback: Callback, ): Promise; @@ -182,9 +182,9 @@ export class Issues { * of the submitted request. * * You can use the [get - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-rest-api-2-task-taskid-get) * and [cancel - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-rest-api-2-task-taskid-cancel-post) * APIs to manage the request. * * **Note that:** @@ -201,8 +201,8 @@ export class Issues { * * **Rate limiting:** Only a single request per jira instance can be active at any given time. */ - async archiveIssuesAsync(parameters?: Parameters.ArchiveIssuesAsync, callback?: never): Promise; - async archiveIssuesAsync( + async archiveIssuesAsync(parameters?: Parameters.ArchiveIssuesAsync, callback?: never): Promise; + async archiveIssuesAsync( parameters?: Parameters.ArchiveIssuesAsync, callback?: Callback, ): Promise { @@ -327,70 +327,9 @@ export class Issues { return this.client.sendRequest(config, callback); } - /** - * Returns the details for a set of requested issues. You can request up to 100 issues. - * - * Each issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive - * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or - * other redirect is **not** returned. - * - * Issues will be returned in ascending `id` order. If there are errors, Jira will return a list of issues which - * couldn't be fetched along with error messages. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async bulkFetchIssues( - parameters: Parameters.BulkFetchIssues | undefined, - callback: Callback, - ): Promise; - /** - * Returns the details for a set of requested issues. You can request up to 100 issues. - * - * Each issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive - * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or - * other redirect is **not** returned. - * - * Issues will be returned in ascending `id` order. If there are errors, Jira will return a list of issues which - * couldn't be fetched along with error messages. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async bulkFetchIssues(parameters?: Parameters.BulkFetchIssues, callback?: never): Promise; - async bulkFetchIssues( - parameters?: Parameters.BulkFetchIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/bulkfetch', - method: 'POST', - data: { - expand: parameters?.expand, - fields: parameters?.fields, - fieldsByKeys: parameters?.fieldsByKeys, - issueIdsOrKeys: parameters?.issueIdsOrKeys, - properties: parameters?.properties, - }, - }; - return this.client.sendRequest(config, callback); - } /** + * @deprecated * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each * issue type for the user. Use the information to populate the requests in [ Create * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). @@ -412,6 +351,7 @@ export class Issues { callback: Callback, ): Promise; /** + * @deprecated * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each * issue type for the user. Use the information to populate the requests in [ Create * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). diff --git a/src/version2/jQL.ts b/src/version2/jQL.ts index 4b0ce522c7..54f434391e 100644 --- a/src/version2/jQL.ts +++ b/src/version2/jQL.ts @@ -261,7 +261,7 @@ export class JQL { * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in * JQL - * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). + * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-jql/#api-rest-api-2-jql-sanitize-post). * * Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. * @@ -284,7 +284,7 @@ export class JQL { * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in * JQL - * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). + * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-jql/#api-rest-api-2-jql-sanitize-post). * * Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. * diff --git a/src/version2/jiraExpressions.ts b/src/version2/jiraExpressions.ts index 0d41729966..6b15a0593e 100644 --- a/src/version2/jiraExpressions.ts +++ b/src/version2/jiraExpressions.ts @@ -109,7 +109,7 @@ export class JiraExpressions { * fields (for example, `issue.sprint`). */ async evaluateJiraExpression( - parameters: Parameters.EvaluateJiraExpression | undefined, + parameters: Parameters.EvaluateJiraExpression, callback: Callback, ): Promise; /** @@ -169,22 +169,22 @@ export class JiraExpressions { * fields (for example, `issue.sprint`). */ async evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, + parameters: Parameters.EvaluateJiraExpression, callback?: never, ): Promise; async evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, + parameters: Parameters.EvaluateJiraExpression, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/expression/eval', method: 'POST', params: { - expand: parameters?.expand, + expand: parameters.expand, }, data: { - context: parameters?.context, - expression: parameters?.expression, + context: parameters.context, + expression: parameters.expression, }, }; @@ -250,8 +250,8 @@ export class JiraExpressions { * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or * fields (for example, `issue.sprint`). */ - async evaluateJSISJiraExpression( - parameters: Parameters.EvaluateJSISJiraExpression | undefined, + async evaluateJiraExpressionUsingEnhancedSearch( + parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, callback: Callback, ): Promise; /** @@ -314,23 +314,23 @@ export class JiraExpressions { * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or * fields (for example, `issue.sprint`). */ - async evaluateJSISJiraExpression( - parameters?: Parameters.EvaluateJSISJiraExpression, + async evaluateJiraExpressionUsingEnhancedSearch( + parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, callback?: never, ): Promise; - async evaluateJSISJiraExpression( - parameters?: Parameters.EvaluateJSISJiraExpression, + async evaluateJiraExpressionUsingEnhancedSearch( + parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/expression/evaluate', method: 'POST', params: { - expand: parameters?.expand, + expand: parameters.expand, }, data: { - context: parameters?.context, - expression: parameters?.expression, + expression: parameters.expression, + context: parameters.context, }, }; diff --git a/src/version2/models/addSecuritySchemeLevelsRequestBean.ts b/src/version2/models/addSecuritySchemeLevelsRequestBean.ts deleted file mode 100644 index 02ddf9eeea..0000000000 --- a/src/version2/models/addSecuritySchemeLevelsRequestBean.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { SecuritySchemeLevelBean } from './securitySchemeLevelBean'; - -export interface AddSecuritySchemeLevelsRequestBean { - /** The list of scheme levels which should be added to the security scheme. */ - levels?: SecuritySchemeLevelBean[]; -} diff --git a/src/version2/models/bulkIssue.ts b/src/version2/models/bulkIssue.ts deleted file mode 100644 index 43ffd98971..0000000000 --- a/src/version2/models/bulkIssue.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IssueError } from './issueError'; -import { IssueBean } from './issueBean'; - -/** The list of requested issues & fields. */ -export interface BulkIssue { - /** - * When Jira can't return an issue enumerated in a request due to a retriable error or payload constraint, we'll - * return the respective issue ID with a corresponding error message. This list is empty when there are no errors - * Issues which aren't found or that the user doesn't have permission to view won't be returned in this list. - */ - issueErrors?: IssueError[]; - /** The list of issues. */ - issues?: IssueBean[]; -} diff --git a/src/version2/models/createPriorityDetails.ts b/src/version2/models/createPriorityDetails.ts index 363c7a2759..934f9993bf 100644 --- a/src/version2/models/createPriorityDetails.ts +++ b/src/version2/models/createPriorityDetails.ts @@ -1,9 +1,40 @@ /** Details of an issue priority. */ export interface CreatePriorityDetails { + /** + * The ID for the avatar for the priority. Either the iconUrl or avatarId must be defined, but not both. This + * parameter is nullable and will become mandatory once the iconUrl parameter is deprecated. + */ + avatarId?: number; /** The description of the priority. */ description?: string; - /** The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. */ - iconUrl?: string; + /** + * The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. Either + * the iconUrl or avatarId must be defined, but not both. + * + * @deprecated This property is deprecated and will be removed in a future version. Use `avatarId` instead. + */ + iconUrl?: + | '/images/icons/priorities/blocker.png' + | '/images/icons/priorities/critical.png' + | '/images/icons/priorities/high.png' + | '/images/icons/priorities/highest.png' + | '/images/icons/priorities/low.png' + | '/images/icons/priorities/lowest.png' + | '/images/icons/priorities/major.png' + | '/images/icons/priorities/medium.png' + | '/images/icons/priorities/minor.png' + | '/images/icons/priorities/trivial.png' + | '/images/icons/priorities/blocker_new.png' + | '/images/icons/priorities/critical_new.png' + | '/images/icons/priorities/high_new.png' + | '/images/icons/priorities/highest_new.png' + | '/images/icons/priorities/low_new.png' + | '/images/icons/priorities/lowest_new.png' + | '/images/icons/priorities/major_new.png' + | '/images/icons/priorities/medium_new.png' + | '/images/icons/priorities/minor_new.png' + | '/images/icons/priorities/trivial_new.png' + | string; /** The name of the priority. Must be unique. */ name: string; /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ diff --git a/src/version2/models/dataClassificationLevels.ts b/src/version2/models/dataClassificationLevels.ts index d921e59834..8358ceb249 100644 --- a/src/version2/models/dataClassificationLevels.ts +++ b/src/version2/models/dataClassificationLevels.ts @@ -1,7 +1,7 @@ -import { DataClassificationTagBean } from './dataClassificationTagBean'; +import { DataClassificationTag } from './dataClassificationTag'; /** The data classification. */ export interface DataClassificationLevels { /** The data classifications. */ - classifications?: DataClassificationTagBean[]; + classifications?: DataClassificationTag[]; } diff --git a/src/version2/models/evaluateMetaData.ts b/src/version2/models/evaluateMetaData.ts index c636542ad3..827c47dad2 100644 --- a/src/version2/models/evaluateMetaData.ts +++ b/src/version2/models/evaluateMetaData.ts @@ -1,11 +1,11 @@ -import { JiraExpressionsComplexityBean } from './jiraExpressionsComplexityBean'; -import { JExpEvaluateIssuesMetaBean } from './jExpEvaluateIssuesMetaBean'; +import { JiraExpressionsComplexity } from './jiraExpressionsComplexity'; +import { JExpEvaluateIssuesMeta } from './jExpEvaluateIssuesMeta'; /** * Contains information about the expression evaluation. This bean will be replacing * `JiraExpressionEvaluationMetaDataBean` bean as part of new `evaluate` endpoint */ export interface EvaluateMetaData { - complexity?: JiraExpressionsComplexityBean; - issues?: JExpEvaluateIssuesMetaBean; + complexity?: JiraExpressionsComplexity; + issues?: JExpEvaluateIssuesMeta; } diff --git a/src/version2/models/evaluatedJiraExpression.ts b/src/version2/models/evaluatedJiraExpression.ts index 3c4ce1a643..beb9f0a724 100644 --- a/src/version2/models/evaluatedJiraExpression.ts +++ b/src/version2/models/evaluatedJiraExpression.ts @@ -1,11 +1,11 @@ -import { JExpEvaluateMetaDataBean } from './jExpEvaluateMetaDataBean'; +import { JExpEvaluateMetaData } from './jExpEvaluateMetaData'; /** * The result of evaluating a Jira expression.This bean will be replacing `JiraExpressionResultBean` bean as part of new * evaluate endpoint */ export interface EvaluatedJiraExpression { - meta?: JExpEvaluateMetaDataBean; + meta?: JExpEvaluateMetaData; /** * The value of the evaluated expression. It may be a primitive JSON value or a Jira REST API object. (Some * expressions do not produce any meaningful results—for example, an expression that returns a lambda function—if diff --git a/src/version2/models/fieldCreateMetadata.ts b/src/version2/models/fieldCreateMetadata.ts index 93e6db0c19..462e2c172e 100644 --- a/src/version2/models/fieldCreateMetadata.ts +++ b/src/version2/models/fieldCreateMetadata.ts @@ -1,4 +1,4 @@ -import { JsonTypeBean } from './jsonTypeBean'; +import { JsonType } from './jsonType'; /** The metadata describing an issue field for createmeta. */ export interface FieldCreateMetadata { @@ -22,5 +22,5 @@ export interface FieldCreateMetadata { operations: string[]; /** Whether the field is required. */ required: boolean; - schema?: JsonTypeBean; + schema?: JsonType; } diff --git a/src/version2/models/filter.ts b/src/version2/models/filter.ts index ac37b1db24..84c57805b2 100644 --- a/src/version2/models/filter.ts +++ b/src/version2/models/filter.ts @@ -5,6 +5,12 @@ import { UserList } from './userList'; /** Details about a filter. */ export interface Filter { + /** + * @experimental [Experimental] Approximate last used time. Returns the date and time when the filter was last used. Returns `null` + * if the filter hasn't been used after tracking was enabled. For performance reasons, timestamps aren't updated in + * real time and therefore may not be exactly accurate. + */ + approximateLastUsed?: string; /** A description of the filter. */ description?: string; /** The groups and projects that can edit the filter. */ diff --git a/src/version2/models/filterDetails.ts b/src/version2/models/filterDetails.ts index d4b8b3d624..a44d9ea59b 100644 --- a/src/version2/models/filterDetails.ts +++ b/src/version2/models/filterDetails.ts @@ -4,6 +4,12 @@ import { User } from './user'; /** Details of a filter. */ export interface FilterDetails { + /** + * @experimental [Experimental] Approximate last used time. Returns the date and time when the filter was last used. Returns `null` + * if the filter hasn't been used after tracking was enabled. For performance reasons, timestamps aren't updated in + * real time and therefore may not be exactly accurate. + */ + approximateLastUsed?: string; /** The description of the filter. */ description?: string; /** diff --git a/src/version2/models/index.ts b/src/version2/models/index.ts index e4f98681c3..ba7bff3087 100644 --- a/src/version2/models/index.ts +++ b/src/version2/models/index.ts @@ -1,13 +1,16 @@ export * from './actorInput'; export * from './actorsMap'; +export * from './addAtlassianTeamRequest'; export * from './addField'; export * from './addGroup'; +export * from './addNotificationsDetails'; export * from './addSecuritySchemeLevelsRequest'; export * from './announcementBannerConfiguration'; export * from './announcementBannerConfigurationUpdate'; export * from './application'; export * from './applicationProperty'; export * from './applicationRole'; +export * from './archiveIssueAsyncRequest'; export * from './associatedItem'; export * from './associateFieldConfigurationsWithIssueTypesRequest'; export * from './attachment'; @@ -32,10 +35,13 @@ export * from './avatar'; export * from './avatars'; export * from './avatarUrls'; export * from './avatarWithDetails'; +export * from './bulkChangelog'; +export * from './bulkChangelogRequest'; export * from './bulkChangeOwnerDetails'; export * from './bulkCustomFieldOptionCreateRequest'; export * from './bulkCustomFieldOptionUpdateRequest'; export * from './bulkEditShareableEntity'; +export * from './bulkFetchIssueRequest'; export * from './bulkIssueIsWatching'; export * from './bulkIssuePropertyUpdateRequest'; export * from './bulkOperationErrorResult'; @@ -50,11 +56,13 @@ export * from './changedWorklogs'; export * from './changelog'; export * from './columnItem'; export * from './comment'; +export * from './component'; export * from './componentIssuesCount'; export * from './componentWithIssueCount'; export * from './conditionGroupConfiguration'; export * from './conditionGroupUpdate'; export * from './configuration'; +export * from './configurationsListParameters'; export * from './connectCustomFieldValue'; export * from './connectCustomFieldValues'; export * from './connectModule'; @@ -67,14 +75,23 @@ export * from './containerOfWorkflowSchemeAssociations'; export * from './contextForProjectAndIssueType'; export * from './contextualConfiguration'; export * from './convertedJQLQueries'; +export * from './createCrossProjectReleaseRequest'; export * from './createCustomFieldContext'; +export * from './createCustomFieldRequest'; export * from './createdIssue'; export * from './createdIssues'; +export * from './createExclusionRulesRequest'; export * from './createIssueSecuritySchemeDetails'; +export * from './createIssueSourceRequest'; export * from './createNotificationSchemeDetails'; +export * from './createPermissionRequest'; +export * from './createPlanOnlyTeamRequest'; +export * from './createPlanRequest'; export * from './createPriorityDetails'; +export * from './createPrioritySchemeDetails'; export * from './createProjectDetails'; export * from './createResolutionDetails'; +export * from './createSchedulingRequest'; export * from './createUiModificationDetails'; export * from './createUpdateRoleRequest'; export * from './createWorkflowCondition'; @@ -109,19 +126,24 @@ export * from './dashboardGadgetResponse'; export * from './dashboardGadgetSettings'; export * from './dashboardGadgetUpdateRequest'; export * from './dashboardUser'; +export * from './dataClassificationLevels'; export * from './dateRangeFilter'; export * from './defaultLevelValue'; export * from './defaultShareScope'; export * from './defaultWorkflow'; +export * from './deleteAndReplaceVersion'; export * from './documentVersion'; +export * from './duplicatePlanRequest'; export * from './enhancedSearchRequest'; export * from './entityProperty'; export * from './entityPropertyDetails'; export * from './error'; export * from './errorCollection'; export * from './errors'; +export * from './evaluatedJiraExpression'; export * from './eventNotification'; export * from './exportArchivedIssuesTaskProgress'; +export * from './exportArchivedIssuesTaskProgressResponse'; export * from './failedWebhook'; export * from './failedWebhooks'; export * from './field'; @@ -149,6 +171,8 @@ export * from './foundGroups'; export * from './foundUsers'; export * from './foundUsersAndGroups'; export * from './functionReferenceData'; +export * from './getAtlassianTeamResponse'; +export * from './getPlanOnlyTeamResponse'; export * from './globalScope'; export * from './group'; export * from './groupDetails'; @@ -161,9 +185,12 @@ export * from './historyMetadataParticipant'; export * from './icon'; export * from './id'; export * from './idOrKey'; +export * from './idSearchRequest'; +export * from './idSearchResults'; export * from './includedFields'; export * from './issue'; export * from './issueArchivalSync'; +export * from './issueArchivalSyncRequest'; export * from './issueChangelogIds'; export * from './issueCommentListRequest'; export * from './issueContextVariable'; @@ -177,6 +204,8 @@ export * from './issueFieldOptionCreate'; export * from './issueFieldOptionScope'; export * from './issueFilterForBulkPropertyDelete'; export * from './issueFilterForBulkPropertySet'; +export * from './issueLimitReport'; +export * from './issueLimitReportRequest'; export * from './issueLink'; export * from './issueLinkType'; export * from './issueLinkTypes'; @@ -227,13 +256,14 @@ export * from './jExpEvaluateIssuesJqlMetaData'; export * from './jExpEvaluateIssuesMeta'; export * from './jExpEvaluateJiraExpressionResult'; export * from './jExpEvaluateMetaData'; -export * from './jiraExpressionEvaluateContext'; export * from './jexpIssues'; export * from './jexpJqlIssues'; export * from './jiraExpressionAnalysis'; export * from './jiraExpressionComplexity'; export * from './jiraExpressionEvalContext'; export * from './jiraExpressionEvalRequest'; +export * from './jiraExpressionEvaluateContext'; +export * from './jiraExpressionEvaluateRequest'; export * from './jiraExpressionEvaluationMetaData'; export * from './jiraExpressionEvalUsingEnhancedSearchRequest'; export * from './jiraExpressionForAnalysis'; @@ -243,9 +273,11 @@ export * from './jiraExpressionsComplexity'; export * from './jiraExpressionsComplexityValue'; export * from './jiraExpressionValidationError'; export * from './jiraStatus'; -export * from './jiraWorkflow'; -export * from './jiraWorkflowStatus'; +export * from './jQLCount'; +export * from './jQLCountRequest'; export * from './jqlFunctionPrecomputation'; +export * from './jqlFunctionPrecomputationGetByIdRequest'; +export * from './jqlFunctionPrecomputationGetByIdResponse'; export * from './jqlFunctionPrecomputationUpdate'; export * from './jqlFunctionPrecomputationUpdateRequest'; export * from './jQLPersonalDataMigrationRequest'; @@ -271,6 +303,8 @@ export * from './linkIssueRequestJson'; export * from './listWrapperCallbackApplicationRole'; export * from './listWrapperCallbackGroupName'; export * from './locale'; +export * from './mappingsByIssueTypeOverride'; +export * from './mappingsByWorkflow'; export * from './moveField'; export * from './multiIssueEntityProperties'; export * from './multipleCustomFieldValuesUpdate'; @@ -294,9 +328,14 @@ export * from './operationMessage'; export * from './operations'; export * from './orderOfCustomFieldOptions'; export * from './orderOfIssueTypes'; +export * from './pageBeanFieldConfigurationDetails'; +export * from './pageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects'; +export * from './pageBeanPriorityWithSequence'; +export * from './pageBulkContextualConfiguration'; export * from './pageChangelog'; export * from './pageComment'; export * from './pageComponentWithIssueCount'; +export * from './pageContext'; export * from './pageContextForProjectAndIssueType'; export * from './pageContextualConfiguration'; export * from './pageCustomFieldContext'; @@ -327,6 +366,8 @@ export * from './pageJqlFunctionPrecomputation'; export * from './pageNotificationScheme'; export * from './pageOfChangelogs'; export * from './pageOfComments'; +export * from './pageOfCreateMetaIssueTypes'; +export * from './pageOfCreateMetaIssueTypeWithField'; export * from './pageOfDashboards'; export * from './pageOfStatuses'; export * from './pageOfWorklogs'; @@ -347,6 +388,8 @@ export * from './pageUserDetails'; export * from './pageUserKey'; export * from './pageVersion'; export * from './pageWebhook'; +export * from './pageWithCursorGetPlanResponseForPage'; +export * from './pageWithCursorGetTeamResponseForPage'; export * from './pageWorkflow'; export * from './pageWorkflowScheme'; export * from './pageWorkflowTransitionRules'; @@ -361,13 +404,19 @@ export * from './permissionScheme'; export * from './permissionSchemes'; export * from './permissionsKeys'; export * from './permittedProjects'; +export * from './plan'; export * from './priority'; export * from './priorityId'; +export * from './priorityMapping'; +export * from './prioritySchemeId'; +export * from './prioritySchemeWithPaginatedPrioritiesAndProjects'; +export * from './priorityWithSequence'; export * from './project'; export * from './projectAndIssueTypePair'; export * from './projectAvatars'; export * from './projectCategory'; export * from './projectComponent'; +export * from './projectDataPolicies'; export * from './projectDetails'; export * from './projectEmailAddress'; export * from './projectFeature'; @@ -401,6 +450,7 @@ export * from './remoteIssueLink'; export * from './remoteIssueLinkIdentifies'; export * from './remoteIssueLinkRequest'; export * from './remoteObject'; +export * from './removeOptionFromIssuesResult'; export * from './reorderIssuePriorities'; export * from './reorderIssueResolutionsRequest'; export * from './resolution'; @@ -421,8 +471,10 @@ export * from './screenSchemeDetails'; export * from './screenSchemeId'; export * from './screenTypes'; export * from './screenWithTab'; +export * from './searchAndReconcileRequest'; export * from './searchAndReconcileResults'; export * from './searchAutoComplete'; +export * from './searchAutoCompleteFilter'; export * from './searchRequest'; export * from './searchResults'; export * from './securityLevel'; @@ -435,12 +487,14 @@ export * from './securitySchemeMembersRequest'; export * from './securitySchemes'; export * from './securitySchemeWithProjects'; export * from './serverInformation'; +export * from './serviceRegistry'; export * from './setDefaultLevelsRequest'; export * from './setDefaultPriorityRequest'; export * from './setDefaultResolutionRequest'; export * from './sharePermission'; export * from './sharePermissionInput'; export * from './simpleApplicationProperty'; +export * from './simpleErrorCollection'; export * from './simpleLink'; export * from './simpleListWrapperApplicationRole'; export * from './simpleListWrapperGroupName'; @@ -453,14 +507,20 @@ export * from './statusLayoutUpdate'; export * from './statusMapping'; export * from './statusMappingDTO'; export * from './statusMigration'; +export * from './statusProjectIssueTypeUsageDTO'; +export * from './statusProjectUsageDTO'; export * from './statusReferenceAndPort'; export * from './statusScope'; export * from './statusUpdate'; export * from './statusUpdateRequest'; +export * from './statusWorkflowUsageDTO'; +export * from './streamingResponseBody'; export * from './suggestedIssue'; +export * from './suggestedMappingsRequest'; export * from './systemAvatars'; export * from './tabMetadata'; export * from './taskProgressObject'; +export * from './taskProgressRemoveOptionFromIssuesResult'; export * from './timeTrackingConfiguration'; export * from './timeTrackingDetails'; export * from './timeTrackingProvider'; @@ -473,12 +533,15 @@ export * from './uiModificationDetails'; export * from './uiModificationIdentifiers'; export * from './unrestrictedUserEmail'; export * from './updateCustomFieldDetails'; +export * from './updateDefaultProjectClassification'; export * from './updatedProjectCategory'; export * from './updateFieldConfigurationSchemeDetails'; export * from './updateIssueSecurityLevelDetails'; export * from './updateIssueSecuritySchemeRequest'; export * from './updateNotificationSchemeDetails'; export * from './updatePriorityDetails'; +export * from './updatePrioritySchemeRequest'; +export * from './updatePrioritySchemeResponse'; export * from './updateProjectDetails'; export * from './updateResolutionDetails'; export * from './updateScreenDetails'; @@ -500,6 +563,7 @@ export * from './version'; export * from './versionIssueCounts'; export * from './versionIssuesStatus'; export * from './versionMove'; +export * from './versionRelatedWork'; export * from './versionUnresolvedIssuesCount'; export * from './versionUsageInCustomField'; export * from './visibility'; @@ -520,6 +584,8 @@ export * from './workflowElementReference'; export * from './workflowId'; export * from './workflowLayout'; export * from './workflowOperations'; +export * from './workflowProjectIssueTypeUsageDTO'; +export * from './workflowProjectUsageDTO'; export * from './workflowRead'; export * from './workflowReferenceStatus'; export * from './workflowRuleConfiguration'; @@ -527,10 +593,19 @@ export * from './workflowRules'; export * from './workflowRulesSearch'; export * from './workflowRulesSearchDetails'; export * from './workflowScheme'; +export * from './workflowSchemeAssociation'; export * from './workflowSchemeAssociations'; export * from './workflowSchemeIdName'; export * from './workflowSchemeProjectAssociation'; +export * from './workflowSchemeProjectUsageDTO'; +export * from './workflowSchemeReadRequest'; +export * from './workflowSchemeReadResponse'; +export * from './workflowSchemeUpdateRequest'; +export * from './workflowSchemeUpdateRequiredMappingsRequest'; +export * from './workflowSchemeUpdateRequiredMappingsResponse'; +export * from './workflowSchemeUsageDTO'; export * from './workflowScope'; +export * from './workflowSearchResponse'; export * from './workflowStatus'; export * from './workflowStatusAndPort'; export * from './workflowStatusLayout'; @@ -550,7 +625,10 @@ export * from './workflowTrigger'; export * from './workflowUpdate'; export * from './workflowUpdateRequest'; export * from './workflowUpdateResponse'; +export * from './workflowUpdateValidateRequest'; export * from './workflowValidationError'; export * from './workflowValidationErrorList'; export * from './worklog'; export * from './worklogIdsRequest'; +export * from './worklogsMoveRequest'; +export * from './workspaceDataPolicy'; diff --git a/src/version2/models/jiraExpressionEvaluateRequest.ts b/src/version2/models/jiraExpressionEvaluateRequest.ts index 420c826247..d4a5465662 100644 --- a/src/version2/models/jiraExpressionEvaluateRequest.ts +++ b/src/version2/models/jiraExpressionEvaluateRequest.ts @@ -1,11 +1,11 @@ -import { JiraExpressionEvaluateContextBean } from './jiraExpressionEvaluateContextBean'; +import { JiraExpressionEvaluateContext } from './jiraExpressionEvaluateContext'; /** * The request to evaluate a Jira expression. This bean will be replacing `JiraExpressionEvaluateRequest` as part of new * `evaluate` endpoint */ export interface JiraExpressionEvaluateRequest { - context?: JiraExpressionEvaluateContextBean; + context?: JiraExpressionEvaluateContext; /** The Jira expression to evaluate. */ expression: string; } diff --git a/src/version2/models/jiraTimeTrackingField.ts b/src/version2/models/jiraTimeTrackingField.ts new file mode 100644 index 0000000000..1f4a466203 --- /dev/null +++ b/src/version2/models/jiraTimeTrackingField.ts @@ -0,0 +1,3 @@ +export interface JiraTimeTrackingField { + timeRemaining: string; +} diff --git a/src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts b/src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts index e74d35e280..391c1f8663 100644 --- a/src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts +++ b/src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts @@ -1,9 +1,9 @@ -import { JqlFunctionPrecomputationBean } from './jqlFunctionPrecomputationBean'; +import { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation'; /** Get precomputations by ID response. */ export interface JqlFunctionPrecomputationGetByIdResponse { /** List of precomputations that were not found. */ notFoundPrecomputationIDs?: string[]; /** The list of precomputations. */ - precomputations?: JqlFunctionPrecomputationBean[]; + precomputations?: JqlFunctionPrecomputation[]; } diff --git a/src/version2/models/pageBeanFieldConfigurationDetails.ts b/src/version2/models/pageBeanFieldConfigurationDetails.ts index 874778303f..5917529a6b 100644 --- a/src/version2/models/pageBeanFieldConfigurationDetails.ts +++ b/src/version2/models/pageBeanFieldConfigurationDetails.ts @@ -1,6 +1,12 @@ import { FieldConfigurationDetails } from './fieldConfigurationDetails'; -/** A page of items. */ +/** + * Represents a page of items, typically used for paginated responses. + * + * @deprecated This interface is deprecated and will be removed in a future version. Use + * `Paginated` instead, which is the preferred way to handle paginated responses for field + * configuration details. + */ export interface PageBeanFieldConfigurationDetails { /** Whether this is the last page. */ isLast?: boolean; diff --git a/src/version2/models/prioritySchemeId.ts b/src/version2/models/prioritySchemeId.ts index 7438ba3bde..7e349f2e21 100644 --- a/src/version2/models/prioritySchemeId.ts +++ b/src/version2/models/prioritySchemeId.ts @@ -1,8 +1,8 @@ -import { TaskProgressBeanJsonNode } from './taskProgressBeanJsonNode'; +import { TaskProgressNode } from './taskProgressNode'; /** The ID of a priority scheme. */ export interface PrioritySchemeId { /** The ID of the priority scheme. */ id?: string; - task?: TaskProgressBeanJsonNode; + task?: TaskProgressNode; } diff --git a/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts b/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts index 3ec69d654b..9dc5ed1bc5 100644 --- a/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts +++ b/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts @@ -1,5 +1,6 @@ -import { PageBeanPriorityWithSequence } from './pageBeanPriorityWithSequence'; -import { PageBeanProjectDetails } from './pageBeanProjectDetails'; +import { Paginated } from '../../paginated'; +import { ProjectDetails } from './projectDetails'; +import { PriorityWithSequence } from './priorityWithSequence'; /** A priority scheme with paginated priorities and projects. */ export interface PrioritySchemeWithPaginatedPrioritiesAndProjects { @@ -13,8 +14,8 @@ export interface PrioritySchemeWithPaginatedPrioritiesAndProjects { isDefault?: boolean; /** The name of the priority scheme */ name: string; - priorities?: PageBeanPriorityWithSequence; - projects?: PageBeanProjectDetails; + priorities?: Paginated; + projects?: Paginated; /** The URL of the priority scheme. */ self?: string; } diff --git a/src/version2/models/projectComponent.ts b/src/version2/models/projectComponent.ts index 6703ca07d0..2ab1585277 100644 --- a/src/version2/models/projectComponent.ts +++ b/src/version2/models/projectComponent.ts @@ -2,6 +2,8 @@ import { User } from './user'; /** Details about a project component. */ export interface ProjectComponent { + /** Compass component's ID. Can't be updated. Not required for creating a Project Component. */ + ari?: string; assignee?: User; /** * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` @@ -39,6 +41,8 @@ export interface ProjectComponent { * for details. */ leadUserName?: string; + /** Compass component's metadata. Can't be updated. Not required for creating a Project Component. */ + metadata?: {}; /** * The unique name for the component in the project. Required when creating a component. Optional when updating a * component. The maximum length is 255 characters. diff --git a/src/version2/models/ruleConfiguration.ts b/src/version2/models/ruleConfiguration.ts index bcd3aefc4c..4acde27293 100644 --- a/src/version2/models/ruleConfiguration.ts +++ b/src/version2/models/ruleConfiguration.ts @@ -4,7 +4,7 @@ export interface RuleConfiguration { disabled?: boolean; /** * EXPERIMENTAL: A tag used to filter rules in [Get workflow transition rule - * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). + * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflow-transition-rules/#api-rest-api-2-workflow-rule-config-get). */ tag?: string; /** Configuration of the rule, as it is stored by the Connect or the Forge app on the rule configuration page. */ diff --git a/src/version2/models/searchAndReconcileRequest.ts b/src/version2/models/searchAndReconcileRequest.ts index e4aeb1e63c..de835be041 100644 --- a/src/version2/models/searchAndReconcileRequest.ts +++ b/src/version2/models/searchAndReconcileRequest.ts @@ -60,4 +60,6 @@ export interface SearchAndReconcileRequest { properties?: string[]; /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids. All issues must exist. */ reconcileIssues?: number[]; + /** Fail this request early if we can't retrieve all field data. The default is `false`. */ + failFast?: boolean; } diff --git a/src/version2/models/updatePriorityDetails.ts b/src/version2/models/updatePriorityDetails.ts index ab3ed530a2..5d61df8da2 100644 --- a/src/version2/models/updatePriorityDetails.ts +++ b/src/version2/models/updatePriorityDetails.ts @@ -1,9 +1,37 @@ /** Details of an issue priority. */ export interface UpdatePriorityDetails { + /** The ID for the avatar for the priority. This parameter is nullable and both iconUrl and avatarId cannot be defined. */ + avatarId?: number; /** The description of the priority. */ description?: string; - /** The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. */ - iconUrl?: string; + /** + * The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. Both + * iconUrl and avatarId cannot be defined. + * + * @deprecated This property is deprecated and will be removed in a future version. Use `avatarId` instead. + */ + iconUrl?: + | '/images/icons/priorities/blocker.png' + | '/images/icons/priorities/critical.png' + | '/images/icons/priorities/high.png' + | '/images/icons/priorities/highest.png' + | '/images/icons/priorities/low.png' + | '/images/icons/priorities/lowest.png' + | '/images/icons/priorities/major.png' + | '/images/icons/priorities/medium.png' + | '/images/icons/priorities/minor.png' + | '/images/icons/priorities/trivial.png' + | '/images/icons/priorities/blocker_new.png' + | '/images/icons/priorities/critical_new.png' + | '/images/icons/priorities/high_new.png' + | '/images/icons/priorities/highest_new.png' + | '/images/icons/priorities/low_new.png' + | '/images/icons/priorities/lowest_new.png' + | '/images/icons/priorities/major_new.png' + | '/images/icons/priorities/medium_new.png' + | '/images/icons/priorities/minor_new.png' + | '/images/icons/priorities/trivial_new.png' + | string; /** The name of the priority. Must be unique. */ name?: string; /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ diff --git a/src/version2/models/updatePrioritySchemeRequest.ts b/src/version2/models/updatePrioritySchemeRequest.ts index 6ec61d28c6..95ecc0e93a 100644 --- a/src/version2/models/updatePrioritySchemeRequest.ts +++ b/src/version2/models/updatePrioritySchemeRequest.ts @@ -1,6 +1,6 @@ import { PriorityMapping } from './priorityMapping'; -import { UpdatePrioritiesInSchemeRequestBean } from './updatePrioritiesInSchemeRequestBean'; -import { UpdateProjectsInSchemeRequestBean } from './updateProjectsInSchemeRequestBean'; +import { UpdatePrioritiesInSchemeRequest } from './updatePrioritiesInSchemeRequest'; +import { UpdateProjectsInSchemeRequest } from './updateProjectsInSchemeRequest'; /** Details of a priority scheme. */ export interface UpdatePrioritySchemeRequest { @@ -11,6 +11,6 @@ export interface UpdatePrioritySchemeRequest { mappings?: PriorityMapping; /** The name of the priority scheme. Must be unique. */ name?: string; - priorities?: UpdatePrioritiesInSchemeRequestBean; - projects?: UpdateProjectsInSchemeRequestBean; + priorities?: UpdatePrioritiesInSchemeRequest; + projects?: UpdateProjectsInSchemeRequest; } diff --git a/src/version2/models/updatePrioritySchemeResponse.ts b/src/version2/models/updatePrioritySchemeResponse.ts index 51f1d1b977..236481e5b3 100644 --- a/src/version2/models/updatePrioritySchemeResponse.ts +++ b/src/version2/models/updatePrioritySchemeResponse.ts @@ -1,8 +1,8 @@ import { PrioritySchemeWithPaginatedPrioritiesAndProjects } from './prioritySchemeWithPaginatedPrioritiesAndProjects'; -import { TaskProgressBeanJsonNode } from './taskProgressBeanJsonNode'; +import { TaskProgressNode } from './taskProgressNode'; /** Details of the updated priority scheme. */ export interface UpdatePrioritySchemeResponse { priorityScheme?: PrioritySchemeWithPaginatedPrioritiesAndProjects; - task?: TaskProgressBeanJsonNode; + task?: TaskProgressNode; } diff --git a/src/version2/models/updateProjectDetails.ts b/src/version2/models/updateProjectDetails.ts index c042c8d57a..6fc4a51306 100644 --- a/src/version2/models/updateProjectDetails.ts +++ b/src/version2/models/updateProjectDetails.ts @@ -1,17 +1,22 @@ /** Details about the project. */ export interface UpdateProjectDetails { - /** The default assignee when creating issues for this project. */ - assigneeType?: string; - /** An integer value for the project's avatar. */ - avatarId?: number; /** - * The ID of the project's category. A complete list of category IDs is found using the [Get all project - * categories](#api-rest-api-2-projectCategory-get) operation. To remove the project category from the project, set - * the value to `-1.` + * Project keys must be unique and start with an uppercase letter followed by one or more uppercase alphanumeric + * characters. The maximum length is 10 characters. */ - categoryId?: number; + key?: string; + /** The name of the project. */ + name?: string; /** A brief description of the project. */ description?: string; + /** The account ID of the project lead. Cannot be provided with `lead`. */ + leadAccountId: string; + /** A link to information about this project, such as project documentation */ + url?: string; + /** The default assignee when creating issues for this project. */ + assigneeType?: string; + /** An integer value for the project's avatar. */ + avatarId?: number; /** * The ID of the issue security scheme for the project, which enables you to control who can and cannot view issues. * Use the [Get issue security schemes](#api-rest-api-2-issuesecurityschemes-get) resource to get all issue security @@ -19,24 +24,24 @@ export interface UpdateProjectDetails { */ issueSecurityScheme?: number; /** - * Project keys must be unique and start with an uppercase letter followed by one or more uppercase alphanumeric - * characters. The maximum length is 10 characters. + * The ID of the permission scheme for the project. Use the [Get all permission + * schemes](#api-rest-api-2-permissionscheme-get) resource to see a list of all permission scheme IDs. */ - key?: string; - /** The account ID of the project lead. Cannot be provided with `lead`. */ - leadAccountId: string; - /** The name of the project. */ - name?: string; + permissionScheme?: number; /** * The ID of the notification scheme for the project. Use the [Get notification * schemes](#api-rest-api-2-notificationscheme-get) resource to get a list of notification scheme IDs. */ notificationScheme?: number; /** - * The ID of the permission scheme for the project. Use the [Get all permission - * schemes](#api-rest-api-2-permissionscheme-get) resource to see a list of all permission scheme IDs. + * The ID of the project's category. A complete list of category IDs is found using the [Get all project + * categories](#api-rest-api-2-projectCategory-get) operation. To remove the project category from the project, set + * the value to `-1.` */ - permissionScheme?: number; - /** A link to information about this project, such as project documentation */ - url?: string; + categoryId?: number; + /** + * Previous project keys to be released from the current project. Released keys must belong to the current project and + * not contain the current project key + */ + releasedProjectKeys?: string[]; } diff --git a/src/version2/models/version.ts b/src/version2/models/version.ts index 5c2cd84911..d656976ce5 100644 --- a/src/version2/models/version.ts +++ b/src/version2/models/version.ts @@ -1,8 +1,17 @@ -import { SimpleLink } from './simpleLink'; +import { VersionApprover } from './versionApprover'; import { VersionIssuesStatus } from './versionIssuesStatus'; +import { SimpleLink } from './simpleLink'; /** Details about a project version. */ export interface Version { + /** If the expand option `approvers` is used, returns a list containing the approvers for this version. */ + approvers?: VersionApprover[]; + /** Indicates that the version is archived. Optional when creating or updating a version. */ + archived?: boolean; + /** The description of the version. Optional when creating or updating a version. The maximum size is 16,384 bytes. */ + description?: string; + /** If the expand option `driver` is used, returns the Atlassian account ID of the driver. */ + driver?: string; /** * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional * information about version in the response. This parameter accepts a comma-separated list. Expand options include: @@ -19,15 +28,11 @@ export interface Version { self?: string; /** The ID of the version. */ id?: string; - /** The description of the version. Optional when creating or updating a version. */ - description?: string; /** * The unique name of the version. Required when creating a version. Optional when updating a version. The maximum * length is 255 characters. */ name?: string; - /** Indicates that the version is archived. Optional when creating or updating a version. */ - archived?: boolean; /** * Indicates that the version is released. If the version is released a request to release again is ignored. Not * applicable when creating a version. Optional when updating a version. diff --git a/src/version2/models/webhook.ts b/src/version2/models/webhook.ts index 7886ad7274..e9e804f184 100644 --- a/src/version2/models/webhook.ts +++ b/src/version2/models/webhook.ts @@ -4,7 +4,7 @@ export interface Webhook { events: string[]; /** * The date after which the webhook is no longer sent. Use [Extend webhook - * life](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-webhooks/#api-rest-api-3-webhook-refresh-put) + * life](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-webhooks/#api-rest-api-2-webhook-refresh-put) * to extend the date. */ expirationDate?: number; diff --git a/src/version2/myself.ts b/src/version2/myself.ts index 7876132dc0..c0692b4c26 100644 --- a/src/version2/myself.ts +++ b/src/version2/myself.ts @@ -31,7 +31,7 @@ export class Myself { * **[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; + async getPreference(parameters: Parameters.GetPreference, callback: Callback): Promise; /** * Returns the value of a preference of the current user. * @@ -57,8 +57,8 @@ export class Myself { * **[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( + async getPreference(parameters: Parameters.GetPreference, callback?: never): Promise; + async getPreference( parameters: Parameters.GetPreference, callback?: Callback, ): Promise { diff --git a/src/version2/parameters/bulkDeleteWorklogs.ts b/src/version2/parameters/bulkDeleteWorklogs.ts index ef7dcab89e..1358266f7f 100644 --- a/src/version2/parameters/bulkDeleteWorklogs.ts +++ b/src/version2/parameters/bulkDeleteWorklogs.ts @@ -1,6 +1,6 @@ -import { WorklogIdsRequestBean } from '../models'; +import { WorklogIdsRequest } from '../models'; -export interface BulkDeleteWorklogs extends WorklogIdsRequestBean { +export interface BulkDeleteWorklogs extends WorklogIdsRequest { /** The ID or key of the issue. */ issueIdOrKey: string; /** diff --git a/src/version2/parameters/bulkFetchIssues.ts b/src/version2/parameters/bulkFetchIssues.ts index c9c19ef59b..ac8d5b91a2 100644 --- a/src/version2/parameters/bulkFetchIssues.ts +++ b/src/version2/parameters/bulkFetchIssues.ts @@ -1,3 +1,3 @@ -import { BulkFetchIssueRequestBean } from '../models'; +import { BulkFetchIssueRequest } from '../models'; -export interface BulkFetchIssues extends BulkFetchIssueRequestBean {} +export interface BulkFetchIssues extends BulkFetchIssueRequest {} diff --git a/src/version2/parameters/bulkMoveWorklogs.ts b/src/version2/parameters/bulkMoveWorklogs.ts index 7d34cefb2b..6e87b7d393 100644 --- a/src/version2/parameters/bulkMoveWorklogs.ts +++ b/src/version2/parameters/bulkMoveWorklogs.ts @@ -1,12 +1,13 @@ -import { WorklogsMoveRequestBean } from '../models'; +import { WorklogsMoveRequest } from '../models'; -export interface BulkMoveWorklogs extends WorklogsMoveRequestBean { +export interface BulkMoveWorklogs { issueIdOrKey: string; /** * Defines how to update the issues' time estimate, the options are: * - * `leave` Leaves the estimate unchanged. `auto` Reduces the estimate by the aggregate value of `timeSpent` across - * all worklogs being moved in the source issue, and increases it in the destination issue. + * - `leave` Leaves the estimate unchanged. + * - `auto` Reduces the estimate by the aggregate value of `timeSpent` across all worklogs being moved in the source + * issue, and increases it in the destination issue. */ adjustEstimate?: 'leave' | 'auto' | string; /** @@ -15,4 +16,5 @@ export interface BulkMoveWorklogs extends WorklogsMoveRequestBean { * admin permission can use this flag. */ overrideEditableFlag?: boolean; + worklogs: WorklogsMoveRequest; } diff --git a/src/version2/parameters/copyDashboard.ts b/src/version2/parameters/copyDashboard.ts index 1e157d012e..905415da28 100644 --- a/src/version2/parameters/copyDashboard.ts +++ b/src/version2/parameters/copyDashboard.ts @@ -2,4 +2,9 @@ import { DashboardDetails } from '../models'; export interface CopyDashboard extends DashboardDetails { id: string; + /** + * Whether admin level permissions are used. It should only be true if the user has _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) + */ + extendAdminPermissions?: boolean; } diff --git a/src/version2/parameters/countIssues.ts b/src/version2/parameters/countIssues.ts index 8652b1c269..527120f2a4 100644 --- a/src/version2/parameters/countIssues.ts +++ b/src/version2/parameters/countIssues.ts @@ -1,3 +1,3 @@ -import { JQLCountRequestBean } from '../models'; +import { JQLCountRequest } from '../models'; -export interface CountIssues extends JQLCountRequestBean {} +export interface CountIssues extends JQLCountRequest {} diff --git a/src/version2/parameters/createDashboard.ts b/src/version2/parameters/createDashboard.ts index eb78135c41..372243bbac 100644 --- a/src/version2/parameters/createDashboard.ts +++ b/src/version2/parameters/createDashboard.ts @@ -3,4 +3,9 @@ import { DashboardDetails, SharePermission } from '../models'; export interface CreateDashboard extends Omit { /** The edit permissions for the dashboard. */ editPermissions?: SharePermission[]; + /** + * Whether admin level permissions are used. It should only be true if the user has _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) + */ + extendAdminPermissions?: boolean; } diff --git a/src/version2/parameters/deleteComment.ts b/src/version2/parameters/deleteComment.ts index a06ad01e85..5050950ed1 100644 --- a/src/version2/parameters/deleteComment.ts +++ b/src/version2/parameters/deleteComment.ts @@ -3,4 +3,5 @@ export interface DeleteComment { issueIdOrKey: string; /** The ID of the comment. */ id: string; + parentId?: string; } diff --git a/src/version2/parameters/editIssue.ts b/src/version2/parameters/editIssue.ts index 1be9cc59a8..f5ad5596df 100644 --- a/src/version2/parameters/editIssue.ts +++ b/src/version2/parameters/editIssue.ts @@ -23,7 +23,7 @@ export interface EditIssue extends IssueUpdateDetails { overrideEditableFlag?: boolean; /** * Whether the response should contain the issue with fields edited in this request. The returned issue will have the - * same format as in the [Get issue API](#api-rest-api-3-issue-issueidorkey-get). + * same format as in the [Get issue API](#api-rest-api-2-issue-issueidorkey-get). */ returnIssue?: boolean; /** The Get issue API expand parameter to use in the response if the `returnIssue` parameter is `true`. */ diff --git a/src/version2/parameters/evaluateJSISJiraExpression.ts b/src/version2/parameters/evaluateJSISJiraExpression.ts deleted file mode 100644 index 3dc1122bb4..0000000000 --- a/src/version2/parameters/evaluateJSISJiraExpression.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { JiraExpressionEvaluateRequestBean } from '../models'; - -export interface EvaluateJSISJiraExpression extends JiraExpressionEvaluateRequestBean { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts `meta.complexity` that returns information about the - * expression complexity. For example, the number of expensive operations used by the expression and how close the - * expression is to reaching the [complexity - * limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing - * and debugging your expressions. - */ - expand?: string; -} diff --git a/src/version2/parameters/findAssignableUsers.ts b/src/version2/parameters/findAssignableUsers.ts index 54f9e3a09f..78bb7397f6 100644 --- a/src/version2/parameters/findAssignableUsers.ts +++ b/src/version2/parameters/findAssignableUsers.ts @@ -20,6 +20,8 @@ export interface FindAssignableUsers { project?: string; /** The key of the issue. Required, unless `project` is specified. */ issueKey?: string; + /** The ID of the issue. Required, unless `issueKey` or `project` is specified. */ + issueId?: string; /** The index of the first item to return in a page of results (page offset). */ startAt?: number; /** diff --git a/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts b/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts index e576614d09..da7ba318f6 100644 --- a/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts +++ b/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts @@ -1,8 +1,8 @@ export interface GetAvailablePrioritiesByPriorityScheme { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The string to query priorities on by name. */ query?: string; /** The priority scheme ID. */ diff --git a/src/version2/parameters/getAvailableTransitions.ts b/src/version2/parameters/getAvailableTransitions.ts new file mode 100644 index 0000000000..77684c7885 --- /dev/null +++ b/src/version2/parameters/getAvailableTransitions.ts @@ -0,0 +1,8 @@ +export interface GetAvailableTransitions { + /** Ids or keys of the issues to get transitions available for them. */ + issueIdsOrKeys: (number | string)[]; + /** The end cursor for use in pagination. */ + endingBefore?: string; + /** The start cursor for use in pagination. */ + startingAfter?: string; +} diff --git a/src/version2/parameters/getBulkChangelogs.ts b/src/version2/parameters/getBulkChangelogs.ts index 662e69d8da..fefc8eb77f 100644 --- a/src/version2/parameters/getBulkChangelogs.ts +++ b/src/version2/parameters/getBulkChangelogs.ts @@ -1,3 +1,3 @@ -import { BulkChangelogRequestBean } from '../models'; +import { BulkChangelogRequest } from '../models'; -export interface GetBulkChangelogs extends BulkChangelogRequestBean {} +export interface GetBulkChangelogs extends BulkChangelogRequest {} diff --git a/src/version2/parameters/getBulkEditableFields.ts b/src/version2/parameters/getBulkEditableFields.ts new file mode 100644 index 0000000000..148a44d41e --- /dev/null +++ b/src/version2/parameters/getBulkEditableFields.ts @@ -0,0 +1,10 @@ +export interface GetBulkEditableFields { + /** The IDs or keys of the issues to get editable fields from. */ + issueIdsOrKeys: number | string; + /** (Optional)The text to search for in the editable fields. */ + searchText?: string; + /** (Optional)The end cursor for use in pagination. */ + endingBefore?: string; + /** (Optional)The start cursor for use in pagination. */ + startingAfter?: string; +} diff --git a/src/version2/parameters/getBulkOperationProgress.ts b/src/version2/parameters/getBulkOperationProgress.ts new file mode 100644 index 0000000000..976c68799c --- /dev/null +++ b/src/version2/parameters/getBulkOperationProgress.ts @@ -0,0 +1,4 @@ +export interface GetBulkOperationProgress { + /** The ID of the task. */ + taskId: string; +} diff --git a/src/version2/parameters/getFiltersPaginated.ts b/src/version2/parameters/getFiltersPaginated.ts index 8dbaac430c..ea3bf95207 100644 --- a/src/version2/parameters/getFiltersPaginated.ts +++ b/src/version2/parameters/getFiltersPaginated.ts @@ -112,4 +112,10 @@ export interface GetFiltersPaginated { * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ overrideSharePermissions?: boolean; + /** + * When `true` this will perform a case-insensitive substring match for the provided `filterName`. When `false` the + * filter name will be searched using [full text search + * syntax](https://support.atlassian.com/jira-software-cloud/docs/search-for-issues-using-the-text-field/). + */ + isSubstringMatch?: boolean; } diff --git a/src/version2/parameters/getIssue.ts b/src/version2/parameters/getIssue.ts index 683b429396..5fb6802390 100644 --- a/src/version2/parameters/getIssue.ts +++ b/src/version2/parameters/getIssue.ts @@ -67,4 +67,10 @@ export interface GetIssue { * field. */ updateHistory?: boolean; + /** + * Whether to fail the request quickly in case of an error while loading fields for an issue. For `failFast=true`, if + * one field fails, the entire operation fails. For `failFast=false`, the operation will continue even if a field + * fails. It will return a valid response, but without values for the failed field(s). + */ + failFast?: boolean; } diff --git a/src/version2/parameters/getNotificationSchemeToProjectMappings.ts b/src/version2/parameters/getNotificationSchemeToProjectMappings.ts index 34cfec0e7b..bfb504e6e2 100644 --- a/src/version2/parameters/getNotificationSchemeToProjectMappings.ts +++ b/src/version2/parameters/getNotificationSchemeToProjectMappings.ts @@ -1,8 +1,8 @@ export interface GetNotificationSchemeToProjectMappings { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The list of notifications scheme IDs to be filtered out */ notificationSchemeId?: string[]; /** The list of project IDs to be filtered out */ diff --git a/src/version2/parameters/getPrioritiesByPriorityScheme.ts b/src/version2/parameters/getPrioritiesByPriorityScheme.ts index 76d7512d9c..6cd7fcedac 100644 --- a/src/version2/parameters/getPrioritiesByPriorityScheme.ts +++ b/src/version2/parameters/getPrioritiesByPriorityScheme.ts @@ -1,8 +1,8 @@ export interface GetPrioritiesByPriorityScheme { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The priority scheme ID. */ schemeId: string; } diff --git a/src/version2/parameters/getPrioritySchemes.ts b/src/version2/parameters/getPrioritySchemes.ts index 9ea7155e7c..0b592bd02c 100644 --- a/src/version2/parameters/getPrioritySchemes.ts +++ b/src/version2/parameters/getPrioritySchemes.ts @@ -1,8 +1,8 @@ export interface GetPrioritySchemes { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * A set of priority IDs to filter by. To include multiple IDs, provide an ampersand-separated list. For example, * `priorityId=10000&priorityId=10001`. diff --git a/src/version2/parameters/getProjectComponents.ts b/src/version2/parameters/getProjectComponents.ts index 4bdde93bb0..5c47fd94d6 100644 --- a/src/version2/parameters/getProjectComponents.ts +++ b/src/version2/parameters/getProjectComponents.ts @@ -1,4 +1,12 @@ export interface GetProjectComponents { /** The project ID or project key (case sensitive). */ projectIdOrKey: string; + /** + * The source of the components to return. Can be `jira` (default), `compass` or `auto`. When `auto` is specified, the + * API will return connected Compass components if the project is opted into Compass, otherwise it will return Jira + * components. Defaults to `jira`. + * + * @default jira + */ + componentSource?: 'jira' | 'compass' | 'auto' | string; } diff --git a/src/version2/parameters/getProjectComponentsPaginated.ts b/src/version2/parameters/getProjectComponentsPaginated.ts index 5625e9ee39..0deb60f1e2 100644 --- a/src/version2/parameters/getProjectComponentsPaginated.ts +++ b/src/version2/parameters/getProjectComponentsPaginated.ts @@ -32,4 +32,12 @@ export interface GetProjectComponentsPaginated { * insensitive). */ query?: string; + /** + * The source of the components to return. Can be `jira` (default), `compass` or `auto`. When `auto` is specified, the + * API will return connected Compass components if the project is opted into Compass, otherwise it will return Jira + * components. Defaults to `jira`. + * + * @default jira + */ + componentSource?: 'jira' | 'compass' | 'auto' | string; } diff --git a/src/version2/parameters/getProjectsByPriorityScheme.ts b/src/version2/parameters/getProjectsByPriorityScheme.ts index 6bbbf10e42..607505f6d4 100644 --- a/src/version2/parameters/getProjectsByPriorityScheme.ts +++ b/src/version2/parameters/getProjectsByPriorityScheme.ts @@ -1,8 +1,8 @@ export interface GetProjectsByPriorityScheme { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The project IDs to filter by. For example, `projectId=10000&projectId=10001`. */ projectId?: number[]; /** The priority scheme ID. */ diff --git a/src/version2/parameters/getSecurityLevelMembers.ts b/src/version2/parameters/getSecurityLevelMembers.ts index 1c16a7eaad..ceb2e31ef6 100644 --- a/src/version2/parameters/getSecurityLevelMembers.ts +++ b/src/version2/parameters/getSecurityLevelMembers.ts @@ -1,8 +1,8 @@ export interface GetSecurityLevelMembers { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * The list of issue security level member IDs. To include multiple issue security level members separate IDs with an * ampersand: `id=10000&id=10001`. diff --git a/src/version2/parameters/getSecurityLevels.ts b/src/version2/parameters/getSecurityLevels.ts index 7b2fccad02..cd8503604b 100644 --- a/src/version2/parameters/getSecurityLevels.ts +++ b/src/version2/parameters/getSecurityLevels.ts @@ -1,8 +1,8 @@ export interface GetSecurityLevels { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * The list of issue security scheme level IDs. To include multiple issue security levels, separate IDs with an * ampersand: `id=10000&id=10001`. diff --git a/src/version2/parameters/index.ts b/src/version2/parameters/index.ts index cb9dbe024b..e5450596e1 100644 --- a/src/version2/parameters/index.ts +++ b/src/version2/parameters/index.ts @@ -1,10 +1,12 @@ export * from './addActorUsers'; +export * from './addAtlassianTeam'; export * from './addAttachment'; export * from './addComment'; export * from './addFieldToDefaultScreen'; export * from './addGadget'; export * from './addIssueTypesToContext'; export * from './addIssueTypesToIssueTypeScheme'; +export * from './addNotifications'; export * from './addProjectRoleActorsToRole'; export * from './addScreenTab'; export * from './addScreenTabField'; @@ -19,6 +21,7 @@ export * from './analyseExpression'; export * from './appendMappingsForIssueTypeScreenScheme'; export * from './archiveIssues'; export * from './archiveIssuesAsync'; +export * from './archivePlan'; export * from './archiveProject'; export * from './assignFieldConfigurationSchemeToProject'; export * from './assignIssue'; @@ -29,16 +32,20 @@ export * from './assignProjectsToCustomFieldContext'; export * from './assignSchemeToProject'; export * from './associateSchemesToProjects'; export * from './bulkDeleteIssueProperty'; +export * from './bulkDeleteWorklogs'; export * from './bulkEditDashboards'; +export * from './bulkFetchIssues'; export * from './bulkGetGroups'; export * from './bulkGetUsers'; export * from './bulkGetUsersMigration'; +export * from './bulkMoveWorklogs'; export * from './bulkSetIssuePropertiesByIssue'; export * from './bulkSetIssueProperty'; export * from './bulkSetIssuesProperties'; export * from './cancelTask'; export * from './changeFilterOwner'; export * from './copyDashboard'; +export * from './countIssues'; export * from './createComponent'; export * from './createCustomField'; export * from './createCustomFieldContext'; @@ -61,11 +68,15 @@ export * from './createNotificationScheme'; export * from './createOrUpdateRemoteIssueLink'; export * from './createPermissionGrant'; export * from './createPermissionScheme'; +export * from './createPlan'; +export * from './createPlanOnlyTeam'; export * from './createPriority'; +export * from './createPriorityScheme'; export * from './createProject'; export * from './createProjectAvatar'; export * from './createProjectCategory'; export * from './createProjectRole'; +export * from './createRelatedWork'; export * from './createResolution'; export * from './createScreen'; export * from './createScreenScheme'; @@ -111,12 +122,16 @@ export * from './deleteIssueTypeScreenScheme'; export * from './deleteNotificationScheme'; export * from './deletePermissionScheme'; export * from './deletePermissionSchemeEntity'; +export * from './deletePlanOnlyTeam'; +export * from './deletePriority'; +export * from './deletePriorityScheme'; export * from './deleteProject'; export * from './deleteProjectAsynchronously'; export * from './deleteProjectAvatar'; export * from './deleteProjectProperty'; export * from './deleteProjectRole'; export * from './deleteProjectRoleActorsFromRole'; +export * from './deleteRelatedWork'; export * from './deleteRemoteIssueLinkByGlobalId'; export * from './deleteRemoteIssueLinkById'; export * from './deleteResolution'; @@ -128,6 +143,7 @@ export * from './deleteSharePermission'; export * from './deleteStatusesById'; export * from './deleteUiModification'; export * from './deleteUserProperty'; +export * from './deleteVersion'; export * from './deleteWebhookById'; export * from './deleteWorkflowMapping'; export * from './deleteWorkflowScheme'; @@ -139,6 +155,7 @@ export * from './deleteWorkflowTransitionRuleConfigurations'; export * from './deleteWorklog'; export * from './deleteWorklogProperty'; export * from './doTransition'; +export * from './duplicatePlan'; export * from './editIssue'; export * from './evaluateJiraExpression'; export * from './evaluateJiraExpressionUsingEnhancedSearch'; @@ -147,6 +164,7 @@ export * from './expandAttachmentForMachines'; export * from './exportArchivedIssues'; export * from './findAssignableUsers'; export * from './findBulkAssignableUsers'; +export * from './findComponentsForProjects'; export * from './findGroups'; export * from './findUserKeysByQuery'; export * from './findUsers'; @@ -168,10 +186,12 @@ export * from './getAllIssueTypeSchemes'; export * from './getAllLabels'; export * from './getAllPermissionSchemes'; export * from './getAllProjectAvatars'; +export * from './getAllProjects'; export * from './getAllScreenTabFields'; export * from './getAllScreenTabs'; export * from './getAllStatuses'; export * from './getAllSystemAvatars'; +export * from './getAllUserDataClassificationLevels'; export * from './getAllUsers'; export * from './getAllUsersDefault'; export * from './getAllWorkflowSchemes'; @@ -179,17 +199,24 @@ export * from './getAlternativeIssueTypes'; export * from './getApplicationProperty'; export * from './getApplicationRole'; export * from './getAssignedPermissionScheme'; +export * from './getAtlassianTeam'; export * from './getAttachment'; export * from './getAttachmentContent'; export * from './getAttachmentThumbnail'; export * from './getAuditRecords'; export * from './getAutoCompletePost'; +export * from './getAvailablePrioritiesByPriorityScheme'; export * from './getAvailableScreenFields'; +export * from './getAvailableTransitions'; export * from './getAvatarImageByID'; export * from './getAvatarImageByOwner'; export * from './getAvatarImageByType'; export * from './getAvatars'; +export * from './getBulkChangelogs'; +export * from './getBulkEditableFields'; +export * from './getBulkOperationProgress'; export * from './getBulkPermissions'; +export * from './getBulkScreenTabs'; export * from './getChangeLogs'; export * from './getChangeLogsByIds'; export * from './getColumns'; @@ -201,15 +228,20 @@ export * from './getCommentsByIds'; export * from './getComponent'; export * from './getComponentRelatedIssues'; export * from './getContextsForField'; +export * from './getContextsForFieldDeprecated'; export * from './getCreateIssueMeta'; +export * from './getCreateIssueMetaIssueTypeId'; +export * from './getCreateIssueMetaIssueTypes'; export * from './getCurrentUser'; export * from './getCustomFieldConfiguration'; export * from './getCustomFieldContextsForProjectsAndIssueTypes'; export * from './getCustomFieldOption'; +export * from './getCustomFieldsConfigurations'; export * from './getDashboard'; export * from './getDashboardItemProperty'; export * from './getDashboardItemPropertyKeys'; export * from './getDashboardsPaginated'; +export * from './getDefaultProjectClassification'; export * from './getDefaultValues'; export * from './getDefaultWorkflow'; export * from './getDraftDefaultWorkflow'; @@ -231,6 +263,7 @@ export * from './getIdsOfWorklogsDeletedSince'; export * from './getIdsOfWorklogsModifiedSince'; export * from './getIssue'; export * from './getIssueFieldOption'; +export * from './getIssueLimitReport'; export * from './getIssueLink'; export * from './getIssueLinkType'; export * from './getIssuePickerResource'; @@ -263,9 +296,16 @@ export * from './getPermissionScheme'; export * from './getPermissionSchemeGrant'; export * from './getPermissionSchemeGrants'; export * from './getPermittedProjects'; +export * from './getPlan'; +export * from './getPlanOnlyTeam'; +export * from './getPlans'; +export * from './getPolicies'; export * from './getPrecomputations'; +export * from './getPrecomputationsByID'; export * from './getPreference'; +export * from './getPrioritiesByPriorityScheme'; export * from './getPriority'; +export * from './getPrioritySchemes'; export * from './getProject'; export * from './getProjectCategoryById'; export * from './getProjectComponents'; @@ -273,6 +313,7 @@ export * from './getProjectComponentsPaginated'; export * from './getProjectContextMapping'; export * from './getProjectEmail'; export * from './getProjectIssueSecurityScheme'; +export * from './getProjectIssueTypeUsagesForStatus'; export * from './getProjectProperty'; export * from './getProjectPropertyKeys'; export * from './getProjectRole'; @@ -280,13 +321,19 @@ export * from './getProjectRoleActorsForRole'; export * from './getProjectRoleById'; export * from './getProjectRoleDetails'; export * from './getProjectRoles'; +export * from './getProjectsByPriorityScheme'; export * from './getProjectsForIssueTypeScreenScheme'; export * from './getProjectTypeByKey'; +export * from './getProjectUsagesForStatus'; +export * from './getProjectUsagesForWorkflow'; +export * from './getProjectUsagesForWorkflowScheme'; export * from './getProjectVersions'; export * from './getProjectVersionsPaginated'; export * from './getRecent'; +export * from './getRelatedWork'; export * from './getRemoteIssueLinkById'; export * from './getRemoteIssueLinks'; +export * from './getResolution'; export * from './getScreens'; export * from './getScreenSchemes'; export * from './getScreensForField'; @@ -300,6 +347,7 @@ export * from './getStatus'; export * from './getStatusCategory'; export * from './getStatusesById'; export * from './getTask'; +export * from './getTeams'; export * from './getTransitions'; export * from './getTrashedFieldsPaginated'; export * from './getUiModifications'; @@ -319,14 +367,17 @@ export * from './getVersionUnresolvedIssues'; export * from './getVisibleIssueFieldOptions'; export * from './getVotes'; export * from './getWorkflow'; +export * from './getWorkflowProjectIssueTypeUsages'; export * from './getWorkflowScheme'; export * from './getWorkflowSchemeDraft'; export * from './getWorkflowSchemeDraftIssueType'; export * from './getWorkflowSchemeIssueType'; export * from './getWorkflowSchemeProjectAssociations'; +export * from './getWorkflowSchemeUsagesForWorkflow'; export * from './getWorkflowsPaginated'; export * from './getWorkflowTransitionProperties'; export * from './getWorkflowTransitionRuleConfigurations'; +export * from './getWorkflowUsagesForStatus'; export * from './getWorklog'; export * from './getWorklogProperty'; export * from './getWorklogPropertyKeys'; @@ -347,11 +398,14 @@ export * from './publishDraftWorkflowScheme'; export * from './putAddonProperty'; export * from './putAppProperty'; export * from './readWorkflows'; +export * from './readWorkflowSchemes'; export * from './refreshWebhooks'; export * from './registerDynamicWebhooks'; export * from './registerModules'; +export * from './removeAtlassianTeam'; export * from './removeAttachment'; export * from './removeCustomFieldContextFromProjects'; +export * from './removeDefaultProjectClassification'; export * from './removeGadget'; export * from './removeGroup'; export * from './removeIssueTypeFromIssueTypeScheme'; @@ -372,6 +426,7 @@ export * from './removeWatcher'; export * from './renameScreenTab'; export * from './reorderCustomFieldOptions'; export * from './reorderIssueTypesInIssueTypeScheme'; +export * from './replaceCustomFieldOption'; export * from './replaceIssueFieldOption'; export * from './resetColumns'; export * from './resetUserColumns'; @@ -379,6 +434,7 @@ export * from './restore'; export * from './restoreCustomField'; export * from './sanitiseJqlQueries'; export * from './search'; +export * from './searchForIssuesIds'; export * from './searchForIssuesUsingJql'; export * from './searchForIssuesUsingJqlEnhancedSearch'; export * from './searchForIssuesUsingJqlEnhancedSearchPost'; @@ -388,7 +444,9 @@ export * from './searchProjects'; export * from './searchProjectsUsingSecuritySchemes'; export * from './searchResolutions'; export * from './searchSecuritySchemes'; +export * from './searchWorkflows'; export * from './selectTimeTrackingImplementation'; +export * from './services'; export * from './setActors'; export * from './setApplicationProperty'; export * from './setBanner'; @@ -404,6 +462,7 @@ export * from './setFavouriteForFilter'; export * from './setFieldConfigurationSchemeMapping'; export * from './setIssueProperty'; export * from './setIssueTypeProperty'; +export * from './setLocale'; export * from './setPreference'; export * from './setProjectProperty'; export * from './setSharedTimeTrackingConfiguration'; @@ -413,9 +472,12 @@ export * from './setWorkflowSchemeDraftIssueType'; export * from './setWorkflowSchemeIssueType'; export * from './setWorklogProperty'; export * from './storeAvatar'; +export * from './suggestedPrioritiesForMappings'; export * from './toggleFeatureForProject'; export * from './trashCustomField'; +export * from './trashPlan'; export * from './unarchiveIssues'; +export * from './updateAtlassianTeam'; export * from './updateComment'; export * from './updateComponent'; export * from './updateCustomField'; @@ -424,6 +486,7 @@ export * from './updateCustomFieldContext'; export * from './updateCustomFieldOption'; export * from './updateCustomFieldValue'; export * from './updateDashboard'; +export * from './updateDefaultProjectClassification'; export * from './updateDefaultScreenScheme'; export * from './updateDefaultWorkflow'; export * from './updateDraftDefaultWorkflow'; @@ -444,14 +507,19 @@ export * from './updateIssueTypeScreenScheme'; export * from './updateMultipleCustomFieldValues'; export * from './updateNotificationScheme'; export * from './updatePermissionScheme'; +export * from './updatePlan'; +export * from './updatePlanOnlyTeam'; export * from './updatePrecomputations'; export * from './updatePriority'; +export * from './updatePriorityScheme'; export * from './updateProject'; export * from './updateProjectAvatar'; export * from './updateProjectCategory'; export * from './updateProjectEmail'; +export * from './updateRelatedWork'; export * from './updateRemoteIssueLink'; export * from './updateResolution'; +export * from './updateSchemes'; export * from './updateScreen'; export * from './updateScreenScheme'; export * from './updateSecurityLevel'; @@ -462,6 +530,7 @@ export * from './updateWorkflowMapping'; export * from './updateWorkflows'; export * from './updateWorkflowScheme'; export * from './updateWorkflowSchemeDraft'; +export * from './updateWorkflowSchemeMappings'; export * from './updateWorkflowTransitionProperty'; export * from './updateWorkflowTransitionRuleConfigurations'; export * from './updateWorklog'; diff --git a/src/version2/parameters/readWorkflows.ts b/src/version2/parameters/readWorkflows.ts index c1248108f5..cc844a5386 100644 --- a/src/version2/parameters/readWorkflows.ts +++ b/src/version2/parameters/readWorkflows.ts @@ -1,18 +1,20 @@ import { ProjectAndIssueTypePair } from '../models'; export interface ReadWorkflows { + /** + * Return the new fields (`toStatusReference`/`links`) instead of the deprecated fields (`to`/`from`) for workflow + * transition port mappings. + */ + useTransitionLinksFormat?: boolean; + /** + * Return the new field `approvalConfiguration` instead of the deprecated status properties for approval + * configuration. + */ + useApprovalConfiguration?: boolean; /** The list of projects and issue types to query. */ projectAndIssueTypes?: ProjectAndIssueTypePair[]; /** The list of workflow IDs to query. */ workflowIds?: string[]; /** The list of workflow names to query. */ workflowNames?: string[]; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `workflows.usages` Returns the project and issue types that each workflow is associated with. `statuses.usages` - * Returns the project and issue types that each status is associated with. - */ - expand?: string; } diff --git a/src/version2/parameters/searchAndReconsileIssuesUsingJql.ts b/src/version2/parameters/searchAndReconsileIssuesUsingJql.ts deleted file mode 100644 index 730c48f43d..0000000000 --- a/src/version2/parameters/searchAndReconsileIssuesUsingJql.ts +++ /dev/null @@ -1,65 +0,0 @@ -export interface SearchAndReconsileIssuesUsingJql { - /** - * A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a - * bounded query. A bounded query is a query with a search restriction. - * - * Example of an unbounded query: `order by key desc`. Example of a bounded query: `assignee = currentUser() order - * by key`. - * - * Additionally, `orderBy` clause can contain a maximum of 7 fields. - */ - jql?: string; - /** - * The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. Use the - * `nextPageToken` to fetch the next page of issues. - */ - nextPageToken?: string; - /** - * The maximum number of items to return per page. To manage page size, API may return fewer items per page where a - * large number of fields are requested. The greatest number of items returned per page is achieved when requesting - * `id` or `key` only. It returns max 5000 issues. - */ - maxResults?: number; - /** - * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a - * comma-separated list. Expand options include: - * - * `*all` Returns all fields. `*navigable` Returns navigable fields. `id` Returns only issue IDs. Any issue field, - * prefixed with a minus to exclude. - * - * The default is `id`. - * - * Examples: - * - * `summary,comment` Returns only the summary and comments fields 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: By default, this resource returns IDs only. 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. Note that, unlike the majority of instances where `expand` is - * specified, `expand` is defined as a comma-delimited string of values. The expand options are: - * - * `renderedFields` Returns field values rendered in HTML format. `names` Returns the display name of each field. - * `schema` Returns the schema describing a field type. `transitions` Returns all possible transitions for the - * issue. `operations` Returns all possible operations for the issue. `editmeta` Returns information about how each - * field can be edited. `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the - * most recent. `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array - * containing each version of a field's value, with the highest numbered item representing the most recent version. - * - * Examples: `"names,changelog"` Returns the display name of each field as well as a list of recent updates to an issue. - */ - expand?: string; - /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ - properties?: string[]; - /** Reference fields by their key (rather than ID). The default is `false`. */ - fieldsByKeys?: boolean; - /** Fail this request early if we can't retrieve all field data. */ - failFast?: boolean; - /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids. All issues must exist. */ - reconcileIssues?: number[]; -} diff --git a/src/version2/parameters/searchAndReconsileIssuesUsingJqlPost.ts b/src/version2/parameters/searchAndReconsileIssuesUsingJqlPost.ts deleted file mode 100644 index f839145d60..0000000000 --- a/src/version2/parameters/searchAndReconsileIssuesUsingJqlPost.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SearchAndReconcileRequestBean } from '../models'; - -export interface SearchAndReconsileIssuesUsingJqlPost extends SearchAndReconcileRequestBean {} diff --git a/src/version2/parameters/searchForIssuesIds.ts b/src/version2/parameters/searchForIssuesIds.ts index 9127fa13c0..3c6179bc0b 100644 --- a/src/version2/parameters/searchForIssuesIds.ts +++ b/src/version2/parameters/searchForIssuesIds.ts @@ -1,3 +1,3 @@ -import { IdSearchRequestBean } from '../models'; +import { IdSearchRequest } from '../models'; -export interface SearchForIssuesIds extends IdSearchRequestBean {} +export interface SearchForIssuesIds extends IdSearchRequest {} diff --git a/src/version2/parameters/searchForIssuesUsingJql.ts b/src/version2/parameters/searchForIssuesUsingJql.ts index bb85f45aeb..8e1a025a00 100644 --- a/src/version2/parameters/searchForIssuesUsingJql.ts +++ b/src/version2/parameters/searchForIssuesUsingJql.ts @@ -76,4 +76,10 @@ export interface SearchForIssuesUsingJql { properties?: string[]; /** Reference fields by their key (rather than ID). */ fieldsByKeys?: boolean; + /** + * Whether to fail the request quickly in case of an error while loading fields for an issue. For `failFast=true`, if + * one field fails, the entire operation fails. For `failFast=false`, the operation will continue even if a field + * fails. It will return a valid response, but without values for the failed field(s). + */ + failFast?: boolean; } diff --git a/src/version2/parameters/searchPriorities.ts b/src/version2/parameters/searchPriorities.ts index 8e1dae180c..7ad7be9707 100644 --- a/src/version2/parameters/searchPriorities.ts +++ b/src/version2/parameters/searchPriorities.ts @@ -10,6 +10,13 @@ export interface SearchPriorities { * `projectId=10010&projectId=10111`. */ projectId?: string[]; + /** The name of priority to search for. */ + priorityName?: string; /** Whether only the default priority is returned. */ onlyDefault?: boolean; + /** + * Use `schemes` to return the associated priority schemes for each priority. Limited to returning first 15 priority + * schemes per priority. + */ + expand?: 'schemes' | string; } diff --git a/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts b/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts index 6e2ee07020..ba08b5778f 100644 --- a/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts +++ b/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts @@ -1,8 +1,8 @@ export interface SearchProjectsUsingSecuritySchemes { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The list of security scheme IDs to be filtered out. */ issueSecuritySchemeId?: string[]; /** The list of project IDs to be filtered out. */ diff --git a/src/version2/parameters/searchSecuritySchemes.ts b/src/version2/parameters/searchSecuritySchemes.ts index 21e4af570f..150e06463d 100644 --- a/src/version2/parameters/searchSecuritySchemes.ts +++ b/src/version2/parameters/searchSecuritySchemes.ts @@ -1,8 +1,8 @@ export interface SearchSecuritySchemes { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * The list of issue security scheme IDs. To include multiple issue security scheme IDs, separate IDs with an * ampersand: `id=10000&id=10001`. diff --git a/src/version2/parameters/suggestedPrioritiesForMappings.ts b/src/version2/parameters/suggestedPrioritiesForMappings.ts index d24049c5ce..ed706bf989 100644 --- a/src/version2/parameters/suggestedPrioritiesForMappings.ts +++ b/src/version2/parameters/suggestedPrioritiesForMappings.ts @@ -1,3 +1,3 @@ -import { SuggestedMappingsRequestBean } from '../models'; +import { SuggestedMappingsRequest } from '../models'; -export interface SuggestedPrioritiesForMappings extends SuggestedMappingsRequestBean {} +export interface SuggestedPrioritiesForMappings extends SuggestedMappingsRequest {} diff --git a/src/version2/parameters/updateDashboard.ts b/src/version2/parameters/updateDashboard.ts index 3b01c0c2d9..7144648aa6 100644 --- a/src/version2/parameters/updateDashboard.ts +++ b/src/version2/parameters/updateDashboard.ts @@ -3,4 +3,9 @@ import { DashboardDetails } from '../models'; export interface UpdateDashboard extends DashboardDetails { /** The ID of the dashboard to update. */ id: string; + /** + * Whether admin level permissions are used. It should only be true if the user has _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) + */ + extendAdminPermissions?: boolean; } diff --git a/src/version2/parameters/updateDefaultProjectClassification.ts b/src/version2/parameters/updateDefaultProjectClassification.ts index dc4ae8e91a..01b6cb1eb2 100644 --- a/src/version2/parameters/updateDefaultProjectClassification.ts +++ b/src/version2/parameters/updateDefaultProjectClassification.ts @@ -1,6 +1,6 @@ -import { UpdateDefaultProjectClassificationBean } from '../models'; +import { UpdateDefaultProjectClassification as UpdateDefaultProjectClassificationModel } from '../models'; -export interface UpdateDefaultProjectClassification extends UpdateDefaultProjectClassificationBean { +export interface UpdateDefaultProjectClassification extends UpdateDefaultProjectClassificationModel { /** The project ID or project key (case-sensitive). */ projectIdOrKey: string; } diff --git a/src/version2/parameters/updatePrecomputations.ts b/src/version2/parameters/updatePrecomputations.ts index ecf83b9aaf..7371900380 100644 --- a/src/version2/parameters/updatePrecomputations.ts +++ b/src/version2/parameters/updatePrecomputations.ts @@ -1,3 +1,5 @@ import { JqlFunctionPrecomputationUpdateRequest } from '../models'; -export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest {} +export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest { + skipNotFoundPrecomputations?: boolean; +} diff --git a/src/version2/parameters/updatePriorityScheme.ts b/src/version2/parameters/updatePriorityScheme.ts index a43e200c25..bbd7a2f666 100644 --- a/src/version2/parameters/updatePriorityScheme.ts +++ b/src/version2/parameters/updatePriorityScheme.ts @@ -1,6 +1,6 @@ -import { UpdatePrioritySchemeRequestBean } from '../models'; +import { UpdatePrioritySchemeRequest } from '../models'; -export interface UpdatePriorityScheme extends UpdatePrioritySchemeRequestBean { +export interface UpdatePriorityScheme extends UpdatePrioritySchemeRequest { /** The ID of the priority scheme. */ schemeId: number; } diff --git a/src/version2/permissionSchemes.ts b/src/version2/permissionSchemes.ts index 23d978d498..b81c1d514e 100644 --- a/src/version2/permissionSchemes.ts +++ b/src/version2/permissionSchemes.ts @@ -274,7 +274,10 @@ export class PermissionSchemes { params: { expand: parameters?.expand, }, - data: parameters?.body, + data: { + ...parameters, + expand: undefined, + }, }; return this.client.sendRequest(config, callback); @@ -367,7 +370,11 @@ export class PermissionSchemes { params: { expand: parameters.expand, }, - data: parameters.body, + data: { + ...parameters, + schemeId: undefined, + expand: undefined, + }, }; return this.client.sendRequest(config, callback); diff --git a/src/version2/prioritySchemes.ts b/src/version2/prioritySchemes.ts index 643bdf5ee3..a36cbcfe92 100644 --- a/src/version2/prioritySchemes.ts +++ b/src/version2/prioritySchemes.ts @@ -3,6 +3,8 @@ import * as Parameters from './parameters'; import { Client } from '../clients'; import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; +import { paramSerializer } from '../paramSerializer'; +import { Paginated } from '../paginated'; export class PrioritySchemes { constructor(private client: Client) {} @@ -13,7 +15,7 @@ export class PrioritySchemes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * Permission to access Jira. */ - async getPrioritySchemes( + async getPrioritySchemes>( parameters: Parameters.GetPrioritySchemes | undefined, callback: Callback, ): Promise; @@ -24,11 +26,11 @@ export class PrioritySchemes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * Permission to access Jira. */ - async getPrioritySchemes( + async getPrioritySchemes>( parameters?: Parameters.GetPrioritySchemes, callback?: never, ): Promise; - async getPrioritySchemes( + async getPrioritySchemes>( parameters?: Parameters.GetPrioritySchemes, callback?: Callback, ): Promise { @@ -38,8 +40,8 @@ export class PrioritySchemes { params: { startAt: parameters?.startAt, maxResults: parameters?.maxResults, - priorityId: parameters?.priorityId, - schemeId: parameters?.schemeId, + priorityId: paramSerializer('priorityId', parameters?.priorityId), + schemeId: paramSerializer('schemeId', parameters?.schemeId), schemeName: parameters?.schemeName, onlyDefault: parameters?.onlyDefault, orderBy: parameters?.orderBy, @@ -56,7 +58,7 @@ export class PrioritySchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createPriorityScheme( - parameters: Parameters.CreatePriorityScheme | undefined, + parameters: Parameters.CreatePriorityScheme, callback: Callback, ): Promise; /** @@ -66,23 +68,23 @@ export class PrioritySchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createPriorityScheme( - parameters?: Parameters.CreatePriorityScheme, + parameters: Parameters.CreatePriorityScheme, callback?: never, ): Promise; async createPriorityScheme( - parameters?: Parameters.CreatePriorityScheme, + parameters: Parameters.CreatePriorityScheme, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/priorityscheme', method: 'POST', data: { - defaultPriorityId: parameters?.defaultPriorityId, - description: parameters?.description, - mappings: parameters?.mappings, - name: parameters?.name, - priorityIds: parameters?.priorityIds, - projectIds: parameters?.projectIds, + defaultPriorityId: parameters.defaultPriorityId, + description: parameters.description, + mappings: parameters.mappings, + name: parameters.name, + priorityIds: parameters.priorityIds, + projectIds: parameters.projectIds, }, }; @@ -95,7 +97,7 @@ export class PrioritySchemes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * Permission to access Jira. */ - async suggestedPrioritiesForMappings( + async suggestedPrioritiesForMappings>( parameters: Parameters.SuggestedPrioritiesForMappings | undefined, callback: Callback, ): Promise; @@ -106,11 +108,11 @@ export class PrioritySchemes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * Permission to access Jira. */ - async suggestedPrioritiesForMappings( + async suggestedPrioritiesForMappings>( parameters?: Parameters.SuggestedPrioritiesForMappings, callback?: never, ): Promise; - async suggestedPrioritiesForMappings( + async suggestedPrioritiesForMappings>( parameters?: Parameters.SuggestedPrioritiesForMappings, callback?: Callback, ): Promise { @@ -135,7 +137,7 @@ export class PrioritySchemes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * Permission to access Jira. */ - async getAvailablePrioritiesByPriorityScheme( + async getAvailablePrioritiesByPriorityScheme>( parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, callback: Callback, ): Promise; @@ -146,11 +148,11 @@ export class PrioritySchemes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * Permission to access Jira. */ - async getAvailablePrioritiesByPriorityScheme( + async getAvailablePrioritiesByPriorityScheme>( parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, callback?: never, ): Promise; - async getAvailablePrioritiesByPriorityScheme( + async getAvailablePrioritiesByPriorityScheme>( parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, callback?: Callback, ): Promise { @@ -248,7 +250,7 @@ export class PrioritySchemes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * Permission to access Jira. */ - async getPrioritiesByPriorityScheme( + async getPrioritiesByPriorityScheme>( parameters: Parameters.GetPrioritiesByPriorityScheme, callback: Callback, ): Promise; @@ -259,11 +261,11 @@ export class PrioritySchemes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * Permission to access Jira. */ - async getPrioritiesByPriorityScheme( + async getPrioritiesByPriorityScheme>( parameters: Parameters.GetPrioritiesByPriorityScheme, callback?: never, ): Promise; - async getPrioritiesByPriorityScheme( + async getPrioritiesByPriorityScheme>( parameters: Parameters.GetPrioritiesByPriorityScheme, callback?: Callback, ): Promise { @@ -310,7 +312,7 @@ export class PrioritySchemes { params: { startAt: parameters.startAt, maxResults: parameters.maxResults, - projectId: parameters.projectId, + projectId: paramSerializer('projectId', parameters.projectId), query: parameters.query, }, }; diff --git a/src/version2/projectClassificationLevels.ts b/src/version2/projectClassificationLevels.ts index 1b2fb798cd..0083f8d199 100644 --- a/src/version2/projectClassificationLevels.ts +++ b/src/version2/projectClassificationLevels.ts @@ -1,4 +1,3 @@ -import * as Models from './models'; import * as Parameters from './parameters'; import { Client } from '../clients'; import { Callback } from '../callback'; diff --git a/src/version2/projectComponents.ts b/src/version2/projectComponents.ts index 6aac6dad19..6fade9f351 100644 --- a/src/version2/projectComponents.ts +++ b/src/version2/projectComponents.ts @@ -3,6 +3,7 @@ import * as Parameters from './parameters'; import { Client } from '../clients'; import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; +import { Paginated } from '../paginated'; export class ProjectComponents { constructor(private client: Client) {} @@ -15,7 +16,7 @@ export class ProjectComponents { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ - async findComponentsForProjects( + async findComponentsForProjects>( parameters: Parameters.FindComponentsForProjects | undefined, callback: Callback, ): Promise; @@ -28,11 +29,11 @@ export class ProjectComponents { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ - async findComponentsForProjects( + async findComponentsForProjects>( parameters?: Parameters.FindComponentsForProjects, callback?: never, ): Promise; - async findComponentsForProjects( + async findComponentsForProjects>( parameters?: Parameters.FindComponentsForProjects, callback?: Callback, ): Promise { @@ -174,7 +175,14 @@ export class ProjectComponents { const config: RequestConfig = { url: `/rest/api/2/component/${parameters.id}`, method: 'PUT', - data: parameters.body, + 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); diff --git a/src/version2/projectKeyAndNameValidation.ts b/src/version2/projectKeyAndNameValidation.ts index 96a0f91345..6b08bb39b8 100644 --- a/src/version2/projectKeyAndNameValidation.ts +++ b/src/version2/projectKeyAndNameValidation.ts @@ -47,7 +47,7 @@ export class ProjectKeyAndNameValidation { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getValidProjectKey( + async getValidProjectKey( parameters: Parameters.GetValidProjectKey | string | undefined, callback: Callback, ): Promise; @@ -56,11 +56,11 @@ export class ProjectKeyAndNameValidation { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getValidProjectKey( + async getValidProjectKey( parameters?: Parameters.GetValidProjectKey | string, callback?: never, ): Promise; - async getValidProjectKey( + async getValidProjectKey( parameters?: Parameters.GetValidProjectKey | string, callback?: Callback, ): Promise { diff --git a/src/version2/projectVersions.ts b/src/version2/projectVersions.ts index 60532214cf..8a5f972970 100644 --- a/src/version2/projectVersions.ts +++ b/src/version2/projectVersions.ts @@ -137,7 +137,6 @@ export class ProjectVersions { name: parameters?.name, operations: parameters?.operations, overdue: parameters?.overdue, - project: parameters?.project, projectId: parameters?.projectId, releaseDate: parameters?.releaseDate, released: parameters?.released, @@ -206,7 +205,19 @@ export class ProjectVersions { const config: RequestConfig = { url: `/rest/api/2/version/${parameters.id}`, method: 'PUT', - data: parameters.body, + data: { + approvers: parameters.approvers, + driver: parameters.driver, + 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); diff --git a/src/version2/projects.ts b/src/version2/projects.ts index acc991379b..c149da8586 100644 --- a/src/version2/projects.ts +++ b/src/version2/projects.ts @@ -118,7 +118,6 @@ export class Projects { issueTypeScheme: parameters?.issueTypeScheme, issueTypeScreenScheme: parameters?.issueTypeScreenScheme, key: parameters?.key, - lead: parameters?.lead, leadAccountId: parameters?.leadAccountId, name: parameters?.name, notificationScheme: parameters?.notificationScheme, @@ -301,7 +300,6 @@ export class Projects { description: parameters.description, issueSecurityScheme: parameters.issueSecurityScheme, key: parameters.key, - lead: parameters.lead, leadAccountId: parameters.leadAccountId, name: parameters.name, notificationScheme: parameters.notificationScheme, diff --git a/src/version2/status.ts b/src/version2/status.ts index ed86523238..abeba72f2c 100644 --- a/src/version2/status.ts +++ b/src/version2/status.ts @@ -155,7 +155,7 @@ export class Status { } /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * statuses that match a search on name or project. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -168,7 +168,7 @@ export class Status { callback: Callback, ): Promise; /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * statuses that match a search on name or project. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** diff --git a/src/version2/workflowSchemes.ts b/src/version2/workflowSchemes.ts index b4aa751240..edee135db6 100644 --- a/src/version2/workflowSchemes.ts +++ b/src/version2/workflowSchemes.ts @@ -164,14 +164,14 @@ export class WorkflowSchemes { url: '/rest/api/2/workflowscheme/update', method: 'POST', data: { - defaultWorkflowId: parameters?.defaultWorkflowId, - description: parameters?.description, - id: parameters?.id, - name: parameters?.name, - statusMappingsByIssueTypeOverride: parameters?.statusMappingsByIssueTypeOverride, - statusMappingsByWorkflows: parameters?.statusMappingsByWorkflows, - version: parameters?.version, - workflowsForIssueTypes: parameters?.workflowsForIssueTypes, + defaultWorkflowId: parameters.defaultWorkflowId, + description: parameters.description, + id: parameters.id, + name: parameters.name, + statusMappingsByIssueTypeOverride: parameters.statusMappingsByIssueTypeOverride, + statusMappingsByWorkflows: parameters.statusMappingsByWorkflows, + version: parameters.version, + workflowsForIssueTypes: parameters.workflowsForIssueTypes, }, }; @@ -214,9 +214,9 @@ export class WorkflowSchemes { url: '/rest/api/2/workflowscheme/update/mappings', method: 'POST', data: { - defaultWorkflowId: parameters?.defaultWorkflowId, - id: parameters?.id, - workflowsForIssueTypes: parameters?.workflowsForIssueTypes, + defaultWorkflowId: parameters.defaultWorkflowId, + id: parameters.id, + workflowsForIssueTypes: parameters.workflowsForIssueTypes, }, }; diff --git a/src/version2/workflowTransitionRules.ts b/src/version2/workflowTransitionRules.ts index efda85c0bc..85874662e6 100644 --- a/src/version2/workflowTransitionRules.ts +++ b/src/version2/workflowTransitionRules.ts @@ -92,7 +92,7 @@ export class WorkflowTransitionRules { * * - Disable a rule. * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule - * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). + * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflow-transition-rules/#api-rest-api-2-workflow-rule-config-get). * * Rules are enabled if the `disabled` parameter is not provided. * @@ -119,7 +119,7 @@ export class WorkflowTransitionRules { * * - Disable a rule. * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule - * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). + * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflow-transition-rules/#api-rest-api-2-workflow-rule-config-get). * * Rules are enabled if the `disabled` parameter is not provided. * diff --git a/src/version2/workflows.ts b/src/version2/workflows.ts index 73c043b116..20b0c9c929 100644 --- a/src/version2/workflows.ts +++ b/src/version2/workflows.ts @@ -12,7 +12,7 @@ export class Workflows { * Creates a workflow. You can define transition rules using the shapes detailed in the following sections. If no * transitional rules are specified the default system transition rules are used. Note: This only applies to * company-managed scoped workflows. Use [bulk create - * workflows](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflows-create-post) + * workflows](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflows/#api-rest-api-2-workflows-create-post) * to create both team and company-managed scoped workflows. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -26,7 +26,7 @@ export class Workflows { * Creates a workflow. You can define transition rules using the shapes detailed in the following sections. If no * transitional rules are specified the default system transition rules are used. Note: This only applies to * company-managed scoped workflows. Use [bulk create - * workflows](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflows-create-post) + * workflows](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflows/#api-rest-api-2-workflows-create-post) * to create both team and company-managed scoped workflows. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -259,7 +259,6 @@ export class Workflows { url: '/rest/api/2/workflows', method: 'POST', params: { - expand: parameters.expand, useTransitionLinksFormat: parameters.useTransitionLinksFormat, useApprovalConfiguration: parameters.useApprovalConfiguration, }, diff --git a/src/version3/models/index.ts b/src/version3/models/index.ts index 25a6121df5..3cfce66b38 100644 --- a/src/version3/models/index.ts +++ b/src/version3/models/index.ts @@ -1,72 +1,3 @@ -export * from './workflowSchemeProjectUsage'; -export * from './updateDefaultProjectClassification'; -export * from './workflowUpdateRequest'; -export * from './mappingsByIssueTypeOverride'; -export * from './createCrossProjectReleaseRequest'; -export * from './validationOptionsForCreate'; -export * from './createCustomFieldRequest'; -export * from './createExclusionRulesRequest'; -export * from './createIssueSourceRequest'; -export * from './createPermissionRequest'; -export * from './createSchedulingRequest'; -export * from './priorityMapping'; -export * from './getPlanOnlyTeamResponse'; -export * from './getAtlassianTeamResponse'; -export * from './pageWithCursorGetTeamResponseForPage'; -export * from './serviceRegistry'; -export * from './updatePrioritySchemeRequest'; -export * from './updatePrioritySchemeResponse'; -export * from './suggestedMappingsRequest'; -export * from './priorityWithSequence'; -export * from './prioritySchemeWithPaginatedPrioritiesAndProjects'; -export * from './prioritySchemeId'; -export * from './plan'; -export * from './pageWithCursorGetPlanResponseForPage'; -export * from './versionRelatedWork'; -export * from './component'; -export * from './worklogsMoveRequest'; -export * from './searchAndReconcileResults'; -export * from './projectAndIssueTypePair'; -export * from './idSearchRequest'; -export * from './idSearchResults'; -export * from './jqlCountRequest'; -export * from './jqlCount'; -export * from './pageOfCreateMetaIssueTypeWithField'; -export * from './issueLimitReport'; -export * from './pageOfCreateMetaIssueTypes'; -export * from './bulkIssue'; -export * from './bulkChangelogRequest'; -export * from './bulkChangelog'; -export * from './workflowUpdateValidateRequest'; -export * from './workflowUpdate'; -export * from './workflowValidationErrorList'; -export * from './workflowCreateRequest'; -export * from './workflowCreate'; -export * from './workflowCapabilities'; -export * from './workflowRead'; -export * from './jqlFunctionPrecomputationGetByIdRequest'; -export * from './jqlFunctionPrecomputationGetByIdResponse'; -export * from './bulkOperationProgress'; -export * from './issueBulkTransitionPayload'; -export * from './bulkTransitionGetAvailableTransitions'; -export * from './issueBulkMovePayload'; -export * from './issueBulkEditPayload'; -export * from './bulkEditGetFields'; -export * from './issueBulkDeletePayload'; -export * from './submittedBulkOperation'; -export * from './dataClassificationLevels'; -export * from './workflowSchemeUpdateRequiredMappingsResponse'; -export * from './workflowSchemeReadRequest'; -export * from './mappingsByWorkflow'; -export * from './documentVersion'; -export * from './workflowSchemeAssociation'; -export * from './workflowSchemeReadResponse'; -export * from './jiraExpressionEvaluateContext'; -export * from './evaluatedJiraExpression'; -export * from './configurationsListParameters'; -export * from './pageBulkContextualConfiguration'; -export * from './workspaceDataPolicy'; -export * from './projectDataPolicies'; export * from './actorInput'; export * from './actorsMap'; export * from './addField'; @@ -97,17 +28,23 @@ export * from './avatar'; export * from './avatars'; export * from './avatarUrls'; export * from './avatarWithDetails'; +export * from './bulkChangelog'; +export * from './bulkChangelogRequest'; export * from './bulkChangeOwnerDetails'; export * from './bulkCustomFieldOptionCreateRequest'; export * from './bulkCustomFieldOptionUpdateRequest'; +export * from './bulkEditGetFields'; export * from './bulkEditShareableEntity'; +export * from './bulkIssue'; export * from './bulkIssueIsWatching'; export * from './bulkIssuePropertyUpdateRequest'; export * from './bulkOperationErrorResult'; +export * from './bulkOperationProgress'; export * from './bulkPermissionGrants'; export * from './bulkPermissionsRequest'; export * from './bulkProjectPermissionGrants'; export * from './bulkProjectPermissions'; +export * from './bulkTransitionGetAvailableTransitions'; export * from './changeDetails'; export * from './changedValue'; export * from './changedWorklog'; @@ -115,9 +52,11 @@ export * from './changedWorklogs'; export * from './changelog'; export * from './columnItem'; export * from './comment'; +export * from './component'; export * from './componentIssuesCount'; export * from './componentWithIssueCount'; export * from './configuration'; +export * from './configurationsListParameters'; export * from './connectCustomFieldValue'; export * from './connectCustomFieldValues'; export * from './connectModule'; @@ -130,14 +69,20 @@ export * from './containerOfWorkflowSchemeAssociations'; export * from './contextForProjectAndIssueType'; export * from './contextualConfiguration'; export * from './convertedJQLQueries'; +export * from './createCrossProjectReleaseRequest'; export * from './createCustomFieldContext'; +export * from './createCustomFieldRequest'; export * from './createdIssue'; export * from './createdIssues'; +export * from './createExclusionRulesRequest'; export * from './createIssueSecuritySchemeDetails'; +export * from './createIssueSourceRequest'; export * from './createNotificationSchemeDetails'; +export * from './createPermissionRequest'; export * from './createPriorityDetails'; export * from './createProjectDetails'; export * from './createResolutionDetails'; +export * from './createSchedulingRequest'; export * from './createUiModificationDetails'; export * from './createUpdateRoleRequest'; export * from './createWorkflowCondition'; @@ -172,18 +117,21 @@ export * from './dashboardGadgetResponse'; export * from './dashboardGadgetSettings'; export * from './dashboardGadgetUpdateRequest'; export * from './dashboardUser'; +export * from './dataClassificationLevels'; export * from './dateRangeFilter'; export * from './defaultLevelValue'; export * from './defaultShareScope'; export * from './defaultWorkflow'; export * from './deleteAndReplaceVersion'; export * from './document'; +export * from './documentVersion'; export * from './enhancedSearchRequest'; export * from './entityProperty'; export * from './entityPropertyDetails'; export * from './error'; export * from './errorCollection'; export * from './errors'; +export * from './evaluatedJiraExpression'; export * from './eventNotification'; export * from './exportArchivedIssuesTaskProgress'; export * from './failedWebhook'; @@ -212,6 +160,8 @@ export * from './foundGroups'; export * from './foundUsers'; export * from './foundUsersAndGroups'; export * from './functionReferenceData'; +export * from './getAtlassianTeamResponse'; +export * from './getPlanOnlyTeamResponse'; export * from './globalScope'; export * from './group'; export * from './groupDetails'; @@ -224,10 +174,16 @@ export * from './historyMetadataParticipant'; export * from './icon'; export * from './id'; export * from './idOrKey'; +export * from './idSearchRequest'; +export * from './idSearchResults'; export * from './includedFields'; export * from './issue'; export * from './issueArchivalSync'; export * from './issueArchivalSyncRequest'; +export * from './issueBulkDeletePayload'; +export * from './issueBulkEditPayload'; +export * from './issueBulkMovePayload'; +export * from './issueBulkTransitionPayload'; export * from './issueChangelogIds'; export * from './issueCommentListRequest'; export * from './issueContextVariable'; @@ -241,6 +197,7 @@ export * from './issueFieldOptionCreate'; export * from './issueFieldOptionScope'; export * from './issueFilterForBulkPropertyDelete'; export * from './issueFilterForBulkPropertySet'; +export * from './issueLimitReport'; export * from './issueLink'; export * from './issueLinkType'; export * from './issueLinkTypes'; @@ -291,13 +248,13 @@ export * from './jExpEvaluateIssuesJqlMetaData'; export * from './jExpEvaluateIssuesMeta'; export * from './jExpEvaluateJiraExpressionResult'; export * from './jExpEvaluateMetaData'; -export * from './jiraExpressionEvaluateContext'; export * from './jexpIssues'; export * from './jexpJqlIssues'; export * from './jiraExpressionAnalysis'; export * from './jiraExpressionComplexity'; export * from './jiraExpressionEvalContext'; export * from './jiraExpressionEvalRequest'; +export * from './jiraExpressionEvaluateContext'; export * from './jiraExpressionEvaluationMetaData'; export * from './jiraExpressionEvalUsingEnhancedSearchRequest'; export * from './jiraExpressionForAnalysis'; @@ -307,7 +264,11 @@ export * from './jiraExpressionsComplexity'; export * from './jiraExpressionsComplexityValue'; export * from './jiraExpressionValidationError'; export * from './jiraStatus'; +export * from './jqlCount'; +export * from './jqlCountRequest'; export * from './jqlFunctionPrecomputation'; +export * from './jqlFunctionPrecomputationGetByIdRequest'; +export * from './jqlFunctionPrecomputationGetByIdResponse'; export * from './jqlFunctionPrecomputationUpdate'; export * from './jqlFunctionPrecomputationUpdateRequest'; export * from './jQLPersonalDataMigrationRequest'; @@ -333,6 +294,8 @@ export * from './linkIssueRequestJson'; export * from './listWrapperCallbackApplicationRole'; export * from './listWrapperCallbackGroupName'; export * from './locale'; +export * from './mappingsByIssueTypeOverride'; +export * from './mappingsByWorkflow'; export * from './mark'; export * from './moveField'; export * from './multiIssueEntityProperties'; @@ -358,6 +321,7 @@ export * from './operations'; export * from './orderOfCustomFieldOptions'; export * from './orderOfIssueTypes'; export * from './pageBeanFieldConfigurationDetails'; +export * from './pageBulkContextualConfiguration'; export * from './pageChangelog'; export * from './pageComment'; export * from './pageComponentWithIssueCount'; @@ -390,6 +354,8 @@ export * from './pageJqlFunctionPrecomputation'; export * from './pageNotificationScheme'; export * from './pageOfChangelogs'; export * from './pageOfComments'; +export * from './pageOfCreateMetaIssueTypes'; +export * from './pageOfCreateMetaIssueTypeWithField'; export * from './pageOfDashboards'; export * from './pageOfStatuses'; export * from './pageOfWorklogs'; @@ -410,6 +376,8 @@ export * from './pageUserDetails'; export * from './pageUserKey'; export * from './pageVersion'; export * from './pageWebhook'; +export * from './pageWithCursorGetPlanResponseForPage'; +export * from './pageWithCursorGetTeamResponseForPage'; export * from './pageWorkflow'; export * from './pageWorkflowScheme'; export * from './pageWorkflowTransitionRules'; @@ -424,12 +392,19 @@ export * from './permissionScheme'; export * from './permissionSchemes'; export * from './permissionsKeys'; export * from './permittedProjects'; +export * from './plan'; export * from './priority'; export * from './priorityId'; +export * from './priorityMapping'; +export * from './prioritySchemeId'; +export * from './prioritySchemeWithPaginatedPrioritiesAndProjects'; +export * from './priorityWithSequence'; export * from './project'; +export * from './projectAndIssueTypePair'; export * from './projectAvatars'; export * from './projectCategory'; export * from './projectComponent'; +export * from './projectDataPolicies'; export * from './projectDetails'; export * from './projectEmailAddress'; export * from './projectFeature'; @@ -486,6 +461,7 @@ export * from './screenSchemeId'; export * from './screenTypes'; export * from './screenWithTab'; export * from './searchAndReconcileResults'; +export * from './searchAndReconcileResults'; export * from './searchAutoCompleteFilter'; export * from './searchRequest'; export * from './searchResults'; @@ -499,6 +475,7 @@ export * from './securitySchemeMembersRequest'; export * from './securitySchemes'; export * from './securitySchemeWithProjects'; export * from './serverInformation'; +export * from './serviceRegistry'; export * from './setDefaultLevelsRequest'; export * from './setDefaultPriorityRequest'; export * from './setDefaultResolutionRequest'; @@ -515,10 +492,15 @@ export * from './statusCreate'; export * from './statusCreateRequest'; export * from './statusDetails'; export * from './statusMapping'; +export * from './statusProjectIssueTypeUsage'; +export * from './statusProjectUsage'; export * from './statusScope'; export * from './statusUpdate'; export * from './statusUpdateRequest'; +export * from './statusWorkflowUsage'; +export * from './submittedBulkOperation'; export * from './suggestedIssue'; +export * from './suggestedMappingsRequest'; export * from './systemAvatars'; export * from './taskProgressObject'; export * from './taskProgressRemoveOptionFromIssuesResult'; @@ -532,12 +514,15 @@ export * from './uiModificationDetails'; export * from './uiModificationIdentifiers'; export * from './unrestrictedUserEmail'; export * from './updateCustomFieldDetails'; +export * from './updateDefaultProjectClassification'; export * from './updatedProjectCategory'; export * from './updateFieldConfigurationSchemeDetails'; export * from './updateIssueSecurityLevelDetails'; export * from './updateIssueSecuritySchemeRequest'; export * from './updateNotificationSchemeDetails'; export * from './updatePriorityDetails'; +export * from './updatePrioritySchemeRequest'; +export * from './updatePrioritySchemeResponse'; export * from './updateProjectDetails'; export * from './updateResolutionDetails'; export * from './updateScreenDetails'; @@ -553,10 +538,12 @@ export * from './userKey'; export * from './userList'; export * from './userMigration'; export * from './userPickerUser'; +export * from './validationOptionsForCreate'; export * from './version'; export * from './versionIssueCounts'; export * from './versionIssuesStatus'; export * from './versionMove'; +export * from './versionRelatedWork'; export * from './versionUnresolvedIssuesCount'; export * from './versionUsageInCustomField'; export * from './visibility'; @@ -567,16 +554,29 @@ export * from './webhookDetails'; export * from './webhookRegistrationDetails'; export * from './webhooksExpirationDate'; export * from './workflow'; +export * from './workflowCapabilities'; export * from './workflowCondition'; +export * from './workflowCreate'; +export * from './workflowCreateRequest'; export * from './workflowId'; export * from './workflowOperations'; +export * from './workflowProjectIssueTypeUsage'; +export * from './workflowProjectUsage'; +export * from './workflowRead'; export * from './workflowRules'; export * from './workflowRulesSearch'; export * from './workflowRulesSearchDetails'; export * from './workflowScheme'; +export * from './workflowSchemeAssociation'; export * from './workflowSchemeAssociations'; export * from './workflowSchemeIdName'; export * from './workflowSchemeProjectAssociation'; +export * from './workflowSchemeProjectUsage'; +export * from './workflowSchemeReadRequest'; +export * from './workflowSchemeReadResponse'; +export * from './workflowSchemeUpdateRequiredMappingsResponse'; +export * from './workflowSchemeUsage'; +export * from './workflowSearchResponse'; export * from './workflowStatus'; export * from './workflowStatusProperties'; export * from './workflowsWithTransitionRulesDetails'; @@ -588,5 +588,11 @@ export * from './workflowTransitionRulesDetails'; export * from './workflowTransitionRulesUpdate'; export * from './workflowTransitionRulesUpdateErrorDetails'; export * from './workflowTransitionRulesUpdateErrors'; +export * from './workflowUpdate'; +export * from './workflowUpdateRequest'; +export * from './workflowUpdateValidateRequest'; +export * from './workflowValidationErrorList'; export * from './worklog'; export * from './worklogIdsRequest'; +export * from './worklogsMoveRequest'; +export * from './workspaceDataPolicy'; diff --git a/src/version3/models/statusProjectIssueTypeUsage.ts b/src/version3/models/statusProjectIssueTypeUsage.ts new file mode 100644 index 0000000000..a6e133af18 --- /dev/null +++ b/src/version3/models/statusProjectIssueTypeUsage.ts @@ -0,0 +1,10 @@ +import { StatusProjectIssueTypeUsagePage } from './statusProjectIssueTypeUsagePage'; + +/** The issue types using this status in a project. */ +export interface StatusProjectIssueTypeUsage { + issueTypes?: StatusProjectIssueTypeUsagePage; + /** The project ID. */ + projectId?: string; + /** The status ID. */ + statusId?: string; +} diff --git a/src/version3/models/statusProjectIssueTypeUsagePage.ts b/src/version3/models/statusProjectIssueTypeUsagePage.ts new file mode 100644 index 0000000000..b273c4e6c2 --- /dev/null +++ b/src/version3/models/statusProjectIssueTypeUsagePage.ts @@ -0,0 +1,9 @@ +import { StatusProjectIssueTypeUsage } from './statusProjectIssueTypeUsage'; + +/** A page of issue types. */ +export interface StatusProjectIssueTypeUsagePage { + /** Page token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of issue types. */ + values?: StatusProjectIssueTypeUsage[]; +} diff --git a/src/version3/models/statusProjectUsage.ts b/src/version3/models/statusProjectUsage.ts new file mode 100644 index 0000000000..c1390878c3 --- /dev/null +++ b/src/version3/models/statusProjectUsage.ts @@ -0,0 +1,8 @@ +import { StatusProjectUsagePage } from './statusProjectUsagePage'; + +/** The projects using this status. */ +export interface StatusProjectUsage { + projects?: StatusProjectUsagePage; + /** The status ID. */ + statusId?: string; +} diff --git a/src/version3/models/statusProjectUsagePage.ts b/src/version3/models/statusProjectUsagePage.ts new file mode 100644 index 0000000000..5a9583f815 --- /dev/null +++ b/src/version3/models/statusProjectUsagePage.ts @@ -0,0 +1,9 @@ +import { StatusProjectUsage } from './statusProjectUsage'; + +/** A page of projects. */ +export interface StatusProjectUsagePage { + /** Page token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of projects. */ + values?: StatusProjectUsage[]; +} diff --git a/src/version3/models/statusWorkflowUsage.ts b/src/version3/models/statusWorkflowUsage.ts new file mode 100644 index 0000000000..53780c802b --- /dev/null +++ b/src/version3/models/statusWorkflowUsage.ts @@ -0,0 +1,8 @@ +import { StatusWorkflowUsagePage } from './statusWorkflowUsagePage'; + +/** Workflows using the status. */ +export interface StatusWorkflowUsage { + /** The status ID. */ + statusId?: string; + workflows?: StatusWorkflowUsagePage; +} diff --git a/src/version3/models/statusWorkflowUsagePage.ts b/src/version3/models/statusWorkflowUsagePage.ts new file mode 100644 index 0000000000..6d358d8517 --- /dev/null +++ b/src/version3/models/statusWorkflowUsagePage.ts @@ -0,0 +1,9 @@ +import { StatusWorkflowUsageWorkflow } from './statusWorkflowUsageWorkflow'; + +/** A page of workflows. */ +export interface StatusWorkflowUsagePage { + /** Page token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of statuses. */ + values?: StatusWorkflowUsageWorkflow[]; +} diff --git a/src/version3/models/statusWorkflowUsageWorkflow.ts b/src/version3/models/statusWorkflowUsageWorkflow.ts new file mode 100644 index 0000000000..3e860725b5 --- /dev/null +++ b/src/version3/models/statusWorkflowUsageWorkflow.ts @@ -0,0 +1,5 @@ +/** The worflow. */ +export interface StatusWorkflowUsageWorkflow { + /** The workflow ID. */ + id?: string; +} diff --git a/src/version3/models/workflowProjectIssueTypeUsage.ts b/src/version3/models/workflowProjectIssueTypeUsage.ts new file mode 100644 index 0000000000..9545964f09 --- /dev/null +++ b/src/version3/models/workflowProjectIssueTypeUsage.ts @@ -0,0 +1,10 @@ +import { WorkflowProjectIssueTypeUsagePage } from './workflowProjectIssueTypeUsagePage'; + +/** Issue types associated with the workflow for a project. */ +export interface WorkflowProjectIssueTypeUsage { + issueTypes?: WorkflowProjectIssueTypeUsagePage; + /** The ID of the project. */ + projectId?: string; + /** The ID of the workflow. */ + workflowId?: string; +} diff --git a/src/version3/models/workflowProjectIssueTypeUsagePage.ts b/src/version3/models/workflowProjectIssueTypeUsagePage.ts new file mode 100644 index 0000000000..33efc451d8 --- /dev/null +++ b/src/version3/models/workflowProjectIssueTypeUsagePage.ts @@ -0,0 +1,9 @@ +import { WorkflowProjectIssueTypeUsage } from './workflowProjectIssueTypeUsage'; + +/** A page of issue types. */ +export interface WorkflowProjectIssueTypeUsagePage { + /** Token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of issue types. */ + values?: WorkflowProjectIssueTypeUsage[]; +} diff --git a/src/version3/models/workflowProjectUsage.ts b/src/version3/models/workflowProjectUsage.ts new file mode 100644 index 0000000000..6276eb98c4 --- /dev/null +++ b/src/version3/models/workflowProjectUsage.ts @@ -0,0 +1,8 @@ +import { ProjectUsagePage } from './projectUsagePage'; + +/** Projects using the workflow. */ +export interface WorkflowProjectUsage { + projects?: ProjectUsagePage; + /** The workflow ID. */ + workflowId?: string; +} diff --git a/src/version3/models/workflowSchemeUsage.ts b/src/version3/models/workflowSchemeUsage.ts new file mode 100644 index 0000000000..0c28522096 --- /dev/null +++ b/src/version3/models/workflowSchemeUsage.ts @@ -0,0 +1,8 @@ +import { WorkflowSchemeUsagePage } from './workflowSchemeUsagePage'; + +/** Workflow schemes using the workflow. */ +export interface WorkflowSchemeUsage { + /** The workflow ID. */ + workflowId?: string; + workflowSchemes?: WorkflowSchemeUsagePage; +} diff --git a/src/version3/models/workflowSchemeUsagePage.ts b/src/version3/models/workflowSchemeUsagePage.ts new file mode 100644 index 0000000000..5b883978f6 --- /dev/null +++ b/src/version3/models/workflowSchemeUsagePage.ts @@ -0,0 +1,9 @@ +import { WorkflowSchemeUsage } from './workflowSchemeUsage'; + +/** A page of workflow schemes. */ +export interface WorkflowSchemeUsagePage { + /** Token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of workflow schemes. */ + values?: WorkflowSchemeUsage[]; +} diff --git a/src/version2/models/pageBean2ComponentJsonBean.ts b/src/version3/models/workflowSearchResponse.ts similarity index 55% rename from src/version2/models/pageBean2ComponentJsonBean.ts rename to src/version3/models/workflowSearchResponse.ts index 02483674b7..966016a32a 100644 --- a/src/version2/models/pageBean2ComponentJsonBean.ts +++ b/src/version3/models/workflowSearchResponse.ts @@ -1,7 +1,8 @@ -import { ComponentJsonBean } from './componentJsonBean'; +import { JiraWorkflowStatus } from './jiraWorkflowStatus'; +import { JiraWorkflow } from './jiraWorkflow'; -/** A page of items. */ -export interface PageBean2ComponentJsonBean { +/** Page of items, including workflows and related statuses. */ +export interface WorkflowSearchResponse { /** Whether this is the last page. */ isLast?: boolean; /** The maximum number of items that could be returned. */ @@ -12,8 +13,10 @@ export interface PageBean2ComponentJsonBean { self?: string; /** The index of the first item returned. */ startAt?: number; + /** List of statuses. */ + statuses?: JiraWorkflowStatus[]; /** The number of items returned. */ total?: number; - /** The list of items. */ - values?: ComponentJsonBean[]; + /** List of workflows. */ + values?: JiraWorkflow[]; } diff --git a/src/version3/parameters/getAvailablePrioritiesByPriorityScheme.ts b/src/version3/parameters/getAvailablePrioritiesByPriorityScheme.ts index e576614d09..da7ba318f6 100644 --- a/src/version3/parameters/getAvailablePrioritiesByPriorityScheme.ts +++ b/src/version3/parameters/getAvailablePrioritiesByPriorityScheme.ts @@ -1,8 +1,8 @@ export interface GetAvailablePrioritiesByPriorityScheme { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The string to query priorities on by name. */ query?: string; /** The priority scheme ID. */ diff --git a/src/version3/parameters/getNotificationSchemeToProjectMappings.ts b/src/version3/parameters/getNotificationSchemeToProjectMappings.ts index 34cfec0e7b..bfb504e6e2 100644 --- a/src/version3/parameters/getNotificationSchemeToProjectMappings.ts +++ b/src/version3/parameters/getNotificationSchemeToProjectMappings.ts @@ -1,8 +1,8 @@ export interface GetNotificationSchemeToProjectMappings { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The list of notifications scheme IDs to be filtered out */ notificationSchemeId?: string[]; /** The list of project IDs to be filtered out */ diff --git a/src/version3/parameters/getPrioritiesByPriorityScheme.ts b/src/version3/parameters/getPrioritiesByPriorityScheme.ts index 76d7512d9c..6cd7fcedac 100644 --- a/src/version3/parameters/getPrioritiesByPriorityScheme.ts +++ b/src/version3/parameters/getPrioritiesByPriorityScheme.ts @@ -1,8 +1,8 @@ export interface GetPrioritiesByPriorityScheme { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The priority scheme ID. */ schemeId: string; } diff --git a/src/version3/parameters/getPrioritySchemes.ts b/src/version3/parameters/getPrioritySchemes.ts index 0ce9f0840e..bb87151030 100644 --- a/src/version3/parameters/getPrioritySchemes.ts +++ b/src/version3/parameters/getPrioritySchemes.ts @@ -1,8 +1,8 @@ export interface GetPrioritySchemes { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * A set of priority IDs to filter by. To include multiple IDs, provide an ampersand-separated list. For example, * `priorityId=10000&priorityId=10001`. diff --git a/src/version3/parameters/getProjectIssueTypeUsagesForStatus.ts b/src/version3/parameters/getProjectIssueTypeUsagesForStatus.ts new file mode 100644 index 0000000000..80deab4e9d --- /dev/null +++ b/src/version3/parameters/getProjectIssueTypeUsagesForStatus.ts @@ -0,0 +1,10 @@ +export interface GetProjectIssueTypeUsagesForStatus { + /** The statusId to fetch issue type usages for */ + statusId: string; + /** The projectId to fetch issue type usages for */ + projectId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getProjectUsagesForStatus.ts b/src/version3/parameters/getProjectUsagesForStatus.ts new file mode 100644 index 0000000000..0e8913c901 --- /dev/null +++ b/src/version3/parameters/getProjectUsagesForStatus.ts @@ -0,0 +1,8 @@ +export interface GetProjectUsagesForStatus { + /** The statusId to fetch project usages for */ + statusId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getProjectUsagesForWorkflow.ts b/src/version3/parameters/getProjectUsagesForWorkflow.ts new file mode 100644 index 0000000000..e70544f1f4 --- /dev/null +++ b/src/version3/parameters/getProjectUsagesForWorkflow.ts @@ -0,0 +1,8 @@ +export interface GetProjectUsagesForWorkflow { + /** The workflow ID */ + workflowId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getProjectsByPriorityScheme.ts b/src/version3/parameters/getProjectsByPriorityScheme.ts index 6bbbf10e42..607505f6d4 100644 --- a/src/version3/parameters/getProjectsByPriorityScheme.ts +++ b/src/version3/parameters/getProjectsByPriorityScheme.ts @@ -1,8 +1,8 @@ export interface GetProjectsByPriorityScheme { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The project IDs to filter by. For example, `projectId=10000&projectId=10001`. */ projectId?: number[]; /** The priority scheme ID. */ diff --git a/src/version3/parameters/getSecurityLevelMembers.ts b/src/version3/parameters/getSecurityLevelMembers.ts index ca3cfe5b25..d1ed167d63 100644 --- a/src/version3/parameters/getSecurityLevelMembers.ts +++ b/src/version3/parameters/getSecurityLevelMembers.ts @@ -1,8 +1,8 @@ export interface GetSecurityLevelMembers { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * The list of issue security level member IDs. To include multiple issue security level members separate IDs with an * ampersand: `id=10000&id=10001`. diff --git a/src/version3/parameters/getSecurityLevels.ts b/src/version3/parameters/getSecurityLevels.ts index 05024f88eb..4c49f93753 100644 --- a/src/version3/parameters/getSecurityLevels.ts +++ b/src/version3/parameters/getSecurityLevels.ts @@ -1,8 +1,8 @@ export interface GetSecurityLevels { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * The list of issue security scheme level IDs. To include multiple issue security levels, separate IDs with an * ampersand: `id=10000&id=10001`. diff --git a/src/version3/parameters/getWorkflowProjectIssueTypeUsages.ts b/src/version3/parameters/getWorkflowProjectIssueTypeUsages.ts new file mode 100644 index 0000000000..42ce81e475 --- /dev/null +++ b/src/version3/parameters/getWorkflowProjectIssueTypeUsages.ts @@ -0,0 +1,10 @@ +export interface GetWorkflowProjectIssueTypeUsages { + /** The workflow ID */ + workflowId: string; + /** The project ID */ + projectId: number; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getWorkflowSchemeUsagesForWorkflow.ts b/src/version3/parameters/getWorkflowSchemeUsagesForWorkflow.ts new file mode 100644 index 0000000000..dae488d332 --- /dev/null +++ b/src/version3/parameters/getWorkflowSchemeUsagesForWorkflow.ts @@ -0,0 +1,8 @@ +export interface GetWorkflowSchemeUsagesForWorkflow { + /** The workflow ID */ + workflowId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getWorkflowUsagesForStatus.ts b/src/version3/parameters/getWorkflowUsagesForStatus.ts new file mode 100644 index 0000000000..cdfb21d971 --- /dev/null +++ b/src/version3/parameters/getWorkflowUsagesForStatus.ts @@ -0,0 +1,8 @@ +export interface GetWorkflowUsagesForStatus { + /** The statusId to fetch workflow usages for */ + statusId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/index.ts b/src/version3/parameters/index.ts index 18217f0a09..2661ee7e99 100644 --- a/src/version3/parameters/index.ts +++ b/src/version3/parameters/index.ts @@ -1,73 +1,5 @@ -export * from './getProjectUsagesForWorkflowScheme'; -export * from './deletePlanOnlyTeam'; -export * from './updatePlanOnlyTeam'; -export * from './getPlanOnlyTeam'; -export * from './createPlanOnlyTeam'; -export * from './removeAtlassianTeam'; -export * from './updateAtlassianTeam'; -export * from './getAtlassianTeam'; -export * from './addAtlassianTeam'; -export * from './getTeams'; -export * from './services'; -export * from './removeDefaultProjectClassification'; -export * from './updateDefaultProjectClassification'; -export * from './getDefaultProjectClassification'; -export * from './getProjectsByPriorityScheme'; -export * from './getPrioritiesByPriorityScheme'; -export * from './deletePriorityScheme'; -export * from './updatePriorityScheme'; -export * from './getAvailablePrioritiesByPriorityScheme'; -export * from './suggestedPrioritiesForMappings'; -export * from './createPriorityScheme'; -export * from './getPrioritySchemes'; -export * from './trashPlan'; -export * from './duplicatePlan'; -export * from './archivePlan'; -export * from './updatePlan'; -export * from './getPlan'; -export * from './createPlan'; -export * from './getPlans'; -export * from './deleteRelatedWork'; -export * from './updateRelatedWork'; -export * from './createRelatedWork'; -export * from './getRelatedWork'; -export * from './findComponentsForProjects'; -export * from './bulkMoveWorklogs'; -export * from './bulkDeleteWorklogs'; -export * from './searchAndReconsileIssuesUsingJqlPost'; -export * from './searchForIssuesIds'; -export * from './countIssues'; -export * from './getCreateIssueMetaIssueTypeId'; -export * from './getIssueLimitReport'; -export * from './getCreateIssueMetaIssueTypes'; -export * from './bulkFetchIssues'; -export * from './getBulkChangelogs'; -export * from './validateUpdateWorkflows'; -export * from './updateWorkflows'; -export * from './validateCreateWorkflows'; -export * from './createWorkflows'; -export * from './workflowCapabilities'; -export * from './readWorkflows'; -export * from './getPrecomputationsByID'; -export * from './getBulkOperationProgress'; -export * from './submitBulkTransition'; -export * from './getAvailableTransitions'; -export * from './submitBulkMove'; -export * from './submitBulkEdit'; -export * from './getBulkEditableFields'; -export * from './submitBulkDelete'; -export * from './getAllUserDataClassificationLevels'; -export * from './getResolution'; -export * from './deletePriority'; -export * from './getBulkScreenTabs'; -export * from './getNotificationSchemeForProject'; -export * from './updateWorkflowSchemeMappings'; -export * from './updateSchemes'; -export * from './readWorkflowSchemes'; -export * from './replaceCustomFieldOption'; -export * from './getCustomFieldsConfigurations'; -export * from './getPolicies'; export * from './addActorUsers'; +export * from './addAtlassianTeam'; export * from './addAttachment'; export * from './addComment'; export * from './addFieldToDefaultScreen'; @@ -88,6 +20,7 @@ export * from './analyseExpression'; export * from './appendMappingsForIssueTypeScreenScheme'; export * from './archiveIssues'; export * from './archiveIssuesAsync'; +export * from './archivePlan'; export * from './archiveProject'; export * from './assignFieldConfigurationSchemeToProject'; export * from './assignIssue'; @@ -98,16 +31,20 @@ export * from './assignProjectsToCustomFieldContext'; export * from './assignSchemeToProject'; export * from './associateSchemesToProjects'; export * from './bulkDeleteIssueProperty'; +export * from './bulkDeleteWorklogs'; export * from './bulkEditDashboards'; +export * from './bulkFetchIssues'; export * from './bulkGetGroups'; export * from './bulkGetUsers'; export * from './bulkGetUsersMigration'; +export * from './bulkMoveWorklogs'; export * from './bulkSetIssuePropertiesByIssue'; export * from './bulkSetIssueProperty'; export * from './bulkSetIssuesProperties'; export * from './cancelTask'; export * from './changeFilterOwner'; export * from './copyDashboard'; +export * from './countIssues'; export * from './createComponent'; export * from './createCustomField'; export * from './createCustomFieldContext'; @@ -130,11 +67,15 @@ export * from './createNotificationScheme'; export * from './createOrUpdateRemoteIssueLink'; export * from './createPermissionGrant'; export * from './createPermissionScheme'; +export * from './createPlan'; +export * from './createPlanOnlyTeam'; export * from './createPriority'; +export * from './createPriorityScheme'; export * from './createProject'; export * from './createProjectAvatar'; export * from './createProjectCategory'; export * from './createProjectRole'; +export * from './createRelatedWork'; export * from './createResolution'; export * from './createScreen'; export * from './createScreenScheme'; @@ -143,6 +84,7 @@ export * from './createUiModification'; export * from './createUser'; export * from './createVersion'; export * from './createWorkflow'; +export * from './createWorkflows'; export * from './createWorkflowScheme'; export * from './createWorkflowSchemeDraftFromParent'; export * from './createWorkflowTransitionProperty'; @@ -179,12 +121,16 @@ export * from './deleteIssueTypeScreenScheme'; export * from './deleteNotificationScheme'; export * from './deletePermissionScheme'; export * from './deletePermissionSchemeEntity'; +export * from './deletePlanOnlyTeam'; +export * from './deletePriority'; +export * from './deletePriorityScheme'; export * from './deleteProject'; export * from './deleteProjectAsynchronously'; export * from './deleteProjectAvatar'; export * from './deleteProjectProperty'; export * from './deleteProjectRole'; export * from './deleteProjectRoleActorsFromRole'; +export * from './deleteRelatedWork'; export * from './deleteRemoteIssueLinkByGlobalId'; export * from './deleteRemoteIssueLinkById'; export * from './deleteResolution'; @@ -207,6 +153,7 @@ export * from './deleteWorkflowTransitionRuleConfigurations'; export * from './deleteWorklog'; export * from './deleteWorklogProperty'; export * from './doTransition'; +export * from './duplicatePlan'; export * from './editIssue'; export * from './evaluateJiraExpression'; export * from './evaluateJiraExpressionUsingEnhancedSearch'; @@ -215,6 +162,7 @@ export * from './expandAttachmentForMachines'; export * from './exportArchivedIssues'; export * from './findAssignableUsers'; export * from './findBulkAssignableUsers'; +export * from './findComponentsForProjects'; export * from './findGroups'; export * from './findUserKeysByQuery'; export * from './findUsers'; @@ -240,6 +188,7 @@ export * from './getAllScreenTabFields'; export * from './getAllScreenTabs'; export * from './getAllStatuses'; export * from './getAllSystemAvatars'; +export * from './getAllUserDataClassificationLevels'; export * from './getAllUsers'; export * from './getAllUsersDefault'; export * from './getAllWorkflowSchemes'; @@ -247,17 +196,24 @@ export * from './getAlternativeIssueTypes'; export * from './getApplicationProperty'; export * from './getApplicationRole'; export * from './getAssignedPermissionScheme'; +export * from './getAtlassianTeam'; export * from './getAttachment'; export * from './getAttachmentContent'; export * from './getAttachmentThumbnail'; export * from './getAuditRecords'; export * from './getAutoCompletePost'; +export * from './getAvailablePrioritiesByPriorityScheme'; export * from './getAvailableScreenFields'; +export * from './getAvailableTransitions'; export * from './getAvatarImageByID'; export * from './getAvatarImageByOwner'; export * from './getAvatarImageByType'; export * from './getAvatars'; +export * from './getBulkChangelogs'; +export * from './getBulkEditableFields'; +export * from './getBulkOperationProgress'; export * from './getBulkPermissions'; +export * from './getBulkScreenTabs'; export * from './getChangeLogs'; export * from './getChangeLogsByIds'; export * from './getColumns'; @@ -270,14 +226,18 @@ export * from './getComponent'; export * from './getComponentRelatedIssues'; export * from './getContextsForField'; export * from './getCreateIssueMeta'; +export * from './getCreateIssueMetaIssueTypeId'; +export * from './getCreateIssueMetaIssueTypes'; export * from './getCurrentUser'; export * from './getCustomFieldConfiguration'; export * from './getCustomFieldContextsForProjectsAndIssueTypes'; export * from './getCustomFieldOption'; +export * from './getCustomFieldsConfigurations'; export * from './getDashboard'; export * from './getDashboardItemProperty'; export * from './getDashboardItemPropertyKeys'; export * from './getDashboardsPaginated'; +export * from './getDefaultProjectClassification'; export * from './getDefaultValues'; export * from './getDefaultWorkflow'; export * from './getDraftDefaultWorkflow'; @@ -299,6 +259,7 @@ export * from './getIdsOfWorklogsDeletedSince'; export * from './getIdsOfWorklogsModifiedSince'; export * from './getIssue'; export * from './getIssueFieldOption'; +export * from './getIssueLimitReport'; export * from './getIssueLink'; export * from './getIssueLinkType'; export * from './getIssuePickerResource'; @@ -323,6 +284,7 @@ export * from './getIsWatchingIssueBulk'; export * from './getMyFilters'; export * from './getMyPermissions'; export * from './getNotificationScheme'; +export * from './getNotificationSchemeForProject'; export * from './getNotificationSchemes'; export * from './getNotificationSchemeToProjectMappings'; export * from './getOptionsForContext'; @@ -330,9 +292,16 @@ export * from './getPermissionScheme'; export * from './getPermissionSchemeGrant'; export * from './getPermissionSchemeGrants'; export * from './getPermittedProjects'; +export * from './getPlan'; +export * from './getPlanOnlyTeam'; +export * from './getPlans'; +export * from './getPolicies'; export * from './getPrecomputations'; +export * from './getPrecomputationsByID'; export * from './getPreference'; +export * from './getPrioritiesByPriorityScheme'; export * from './getPriority'; +export * from './getPrioritySchemes'; export * from './getProject'; export * from './getProjectCategoryById'; export * from './getProjectComponents'; @@ -340,6 +309,7 @@ export * from './getProjectComponentsPaginated'; export * from './getProjectContextMapping'; export * from './getProjectEmail'; export * from './getProjectIssueSecurityScheme'; +export * from './getProjectIssueTypeUsagesForStatus'; export * from './getProjectProperty'; export * from './getProjectPropertyKeys'; export * from './getProjectRole'; @@ -347,13 +317,19 @@ export * from './getProjectRoleActorsForRole'; export * from './getProjectRoleById'; export * from './getProjectRoleDetails'; export * from './getProjectRoles'; +export * from './getProjectsByPriorityScheme'; export * from './getProjectsForIssueTypeScreenScheme'; export * from './getProjectTypeByKey'; +export * from './getProjectUsagesForStatus'; +export * from './getProjectUsagesForWorkflow'; +export * from './getProjectUsagesForWorkflowScheme'; export * from './getProjectVersions'; export * from './getProjectVersionsPaginated'; export * from './getRecent'; +export * from './getRelatedWork'; export * from './getRemoteIssueLinkById'; export * from './getRemoteIssueLinks'; +export * from './getResolution'; export * from './getScreens'; export * from './getScreenSchemes'; export * from './getScreensForField'; @@ -367,6 +343,7 @@ export * from './getStatus'; export * from './getStatusCategory'; export * from './getStatusesById'; export * from './getTask'; +export * from './getTeams'; export * from './getTransitions'; export * from './getTrashedFieldsPaginated'; export * from './getUiModifications'; @@ -386,14 +363,17 @@ export * from './getVersionUnresolvedIssues'; export * from './getVisibleIssueFieldOptions'; export * from './getVotes'; export * from './getWorkflow'; +export * from './getWorkflowProjectIssueTypeUsages'; export * from './getWorkflowScheme'; export * from './getWorkflowSchemeDraft'; export * from './getWorkflowSchemeDraftIssueType'; export * from './getWorkflowSchemeIssueType'; export * from './getWorkflowSchemeProjectAssociations'; +export * from './getWorkflowSchemeUsagesForWorkflow'; export * from './getWorkflowsPaginated'; export * from './getWorkflowTransitionProperties'; export * from './getWorkflowTransitionRuleConfigurations'; +export * from './getWorkflowUsagesForStatus'; export * from './getWorklog'; export * from './getWorklogProperty'; export * from './getWorklogPropertyKeys'; @@ -413,11 +393,15 @@ export * from './partialUpdateProjectRole'; export * from './publishDraftWorkflowScheme'; export * from './putAddonProperty'; export * from './putAppProperty'; +export * from './readWorkflows'; +export * from './readWorkflowSchemes'; export * from './refreshWebhooks'; export * from './registerDynamicWebhooks'; export * from './registerModules'; +export * from './removeAtlassianTeam'; export * from './removeAttachment'; export * from './removeCustomFieldContextFromProjects'; +export * from './removeDefaultProjectClassification'; export * from './removeGadget'; export * from './removeGroup'; export * from './removeIssueTypeFromIssueTypeScheme'; @@ -438,6 +422,7 @@ export * from './removeWatcher'; export * from './renameScreenTab'; export * from './reorderCustomFieldOptions'; export * from './reorderIssueTypesInIssueTypeScheme'; +export * from './replaceCustomFieldOption'; export * from './replaceIssueFieldOption'; export * from './resetColumns'; export * from './resetUserColumns'; @@ -445,16 +430,20 @@ export * from './restore'; export * from './restoreCustomField'; export * from './sanitiseJqlQueries'; export * from './search'; +export * from './searchAndReconsileIssuesUsingJqlPost'; +export * from './searchForIssuesIds'; export * from './searchForIssuesUsingJql'; export * from './searchForIssuesUsingJqlEnhancedSearch'; -export * from './searchForIssuesUsingJqlPost'; export * from './searchForIssuesUsingJqlEnhancedSearchPost'; +export * from './searchForIssuesUsingJqlPost'; export * from './searchPriorities'; export * from './searchProjects'; export * from './searchProjectsUsingSecuritySchemes'; export * from './searchResolutions'; export * from './searchSecuritySchemes'; +export * from './searchWorkflows'; export * from './selectTimeTrackingImplementation'; +export * from './services'; export * from './setActors'; export * from './setApplicationProperty'; export * from './setBanner'; @@ -479,9 +468,16 @@ export * from './setWorkflowSchemeDraftIssueType'; export * from './setWorkflowSchemeIssueType'; export * from './setWorklogProperty'; export * from './storeAvatar'; +export * from './submitBulkDelete'; +export * from './submitBulkEdit'; +export * from './submitBulkMove'; +export * from './submitBulkTransition'; +export * from './suggestedPrioritiesForMappings'; export * from './toggleFeatureForProject'; export * from './trashCustomField'; +export * from './trashPlan'; export * from './unarchiveIssues'; +export * from './updateAtlassianTeam'; export * from './updateComment'; export * from './updateComponent'; export * from './updateCustomField'; @@ -490,6 +486,7 @@ export * from './updateCustomFieldContext'; export * from './updateCustomFieldOption'; export * from './updateCustomFieldValue'; export * from './updateDashboard'; +export * from './updateDefaultProjectClassification'; export * from './updateDefaultScreenScheme'; export * from './updateDefaultWorkflow'; export * from './updateDraftDefaultWorkflow'; @@ -510,14 +507,19 @@ export * from './updateIssueTypeScreenScheme'; export * from './updateMultipleCustomFieldValues'; export * from './updateNotificationScheme'; export * from './updatePermissionScheme'; +export * from './updatePlan'; +export * from './updatePlanOnlyTeam'; export * from './updatePrecomputations'; export * from './updatePriority'; +export * from './updatePriorityScheme'; export * from './updateProject'; export * from './updateProjectAvatar'; export * from './updateProjectCategory'; export * from './updateProjectEmail'; +export * from './updateRelatedWork'; export * from './updateRemoteIssueLink'; export * from './updateResolution'; +export * from './updateSchemes'; export * from './updateScreen'; export * from './updateScreenScheme'; export * from './updateSecurityLevel'; @@ -525,10 +527,15 @@ export * from './updateStatuses'; export * from './updateUiModification'; export * from './updateVersion'; export * from './updateWorkflowMapping'; +export * from './updateWorkflows'; export * from './updateWorkflowScheme'; export * from './updateWorkflowSchemeDraft'; +export * from './updateWorkflowSchemeMappings'; export * from './updateWorkflowTransitionProperty'; export * from './updateWorkflowTransitionRuleConfigurations'; export * from './updateWorklog'; +export * from './validateCreateWorkflows'; export * from './validateProjectKey'; +export * from './validateUpdateWorkflows'; +export * from './workflowCapabilities'; export * from './workflowRuleSearch'; diff --git a/src/version3/parameters/searchPriorities.ts b/src/version3/parameters/searchPriorities.ts index 64c81ab36b..7ad7be9707 100644 --- a/src/version3/parameters/searchPriorities.ts +++ b/src/version3/parameters/searchPriorities.ts @@ -1,8 +1,8 @@ export interface SearchPriorities { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The list of priority IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=2&id=3`. */ id?: string[]; /** diff --git a/src/version3/parameters/searchProjectsUsingSecuritySchemes.ts b/src/version3/parameters/searchProjectsUsingSecuritySchemes.ts index 6e2ee07020..ba08b5778f 100644 --- a/src/version3/parameters/searchProjectsUsingSecuritySchemes.ts +++ b/src/version3/parameters/searchProjectsUsingSecuritySchemes.ts @@ -1,8 +1,8 @@ export interface SearchProjectsUsingSecuritySchemes { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The list of security scheme IDs to be filtered out. */ issueSecuritySchemeId?: string[]; /** The list of project IDs to be filtered out. */ diff --git a/src/version3/parameters/searchSecuritySchemes.ts b/src/version3/parameters/searchSecuritySchemes.ts index eb6b6edc62..df7dae9577 100644 --- a/src/version3/parameters/searchSecuritySchemes.ts +++ b/src/version3/parameters/searchSecuritySchemes.ts @@ -1,8 +1,8 @@ export interface SearchSecuritySchemes { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * The list of issue security scheme IDs. To include multiple issue security scheme IDs, separate IDs with an * ampersand: `id=10000&id=10001`. diff --git a/src/version3/parameters/searchWorkflows.ts b/src/version3/parameters/searchWorkflows.ts new file mode 100644 index 0000000000..c05a641727 --- /dev/null +++ b/src/version3/parameters/searchWorkflows.ts @@ -0,0 +1,27 @@ +export interface SearchWorkflows { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `values.transitions` Returns the transitions that each workflow is associated with. + */ + expand?: 'values.transitions' | string; + /** String used to perform a case-insensitive partial match with workflow name. */ + queryString?: string; + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `name` Sorts by workflow name. + * - `created` Sorts by create time. + * - `updated` Sorts by update time. + */ + orderBy?: 'name' | 'created' | 'updated' | '+name' | '+created' | '+updated' | '-name' | '-created' | '-updated' | string; + /** The scope of the workflow. Global for company-managed projects and Project for team-managed projects. */ + scope?: string; + /** Filters active and inactive workflows. */ + isActive?: boolean; +} diff --git a/src/version3/status.ts b/src/version3/status.ts index c197607757..6cf82f415b 100644 --- a/src/version3/status.ts +++ b/src/version3/status.ts @@ -182,16 +182,16 @@ export class Status { return this.client.sendRequest(config, callback); } /** Returns a page of issue types in a project using a given status. */ - async getProjectIssueTypeUsagesForStatus( + async getProjectIssueTypeUsagesForStatus( parameters: Parameters.GetProjectIssueTypeUsagesForStatus, callback: Callback, ): Promise; /** Returns a page of issue types in a project using a given status. */ - async getProjectIssueTypeUsagesForStatus( + async getProjectIssueTypeUsagesForStatus( parameters: Parameters.GetProjectIssueTypeUsagesForStatus, callback?: never, ): Promise; - async getProjectIssueTypeUsagesForStatus( + async getProjectIssueTypeUsagesForStatus( parameters: Parameters.GetProjectIssueTypeUsagesForStatus, callback?: Callback, ): Promise { @@ -208,16 +208,16 @@ export class Status { } /** Returns a page of projects using a given status. */ - async getProjectUsagesForStatus( + async getProjectUsagesForStatus( parameters: Parameters.GetProjectUsagesForStatus, callback: Callback, ): Promise; /** Returns a page of projects using a given status. */ - async getProjectUsagesForStatus( + async getProjectUsagesForStatus( parameters: Parameters.GetProjectUsagesForStatus, callback?: never, ): Promise; - async getProjectUsagesForStatus( + async getProjectUsagesForStatus( parameters: Parameters.GetProjectUsagesForStatus, callback?: Callback, ): Promise { @@ -234,16 +234,16 @@ export class Status { } /** Returns a page of workflows using a given status. */ - async getWorkflowUsagesForStatus( + async getWorkflowUsagesForStatus( parameters: Parameters.GetWorkflowUsagesForStatus, callback: Callback, ): Promise; /** Returns a page of workflows using a given status. */ - async getWorkflowUsagesForStatus( + async getWorkflowUsagesForStatus( parameters: Parameters.GetWorkflowUsagesForStatus, callback?: never, ): Promise; - async getWorkflowUsagesForStatus( + async getWorkflowUsagesForStatus( parameters: Parameters.GetWorkflowUsagesForStatus, callback?: Callback, ): Promise { diff --git a/src/version3/workflows.ts b/src/version3/workflows.ts index 61b1578005..eaccfee546 100644 --- a/src/version3/workflows.ts +++ b/src/version3/workflows.ts @@ -145,16 +145,16 @@ export class Workflows { } /** Returns a page of issue types using a given workflow within a project. */ - async getWorkflowProjectIssueTypeUsages( + async getWorkflowProjectIssueTypeUsages( parameters: Parameters.GetWorkflowProjectIssueTypeUsages, callback: Callback, ): Promise; /** Returns a page of issue types using a given workflow within a project. */ - async getWorkflowProjectIssueTypeUsages( + async getWorkflowProjectIssueTypeUsages( parameters: Parameters.GetWorkflowProjectIssueTypeUsages, callback?: never, ): Promise; - async getWorkflowProjectIssueTypeUsages( + async getWorkflowProjectIssueTypeUsages( parameters: Parameters.GetWorkflowProjectIssueTypeUsages, callback?: Callback, ): Promise { @@ -171,16 +171,16 @@ export class Workflows { } /** Returns a page of projects using a given workflow. */ - async getProjectUsagesForWorkflow( + async getProjectUsagesForWorkflow( parameters: Parameters.GetProjectUsagesForWorkflow, callback: Callback, ): Promise; /** Returns a page of projects using a given workflow. */ - async getProjectUsagesForWorkflow( + async getProjectUsagesForWorkflow( parameters: Parameters.GetProjectUsagesForWorkflow, callback?: never, ): Promise; - async getProjectUsagesForWorkflow( + async getProjectUsagesForWorkflow( parameters: Parameters.GetProjectUsagesForWorkflow, callback?: Callback, ): Promise { @@ -197,16 +197,16 @@ export class Workflows { } /** Returns a page of workflow schemes using a given workflow. */ - async getWorkflowSchemeUsagesForWorkflow( + async getWorkflowSchemeUsagesForWorkflow( parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, callback: Callback, ): Promise; /** Returns a page of workflow schemes using a given workflow. */ - async getWorkflowSchemeUsagesForWorkflow( + async getWorkflowSchemeUsagesForWorkflow( parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, callback?: never, ): Promise; - async getWorkflowSchemeUsagesForWorkflow( + async getWorkflowSchemeUsagesForWorkflow( parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, callback?: Callback, ): Promise { diff --git a/tests/unit/version2/issueSearch.test.ts b/tests/unit/version2/issueSearch.test.ts index 840cadbfb9..7ff24a8171 100644 --- a/tests/unit/version2/issueSearch.test.ts +++ b/tests/unit/version2/issueSearch.test.ts @@ -12,7 +12,9 @@ test('searchForIssuesUsingJql should calls without parameters', ({ expect }) => const client = new Version2Client(config); const sendRequestStub = sinon.stub(client, 'sendRequest'); - client.issueSearch.searchForIssuesUsingJql(); + client.issueSearch.searchForIssuesUsingJql({ + jql: '', + }); expect(sendRequestStub.calledOnce).toBeTruthy(); }); @@ -33,6 +35,7 @@ test('searchForIssuesUsingJql should accept follow parameters', ({ expect }) => expect(callArgument.params).toStrictEqual({ expand: undefined, + failFast: undefined, fields: ['key', 'summary'], fieldsByKeys: undefined, jql: 'id IN (TICKET_ID) ORDER BY key ASC', @@ -72,7 +75,7 @@ test('searchForIssuesUsingJqlEnhancedSearch should calls without parameters', ({ const client = new Version2Client(config); const sendRequestStub = sinon.stub(client, 'sendRequest'); - client.issueSearch.searchForIssuesUsingJqlEnhancedSearch(); + client.issueSearch.searchForIssuesUsingJqlEnhancedSearch({}); expect(sendRequestStub.calledOnce).toBeTruthy(); }); diff --git a/tests/unit/version2/jiraExpressions.test.ts b/tests/unit/version2/jiraExpressions.test.ts index a4e0f3ae5b..94a374c2af 100644 --- a/tests/unit/version2/jiraExpressions.test.ts +++ b/tests/unit/version2/jiraExpressions.test.ts @@ -12,7 +12,9 @@ test('evaluateJiraExpressionUsingEnhancedSearch should calls without parameters' const client = new Version2Client(config); const sendRequestStub = sinon.stub(client, 'sendRequest'); - client.jiraExpressions.evaluateJiraExpressionUsingEnhancedSearch(); + client.jiraExpressions.evaluateJiraExpressionUsingEnhancedSearch({ + expression: '', + }); expect(sendRequestStub.calledOnce).toBeTruthy(); }); diff --git a/tests/unit/version2/projectVersions.test.ts b/tests/unit/version2/projectVersions.test.ts index b60f9201e0..1d3caf5520 100644 --- a/tests/unit/version2/projectVersions.test.ts +++ b/tests/unit/version2/projectVersions.test.ts @@ -73,8 +73,10 @@ test('createVersion should accept follow parameters', ({ expect }) => { const callArgument = sendRequestStub.getCall(0).args[0]; expect(callArgument.data).toStrictEqual({ + approvers: undefined, archived: undefined, description: undefined, + driver: undefined, expand: undefined, id: undefined, issuesStatusForFixVersion: undefined, diff --git a/tests/unit/version3/issueSearch.test.ts b/tests/unit/version3/issueSearch.test.ts index 78d40e9799..28b582c3e7 100644 --- a/tests/unit/version3/issueSearch.test.ts +++ b/tests/unit/version3/issueSearch.test.ts @@ -35,8 +35,8 @@ test('searchForIssuesUsingJql should accept follow parameters', ({ expect }) => expect(callArgument.params).toStrictEqual({ expand: undefined, - fields: ['key', 'summary'], failFast: undefined, + fields: ['key', 'summary'], fieldsByKeys: undefined, jql: 'id IN (TICKET_ID) ORDER BY key ASC', maxResults: 10, From 4826e55c35dc0cd54ca77728bb9f58f08452ab4c Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Thu, 20 Feb 2025 22:29:11 +0300 Subject: [PATCH 03/10] `bulkFetchIssues` returned back for version2 client --- package-lock.json | 506 ++++++++++-------- package.json | 12 +- src/version2/issues.ts | 108 +++- src/version2/models/approvalConfiguration.ts | 5 +- src/version2/models/bulkChangelog.ts | 4 +- src/version2/models/bulkFetchIssueRequest.ts | 43 -- src/version2/models/bulkIssue.ts | 14 + .../models/createIssueSourceRequest.ts | 4 +- .../models/detailedErrorCollection.ts | 4 +- .../models/evaluatedJiraExpression.ts | 4 +- src/version2/models/index.ts | 2 +- .../models/issueLimitReportRequest.ts | 4 +- .../jqlFunctionPrecomputationUpdateBean.ts | 4 +- .../models/searchAndReconcileRequest.ts | 21 +- src/version2/models/simpleErrorCollection.ts | 4 +- .../models/simplifiedHierarchyLevel.ts | 8 +- src/version2/models/userFilter.ts | 4 +- src/version2/models/versionRelatedWork.ts | 9 +- .../models/workflowSchemeUpdateRequest.ts | 3 +- src/version2/myself.ts | 5 +- src/version2/parameters/bulkDeleteWorklogs.ts | 4 +- src/version2/parameters/bulkFetchIssues.ts | 69 ++- src/version2/parameters/getAllProjects.ts | 5 +- .../getCustomFieldsConfigurations.ts | 4 +- src/version2/parameters/getPrioritySchemes.ts | 4 +- src/version3/parameters/searchWorkflows.ts | 12 +- 26 files changed, 498 insertions(+), 368 deletions(-) delete mode 100644 src/version2/models/bulkFetchIssueRequest.ts create mode 100644 src/version2/models/bulkIssue.ts diff --git a/package-lock.json b/package-lock.json index 5d62783fa9..0a29425817 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,22 +15,22 @@ "tslib": "^2.8.1" }, "devDependencies": { - "@types/node": "^18.19.75", + "@types/node": "^18.19.76", "@types/sinon": "^17.0.3", - "@typescript-eslint/eslint-plugin": "^8.23.0", - "@typescript-eslint/parser": "^8.23.0", + "@typescript-eslint/eslint-plugin": "^8.24.1", + "@typescript-eslint/parser": "^8.24.1", "dotenv": "^16.4.7", "eslint": "^8.57.1", "eslint-config-airbnb-base": "^15.0.0", - "eslint-import-resolver-typescript": "^3.7.0", + "eslint-import-resolver-typescript": "^3.8.3", "eslint-plugin-import": "^2.31.0", - "prettier": "^3.5.0", + "prettier": "^3.5.1", "prettier-plugin-jsdoc": "^1.3.2", "sinon": "^18.0.1", "typedoc": "^0.27.7", "typescript": "^5.7.3", "vite-tsconfig-paths": "^5.1.4", - "vitest": "^3.0.5" + "vitest": "^3.0.6" } }, "node_modules/@esbuild/aix-ppc64": { @@ -675,9 +675,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.6.tgz", - "integrity": "sha512-+GcCXtOQoWuC7hhX1P00LqjjIiS/iOouHXhMdiDSnq/1DGTox4SpUvO52Xm+div6+106r+TcvOeo/cxvyEyTgg==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.8.tgz", + "integrity": "sha512-q217OSE8DTp8AFHuNHXo0Y86e1wtlfVrXiAlwkIvGRQv9zbc6mE3sjIVfwI8sYUyNxwOg0j/Vm1RKM04JcWLJw==", "cpu": [ "arm" ], @@ -689,9 +689,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.6.tgz", - "integrity": "sha512-E8+2qCIjciYUnCa1AiVF1BkRgqIGW9KzJeesQqVfyRITGQN+dFuoivO0hnro1DjT74wXLRZ7QF8MIbz+luGaJA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.8.tgz", + "integrity": "sha512-Gigjz7mNWaOL9wCggvoK3jEIUUbGul656opstjaUSGC3eT0BM7PofdAJaBfPFWWkXNVAXbaQtC99OCg4sJv70Q==", "cpu": [ "arm64" ], @@ -703,9 +703,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.6.tgz", - "integrity": "sha512-z9Ib+OzqN3DZEjX7PDQMHEhtF+t6Mi2z/ueChQPLS/qUMKY7Ybn5A2ggFoKRNRh1q1T03YTQfBTQCJZiepESAg==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.8.tgz", + "integrity": "sha512-02rVdZ5tgdUNRxIUrFdcMBZQoaPMrxtwSb+/hOfBdqkatYHR3lZ2A2EGyHq2sGOd0Owk80oV3snlDASC24He3Q==", "cpu": [ "arm64" ], @@ -717,9 +717,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.6.tgz", - "integrity": "sha512-PShKVY4u0FDAR7jskyFIYVyHEPCPnIQY8s5OcXkdU8mz3Y7eXDJPdyM/ZWjkYdR2m0izD9HHWA8sGcXn+Qrsyg==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.8.tgz", + "integrity": "sha512-qIP/elwR/tq/dYRx3lgwK31jkZvMiD6qUtOycLhTzCvrjbZ3LjQnEM9rNhSGpbLXVJYQ3rq39A6Re0h9tU2ynw==", "cpu": [ "x64" ], @@ -731,9 +731,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.6.tgz", - "integrity": "sha512-YSwyOqlDAdKqs0iKuqvRHLN4SrD2TiswfoLfvYXseKbL47ht1grQpq46MSiQAx6rQEN8o8URtpXARCpqabqxGQ==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.8.tgz", + "integrity": "sha512-IQNVXL9iY6NniYbTaOKdrlVP3XIqazBgJOVkddzJlqnCpRi/yAeSOa8PLcECFSQochzqApIOE1GHNu3pCz+BDA==", "cpu": [ "arm64" ], @@ -745,9 +745,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.6.tgz", - "integrity": "sha512-HEP4CgPAY1RxXwwL5sPFv6BBM3tVeLnshF03HMhJYCNc6kvSqBgTMmsEjb72RkZBAWIqiPUyF1JpEBv5XT9wKQ==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.8.tgz", + "integrity": "sha512-TYXcHghgnCqYFiE3FT5QwXtOZqDj5GmaFNTNt3jNC+vh22dc/ukG2cG+pi75QO4kACohZzidsq7yKTKwq/Jq7Q==", "cpu": [ "x64" ], @@ -759,9 +759,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.6.tgz", - "integrity": "sha512-88fSzjC5xeH9S2Vg3rPgXJULkHcLYMkh8faix8DX4h4TIAL65ekwuQMA/g2CXq8W+NJC43V6fUpYZNjaX3+IIg==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.8.tgz", + "integrity": "sha512-A4iphFGNkWRd+5m3VIGuqHnG3MVnqKe7Al57u9mwgbyZ2/xF9Jio72MaY7xxh+Y87VAHmGQr73qoKL9HPbXj1g==", "cpu": [ "arm" ], @@ -773,9 +773,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.6.tgz", - "integrity": "sha512-wM4ztnutBqYFyvNeR7Av+reWI/enK9tDOTKNF+6Kk2Q96k9bwhDDOlnCUNRPvromlVXo04riSliMBs/Z7RteEg==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.8.tgz", + "integrity": "sha512-S0lqKLfTm5u+QTxlFiAnb2J/2dgQqRy/XvziPtDd1rKZFXHTyYLoVL58M/XFwDI01AQCDIevGLbQrMAtdyanpA==", "cpu": [ "arm" ], @@ -787,9 +787,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.6.tgz", - "integrity": "sha512-9RyprECbRa9zEjXLtvvshhw4CMrRa3K+0wcp3KME0zmBe1ILmvcVHnypZ/aIDXpRyfhSYSuN4EPdCCj5Du8FIA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.8.tgz", + "integrity": "sha512-jpz9YOuPiSkL4G4pqKrus0pn9aYwpImGkosRKwNi+sJSkz+WU3anZe6hi73StLOQdfXYXC7hUfsQlTnjMd3s1A==", "cpu": [ "arm64" ], @@ -801,9 +801,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.6.tgz", - "integrity": "sha512-qTmklhCTyaJSB05S+iSovfo++EwnIEZxHkzv5dep4qoszUMX5Ca4WM4zAVUMbfdviLgCSQOu5oU8YoGk1s6M9Q==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.8.tgz", + "integrity": "sha512-KdSfaROOUJXgTVxJNAZ3KwkRc5nggDk+06P6lgi1HLv1hskgvxHUKZ4xtwHkVYJ1Rep4GNo+uEfycCRRxht7+Q==", "cpu": [ "arm64" ], @@ -815,9 +815,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.6.tgz", - "integrity": "sha512-4Qmkaps9yqmpjY5pvpkfOerYgKNUGzQpFxV6rnS7c/JfYbDSU0y6WpbbredB5cCpLFGJEqYX40WUmxMkwhWCjw==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.8.tgz", + "integrity": "sha512-NyF4gcxwkMFRjgXBM6g2lkT58OWztZvw5KkV2K0qqSnUEqCVcqdh2jN4gQrTn/YUpAcNKyFHfoOZEer9nwo6uQ==", "cpu": [ "loong64" ], @@ -829,9 +829,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.6.tgz", - "integrity": "sha512-Zsrtux3PuaxuBTX/zHdLaFmcofWGzaWW1scwLU3ZbW/X+hSsFbz9wDIp6XvnT7pzYRl9MezWqEqKy7ssmDEnuQ==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.8.tgz", + "integrity": "sha512-LMJc999GkhGvktHU85zNTDImZVUCJ1z/MbAJTnviiWmmjyckP5aQsHtcujMjpNdMZPT2rQEDBlJfubhs3jsMfw==", "cpu": [ "ppc64" ], @@ -843,9 +843,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.6.tgz", - "integrity": "sha512-aK+Zp+CRM55iPrlyKiU3/zyhgzWBxLVrw2mwiQSYJRobCURb781+XstzvA8Gkjg/hbdQFuDw44aUOxVQFycrAg==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.8.tgz", + "integrity": "sha512-xAQCAHPj8nJq1PI3z8CIZzXuXCstquz7cIOL73HHdXiRcKk8Ywwqtx2wrIy23EcTn4aZ2fLJNBB8d0tQENPCmw==", "cpu": [ "riscv64" ], @@ -857,9 +857,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.6.tgz", - "integrity": "sha512-WoKLVrY9ogmaYPXwTH326+ErlCIgMmsoRSx6bO+l68YgJnlOXhygDYSZe/qbUJCSiCiZAQ+tKm88NcWuUXqOzw==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.8.tgz", + "integrity": "sha512-DdePVk1NDEuc3fOe3dPPTb+rjMtuFw89gw6gVWxQFAuEqqSdDKnrwzZHrUYdac7A7dXl9Q2Vflxpme15gUWQFA==", "cpu": [ "s390x" ], @@ -871,9 +871,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.6.tgz", - "integrity": "sha512-Sht4aFvmA4ToHd2vFzwMFaQCiYm2lDFho5rPcvPBT5pCdC+GwHG6CMch4GQfmWTQ1SwRKS0dhDYb54khSrjDWw==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.8.tgz", + "integrity": "sha512-8y7ED8gjxITUltTUEJLQdgpbPh1sUQ0kMTmufRF/Ns5tI9TNMNlhWtmPKKHCU0SilX+3MJkZ0zERYYGIVBYHIA==", "cpu": [ "x64" ], @@ -885,9 +885,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.6.tgz", - "integrity": "sha512-zmmpOQh8vXc2QITsnCiODCDGXFC8LMi64+/oPpPx5qz3pqv0s6x46ps4xoycfUiVZps5PFn1gksZzo4RGTKT+A==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.8.tgz", + "integrity": "sha512-SCXcP0ZpGFIe7Ge+McxY5zKxiEI5ra+GT3QRxL0pMMtxPfpyLAKleZODi1zdRHkz5/BhueUrYtYVgubqe9JBNQ==", "cpu": [ "x64" ], @@ -899,9 +899,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.6.tgz", - "integrity": "sha512-3/q1qUsO/tLqGBaD4uXsB6coVGB3usxw3qyeVb59aArCgedSF66MPdgRStUd7vbZOsko/CgVaY5fo2vkvPLWiA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.8.tgz", + "integrity": "sha512-YHYsgzZgFJzTRbth4h7Or0m5O74Yda+hLin0irAIobkLQFRQd1qWmnoVfwmKm9TXIZVAD0nZ+GEb2ICicLyCnQ==", "cpu": [ "arm64" ], @@ -913,9 +913,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.6.tgz", - "integrity": "sha512-oLHxuyywc6efdKVTxvc0135zPrRdtYVjtVD5GUm55I3ODxhU/PwkQFD97z16Xzxa1Fz0AEe4W/2hzRtd+IfpOA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.8.tgz", + "integrity": "sha512-r3NRQrXkHr4uWy5TOjTpTYojR9XmF0j/RYgKCef+Ag46FWUTltm5ziticv8LdNsDMehjJ543x/+TJAek/xBA2w==", "cpu": [ "ia32" ], @@ -927,9 +927,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.6.tgz", - "integrity": "sha512-0PVwmgzZ8+TZ9oGBmdZoQVXflbvuwzN/HRclujpl4N/q3i+y0lqLw8n1bXA8ru3sApDjlmONaNAuYr38y1Kr9w==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.8.tgz", + "integrity": "sha512-U0FaE5O1BCpZSeE6gBl3c5ObhePQSfk9vDRToMmTkbhCOgW4jqvtS5LGyQ76L1fH8sM0keRp4uDTsbjiUyjk0g==", "cpu": [ "x64" ], @@ -970,9 +970,9 @@ } }, "node_modules/@shikijs/vscode-textmate": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.1.tgz", - "integrity": "sha512-fTIQwLF+Qhuws31iw7Ncl1R3HUDtGwIipiJ9iU+UsDUwMhegFcQKQHd51nZjb7CArq0MvON8rbgCGQYWHUKAdg==", + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", + "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", "dev": true, "license": "MIT" }, @@ -1077,9 +1077,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "18.19.75", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.75.tgz", - "integrity": "sha512-UIksWtThob6ZVSyxcOqCLOUNg/dyO1Qvx4McgeuhrEtHTLFTf7BBhEazaE4K806FGTPtzd/2sE90qn4fVr7cyw==", + "version": "18.19.76", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.76.tgz", + "integrity": "sha512-yvR7Q9LdPz2vGpmpJX5LolrgRdWvB67MJKDPSgIIzpFbaf9a1j/f5DnLp5VDyHGMR0QZHlTr1afsD87QCXFHKw==", "dev": true, "license": "MIT", "dependencies": { @@ -1111,17 +1111,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.23.0.tgz", - "integrity": "sha512-vBz65tJgRrA1Q5gWlRfvoH+w943dq9K1p1yDBY2pc+a1nbBLZp7fB9+Hk8DaALUbzjqlMfgaqlVPT1REJdkt/w==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.24.1.tgz", + "integrity": "sha512-ll1StnKtBigWIGqvYDVuDmXJHVH4zLVot1yQ4fJtLpL7qacwkxJc1T0bptqw+miBQ/QfUbhl1TcQ4accW5KUyA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.23.0", - "@typescript-eslint/type-utils": "8.23.0", - "@typescript-eslint/utils": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", + "@typescript-eslint/scope-manager": "8.24.1", + "@typescript-eslint/type-utils": "8.24.1", + "@typescript-eslint/utils": "8.24.1", + "@typescript-eslint/visitor-keys": "8.24.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1141,16 +1141,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.23.0.tgz", - "integrity": "sha512-h2lUByouOXFAlMec2mILeELUbME5SZRN/7R9Cw2RD2lRQQY08MWMM+PmVVKKJNK1aIwqTo9t/0CvOxwPbRIE2Q==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.24.1.tgz", + "integrity": "sha512-Tqoa05bu+t5s8CTZFaGpCH2ub3QeT9YDkXbPd3uQ4SfsLoh1/vv2GEYAioPoxCWJJNsenXlC88tRjwoHNts1oQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.23.0", - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/typescript-estree": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", + "@typescript-eslint/scope-manager": "8.24.1", + "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/typescript-estree": "8.24.1", + "@typescript-eslint/visitor-keys": "8.24.1", "debug": "^4.3.4" }, "engines": { @@ -1166,14 +1166,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.23.0.tgz", - "integrity": "sha512-OGqo7+dXHqI7Hfm+WqkZjKjsiRtFUQHPdGMXzk5mYXhJUedO7e/Y7i8AK3MyLMgZR93TX4bIzYrfyVjLC+0VSw==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.24.1.tgz", + "integrity": "sha512-OdQr6BNBzwRjNEXMQyaGyZzgg7wzjYKfX2ZBV3E04hUCBDv3GQCHiz9RpqdUIiVrMgJGkXm3tcEh4vFSHreS2Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0" + "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/visitor-keys": "8.24.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1184,14 +1184,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.23.0.tgz", - "integrity": "sha512-iIuLdYpQWZKbiH+RkCGc6iu+VwscP5rCtQ1lyQ7TYuKLrcZoeJVpcLiG8DliXVkUxirW/PWlmS+d6yD51L9jvA==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.24.1.tgz", + "integrity": "sha512-/Do9fmNgCsQ+K4rCz0STI7lYB4phTtEXqqCAs3gZW0pnK7lWNkvWd5iW545GSmApm4AzmQXmSqXPO565B4WVrw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.23.0", - "@typescript-eslint/utils": "8.23.0", + "@typescript-eslint/typescript-estree": "8.24.1", + "@typescript-eslint/utils": "8.24.1", "debug": "^4.3.4", "ts-api-utils": "^2.0.1" }, @@ -1208,9 +1208,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.23.0.tgz", - "integrity": "sha512-1sK4ILJbCmZOTt9k4vkoulT6/y5CHJ1qUYxqpF1K/DBAd8+ZUL4LlSCxOssuH5m4rUaaN0uS0HlVPvd45zjduQ==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.24.1.tgz", + "integrity": "sha512-9kqJ+2DkUXiuhoiYIUvIYjGcwle8pcPpdlfkemGvTObzgmYfJ5d0Qm6jwb4NBXP9W1I5tss0VIAnWFumz3mC5A==", "dev": true, "license": "MIT", "engines": { @@ -1222,14 +1222,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.23.0.tgz", - "integrity": "sha512-LcqzfipsB8RTvH8FX24W4UUFk1bl+0yTOf9ZA08XngFwMg4Kj8A+9hwz8Cr/ZS4KwHrmo9PJiLZkOt49vPnuvQ==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.24.1.tgz", + "integrity": "sha512-UPyy4MJ/0RE648DSKQe9g0VDSehPINiejjA6ElqnFaFIhI6ZEiZAkUI0D5MCk0bQcTf/LVqZStvQ6K4lPn/BRg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", + "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/visitor-keys": "8.24.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1249,16 +1249,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.23.0.tgz", - "integrity": "sha512-uB/+PSo6Exu02b5ZEiVtmY6RVYO7YU5xqgzTIVZwTHvvK3HsL8tZZHFaTLFtRG3CsV4A5mhOv+NZx5BlhXPyIA==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.24.1.tgz", + "integrity": "sha512-OOcg3PMMQx9EXspId5iktsI3eMaXVwlhC8BvNnX6B5w9a4dVgpkQZuU8Hy67TolKcl+iFWq0XX+jbDGN4xWxjQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.23.0", - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/typescript-estree": "8.23.0" + "@typescript-eslint/scope-manager": "8.24.1", + "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/typescript-estree": "8.24.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1273,13 +1273,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.23.0.tgz", - "integrity": "sha512-oWWhcWDLwDfu++BGTZcmXWqpwtkwb5o7fxUIGksMQQDSdPW9prsSnfIOZMlsj4vBOSrcnjIUZMiIjODgGosFhQ==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.24.1.tgz", + "integrity": "sha512-EwVHlp5l+2vp8CoqJm9KikPZgi3gbdZAtabKT9KPShGeOcJhsv4Zdo3oc8T8I0uKEmYoU4ItyxbptjF08enaxg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", + "@typescript-eslint/types": "8.24.1", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -1311,15 +1311,15 @@ "license": "ISC" }, "node_modules/@vitest/expect": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.0.5.tgz", - "integrity": "sha512-nNIOqupgZ4v5jWuQx2DSlHLEs7Q4Oh/7AYwNyE+k0UQzG7tSmjPXShUikn1mpNGzYEN2jJbTvLejwShMitovBA==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.0.6.tgz", + "integrity": "sha512-zBduHf/ja7/QRX4HdP1DSq5XrPgdN+jzLOwaTq/0qZjYfgETNFCKf9nOAp2j3hmom3oTbczuUzrzg9Hafh7hNg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "3.0.5", - "@vitest/utils": "3.0.5", - "chai": "^5.1.2", + "@vitest/spy": "3.0.6", + "@vitest/utils": "3.0.6", + "chai": "^5.2.0", "tinyrainbow": "^2.0.0" }, "funding": { @@ -1327,13 +1327,13 @@ } }, "node_modules/@vitest/mocker": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.0.5.tgz", - "integrity": "sha512-CLPNBFBIE7x6aEGbIjaQAX03ZZlBMaWwAjBdMkIf/cAn6xzLTiM3zYqO/WAbieEjsAZir6tO71mzeHZoodThvw==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.0.6.tgz", + "integrity": "sha512-KPztr4/tn7qDGZfqlSPQoF2VgJcKxnDNhmfR3VgZ6Fy1bO8T9Fc1stUiTXtqz0yG24VpD00pZP5f8EOFknjNuQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "3.0.5", + "@vitest/spy": "3.0.6", "estree-walker": "^3.0.3", "magic-string": "^0.30.17" }, @@ -1354,9 +1354,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.0.5.tgz", - "integrity": "sha512-CjUtdmpOcm4RVtB+up8r2vVDLR16Mgm/bYdkGFe3Yj/scRfCpbSi2W/BDSDcFK7ohw8UXvjMbOp9H4fByd/cOA==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.0.6.tgz", + "integrity": "sha512-Zyctv3dbNL+67qtHfRnUE/k8qxduOamRfAL1BurEIQSyOEFffoMvx2pnDSSbKAAVxY0Ej2J/GH2dQKI0W2JyVg==", "dev": true, "license": "MIT", "dependencies": { @@ -1367,38 +1367,38 @@ } }, "node_modules/@vitest/runner": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.0.5.tgz", - "integrity": "sha512-BAiZFityFexZQi2yN4OX3OkJC6scwRo8EhRB0Z5HIGGgd2q+Nq29LgHU/+ovCtd0fOfXj5ZI6pwdlUmC5bpi8A==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.0.6.tgz", + "integrity": "sha512-JopP4m/jGoaG1+CBqubV/5VMbi7L+NQCJTu1J1Pf6YaUbk7bZtaq5CX7p+8sY64Sjn1UQ1XJparHfcvTTdu9cA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "3.0.5", - "pathe": "^2.0.2" + "@vitest/utils": "3.0.6", + "pathe": "^2.0.3" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/snapshot": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.0.5.tgz", - "integrity": "sha512-GJPZYcd7v8QNUJ7vRvLDmRwl+a1fGg4T/54lZXe+UOGy47F9yUfE18hRCtXL5aHN/AONu29NGzIXSVFh9K0feA==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.0.6.tgz", + "integrity": "sha512-qKSmxNQwT60kNwwJHMVwavvZsMGXWmngD023OHSgn873pV0lylK7dwBTfYP7e4URy5NiBCHHiQGA9DHkYkqRqg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "3.0.5", + "@vitest/pretty-format": "3.0.6", "magic-string": "^0.30.17", - "pathe": "^2.0.2" + "pathe": "^2.0.3" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/spy": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.0.5.tgz", - "integrity": "sha512-5fOzHj0WbUNqPK6blI/8VzZdkBlQLnT25knX0r4dbZI9qoZDf3qAdjoMmDcLG5A83W6oUUFJgUd0EYBc2P5xqg==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.0.6.tgz", + "integrity": "sha512-HfOGx/bXtjy24fDlTOpgiAEJbRfFxoX3zIGagCqACkFKKZ/TTOE6gYMKXlqecvxEndKFuNHcHqP081ggZ2yM0Q==", "dev": true, "license": "MIT", "dependencies": { @@ -1409,14 +1409,14 @@ } }, "node_modules/@vitest/utils": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.0.5.tgz", - "integrity": "sha512-N9AX0NUoUtVwKwy21JtwzaqR5L5R5A99GAbrHfCCXK1lp593i/3AZAXhSP43wRQuxYsflrdzEfXZFo1reR1Nkg==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.0.6.tgz", + "integrity": "sha512-18ktZpf4GQFTbf9jK543uspU03Q2qya7ZGya5yiZ0Gx0nnnalBvd5ZBislbl2EhLjM8A8rt4OilqKG7QwcGkvQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "3.0.5", - "loupe": "^3.1.2", + "@vitest/pretty-format": "3.0.6", + "loupe": "^3.1.3", "tinyrainbow": "^2.0.0" }, "funding": { @@ -1735,10 +1735,9 @@ } }, "node_modules/call-bind-apply-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", - "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", - "dev": true, + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -1776,9 +1775,9 @@ } }, "node_modules/chai": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", - "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.2.0.tgz", + "integrity": "sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==", "dev": true, "license": "MIT", "dependencies": { @@ -2113,7 +2112,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -2221,7 +2219,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -2231,7 +2228,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -2248,7 +2244,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -2261,7 +2256,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -2274,13 +2268,16 @@ } }, "node_modules/es-shim-unscopables": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", - "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", "dev": true, "license": "MIT", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/es-to-primitive": { @@ -2465,20 +2462,19 @@ } }, "node_modules/eslint-import-resolver-typescript": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.7.0.tgz", - "integrity": "sha512-Vrwyi8HHxY97K5ebydMtffsWAn1SCR9eol49eCd5fJS4O1WV7PaAjbcjmbfJJSMz/t4Mal212Uz/fQZrOB8mow==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.8.3.tgz", + "integrity": "sha512-A0bu4Ks2QqDWNpeEgTQMPTngaMhuDu4yv6xpftBMAf+1ziXnpx+eSR1WRfoPTe2BAiAjHFZ7kSNx1fvr5g5pmQ==", "dev": true, "license": "ISC", "dependencies": { "@nolyfill/is-core-module": "1.0.39", "debug": "^4.3.7", "enhanced-resolve": "^5.15.0", - "fast-glob": "^3.3.2", - "get-tsconfig": "^4.7.5", + "get-tsconfig": "^4.10.0", "is-bun-module": "^1.0.2", - "is-glob": "^4.0.3", - "stable-hash": "^0.0.4" + "stable-hash": "^0.0.4", + "tinyglobby": "^0.2.12" }, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -2877,9 +2873,9 @@ } }, "node_modules/flatted": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", - "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "dev": true, "license": "ISC" }, @@ -2904,9 +2900,9 @@ } }, "node_modules/for-each": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.4.tgz", - "integrity": "sha512-kKaIINnFpzW6ffJNDjjyjrk21BkDx38c0xa/klsT8VzLCaMEefv4ZTacrcVR4DmgTeBra++jMDAfS/tS799YDw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", "dev": true, "license": "MIT", "dependencies": { @@ -2920,13 +2916,14 @@ } }, "node_modules/form-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", - "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" }, "engines": { @@ -2968,7 +2965,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3009,7 +3005,6 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -3034,7 +3029,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", @@ -3178,7 +3172,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3257,7 +3250,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3270,7 +3262,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" @@ -3286,7 +3277,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -3943,7 +3933,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -4852,9 +4841,9 @@ } }, "node_modules/pathe": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.2.tgz", - "integrity": "sha512-15Ztpk+nov8DR524R4BF7uEuzESgzUEAV4Ah7CUMNGXdE5ELuvxElxGXndBl32vMSsWa1jpNf22Z+Er3sKwq+w==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", "dev": true, "license": "MIT" }, @@ -4899,9 +4888,9 @@ } }, "node_modules/postcss": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz", - "integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", + "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", "dev": true, "funding": [ { @@ -4938,9 +4927,9 @@ } }, "node_modules/prettier": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.0.tgz", - "integrity": "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.1.tgz", + "integrity": "sha512-hPpFQvHwL3Qv5AdRvBFMhnKo4tYxp0ReXiPn2bxkiohEX6mBeBwEpBSQTkD458RaaDKQMYSp4hX4UtfUTA5wDw==", "dev": true, "license": "MIT", "bin": { @@ -5132,9 +5121,9 @@ } }, "node_modules/rollup": { - "version": "4.34.6", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.6.tgz", - "integrity": "sha512-wc2cBWqJgkU3Iz5oztRkQbfVkbxoz5EhnCGOrnJvnLnQ7O0WhQUYyv18qQI79O8L7DdHrrlJNeCHd4VGpnaXKQ==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.8.tgz", + "integrity": "sha512-489gTVMzAYdiZHFVA/ig/iYFllCcWFHMvUHI1rpFmkoUtRlQxqh6/yiNqnYibjMZ2b/+FUQwldG+aLsEt6bglQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5148,25 +5137,25 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.34.6", - "@rollup/rollup-android-arm64": "4.34.6", - "@rollup/rollup-darwin-arm64": "4.34.6", - "@rollup/rollup-darwin-x64": "4.34.6", - "@rollup/rollup-freebsd-arm64": "4.34.6", - "@rollup/rollup-freebsd-x64": "4.34.6", - "@rollup/rollup-linux-arm-gnueabihf": "4.34.6", - "@rollup/rollup-linux-arm-musleabihf": "4.34.6", - "@rollup/rollup-linux-arm64-gnu": "4.34.6", - "@rollup/rollup-linux-arm64-musl": "4.34.6", - "@rollup/rollup-linux-loongarch64-gnu": "4.34.6", - "@rollup/rollup-linux-powerpc64le-gnu": "4.34.6", - "@rollup/rollup-linux-riscv64-gnu": "4.34.6", - "@rollup/rollup-linux-s390x-gnu": "4.34.6", - "@rollup/rollup-linux-x64-gnu": "4.34.6", - "@rollup/rollup-linux-x64-musl": "4.34.6", - "@rollup/rollup-win32-arm64-msvc": "4.34.6", - "@rollup/rollup-win32-ia32-msvc": "4.34.6", - "@rollup/rollup-win32-x64-msvc": "4.34.6", + "@rollup/rollup-android-arm-eabi": "4.34.8", + "@rollup/rollup-android-arm64": "4.34.8", + "@rollup/rollup-darwin-arm64": "4.34.8", + "@rollup/rollup-darwin-x64": "4.34.8", + "@rollup/rollup-freebsd-arm64": "4.34.8", + "@rollup/rollup-freebsd-x64": "4.34.8", + "@rollup/rollup-linux-arm-gnueabihf": "4.34.8", + "@rollup/rollup-linux-arm-musleabihf": "4.34.8", + "@rollup/rollup-linux-arm64-gnu": "4.34.8", + "@rollup/rollup-linux-arm64-musl": "4.34.8", + "@rollup/rollup-linux-loongarch64-gnu": "4.34.8", + "@rollup/rollup-linux-powerpc64le-gnu": "4.34.8", + "@rollup/rollup-linux-riscv64-gnu": "4.34.8", + "@rollup/rollup-linux-s390x-gnu": "4.34.8", + "@rollup/rollup-linux-x64-gnu": "4.34.8", + "@rollup/rollup-linux-x64-musl": "4.34.8", + "@rollup/rollup-win32-arm64-msvc": "4.34.8", + "@rollup/rollup-win32-ia32-msvc": "4.34.8", + "@rollup/rollup-win32-x64-msvc": "4.34.8", "fsevents": "~2.3.2" } }, @@ -5619,6 +5608,51 @@ "dev": true, "license": "MIT" }, + "node_modules/tinyglobby": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", + "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tinypool": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.2.tgz", @@ -5924,14 +5958,14 @@ } }, "node_modules/vite": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.1.0.tgz", - "integrity": "sha512-RjjMipCKVoR4hVfPY6GQTgveinjNuyLw+qruksLDvA5ktI1150VmcMBKmQaEWJhg/j6Uaf6dNCNA0AfdzUb/hQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.1.1.tgz", + "integrity": "sha512-4GgM54XrwRfrOp297aIYspIti66k56v16ZnqHvrIM7mG+HjDlAwS7p+Srr7J6fGvEdOJ5JcQ/D9T7HhtdXDTzA==", "dev": true, "license": "MIT", "dependencies": { "esbuild": "^0.24.2", - "postcss": "^8.5.1", + "postcss": "^8.5.2", "rollup": "^4.30.1" }, "bin": { @@ -5996,16 +6030,16 @@ } }, "node_modules/vite-node": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.0.5.tgz", - "integrity": "sha512-02JEJl7SbtwSDJdYS537nU6l+ktdvcREfLksk/NDAqtdKWGqHl+joXzEubHROmS3E6pip+Xgu2tFezMu75jH7A==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.0.6.tgz", + "integrity": "sha512-s51RzrTkXKJrhNbUzQRsarjmAae7VmMPAsRT7lppVpIg6mK3zGthP9Hgz0YQQKuNcF+Ii7DfYk3Fxz40jRmePw==", "dev": true, "license": "MIT", "dependencies": { "cac": "^6.7.14", "debug": "^4.4.0", "es-module-lexer": "^1.6.0", - "pathe": "^2.0.2", + "pathe": "^2.0.3", "vite": "^5.0.0 || ^6.0.0" }, "bin": { @@ -6039,31 +6073,31 @@ } }, "node_modules/vitest": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.0.5.tgz", - "integrity": "sha512-4dof+HvqONw9bvsYxtkfUp2uHsTN9bV2CZIi1pWgoFpL1Lld8LA1ka9q/ONSsoScAKG7NVGf2stJTI7XRkXb2Q==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.0.6.tgz", + "integrity": "sha512-/iL1Sc5VeDZKPDe58oGK4HUFLhw6b5XdY1MYawjuSaDA4sEfYlY9HnS6aCEG26fX+MgUi7MwlduTBHHAI/OvMA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/expect": "3.0.5", - "@vitest/mocker": "3.0.5", - "@vitest/pretty-format": "^3.0.5", - "@vitest/runner": "3.0.5", - "@vitest/snapshot": "3.0.5", - "@vitest/spy": "3.0.5", - "@vitest/utils": "3.0.5", - "chai": "^5.1.2", + "@vitest/expect": "3.0.6", + "@vitest/mocker": "3.0.6", + "@vitest/pretty-format": "^3.0.6", + "@vitest/runner": "3.0.6", + "@vitest/snapshot": "3.0.6", + "@vitest/spy": "3.0.6", + "@vitest/utils": "3.0.6", + "chai": "^5.2.0", "debug": "^4.4.0", "expect-type": "^1.1.0", "magic-string": "^0.30.17", - "pathe": "^2.0.2", + "pathe": "^2.0.3", "std-env": "^3.8.0", "tinybench": "^2.9.0", "tinyexec": "^0.3.2", "tinypool": "^1.0.2", "tinyrainbow": "^2.0.0", "vite": "^5.0.0 || ^6.0.0", - "vite-node": "3.0.5", + "vite-node": "3.0.6", "why-is-node-running": "^2.3.0" }, "bin": { @@ -6079,8 +6113,8 @@ "@edge-runtime/vm": "*", "@types/debug": "^4.1.12", "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "@vitest/browser": "3.0.5", - "@vitest/ui": "3.0.5", + "@vitest/browser": "3.0.6", + "@vitest/ui": "3.0.6", "happy-dom": "*", "jsdom": "*" }, diff --git a/package.json b/package.json index 9a6192600e..5e56fdbcf1 100644 --- a/package.json +++ b/package.json @@ -57,22 +57,22 @@ "code:formatting": "npm run replace:all && npm run prettier && npm run lint:fix" }, "devDependencies": { - "@types/node": "^18.19.75", + "@types/node": "^18.19.76", "@types/sinon": "^17.0.3", - "@typescript-eslint/eslint-plugin": "^8.23.0", - "@typescript-eslint/parser": "^8.23.0", + "@typescript-eslint/eslint-plugin": "^8.24.1", + "@typescript-eslint/parser": "^8.24.1", "dotenv": "^16.4.7", "eslint": "^8.57.1", "eslint-config-airbnb-base": "^15.0.0", - "eslint-import-resolver-typescript": "^3.7.0", + "eslint-import-resolver-typescript": "^3.8.3", "eslint-plugin-import": "^2.31.0", - "prettier": "^3.5.0", + "prettier": "^3.5.1", "prettier-plugin-jsdoc": "^1.3.2", "sinon": "^18.0.1", "typedoc": "^0.27.7", "typescript": "^5.7.3", "vite-tsconfig-paths": "^5.1.4", - "vitest": "^3.0.5" + "vitest": "^3.0.6" }, "dependencies": { "axios": "^1.7.9", diff --git a/src/version2/issues.ts b/src/version2/issues.ts index 28f14adeee..88eb2335de 100644 --- a/src/version2/issues.ts +++ b/src/version2/issues.ts @@ -329,44 +329,106 @@ export class Issues { } /** - * @deprecated - * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each - * issue type for the user. Use the information to populate the requests in [ Create - * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * Returns the details for a set of requested issues. You can request up to 100 issues. * - * Deprecated, see [Create Issue Meta Endpoint Deprecation - * Notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304). + * Each issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. * - * The request can be restricted to specific projects or issue types using the query parameters. The response will - * contain information for the valid projects, issue types, or project and issue type combinations requested. Note - * that invalid project, issue type, or project and issue type combinations do not generate errors. + * Issues will be returned in ascending `id` order. If there are errors, Jira will return a list of issues which + * couldn't be fetched along with error messages. * * This operation can be accessed anonymously. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create - * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkFetchIssues( + parameters: Parameters.BulkFetchIssues, + callback: Callback, + ): Promise; + /** + * Returns the details for a set of requested issues. You can request up to 100 issues. + * + * Each issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. + * + * Issues will be returned in ascending `id` order. If there are errors, Jira will return a list of issues which + * couldn't be fetched along with error messages. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkFetchIssues(parameters: Parameters.BulkFetchIssues, callback?: never): Promise; + async bulkFetchIssues( + parameters: Parameters.BulkFetchIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/bulkfetch', + method: 'POST', + data: { + expand: parameters.expand, + fields: parameters.fields, + fieldsByKeys: parameters.fieldsByKeys, + issueIdsOrKeys: parameters.issueIdsOrKeys, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * @deprecated Returns details of projects, issue types within projects, and, when requested, the create screen fields + * for each issue type for the user. Use the information to populate the requests in [ Create + * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * + * Deprecated, see [Create Issue Meta Endpoint Deprecation + * Notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304). + * + * The request can be restricted to specific projects or issue types using the query parameters. The response will + * contain information for the valid projects, issue types, or project and issue type combinations requested. Note + * that invalid project, issue type, or project and issue type combinations do not generate errors. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. */ async getCreateIssueMeta( parameters: Parameters.GetCreateIssueMeta | undefined, callback: Callback, ): Promise; /** - * @deprecated - * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each - * issue type for the user. Use the information to populate the requests in [ Create - * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * @deprecated Returns details of projects, issue types within projects, and, when requested, the create screen fields + * for each issue type for the user. Use the information to populate the requests in [ Create + * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). * - * Deprecated, see [Create Issue Meta Endpoint Deprecation - * Notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304). + * Deprecated, see [Create Issue Meta Endpoint Deprecation + * Notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304). * - * The request can be restricted to specific projects or issue types using the query parameters. The response will - * contain information for the valid projects, issue types, or project and issue type combinations requested. Note - * that invalid project, issue type, or project and issue type combinations do not generate errors. + * 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. + * This operation can be accessed anonymously. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create - * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. */ async getCreateIssueMeta( parameters?: Parameters.GetCreateIssueMeta, diff --git a/src/version2/models/approvalConfiguration.ts b/src/version2/models/approvalConfiguration.ts index fbbf35694d..790f18d0a8 100644 --- a/src/version2/models/approvalConfiguration.ts +++ b/src/version2/models/approvalConfiguration.ts @@ -4,9 +4,8 @@ export interface ApprovalConfiguration { active: 'true' | 'false' | string; /** * How the required approval count is calculated. It may be configured to require a specific number of approvals, or - * approval by a percentage of approvers. If the approvers source field is Approver groups, you can configure how - * many approvals per group are required for the request to be approved. The number will be the same across all - * groups. + * approval by a percentage of approvers. If the approvers source field is Approver groups, you can configure how many + * approvals per group are required for the request to be approved. The number will be the same across all groups. */ conditionType: 'number' | 'percent' | 'numberPerPrincipal' | string; /** diff --git a/src/version2/models/bulkChangelog.ts b/src/version2/models/bulkChangelog.ts index f3c04ce9e2..55644ab007 100644 --- a/src/version2/models/bulkChangelog.ts +++ b/src/version2/models/bulkChangelog.ts @@ -5,8 +5,8 @@ export interface BulkChangelog { /** The list of issues changelogs. */ issueChangeLogs?: IssueChangeLog[]; /** - * Continuation token to fetch the next page. If this result represents the last or the only page, this token will - * be null. + * Continuation token to fetch the next page. If this result represents the last or the only page, this token will be + * null. */ nextPageToken?: string; } diff --git a/src/version2/models/bulkFetchIssueRequest.ts b/src/version2/models/bulkFetchIssueRequest.ts deleted file mode 100644 index 779749f5d7..0000000000 --- a/src/version2/models/bulkFetchIssueRequest.ts +++ /dev/null @@ -1,43 +0,0 @@ -export interface BulkFetchIssueRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about issues in the response. Note that, unlike the majority of instances where `expand` is - * specified, `expand` is defined as a list of values. The expand options are: - * - * `renderedFields` Returns field values rendered in HTML format. `names` Returns the display name of each field. - * `schema` Returns the schema describing a field type. `transitions` Returns all possible transitions for the - * issue. `operations` Returns all possible operations for the issue. `editmeta` Returns information about how each - * field can be edited. `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the - * most recent. `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array - * containing each version of a field's value, with the highest numbered item representing the most recent version. - */ - expand?: string[]; - /** - * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a - * comma-separated list. Expand options include: - * - * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to - * exclude. - * - * The default is `*navigable`. - * - * Examples: - * - * `summary,comment` Returns the summary and comments fields only. `-description` Returns all navigable (default) - * fields except description. `*all,-comment` Returns all fields except comments. - * - * Multiple `fields` parameters can be included in a request. - * - * Note: All navigable fields are returned by default. This differs from [GET issue](#api-rest-api-2-issue-issueIdOrKey-get) where the default is all fields. - */ - fields?: string[]; - /** Reference fields by their key (rather than ID). The default is `false`. */ - fieldsByKeys?: boolean; - /** An array of issue IDs or issue keys to fetch. You can mix issue IDs and keys in the same query. */ - issueIdsOrKeys: string[]; - /** - * A list of issue property keys of issue properties to be included in the results. A maximum of 5 issue property - * keys can be specified. - */ - properties?: string[]; -} diff --git a/src/version2/models/bulkIssue.ts b/src/version2/models/bulkIssue.ts new file mode 100644 index 0000000000..8134e65eb7 --- /dev/null +++ b/src/version2/models/bulkIssue.ts @@ -0,0 +1,14 @@ +import { IssueError } from './issueError'; +import { Issue } from './issue'; + +/** The list of requested issues & fields. */ +export interface BulkIssue { + /** + * When Jira can't return an issue enumerated in a request due to a retriable error or payload constraint, we'll + * return the respective issue ID with a corresponding error message. This list is empty when there are no errors + * Issues which aren't found or that the user doesn't have permission to view won't be returned in this list. + */ + issueErrors?: IssueError[]; + /** The list of issues. */ + issues?: Issue[]; +} diff --git a/src/version2/models/createIssueSourceRequest.ts b/src/version2/models/createIssueSourceRequest.ts index d5f08ed651..87f7d3c1f3 100644 --- a/src/version2/models/createIssueSourceRequest.ts +++ b/src/version2/models/createIssueSourceRequest.ts @@ -2,8 +2,8 @@ export interface CreateIssueSourceRequest { /** The issue source type. This must be "Board", "Project" or "Filter". */ type: 'Board' | 'Project' | 'Filter' | string; /** - * The issue source value. This must be a board ID if the type is "Board", a project ID if the type is "Project" or - * a filter ID if the type is "Filter". + * The issue source value. This must be a board ID if the type is "Board", a project ID if the type is "Project" or a + * filter ID if the type is "Filter". */ value: number; } diff --git a/src/version2/models/detailedErrorCollection.ts b/src/version2/models/detailedErrorCollection.ts index c1a1c02cfa..5e30038b4b 100644 --- a/src/version2/models/detailedErrorCollection.ts +++ b/src/version2/models/detailedErrorCollection.ts @@ -4,8 +4,8 @@ export interface DetailedErrorCollection { /** The list of error messages produced by this operation. For example, "input parameter 'key' must be provided" */ errorMessages?: string[]; /** - * The list of errors by parameter returned by the operation. For example,"projectKey": "Project keys must start - * with an uppercase letter, followed by one or more uppercase alphanumeric characters." + * The list of errors by parameter returned by the operation. For example,"projectKey": "Project keys must start with + * an uppercase letter, followed by one or more uppercase alphanumeric characters." */ errors?: {}; } diff --git a/src/version2/models/evaluatedJiraExpression.ts b/src/version2/models/evaluatedJiraExpression.ts index beb9f0a724..c4eeb513c7 100644 --- a/src/version2/models/evaluatedJiraExpression.ts +++ b/src/version2/models/evaluatedJiraExpression.ts @@ -9,8 +9,8 @@ export interface EvaluatedJiraExpression { /** * 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.) + * that's the case a simple string representation is returned. These string representations should not be relied upon + * and may change without notice.) */ value: {}; } diff --git a/src/version2/models/index.ts b/src/version2/models/index.ts index ba7bff3087..0687c0a5d9 100644 --- a/src/version2/models/index.ts +++ b/src/version2/models/index.ts @@ -41,7 +41,7 @@ export * from './bulkChangeOwnerDetails'; export * from './bulkCustomFieldOptionCreateRequest'; export * from './bulkCustomFieldOptionUpdateRequest'; export * from './bulkEditShareableEntity'; -export * from './bulkFetchIssueRequest'; +export * from './bulkIssue'; export * from './bulkIssueIsWatching'; export * from './bulkIssuePropertyUpdateRequest'; export * from './bulkOperationErrorResult'; diff --git a/src/version2/models/issueLimitReportRequest.ts b/src/version2/models/issueLimitReportRequest.ts index 4ea1c52f19..c99f57bc06 100644 --- a/src/version2/models/issueLimitReportRequest.ts +++ b/src/version2/models/issueLimitReportRequest.ts @@ -1,7 +1,7 @@ export interface IssueLimitReportRequest { /** - * A list of fields and their respective approaching limit threshold. Required for querying issues approaching - * limits. Optional for querying issues breaching limits. Accepted fields are: `comment`, `worklog`, `attachment`, + * A list of fields and their respective approaching limit threshold. Required for querying issues approaching limits. + * Optional for querying issues breaching limits. Accepted fields are: `comment`, `worklog`, `attachment`, * `remoteIssueLinks`, and `issuelinks`. Example: `{"issuesApproachingLimitParams": {"comment": 4500, "attachment": * 1800}}` */ diff --git a/src/version2/models/jqlFunctionPrecomputationUpdateBean.ts b/src/version2/models/jqlFunctionPrecomputationUpdateBean.ts index 49f25515bb..85abbb7527 100644 --- a/src/version2/models/jqlFunctionPrecomputationUpdateBean.ts +++ b/src/version2/models/jqlFunctionPrecomputationUpdateBean.ts @@ -1,8 +1,8 @@ /** Precomputation id and its new value. */ export interface JqlFunctionPrecomputationUpdateBean { /** - * The error message to be displayed to the user if the given function clause is no longer valid during - * recalculation of the precomputation. + * The error message to be displayed to the user if the given function clause is no longer valid during recalculation + * of the precomputation. */ error?: string; /** The id of the precomputation to update. */ diff --git a/src/version2/models/searchAndReconcileRequest.ts b/src/version2/models/searchAndReconcileRequest.ts index de835be041..e89b158cec 100644 --- a/src/version2/models/searchAndReconcileRequest.ts +++ b/src/version2/models/searchAndReconcileRequest.ts @@ -1,15 +1,15 @@ export interface SearchAndReconcileRequest { /** * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about issues in the response. Note that, unlike the majority of instances where `expand` is - * specified, `expand` is defined as a comma-delimited string of values. The expand options are: + * information about issues in the response. Note that, unlike the majority of instances where `expand` is specified, + * `expand` is defined as a comma-delimited string of values. The expand options are: * * `renderedFields` Returns field values rendered in HTML format. `names` Returns the display name of each field. - * `schema` Returns the schema describing a field type. `transitions` Returns all possible transitions for the - * issue. `operations` Returns all possible operations for the issue. `editmeta` Returns information about how each - * field can be edited. `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the - * most recent. `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array - * containing each version of a field's value, with the highest numbered item representing the most recent version. + * `schema` Returns the schema describing a field type. `transitions` Returns all possible transitions for the issue. + * `operations` Returns all possible operations for the issue. `editmeta` Returns information about how each field can + * be edited. `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. * * Examples: `"names,changelog"` Returns the display name of each field as well as a list of recent updates to an issue. */ @@ -25,8 +25,7 @@ export interface SearchAndReconcileRequest { * * Examples: * - * `summary,comment` Returns the summary and comments fields only. `*all,-comment` Returns all fields except - * comments. + * `summary,comment` Returns the summary and comments fields only. `*all,-comment` Returns all fields except comments. * * Multiple `fields` parameters can be included in a request. * @@ -39,8 +38,8 @@ export interface SearchAndReconcileRequest { * A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a * bounded query. A bounded query is a query with a search restriction. * - * Example of an unbounded query: `order by key desc`. Example of a bounded query: `assignee = currentUser() order - * by key`. + * Example of an unbounded query: `order by key desc`. Example of a bounded query: `assignee = currentUser() order by + * key`. * * Additionally, `orderBy` clause can contain a maximum of 7 fields. */ diff --git a/src/version2/models/simpleErrorCollection.ts b/src/version2/models/simpleErrorCollection.ts index bd7bfa5910..d3920e1594 100644 --- a/src/version2/models/simpleErrorCollection.ts +++ b/src/version2/models/simpleErrorCollection.ts @@ -2,8 +2,8 @@ export interface SimpleErrorCollection { /** The list of error messages produced by this operation. For example, "input parameter 'key' must be provided" */ errorMessages?: string[]; /** - * The list of errors by parameter returned by the operation. For example,"projectKey": "Project keys must start - * with an uppercase letter, followed by one or more uppercase alphanumeric characters." + * The list of errors by parameter returned by the operation. For example,"projectKey": "Project keys must start with + * an uppercase letter, followed by one or more uppercase alphanumeric characters." */ errors?: {}; httpStatusCode?: number; diff --git a/src/version2/models/simplifiedHierarchyLevel.ts b/src/version2/models/simplifiedHierarchyLevel.ts index 8d7639167e..441c96dbda 100644 --- a/src/version2/models/simplifiedHierarchyLevel.ts +++ b/src/version2/models/simplifiedHierarchyLevel.ts @@ -12,8 +12,8 @@ export interface SimplifiedHierarchyLevel { */ belowLevelId?: number; /** - * The external UUID of the hierarchy level. This property is deprecated, see [Change notice: Removing hierarchy - * level IDs from next-gen + * The external UUID of the hierarchy level. This property is deprecated, see [Change notice: Removing hierarchy level + * IDs from next-gen * APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). */ externalUuid?: string; @@ -31,8 +31,8 @@ export interface SimplifiedHierarchyLevel { /** The name of this hierarchy level. */ name?: string; /** - * The ID of the project configuration. This property is deprecated, see [Change oticen: Removing hierarchy level - * IDs from next-gen + * The ID of the project configuration. This property is deprecated, see [Change oticen: Removing hierarchy level IDs + * from next-gen * APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). */ projectConfigurationId?: number; diff --git a/src/version2/models/userFilter.ts b/src/version2/models/userFilter.ts index 5f806065d9..c03f5f8336 100644 --- a/src/version2/models/userFilter.ts +++ b/src/version2/models/userFilter.ts @@ -8,8 +8,8 @@ export interface UserFilter { */ groups?: string[]; /** - * Roles that autocomplete suggestion users must belong to. If not provided, the default values are used. A maximum - * of 10 roles can be provided. + * Roles that autocomplete suggestion users must belong to. If not provided, the default values are used. A maximum of + * 10 roles can be provided. */ roleIds?: number[]; } diff --git a/src/version2/models/versionRelatedWork.ts b/src/version2/models/versionRelatedWork.ts index 99383823a8..d8e8e88a06 100644 --- a/src/version2/models/versionRelatedWork.ts +++ b/src/version2/models/versionRelatedWork.ts @@ -5,15 +5,12 @@ export interface VersionRelatedWork { /** The ID of the issue associated with the related work (if there is one). Cannot be updated via the Rest API. */ issueId?: number; /** - * The id of the related work. For the native release note related work item, this will be null, and Rest API does - * not support updating it. + * The id of the related work. For the native release note related work item, this will be null, and Rest API does not + * support updating it. */ relatedWorkId?: string; /** The title of the related work */ title?: string; - /** - * The URL of the related work. Will be null for the native release note related work item, but is otherwise - * required. - */ + /** The URL of the related work. Will be null for the native release note related work item, but is otherwise required. */ url?: string; } diff --git a/src/version2/models/workflowSchemeUpdateRequest.ts b/src/version2/models/workflowSchemeUpdateRequest.ts index 2f670c0bc5..fc2a9816c2 100644 --- a/src/version2/models/workflowSchemeUpdateRequest.ts +++ b/src/version2/models/workflowSchemeUpdateRequest.ts @@ -7,8 +7,7 @@ import { WorkflowSchemeAssociation } from './workflowSchemeAssociation'; export interface WorkflowSchemeUpdateRequest { /** * The ID of the workflow for issue types without having a mapping defined in this workflow scheme. Only used in - * global-scoped workflow schemes. If the `defaultWorkflowId` isn't specified, this is set to _Jira Workflow - * (jira)_. + * global-scoped workflow schemes. If the `defaultWorkflowId` isn't specified, this is set to _Jira Workflow (jira)_. */ defaultWorkflowId?: string; /** The new description for this workflow scheme. */ diff --git a/src/version2/myself.ts b/src/version2/myself.ts index c0692b4c26..a4c3cbc68d 100644 --- a/src/version2/myself.ts +++ b/src/version2/myself.ts @@ -58,10 +58,7 @@ export class Myself { * Permission to access Jira. */ async getPreference(parameters: Parameters.GetPreference, callback?: never): Promise; - async getPreference( - parameters: Parameters.GetPreference, - callback?: Callback, - ): Promise { + async getPreference(parameters: Parameters.GetPreference, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/2/mypreferences', method: 'GET', diff --git a/src/version2/parameters/bulkDeleteWorklogs.ts b/src/version2/parameters/bulkDeleteWorklogs.ts index 1358266f7f..65e9d6883d 100644 --- a/src/version2/parameters/bulkDeleteWorklogs.ts +++ b/src/version2/parameters/bulkDeleteWorklogs.ts @@ -6,8 +6,8 @@ export interface BulkDeleteWorklogs extends WorklogIdsRequest { /** * Defines how to update the issue's time estimate, the options are: * - * `leave` Leaves the estimate unchanged. `auto` Reduces the estimate by the aggregate value of `timeSpent` across - * all worklogs being deleted. + * `leave` Leaves the estimate unchanged. `auto` Reduces the estimate by the aggregate value of `timeSpent` across all + * worklogs being deleted. */ adjustEstimate?: 'leave' | 'auto' | string; /** diff --git a/src/version2/parameters/bulkFetchIssues.ts b/src/version2/parameters/bulkFetchIssues.ts index ac8d5b91a2..1849d32397 100644 --- a/src/version2/parameters/bulkFetchIssues.ts +++ b/src/version2/parameters/bulkFetchIssues.ts @@ -1,3 +1,66 @@ -import { BulkFetchIssueRequest } from '../models'; - -export interface BulkFetchIssues extends BulkFetchIssueRequest {} +export interface BulkFetchIssues { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about issues in the response. Note that, unlike the majority of instances where `expand` is specified, + * `expand` is defined as a list of values. The expand options are: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `operations` Returns all possible operations for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. + */ + expand?: + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | string + | ( + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | string + )[]; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to + * exclude. + * + * The default is `*navigable`. + * + * Examples: + * + * `summary,comment` Returns the summary and comments fields only. `-description` Returns all navigable (default) + * fields except description. `*all,-comment` Returns all fields except comments. + * + * Multiple `fields` parameters can be included in a request. + * + * Note: All navigable fields are returned by default. This differs from [GET issue](#api-rest-api-2-issue-issueIdOrKey-get) where the default is all fields. + */ + fields?: string[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; + /** An array of issue IDs or issue keys to fetch. You can mix issue IDs and keys in the same query. */ + issueIdsOrKeys: string[]; + /** + * A list of issue property keys of issue properties to be included in the results. A maximum of 5 issue property keys + * can be specified. + */ + properties?: string[]; +} diff --git a/src/version2/parameters/getAllProjects.ts b/src/version2/parameters/getAllProjects.ts index 0ddbc6f4a6..fab813e801 100644 --- a/src/version2/parameters/getAllProjects.ts +++ b/src/version2/parameters/getAllProjects.ts @@ -9,9 +9,8 @@ export interface GetAllProjects { */ expand?: string; /** - * Returns the user's most recently accessed projects. You may specify the number of results to return up to a - * maximum of 20. If access is anonymous, then the recently accessed projects are based on the current HTTP - * session. + * Returns the user's most recently accessed projects. You may specify the number of results to return up to a maximum + * of 20. If access is anonymous, then the recently accessed projects are based on the current HTTP session. */ recent?: number; /** A list of project properties to return for the project. This parameter accepts a comma-separated list. */ diff --git a/src/version2/parameters/getCustomFieldsConfigurations.ts b/src/version2/parameters/getCustomFieldsConfigurations.ts index 0bfd3a001d..7039e4b8ba 100644 --- a/src/version2/parameters/getCustomFieldsConfigurations.ts +++ b/src/version2/parameters/getCustomFieldsConfigurations.ts @@ -13,8 +13,8 @@ export interface GetCustomFieldsConfigurations extends ConfigurationsListParamet */ fieldContextId?: number[]; /** - * The ID of the issue to filter results by. If the issue doesn't exist, an empty list is returned. Can't be - * provided with `projectKeyOrId`, or `issueTypeId`. + * The ID of the issue to filter results by. If the issue doesn't exist, an empty list is returned. Can't be provided + * with `projectKeyOrId`, or `issueTypeId`. */ issueId?: number; /** diff --git a/src/version2/parameters/getPrioritySchemes.ts b/src/version2/parameters/getPrioritySchemes.ts index 0b592bd02c..b5917ef600 100644 --- a/src/version2/parameters/getPrioritySchemes.ts +++ b/src/version2/parameters/getPrioritySchemes.ts @@ -20,8 +20,8 @@ export interface GetPrioritySchemes { /** The ordering to return the priority schemes by. */ orderBy?: 'name' | '+name' | '-name' | string; /** - * A comma separated list of additional information to return. "priorities" will return priorities associated with - * the priority scheme. "projects" will return projects associated with the priority scheme. + * A comma separated list of additional information to return. "priorities" will return priorities associated with the + * priority scheme. "projects" will return projects associated with the priority scheme. * `expand=priorities,projects`. */ expand?: string; diff --git a/src/version3/parameters/searchWorkflows.ts b/src/version3/parameters/searchWorkflows.ts index c05a641727..c58c10c393 100644 --- a/src/version3/parameters/searchWorkflows.ts +++ b/src/version3/parameters/searchWorkflows.ts @@ -19,7 +19,17 @@ export interface SearchWorkflows { * - `created` Sorts by create time. * - `updated` Sorts by update time. */ - orderBy?: 'name' | 'created' | 'updated' | '+name' | '+created' | '+updated' | '-name' | '-created' | '-updated' | string; + orderBy?: + | 'name' + | 'created' + | 'updated' + | '+name' + | '+created' + | '+updated' + | '-name' + | '-created' + | '-updated' + | string; /** The scope of the workflow. Global for company-managed projects and Project for team-managed projects. */ scope?: string; /** Filters active and inactive workflows. */ From fd6d74480eb001b3633f05f0ab17f6555d28d774 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Thu, 20 Feb 2025 22:53:26 +0300 Subject: [PATCH 04/10] Clients added to Version2Client --- src/version2/client/version2Client.ts | 14 ++++++++++++++ src/version2/parameters/bulkFetchIssues.ts | 20 ++++++++++---------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/version2/client/version2Client.ts b/src/version2/client/version2Client.ts index a7413e6940..0934c399c4 100644 --- a/src/version2/client/version2Client.ts +++ b/src/version2/client/version2Client.ts @@ -1,10 +1,12 @@ import { BaseClient } from '../../clients/baseClient'; import { AnnouncementBanner } from '../announcementBanner'; +import { AppDataPolicies } from '../appDataPolicies'; import { ApplicationRoles } from '../applicationRoles'; import { AppMigration } from '../appMigration'; import { AppProperties } from '../appProperties'; import { AuditRecords } from '../auditRecords'; import { Avatars } from '../avatars'; +import { ClassificationLevels } from '../classificationLevels'; import { Dashboards } from '../dashboards'; import { DynamicModules } from '../dynamicModules'; import { Filters } from '../filters'; @@ -50,8 +52,11 @@ import { LicenseMetrics } from '../licenseMetrics'; import { Myself } from '../myself'; import { Permissions } from '../permissions'; import { PermissionSchemes } from '../permissionSchemes'; +import { Plans } from '../plans'; +import { PrioritySchemes } from '../prioritySchemes'; import { ProjectAvatars } from '../projectAvatars'; import { ProjectCategories } from '../projectCategories'; +import { ProjectClassificationLevels } from '../projectClassificationLevels'; import { ProjectComponents } from '../projectComponents'; import { ProjectEmail } from '../projectEmail'; import { ProjectFeatures } from '../projectFeatures'; @@ -68,8 +73,10 @@ import { ScreenSchemes } from '../screenSchemes'; import { ScreenTabFields } from '../screenTabFields'; import { ScreenTabs } from '../screenTabs'; import { ServerInfo } from '../serverInfo'; +import { ServiceRegistry } from '../serviceRegistry'; import { Status } from '../status'; import { Tasks } from '../tasks'; +import { TeamsInPlan } from '../teamsInPlan'; import { TimeTracking } from '../timeTracking'; import { UIModificationsApps } from '../uIModificationsApps'; import { UserProperties } from '../userProperties'; @@ -87,11 +94,13 @@ import { WorkflowTransitionRules } from '../workflowTransitionRules'; export class Version2Client extends BaseClient { announcementBanner = new AnnouncementBanner(this); + appDataPolicies = new AppDataPolicies(this); applicationRoles = new ApplicationRoles(this); appMigration = new AppMigration(this); appProperties = new AppProperties(this); auditRecords = new AuditRecords(this); avatars = new Avatars(this); + classificationLevels = new ClassificationLevels(this); dashboards = new Dashboards(this); dynamicModules = new DynamicModules(this); filters = new Filters(this); @@ -137,8 +146,11 @@ export class Version2Client extends BaseClient { myself = new Myself(this); permissions = new Permissions(this); permissionSchemes = new PermissionSchemes(this); + plans = new Plans(this); + prioritySchemes = new PrioritySchemes(this); projectAvatars = new ProjectAvatars(this); projectCategories = new ProjectCategories(this); + projectClassificationLevels = new ProjectClassificationLevels(this); projectComponents = new ProjectComponents(this); projectEmail = new ProjectEmail(this); projectFeatures = new ProjectFeatures(this); @@ -155,8 +167,10 @@ export class Version2Client extends BaseClient { screenTabFields = new ScreenTabFields(this); screenTabs = new ScreenTabs(this); serverInfo = new ServerInfo(this); + serviceRegistry = new ServiceRegistry(this); status = new Status(this); tasks = new Tasks(this); + teamsInPlan = new TeamsInPlan(this); timeTracking = new TimeTracking(this); uiModificationsApps = new UIModificationsApps(this); userProperties = new UserProperties(this); diff --git a/src/version2/parameters/bulkFetchIssues.ts b/src/version2/parameters/bulkFetchIssues.ts index 1849d32397..776528ddf2 100644 --- a/src/version2/parameters/bulkFetchIssues.ts +++ b/src/version2/parameters/bulkFetchIssues.ts @@ -25,16 +25,16 @@ export interface BulkFetchIssues { | 'versionedRepresentations' | string | ( - | 'renderedFields' - | 'names' - | 'schema' - | 'transitions' - | 'operations' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - | string - )[]; + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | string + )[]; /** * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a * comma-separated list. Expand options include: From f0adcfecc05d54dd5be68744dd02e26ceebe7117 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sat, 22 Feb 2025 19:17:07 +0300 Subject: [PATCH 05/10] Clients added to README.md --- CHANGELOG.md | 37 +++++++++++++++++-------------------- README.md | 5 +++++ package-lock.json | 24 ++++++++++++------------ package.json | 6 +++--- 4 files changed, 37 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a566e0bc4e..7dead6677b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,13 @@ ### 4.1.0 -// todo add links to code for new classes and modified methods - - **General Improvements:** Enhanced JSDoc documentation across the project for better clarity and developer experience. +- **Deprecation:** Marked the `InstanceInformation.getLicense` method as deprecated. +- **Deprecation:** Marked the `Issues.getCreateIssueMeta` method as deprecated. +- **Deprecation:** Marked the `PageBeanFieldConfigurationDetails` class as deprecated. Use `Paginated` instead. +- **Deprecation:** Marked the `WorkflowUpdateResponse` and `WorkflowCreateResponse` classes as deprecated. + - **New APIs:** Added the following classes to support additional Jira APIs: - **`AppDataPolicies`**: Manage app access rule data policies, allowing developers to set and retrieve rules controlling app access ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-app-data-policies/#api-group-app-data-policies)). - **`ClassificationLevels`**: Define and manage classification levels for sensitive information in Jira ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-classification-levels/#api-group-classification-levels)). @@ -17,10 +20,6 @@ - **`TeamsInPlan`**: Configure settings for Atlassian and custom teams within advanced roadmaps plans, including creating, updating, and deleting team configurations ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-teams-in-plan/#api-group-teams-in-plan)). - **Improvement:** Changed the return type of `ProjectKeyAndNameValidation.getValidProjectKey` and `ProjectKeyAndNameValidation.getValidProjectName` from `unknown` to `string` for improved type safety and usability. -- **Improvement:** Added the `extendAdminPermissions` parameter to the following methods in the `Dashboard` class: - - `Dashboard.createDashboard` - - `Dashboard.updateDashboard` - - `Dashboard.copyDashboard` - **Improvement:** Added the `approximateLastUsed` parameter to the `Filters.createFilter` method. - **Improvement:** Added the `isSubstringMatch` parameter to the `Filters.getFiltersPaginated` method. - **Improvement:** Updated the `IssueComments.updateComment` method to allow passing a plain string for the comment instead of requiring a specific object format. @@ -38,6 +37,10 @@ - **Improvement:** Added the optional `componentSource` parameter to the `ProjectComponents.getProjectComponents` method. - **Improvement:** Added the `approvers` and `driver` parameters to the `ProjectVersions.createVersion` and `ProjectVersions.updateVersion` methods. - **Improvement:** Replaced the `maxResults` property with `maxResult` in the `UserSearch.findUserKeysByQuery` method. +- **Improvement:** Added the `extendAdminPermissions` parameter to the following methods in the `Dashboard` class: + - `Dashboard.createDashboard` + - `Dashboard.updateDashboard` + - `Dashboard.copyDashboard` - **New Method:** Added the `getCustomFieldsConfigurations` method to the `IssueCustomFieldConfigurationApps` class. - **New Method:** Added the `replaceCustomFieldOption` method to the `IssueCustomFieldOptions` class. @@ -77,6 +80,12 @@ - `updateRelatedWork`: Update related work for a version. - `createRelatedWork`: Create related work for a version. - `getRelatedWork`: Retrieve related work for a version. +- **New Method:** Added the `getProjectUsagesForWorkflowScheme` method to the `WorkflowSchemes` class. +- **New Method:** Added the `getWorkflowProjectIssueTypeUsages` method to the `Workflows` class. +- **New Methods:** Added the following methods to the `Status` class: + - `getProjectIssueTypeUsagesForStatus` + - `getProjectUsagesForStatus` + - `getWorkflowUsagesForStatus` - **Fix:** Updated the following methods in `Version2Client` and `Version3Client` to make the `parameters` argument mandatory (as it should have been initially): - `IssueFieldConfigurations.createFieldConfiguration` @@ -92,6 +101,8 @@ - `IssueSearch.matchIssues` - `IssueSearch.searchForIssuesUsingJql` - `JiraExpressions.evaluateJiraExpression` + - `Users.setUserColumns` + - `Users.getUser` - **Fix:** Improved the `Avatars.storeAvatar` method: - Added the `mimeType` parameter to specify the type of the uploaded avatar. - Updated the type of the `avatar` parameter from `any` to `Buffer | ArrayBuffer | Uint8Array | any` for better type safety. @@ -106,11 +117,6 @@ - Set the default value of the `size` parameter to `0`. - **Change:** Removed the `filter` parameter from the `JqlFunctionsApps.getPrecomputations` method (experimental method, not a breaking change). - -- **Deprecation:** Marked the `InstanceInformation.getLicense` method as deprecated. -- **Deprecation:** Marked the `Issues.getCreateIssueMeta` method as deprecated. -- **Deprecation:** Marked the `PageBeanFieldConfigurationDetails` class as deprecated. Use `Paginated` instead. - - **Change:** Renamed `JiraExpressionEvaluateContextBean` to `JiraExpressionEvaluateContext`. - **Improvement:** Added type `string` for properties `projectId` in parameters and models: @@ -156,15 +162,6 @@ - **Special thanks to Ness Li ([nessgor](https://github.com/nessgor)) for implementing the changes above. PR: [#356](https://github.com/MrRefactoring/jira.js/pull/356).** - **Thanks to Niklas Correnz ([uncaught](https://github.com/uncaught)) for reporting the issue: [#352](https://github.com/MrRefactoring/jira.js/issues/352).** -// todo - -- `getProjectUsagesForWorkflowScheme` added to `WorkflowSchemes` -- `getWorkflowProjectIssueTypeUsages` added to `Workflows` -- `WorkflowUpdateResponse`, `WorkflowCreateResponse` was deprecated -- `Users.setUserColumns` parameters are required now -- `Users.getUser` parameters are required now -- Added `getProjectIssueTypeUsagesForStatus`, `getProjectUsagesForStatus`, `getWorkflowUsagesForStatus` to `Status` - --- ### 4.0.6 diff --git a/README.md b/README.md index e77e226474..7df62e90de 100644 --- a/README.md +++ b/README.md @@ -294,9 +294,12 @@ Available groups: - [myself](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-myself/#api-group-myself) - [permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-permissions/#api-group-permissions) - [permissionSchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-permission-schemes/#api-group-permission-schemes) + - [plans](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-plans/#api-group-plans) + - [prioritySchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-priority-schemes/#api-group-priority-schemes) - [projects](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-projects/#api-group-projects) - [projectAvatars](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-avatars/#api-group-project-avatars) - [projectCategories](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-categories/#api-group-project-categories) + - [projectClassificationLevels](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-classification-levels/#api-group-project-classification-levels) - [projectComponents](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-components/#api-group-project-components) - [projectEmail](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-email/#api-group-project-email) - [projectFeatures](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-features/#api-group-project-features) @@ -312,8 +315,10 @@ Available groups: - [screenTabFields](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screen-tab-fields/#api-group-screen-tab-fields) - [screenSchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screen-schemes/#api-group-screen-schemes) - [serverInfo](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-server-info/#api-group-server-info) + - [serviceRegistry](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-service-registry/#api-group-service-registry) - [status](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-status/#api-group-status) - [tasks](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-group-tasks) + - [teamsInPlan](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-teams-in-plan/#api-group-teams-in-plan) - [timeTracking](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-time-tracking/#api-group-time-tracking) - [uiModificationsApps](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-ui-modifications--apps-/#api-group-ui-modifications--apps-) - [users](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-users/#api-group-users) diff --git a/package-lock.json b/package-lock.json index 0a29425817..14d05ae42e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@types/node": "^18.19.76", - "@types/sinon": "^17.0.3", + "@types/sinon": "^17.0.4", "@typescript-eslint/eslint-plugin": "^8.24.1", "@typescript-eslint/parser": "^8.24.1", "dotenv": "^16.4.7", @@ -24,10 +24,10 @@ "eslint-config-airbnb-base": "^15.0.0", "eslint-import-resolver-typescript": "^3.8.3", "eslint-plugin-import": "^2.31.0", - "prettier": "^3.5.1", + "prettier": "^3.5.2", "prettier-plugin-jsdoc": "^1.3.2", "sinon": "^18.0.1", - "typedoc": "^0.27.7", + "typedoc": "^0.27.8", "typescript": "^5.7.3", "vite-tsconfig-paths": "^5.1.4", "vitest": "^3.0.6" @@ -1087,9 +1087,9 @@ } }, "node_modules/@types/sinon": { - "version": "17.0.3", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.3.tgz", - "integrity": "sha512-j3uovdn8ewky9kRBG19bOwaZbexJu/XjtkHyjvUgt4xfPFz18dcORIMqnYh66Fx3Powhcr85NT5+er3+oViapw==", + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.4.tgz", + "integrity": "sha512-RHnIrhfPO3+tJT0s7cFaXGZvsL4bbR3/k7z3P312qMS4JaS2Tk+KiwiLx1S0rQ56ERj00u1/BtdyVd0FY+Pdew==", "dev": true, "license": "MIT", "dependencies": { @@ -4927,9 +4927,9 @@ } }, "node_modules/prettier": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.1.tgz", - "integrity": "sha512-hPpFQvHwL3Qv5AdRvBFMhnKo4tYxp0ReXiPn2bxkiohEX6mBeBwEpBSQTkD458RaaDKQMYSp4hX4UtfUTA5wDw==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.2.tgz", + "integrity": "sha512-lc6npv5PH7hVqozBR7lkBNOGXV9vMwROAPlumdBkX0wTbbzPu/U1hk5yL8p2pt4Xoc+2mkT8t/sow2YrV/M5qg==", "dev": true, "license": "MIT", "bin": { @@ -5864,9 +5864,9 @@ } }, "node_modules/typedoc": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.7.tgz", - "integrity": "sha512-K/JaUPX18+61W3VXek1cWC5gwmuLvYTOXJzBvD9W7jFvbPnefRnCHQCEPw7MSNrP/Hj7JJrhZtDDLKdcYm6ucg==", + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.8.tgz", + "integrity": "sha512-q0/2TUunNEDmWkn23ULKGXieK8cgGuAmBUXC/HcZ/rgzMI9Yr4Nq3in1K1vT1NZ9zx6M78yTk3kmIPbwJgK5KA==", "dev": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 5e56fdbcf1..7e583c3368 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ }, "devDependencies": { "@types/node": "^18.19.76", - "@types/sinon": "^17.0.3", + "@types/sinon": "^17.0.4", "@typescript-eslint/eslint-plugin": "^8.24.1", "@typescript-eslint/parser": "^8.24.1", "dotenv": "^16.4.7", @@ -66,10 +66,10 @@ "eslint-config-airbnb-base": "^15.0.0", "eslint-import-resolver-typescript": "^3.8.3", "eslint-plugin-import": "^2.31.0", - "prettier": "^3.5.1", + "prettier": "^3.5.2", "prettier-plugin-jsdoc": "^1.3.2", "sinon": "^18.0.1", - "typedoc": "^0.27.7", + "typedoc": "^0.27.8", "typescript": "^5.7.3", "vite-tsconfig-paths": "^5.1.4", "vitest": "^3.0.6" From f02e74519ea8b6a5c213009e3c195401a7dadb6b Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sat, 22 Feb 2025 21:56:28 +0300 Subject: [PATCH 06/10] Integration test fixes --- src/version2/avatars.ts | 111 ++++--- src/version2/issueAttachments.ts | 496 +++++++++++-------------------- 2 files changed, 220 insertions(+), 387 deletions(-) diff --git a/src/version2/avatars.ts b/src/version2/avatars.ts index 621d4474a1..6a939240cb 100644 --- a/src/version2/avatars.ts +++ b/src/version2/avatars.ts @@ -16,7 +16,7 @@ export class Avatars { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars, + parameters: Parameters.GetAllSystemAvatars | string, callback: Callback, ): Promise; /** @@ -28,11 +28,11 @@ export class Avatars { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars, + parameters: Parameters.GetAllSystemAvatars | string, callback?: never, ): Promise; async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars, + parameters: Parameters.GetAllSystemAvatars | string, callback?: Callback, ): Promise { const config: RequestConfig = { @@ -80,28 +80,10 @@ export class Avatars { return this.client.sendRequest(config, callback); } + /** * Loads a custom avatar for a project, issue type or priority. * - * 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/universal_avatar/type/{type}/owner/{entityId}'` - * * 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. * @@ -121,25 +103,6 @@ export class Avatars { /** * Loads a custom avatar for a project, issue type or priority. * - * 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/universal_avatar/type/{type}/owner/{entityId}'` - * * 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. * @@ -174,6 +137,7 @@ export class Avatars { return this.client.sendRequest(config, callback); } + /** * Deletes an avatar from a project, issue type or priority. * @@ -196,6 +160,7 @@ export class Avatars { return this.client.sendRequest(config, callback); } + /** * Returns the default project, issue type or priority avatar image. * @@ -203,8 +168,8 @@ export class Avatars { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType, + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, callback: Callback, ): Promise; /** @@ -214,25 +179,36 @@ export class Avatars { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType, + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, callback?: never, ): Promise; - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType, + 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/${parameters.type}`, + url: `/rest/api/2/universal_avatar/view/type/${type}`, method: 'GET', + responseType: 'arraybuffer', params: { - size: parameters.size, - format: parameters.format, + size: typeof parameters !== 'string' ? parameters.size : undefined, + format: typeof parameters !== 'string' ? parameters.format : undefined, }, }; - return this.client.sendRequest(config, callback); + 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, issue type or priority avatar image by ID. * @@ -247,7 +223,7 @@ export class Avatars { * for at least one project the issue type is used in. * - For priority avatars, none. */ - async getAvatarImageByID( + async getAvatarImageByID( parameters: Parameters.GetAvatarImageByID, callback: Callback, ): Promise; @@ -265,25 +241,34 @@ export class Avatars { * for at least one project the issue type is used in. * - For priority avatars, none. */ - async getAvatarImageByID( + async getAvatarImageByID( parameters: Parameters.GetAvatarImageByID, callback?: never, ): Promise; - async getAvatarImageByID( + 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, }, }; - return this.client.sendRequest(config, callback); + 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, issue type or priority. * @@ -298,7 +283,7 @@ export class Avatars { * for at least one project the issue type is used in. * - For priority avatars, none. */ - async getAvatarImageByOwner( + async getAvatarImageByOwner( parameters: Parameters.GetAvatarImageByOwner, callback: Callback, ): Promise; @@ -316,23 +301,31 @@ export class Avatars { * for at least one project the issue type is used in. * - For priority avatars, none. */ - async getAvatarImageByOwner( + async getAvatarImageByOwner( parameters: Parameters.GetAvatarImageByOwner, callback?: never, ): Promise; - async getAvatarImageByOwner( + 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, }, }; - return this.client.sendRequest(config, callback); + 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/issueAttachments.ts b/src/version2/issueAttachments.ts index aa99be1fd4..5295ebd494 100644 --- a/src/version2/issueAttachments.ts +++ b/src/version2/issueAttachments.ts @@ -1,11 +1,14 @@ +import { FormData, File } from 'formdata-node'; +import type { Mime } from 'mime' with { 'resolution-mode': 'import' }; import * as Models from './models'; import * as Parameters from './parameters'; -import { Client } from '../clients'; 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) @@ -23,10 +26,9 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. */ - async getAttachmentContent>( - parameters: Parameters.GetAttachmentContent, + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, callback: Callback, ): Promise; /** @@ -46,26 +48,29 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. */ - async getAttachmentContent>( - parameters: Parameters.GetAttachmentContent, + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, callback?: never, ): Promise; - async getAttachmentContent>( - parameters: Parameters.GetAttachmentContent, + 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/${parameters.id}`, + url: `/rest/api/2/attachment/content/${id}`, method: 'GET', params: { - redirect: parameters.redirect, + 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. * @@ -96,6 +101,7 @@ export class IssueAttachments { return this.client.sendRequest(config, callback); } + /** * Returns the thumbnail of an attachment. * @@ -110,10 +116,9 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. */ - async getAttachmentThumbnail>( - parameters: Parameters.GetAttachmentThumbnail, + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, callback: Callback, ): Promise; /** @@ -130,29 +135,32 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. */ - async getAttachmentThumbnail>( - parameters: Parameters.GetAttachmentThumbnail, + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, callback?: never, ): Promise; - async getAttachmentThumbnail>( - parameters: Parameters.GetAttachmentThumbnail, + 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/${parameters.id}`, + url: `/rest/api/2/attachment/thumbnail/${id}`, method: 'GET', params: { - redirect: parameters.redirect, - fallbackToDefault: parameters.fallbackToDefault, - width: parameters.width, - height: parameters.height, + 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. * @@ -164,10 +172,9 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. */ async getAttachment( - parameters: Parameters.GetAttachment, + parameters: Parameters.GetAttachment | string, callback: Callback, ): Promise; /** @@ -181,23 +188,25 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. */ async getAttachment( - parameters: Parameters.GetAttachment, + parameters: Parameters.GetAttachment | string, callback?: never, ): Promise; async getAttachment( - parameters: Parameters.GetAttachment, + parameters: Parameters.GetAttachment | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/attachment/${parameters.id}`, + url: `/rest/api/2/attachment/${id}`, method: 'GET', }; return this.client.sendRequest(config, callback); } + /** * Deletes an attachment from an issue. * @@ -211,7 +220,10 @@ export class IssueAttachments { * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment * created by any user. */ - async removeAttachment(parameters: Parameters.RemoveAttachment, callback: Callback): Promise; + async removeAttachment( + parameters: Parameters.RemoveAttachment | string, + callback: Callback, + ): Promise; /** * Deletes an attachment from an issue. * @@ -225,15 +237,21 @@ export class IssueAttachments { * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment * created by any user. */ - async removeAttachment(parameters: Parameters.RemoveAttachment, callback?: never): Promise; - async removeAttachment(parameters: Parameters.RemoveAttachment, callback?: Callback): Promise { + 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/${parameters.id}`, + 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 @@ -253,10 +271,9 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. */ async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans, + parameters: Parameters.ExpandAttachmentForHumans | string, callback: Callback, ): Promise; /** @@ -278,23 +295,25 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. */ async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans, + parameters: Parameters.ExpandAttachmentForHumans | string, callback?: never, ): Promise; async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans, + parameters: Parameters.ExpandAttachmentForHumans | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/attachment/${parameters.id}/expand/human`, + 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 @@ -314,10 +333,9 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. */ async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines, + parameters: Parameters.ExpandAttachmentForMachines | string, callback: Callback, ): Promise; /** @@ -339,168 +357,29 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. */ async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines, + parameters: Parameters.ExpandAttachmentForMachines | string, callback?: never, ): Promise; async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines, + parameters: Parameters.ExpandAttachmentForMachines | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/attachment/${parameters.id}/expand/raw`, + 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`. - * - * The following examples upload a file called _myfile.txt_ to the issue _TEST-123_: - * - * #### curl - * - * curl --location --request POST 'https://your-domain.atlassian.net/rest/api/2/issue/TEST-123/attachments' - * -u 'email@example.com:' - * -H 'X-Atlassian-Token: no-check' - * --form 'file=@"myfile.txt"' - * - * #### Node.js - * - * // This code sample uses the 'node-fetch' and 'form-data' libraries: - * // https://www.npmjs.com/package/node-fetch - * // https://www.npmjs.com/package/form-data - * const fetch = require('node-fetch'); - * const FormData = require('form-data'); - * const fs = require('fs'); - * - * const filePath = 'myfile.txt'; - * const form = new FormData(); - * const stats = fs.statSync(filePath); - * const fileSizeInBytes = stats.size; - * const fileStream = fs.createReadStream(filePath); - * - * form.append('file', fileStream, { knownLength: fileSizeInBytes }); - * - * fetch('https://your-domain.atlassian.net/rest/api/2/issue/TEST-123/attachments', { - * method: 'POST', - * body: form, - * headers: { - * Authorization: `Basic ${Buffer.from('email@example.com:').toString('base64')}`, - * Accept: 'application/json', - * 'X-Atlassian-Token': 'no-check', - * }, - * }) - * .then(response => { - * console.log(`Response: ${response.status} ${response.statusText}`); - * return response.text(); - * }) - * .then(text => console.log(text)) - * .catch(err => console.error(err)); - * - * #### Java - * - * // This code sample uses the 'Unirest' library: - * // http://unirest.io/java.html - * HttpResponse response = Unirest.post("https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments") - * .basicAuth("email@example.com", "") - * .header("Accept", "application/json") - * .header("X-Atlassian-Token", "no-check") - * .field("file", new File("myfile.txt")) - * .asJson(); - * - * System.out.println(response.getBody()); - * - * #### Python - * - * # This code sample uses the 'requests' library: - * # http://docs.python-requests.org - * import requests - * from requests.auth import HTTPBasicAuth - * import json - * - * url = "https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments" - * - * auth = HTTPBasicAuth("email@example.com", "") - * - * headers = { - * "Accept": "application/json", - * "X-Atlassian-Token": "no-check" - * } - * - * response = requests.request( - * "POST", - * url, - * headers = headers, - * auth = auth, - * files = { - * "file": ("myfile.txt", open("myfile.txt","rb"), "application-type") - * } - * ) - * - * print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": "))) - * - * #### PHP - * - * // This code sample uses the 'Unirest' library: - * // http://unirest.io/php.html - * Unirest\Request::auth('email@example.com', ''); - * - * $headers = array( - * 'Accept' => 'application/json', - * 'X-Atlassian-Token' => 'no-check' - * ); - * - * $parameters = array( - * 'file' => File::add('myfile.txt') - * ); - * - * $response = Unirest\Request::post( - * 'https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments', - * $headers, - * $parameters - * ); - * - * var_dump($response) - * - * #### Forge - * - * // This sample uses Atlassian Forge and the `form-data` library. - * // https://developer.atlassian.com/platform/forge/ - * // https://www.npmjs.com/package/form-data - * import api from '@forge/api'; - * import FormData from 'form-data'; - * - * const form = new FormData(); - * form.append('file', fileStream, { knownLength: fileSizeInBytes }); - * - * const response = await api.asApp().requestJira('/rest/api/2/issue/{issueIdOrKey}/attachments', { - * method: 'POST', - * body: form, - * headers: { - * Accept: 'application/json', - * 'X-Atlassian-Token': 'no-check', - * }, - * }); - * - * console.log(`Response: ${response.status} ${response.statusText}`); - * console.log(await response.json()); - * - * Tip: Use a client library. Many client libraries have classes for handling multipart POST operations. For example, - * in Java, the Apache HTTP Components library provides a - * [MultiPartEntity](http://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntity.html) - * class for multipart POST operations. - * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -518,147 +397,6 @@ export class IssueAttachments { * 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`. - * - * The following examples upload a file called _myfile.txt_ to the issue _TEST-123_: - * - * #### curl - * - * curl --location --request POST 'https://your-domain.atlassian.net/rest/api/2/issue/TEST-123/attachments' - * -u 'email@example.com:' - * -H 'X-Atlassian-Token: no-check' - * --form 'file=@"myfile.txt"' - * - * #### Node.js - * - * // This code sample uses the 'node-fetch' and 'form-data' libraries: - * // https://www.npmjs.com/package/node-fetch - * // https://www.npmjs.com/package/form-data - * const fetch = require('node-fetch'); - * const FormData = require('form-data'); - * const fs = require('fs'); - * - * const filePath = 'myfile.txt'; - * const form = new FormData(); - * const stats = fs.statSync(filePath); - * const fileSizeInBytes = stats.size; - * const fileStream = fs.createReadStream(filePath); - * - * form.append('file', fileStream, { knownLength: fileSizeInBytes }); - * - * fetch('https://your-domain.atlassian.net/rest/api/2/issue/TEST-123/attachments', { - * method: 'POST', - * body: form, - * headers: { - * Authorization: `Basic ${Buffer.from('email@example.com:').toString('base64')}`, - * Accept: 'application/json', - * 'X-Atlassian-Token': 'no-check', - * }, - * }) - * .then(response => { - * console.log(`Response: ${response.status} ${response.statusText}`); - * return response.text(); - * }) - * .then(text => console.log(text)) - * .catch(err => console.error(err)); - * - * #### Java - * - * // This code sample uses the 'Unirest' library: - * // http://unirest.io/java.html - * HttpResponse response = Unirest.post("https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments") - * .basicAuth("email@example.com", "") - * .header("Accept", "application/json") - * .header("X-Atlassian-Token", "no-check") - * .field("file", new File("myfile.txt")) - * .asJson(); - * - * System.out.println(response.getBody()); - * - * #### Python - * - * # This code sample uses the 'requests' library: - * # http://docs.python-requests.org - * import requests - * from requests.auth import HTTPBasicAuth - * import json - * - * url = "https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments" - * - * auth = HTTPBasicAuth("email@example.com", "") - * - * headers = { - * "Accept": "application/json", - * "X-Atlassian-Token": "no-check" - * } - * - * response = requests.request( - * "POST", - * url, - * headers = headers, - * auth = auth, - * files = { - * "file": ("myfile.txt", open("myfile.txt","rb"), "application-type") - * } - * ) - * - * print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": "))) - * - * #### PHP - * - * // This code sample uses the 'Unirest' library: - * // http://unirest.io/php.html - * Unirest\Request::auth('email@example.com', ''); - * - * $headers = array( - * 'Accept' => 'application/json', - * 'X-Atlassian-Token' => 'no-check' - * ); - * - * $parameters = array( - * 'file' => File::add('myfile.txt') - * ); - * - * $response = Unirest\Request::post( - * 'https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments', - * $headers, - * $parameters - * ); - * - * var_dump($response) - * - * #### Forge - * - * // This sample uses Atlassian Forge and the `form-data` library. - * // https://developer.atlassian.com/platform/forge/ - * // https://www.npmjs.com/package/form-data - * import api from '@forge/api'; - * import FormData from 'form-data'; - * - * const form = new FormData(); - * form.append('file', fileStream, { knownLength: fileSizeInBytes }); - * - * const response = await api.asApp().requestJira('/rest/api/2/issue/{issueIdOrKey}/attachments', { - * method: 'POST', - * body: form, - * headers: { - * Accept: 'application/json', - * 'X-Atlassian-Token': 'no-check', - * }, - * }); - * - * console.log(`Response: ${response.status} ${response.statusText}`); - * console.log(await response.json()); - * - * Tip: Use a client library. Many client libraries have classes for handling multipart POST operations. For example, - * in Java, the Apache HTTP Components library provides a - * [MultiPartEntity](http://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntity.html) - * class for multipart POST operations. - * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -673,11 +411,113 @@ export class IssueAttachments { parameters: Parameters.AddAttachment, callback?: Callback, ): Promise { + const formData = new FormData(); + const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; + + const { default: mime } = await import('mime'); + + let Readable: typeof import('stream').Readable | undefined; + + if (typeof window === 'undefined') { + const { Readable: NodeReadable } = await import('stream'); + + Readable = NodeReadable; + } + + // eslint-disable-next-line no-restricted-syntax + for await (const attachment of attachments) { + const file = await this._convertToFile(attachment, mime, Readable); + + if (!(file instanceof File || file instanceof Blob)) { + throw new Error(`Unsupported file type for attachment: ${typeof file}`); + } + + formData.append('file', 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', + }, + data: formData, + maxBodyLength: Infinity, + maxContentLength: Infinity, }; return this.client.sendRequest(config, callback); } + + private async _convertToFile( + attachment: Parameters.Attachment, + mime: Mime, + Readable?: typeof import('stream').Readable, + ): Promise { + const mimeType = attachment.mimeType ?? (mime.getType(attachment.filename) || undefined); + + if (attachment.file instanceof Blob || attachment.file instanceof File) { + return attachment.file; + } + + if (typeof attachment.file === 'string') { + return new File([attachment.file], attachment.filename, { type: mimeType }); + } + + if (Readable && attachment.file instanceof Readable) { + return this._streamToBlob(attachment.file, attachment.filename, mimeType); + } + + if (attachment.file instanceof ReadableStream) { + return this._streamToBlob(attachment.file, attachment.filename, mimeType); + } + + if (ArrayBuffer.isView(attachment.file) || attachment.file instanceof ArrayBuffer) { + return new File([attachment.file], attachment.filename, { type: mimeType }); + } + + throw new Error('Unsupported attachment file type.'); + } + + private async _streamToBlob( + stream: import('stream').Readable | ReadableStream, + filename: string, + mimeType?: string, + ): Promise { + if (typeof window === 'undefined' && stream instanceof (await import('stream')).Readable) { + return new Promise((resolve, reject) => { + const chunks: Uint8Array[] = []; + + stream.on('data', chunk => chunks.push(chunk)); + stream.on('end', () => { + const blob = new Blob(chunks, { type: mimeType }); + + resolve(new File([blob], filename, { type: mimeType })); + }); + stream.on('error', reject); + }); + } + + if (stream instanceof ReadableStream) { + const reader = stream.getReader(); + const chunks: Uint8Array[] = []; + + let done = false; + + while (!done) { + // eslint-disable-next-line no-await-in-loop + const { value, done: streamDone } = await reader.read(); + + if (value) chunks.push(value); + done = streamDone; + } + + const blob = new Blob(chunks, { type: mimeType }); + + return new File([blob], filename, { type: mimeType }); + } + + throw new Error('Unsupported stream type.'); + } } From 92f0e6f99e250e9622967935fe3e666b7774f304 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sat, 22 Feb 2025 22:00:53 +0300 Subject: [PATCH 07/10] Build fix --- src/version2/avatars.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/version2/avatars.ts b/src/version2/avatars.ts index 6a939240cb..d2d6b42018 100644 --- a/src/version2/avatars.ts +++ b/src/version2/avatars.ts @@ -35,8 +35,10 @@ export class Avatars { parameters: Parameters.GetAllSystemAvatars | string, callback?: Callback, ): Promise { + const type = typeof parameters === 'string' ? parameters : parameters.type; + const config: RequestConfig = { - url: `/rest/api/2/avatar/${parameters.type}/system`, + url: `/rest/api/2/avatar/${type}/system`, method: 'GET', }; From f340a3b6b81444933d8f4733c53b636d0311cd1a Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sun, 23 Feb 2025 20:48:48 +0300 Subject: [PATCH 08/10] Fixes --- src/version2/classificationLevels.ts | 1 + src/version2/dashboards.ts | 106 ++++++---- src/version2/filters.ts | 140 ++++++++----- src/version2/groups.ts | 66 +++--- src/version2/issueAttachments.ts | 2 +- src/version2/issueComments.ts | 40 ++-- .../issueCustomFieldConfigurationApps.ts | 3 + src/version2/issueCustomFieldOptions.ts | 17 +- src/version2/issueCustomFieldOptionsApps.ts | 60 ++++-- src/version2/issueCustomFieldValuesApps.ts | 12 +- src/version2/issueFields.ts | 9 + src/version2/issueNotificationSchemes.ts | 32 ++- src/version2/issueResolutions.ts | 41 ++-- src/version2/issueSearch.ts | 10 +- src/version2/issueTypes.ts | 83 ++++---- src/version2/issueWorklogs.ts | 30 ++- src/version2/issues.ts | 197 ++++++++++-------- src/version2/jiraExpressions.ts | 3 + src/version2/jiraSettings.ts | 4 + src/version2/jqlFunctionsApps.ts | 2 + src/version2/myself.ts | 70 +------ src/version2/permissionSchemes.ts | 21 +- src/version2/permissions.ts | 4 + src/version2/plans.ts | 31 +-- src/version2/prioritySchemes.ts | 8 + src/version2/projectClassificationLevels.ts | 3 + src/version2/projectComponents.ts | 99 +++++---- src/version2/projectEmail.ts | 12 +- src/version2/projectRoles.ts | 71 ++++--- src/version2/projectVersions.ts | 177 +++++++--------- src/version2/projects.ts | 196 ++++++++--------- src/version2/workflowSchemes.ts | 12 +- src/version3/issueNotificationSchemes.ts | 32 +++ src/version3/parameters/addNotifications.ts | 8 + src/version3/parameters/index.ts | 1 + src/version3/workflowSchemes.ts | 10 +- 36 files changed, 928 insertions(+), 685 deletions(-) create mode 100644 src/version3/parameters/addNotifications.ts diff --git a/src/version2/classificationLevels.ts b/src/version2/classificationLevels.ts index ce62ae3caa..7e53a93441 100644 --- a/src/version2/classificationLevels.ts +++ b/src/version2/classificationLevels.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class ClassificationLevels { constructor(private client: Client) {} + /** * Returns all classification levels. * diff --git a/src/version2/dashboards.ts b/src/version2/dashboards.ts index d1618c4192..5bfafe4719 100644 --- a/src/version2/dashboards.ts +++ b/src/version2/dashboards.ts @@ -6,6 +6,7 @@ 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. @@ -46,13 +47,14 @@ export class Dashboards { 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 | undefined, + parameters: Parameters.CreateDashboard, callback: Callback, ): Promise; /** @@ -60,27 +62,28 @@ export class Dashboards { * * **[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?: never): Promise; async createDashboard( - parameters?: Parameters.CreateDashboard, + parameters: Parameters.CreateDashboard, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/dashboard', method: 'POST', params: { - extendAdminPermissions: parameters?.extendAdminPermissions, + extendAdminPermissions: parameters.extendAdminPermissions, }, data: { - description: parameters?.description, - editPermissions: parameters?.editPermissions, - name: parameters?.name, - sharePermissions: parameters?.sharePermissions, + 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. * @@ -89,7 +92,7 @@ export class Dashboards { * The dashboards to be updated must be owned by the user, or the user must be an administrator. */ async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards | undefined, + parameters: Parameters.BulkEditDashboards, callback: Callback, ): Promise; /** @@ -100,27 +103,28 @@ export class Dashboards { * The dashboards to be updated must be owned by the user, or the user must be an administrator. */ async bulkEditDashboards( - parameters?: Parameters.BulkEditDashboards, + parameters: Parameters.BulkEditDashboards, callback?: never, ): Promise; async bulkEditDashboards( - parameters?: Parameters.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, + 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. * @@ -145,6 +149,7 @@ export class Dashboards { 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 @@ -210,6 +215,7 @@ export class Dashboards { return this.client.sendRequest(config, callback); } + /** * Returns a list of dashboard gadgets on a dashboard. * @@ -225,7 +231,7 @@ export class Dashboards { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAllGadgets( - parameters: Parameters.GetAllGadgets, + parameters: Parameters.GetAllGadgets | string, callback: Callback, ): Promise; /** @@ -243,25 +249,28 @@ export class Dashboards { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAllGadgets( - parameters: Parameters.GetAllGadgets, + parameters: Parameters.GetAllGadgets | string, callback?: never, ): Promise; async getAllGadgets( - parameters: Parameters.GetAllGadgets, + parameters: Parameters.GetAllGadgets | string, callback?: Callback, ): Promise { + const dashboardId = typeof parameters === 'string' ? parameters : parameters.dashboardId; + const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, + url: `/rest/api/2/dashboard/${dashboardId}/gadget`, method: 'GET', params: { - moduleKey: parameters.moduleKey, - uri: parameters.uri, - gadgetId: parameters.gadgetId, + 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. * @@ -293,6 +302,7 @@ export class Dashboards { return this.client.sendRequest(config, callback); } + /** * Changes the title, position, and color of the gadget on a dashboard. * @@ -318,6 +328,7 @@ export class Dashboards { return this.client.sendRequest(config, callback); } + /** * Removes a dashboard gadget from a dashboard. * @@ -344,6 +355,7 @@ export class Dashboards { return this.client.sendRequest(config, callback); } + /** * Returns the keys of all properties for a dashboard item. * @@ -353,7 +365,7 @@ export class Dashboards { * 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\u2019s anonymous access is permitted. + * Jira’s anonymous access is permitted. */ async getDashboardItemPropertyKeys( parameters: Parameters.GetDashboardItemPropertyKeys, @@ -368,7 +380,7 @@ export class Dashboards { * 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\u2019s anonymous access is permitted. + * Jira’s anonymous access is permitted. */ async getDashboardItemPropertyKeys( parameters: Parameters.GetDashboardItemPropertyKeys, @@ -385,6 +397,7 @@ export class Dashboards { return this.client.sendRequest(config, callback); } + /** * Returns the key and value of a dashboard item property. * @@ -408,7 +421,7 @@ export class Dashboards { * 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\u2019s anonymous access is permitted. + * Jira’s anonymous access is permitted. */ async getDashboardItemProperty( parameters: Parameters.GetDashboardItemProperty, @@ -437,7 +450,7 @@ export class Dashboards { * 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\u2019s anonymous access is permitted. + * Jira’s anonymous access is permitted. */ async getDashboardItemProperty( parameters: Parameters.GetDashboardItemProperty, @@ -454,6 +467,7 @@ export class Dashboards { 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. @@ -523,10 +537,15 @@ export class Dashboards { 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. * @@ -564,6 +583,7 @@ export class Dashboards { return this.client.sendRequest(config, callback); } + /** * Returns a dashboard. * @@ -575,7 +595,10 @@ export class Dashboards { * 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, callback: Callback): Promise; + async getDashboard( + parameters: Parameters.GetDashboard | string, + callback: Callback, + ): Promise; /** * Returns a dashboard. * @@ -587,18 +610,21 @@ export class Dashboards { * 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, callback?: never): Promise; + async getDashboard(parameters: Parameters.GetDashboard | string, callback?: never): Promise; async getDashboard( - parameters: Parameters.GetDashboard, + parameters: Parameters.GetDashboard | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.id}`, + 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. * @@ -638,6 +664,7 @@ export class Dashboards { return this.client.sendRequest(config, callback); } + /** * Deletes a dashboard. * @@ -645,7 +672,10 @@ export class Dashboards { * * The dashboard to be deleted must be owned by the user. */ - async deleteDashboard(parameters: Parameters.DeleteDashboard, callback: Callback): Promise; + async deleteDashboard( + parameters: Parameters.DeleteDashboard | string, + callback: Callback, + ): Promise; /** * Deletes a dashboard. * @@ -653,15 +683,21 @@ export class Dashboards { * * The dashboard to be deleted must be owned by the user. */ - async deleteDashboard(parameters: Parameters.DeleteDashboard, callback?: never): Promise; - async deleteDashboard(parameters: Parameters.DeleteDashboard, callback?: Callback): Promise { + 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/${parameters.id}`, + 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. * diff --git a/src/version2/filters.ts b/src/version2/filters.ts index 8e4c9f28da..755996ef56 100644 --- a/src/version2/filters.ts +++ b/src/version2/filters.ts @@ -6,6 +6,7 @@ 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. @@ -13,10 +14,7 @@ export class Filters { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * Permission to access Jira. */ - async createFilter( - parameters: Parameters.CreateFilter | undefined, - callback: Callback, - ): Promise; + 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. @@ -24,39 +22,40 @@ export class Filters { * **[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?: never): Promise; async createFilter( - parameters?: Parameters.CreateFilter, + parameters: Parameters.CreateFilter, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/filter', method: 'POST', params: { - expand: parameters?.expand, - overrideSharePermissions: parameters?.overrideSharePermissions, + expand: parameters.expand, + overrideSharePermissions: parameters.overrideSharePermissions, }, data: { - approximateLastUsed: parameters?.approximateLastUsed, - description: parameters?.description, - editPermissions: parameters?.editPermissions, - favourite: parameters?.favourite, - 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, + approximateLastUsed: parameters.approximateLastUsed, + 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. * @@ -115,6 +114,7 @@ export class Filters { 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. @@ -169,6 +169,7 @@ export class Filters { 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: @@ -242,6 +243,7 @@ export class Filters { return this.client.sendRequest(config, callback); } + /** * Returns a filter. * @@ -257,7 +259,7 @@ export class Filters { * - Shared with a public project. * - Shared with the public. */ - async getFilter(parameters: Parameters.GetFilter, callback: Callback): Promise; + async getFilter(parameters: Parameters.GetFilter | string, callback: Callback): Promise; /** * Returns a filter. * @@ -273,19 +275,25 @@ export class Filters { * - Shared with a public project. * - Shared with the public. */ - async getFilter(parameters: Parameters.GetFilter, callback?: never): Promise; - async getFilter(parameters: Parameters.GetFilter, callback?: Callback): Promise { + 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/${parameters.id}`, + url: `/rest/api/2/filter/${id}`, method: 'GET', params: { - expand: parameters.expand, - overrideSharePermissions: parameters.overrideSharePermissions, + 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. * @@ -322,6 +330,7 @@ export class Filters { return this.client.sendRequest(config, callback); } + /** * Delete a filter. * @@ -329,7 +338,7 @@ export class Filters { * 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, callback: Callback): Promise; + async deleteFilter(parameters: Parameters.DeleteFilter | string, callback: Callback): Promise; /** * Delete a filter. * @@ -337,15 +346,21 @@ export class Filters { * 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, callback?: never): Promise; - async deleteFilter(parameters: Parameters.DeleteFilter, callback?: Callback): Promise { + 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/${parameters.id}`, + 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_. @@ -362,7 +377,10 @@ export class Filters { * - Filters shared with a public project. * - Filters shared with the public. */ - async getColumns(parameters: Parameters.GetColumns, callback: Callback): Promise; + 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_. @@ -379,18 +397,21 @@ export class Filters { * - Filters shared with a public project. * - Filters shared with the public. */ - async getColumns(parameters: Parameters.GetColumns, callback?: never): Promise; + async getColumns(parameters: Parameters.GetColumns | string, callback?: never): Promise; async getColumns( - parameters: Parameters.GetColumns, + parameters: Parameters.GetColumns | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/columns`, + url: `/rest/api/2/filter/${id}/columns`, method: '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 @@ -437,13 +458,12 @@ export class Filters { const config: RequestConfig = { url: `/rest/api/2/filter/${parameters.id}/columns`, method: 'PUT', - data: { - columns: parameters.columns, - }, + data: parameters.columns, }; return this.client.sendRequest(config, callback); } + /** * Reset the user's column configuration for the filter to the default. * @@ -457,7 +477,7 @@ export class Filters { * - Filters shared with a public project. * - Filters shared with the public. */ - async resetColumns(parameters: Parameters.ResetColumns, callback: Callback): Promise; + async resetColumns(parameters: Parameters.ResetColumns | string, callback: Callback): Promise; /** * Reset the user's column configuration for the filter to the default. * @@ -471,15 +491,21 @@ export class Filters { * - Filters shared with a public project. * - Filters shared with the public. */ - async resetColumns(parameters: Parameters.ResetColumns, callback?: never): Promise; - async resetColumns(parameters: Parameters.ResetColumns, callback?: Callback): Promise { + async resetColumns(parameters: Parameters.ResetColumns | string, callback?: never): Promise; + async resetColumns( + parameters: Parameters.ResetColumns | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/columns`, + url: `/rest/api/2/filter/${id}/columns`, method: 'DELETE', }; return this.client.sendRequest(config, callback); } + /** * Add a filter as a favorite for the user. * @@ -494,7 +520,7 @@ export class Filters { * - Filters shared with the public. */ async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter, + parameters: Parameters.SetFavouriteForFilter | string, callback: Callback, ): Promise; /** @@ -511,23 +537,26 @@ export class Filters { * - Filters shared with the public. */ async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter, + parameters: Parameters.SetFavouriteForFilter | string, callback?: never, ): Promise; async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter, + parameters: Parameters.SetFavouriteForFilter | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/favourite`, + url: `/rest/api/2/filter/${id}/favourite`, method: 'PUT', params: { - expand: parameters.expand, + 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 @@ -537,7 +566,7 @@ export class Filters { * Permission to access Jira. */ async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter, + parameters: Parameters.DeleteFavouriteForFilter | string, callback: Callback, ): Promise; /** @@ -549,23 +578,26 @@ export class Filters { * Permission to access Jira. */ async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter, + parameters: Parameters.DeleteFavouriteForFilter | string, callback?: never, ): Promise; async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter, + parameters: Parameters.DeleteFavouriteForFilter | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/favourite`, + url: `/rest/api/2/filter/${id}/favourite`, method: 'DELETE', params: { - expand: parameters.expand, + expand: typeof parameters !== 'string' && parameters.expand, }, }; return this.client.sendRequest(config, callback); } + /** * Changes the owner of the filter. * diff --git a/src/version2/groups.ts b/src/version2/groups.ts index 21c994b6c4..ceaea29ebc 100644 --- a/src/version2/groups.ts +++ b/src/version2/groups.ts @@ -13,56 +13,53 @@ export class Groups { * **[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 | undefined, - callback: Callback, - ): Promise; + 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 { + 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: { - name: parameters?.name, - }, + 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 | undefined, callback: Callback): Promise; + 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 { + 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, + 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. @@ -101,6 +98,7 @@ export class Groups { 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. @@ -115,7 +113,7 @@ export class Groups { * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup | undefined, + parameters: Parameters.GetUsersFromGroup, callback: Callback, ): Promise; /** @@ -132,63 +130,62 @@ export class Groups { * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getUsersFromGroup( - parameters?: Parameters.GetUsersFromGroup, + parameters: Parameters.GetUsersFromGroup, callback?: never, ): Promise; async getUsersFromGroup( - parameters?: Parameters.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, + 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 | undefined, - callback: Callback, - ): Promise; + 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?: never): Promise; async addUserToGroup( - parameters?: Parameters.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, + groupname: parameters.groupName, + groupId: parameters.groupId, }, data: { - accountId: parameters?.accountId, - name: parameters?.name, + accountId: parameters.accountId, + name: parameters.name, }, }; return this.client.sendRequest(config, callback); } + /** * Removes a user from a group. * @@ -223,6 +220,7 @@ export class Groups { 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. diff --git a/src/version2/issueAttachments.ts b/src/version2/issueAttachments.ts index 5295ebd494..8400766bd6 100644 --- a/src/version2/issueAttachments.ts +++ b/src/version2/issueAttachments.ts @@ -2,8 +2,8 @@ import { FormData, File } from 'formdata-node'; import type { Mime } from 'mime' with { 'resolution-mode': 'import' }; import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class IssueAttachments { diff --git a/src/version2/issueComments.ts b/src/version2/issueComments.ts index 00e6e24298..f2d69e36ca 100644 --- a/src/version2/issueComments.ts +++ b/src/version2/issueComments.ts @@ -6,6 +6,7 @@ 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. @@ -22,7 +23,7 @@ export class IssueComments { * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ async getCommentsByIds( - parameters: Parameters.GetCommentsByIds | undefined, + parameters: Parameters.GetCommentsByIds, callback: Callback, ): Promise; /** @@ -40,27 +41,25 @@ export class IssueComments { * 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?: never, - ): Promise; - async getCommentsByIds( - parameters?: Parameters.GetCommentsByIds, + parameters: Parameters.GetCommentsByIds, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/comment/list', method: 'POST', params: { - expand: parameters?.expand, + expand: parameters.expand, }, data: { - ids: parameters?.ids, + ids: parameters.ids, }, }; return this.client.sendRequest(config, callback); } + /** * Returns all comments for an issue. * @@ -77,7 +76,7 @@ export class IssueComments { * restricted to. */ async getComments( - parameters: Parameters.GetComments, + parameters: Parameters.GetComments | string, callback: Callback, ): Promise; /** @@ -95,24 +94,30 @@ export class IssueComments { * - 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, callback?: never): Promise; async getComments( - parameters: Parameters.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/${parameters.issueIdOrKey}/comment`, + url: `/rest/api/2/issue/${issueIdOrKey}/comment`, method: 'GET', params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - orderBy: parameters.orderBy, - expand: parameters.expand, + 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. * @@ -164,6 +169,7 @@ export class IssueComments { return this.client.sendRequest(config, callback); } + /** * Returns a comment. * @@ -205,6 +211,7 @@ export class IssueComments { return this.client.sendRequest(config, callback); } + /** * Updates a comment. * @@ -260,6 +267,7 @@ export class IssueComments { return this.client.sendRequest(config, callback); } + /** * Deletes a comment. * diff --git a/src/version2/issueCustomFieldConfigurationApps.ts b/src/version2/issueCustomFieldConfigurationApps.ts index eeb3ffb2d5..3fa8cf8445 100644 --- a/src/version2/issueCustomFieldConfigurationApps.ts +++ b/src/version2/issueCustomFieldConfigurationApps.ts @@ -6,6 +6,7 @@ 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 list of custom fields of a @@ -75,6 +76,7 @@ export class IssueCustomFieldConfigurationApps { return this.client.sendRequest(config, callback); } + /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * configurations for a custom field of a @@ -141,6 +143,7 @@ export class IssueCustomFieldConfigurationApps { return this.client.sendRequest(config, callback); } + /** * Update the configuration for contexts of a custom field of a * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created diff --git a/src/version2/issueCustomFieldOptions.ts b/src/version2/issueCustomFieldOptions.ts index 0cc7ba6ad4..6b6c38b604 100644 --- a/src/version2/issueCustomFieldOptions.ts +++ b/src/version2/issueCustomFieldOptions.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class IssueCustomFieldOptions { constructor(private client: Client) {} + /** * Returns a custom field option. For example, an option in a select list. * @@ -24,7 +25,7 @@ export class IssueCustomFieldOptions { * to view. */ async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption, + parameters: Parameters.GetCustomFieldOption | string, callback: Callback, ): Promise; /** @@ -45,20 +46,23 @@ export class IssueCustomFieldOptions { * to view. */ async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption, + parameters: Parameters.GetCustomFieldOption | string, callback?: never, ): Promise; async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption, + parameters: Parameters.GetCustomFieldOption | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/customFieldOption/${parameters.id}`, + 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 @@ -108,6 +112,7 @@ export class IssueCustomFieldOptions { 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. @@ -158,6 +163,7 @@ export class IssueCustomFieldOptions { return this.client.sendRequest(config, callback); } + /** * Updates the options of a custom field. * @@ -206,6 +212,7 @@ export class IssueCustomFieldOptions { return this.client.sendRequest(config, callback); } + /** * Changes the order of custom field options or cascading options in a context. * @@ -250,6 +257,7 @@ export class IssueCustomFieldOptions { return this.client.sendRequest(config, callback); } + /** * Deletes a custom field option. * @@ -290,6 +298,7 @@ export class IssueCustomFieldOptions { return this.client.sendRequest(config, callback); } + /** * Replaces the options of a custom field. * diff --git a/src/version2/issueCustomFieldOptionsApps.ts b/src/version2/issueCustomFieldOptionsApps.ts index 2a80e9086b..709a5c8044 100644 --- a/src/version2/issueCustomFieldOptionsApps.ts +++ b/src/version2/issueCustomFieldOptionsApps.ts @@ -6,6 +6,7 @@ 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 @@ -21,7 +22,7 @@ export class IssueCustomFieldOptionsApps { * for the app providing the field. */ async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions, + parameters: Parameters.GetAllIssueFieldOptions | string, callback: Callback, ): Promise; /** @@ -39,24 +40,27 @@ export class IssueCustomFieldOptionsApps { * for the app providing the field. */ async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions, + parameters: Parameters.GetAllIssueFieldOptions | string, callback?: never, ): Promise; async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions, + parameters: Parameters.GetAllIssueFieldOptions | string, callback?: Callback, ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option`, + url: `/rest/api/2/field/${fieldKey}/option`, method: 'GET', params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, + 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. * @@ -107,6 +111,7 @@ export class IssueCustomFieldOptionsApps { 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. @@ -119,7 +124,7 @@ export class IssueCustomFieldOptionsApps { * Permission to access Jira. */ async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions, + parameters: Parameters.GetSelectableIssueFieldOptions | string, callback: Callback, ): Promise; /** @@ -134,25 +139,28 @@ export class IssueCustomFieldOptionsApps { * Permission to access Jira. */ async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions, + parameters: Parameters.GetSelectableIssueFieldOptions | string, callback?: never, ): Promise; async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions, + parameters: Parameters.GetSelectableIssueFieldOptions | string, callback?: Callback, ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option/suggestions/edit`, + url: `/rest/api/2/field/${fieldKey}/option/suggestions/edit`, method: 'GET', params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, + 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. @@ -165,7 +173,7 @@ export class IssueCustomFieldOptionsApps { * Permission to access Jira. */ async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions, + parameters: Parameters.GetVisibleIssueFieldOptions | string, callback: Callback, ): Promise; /** @@ -180,25 +188,28 @@ export class IssueCustomFieldOptionsApps { * Permission to access Jira. */ async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions, + parameters: Parameters.GetVisibleIssueFieldOptions | string, callback?: never, ): Promise; async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions, + parameters: Parameters.GetVisibleIssueFieldOptions | string, callback?: Callback, ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option/suggestions/search`, + url: `/rest/api/2/field/${fieldKey}/option/suggestions/search`, method: 'GET', params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, + 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. * @@ -240,6 +251,7 @@ export class IssueCustomFieldOptionsApps { 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 @@ -291,6 +303,7 @@ export class IssueCustomFieldOptionsApps { return this.client.sendRequest(config, callback); } + /** * Deletes an option from a select list issue field. * @@ -329,6 +342,7 @@ export class IssueCustomFieldOptionsApps { 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 @@ -349,7 +363,7 @@ export class IssueCustomFieldOptionsApps { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required * for the app providing the field. */ - async replaceIssueFieldOption( + async replaceIssueFieldOption( parameters: Parameters.ReplaceIssueFieldOption, callback: Callback, ): Promise; @@ -373,11 +387,11 @@ export class IssueCustomFieldOptionsApps { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required * for the app providing the field. */ - async replaceIssueFieldOption( + async replaceIssueFieldOption( parameters: Parameters.ReplaceIssueFieldOption, callback?: never, ): Promise; - async replaceIssueFieldOption( + async replaceIssueFieldOption( parameters: Parameters.ReplaceIssueFieldOption, callback?: Callback, ): Promise { diff --git a/src/version2/issueCustomFieldValuesApps.ts b/src/version2/issueCustomFieldValuesApps.ts index 2fc4e20189..4b3d7e565a 100644 --- a/src/version2/issueCustomFieldValuesApps.ts +++ b/src/version2/issueCustomFieldValuesApps.ts @@ -6,6 +6,7 @@ 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. @@ -22,7 +23,7 @@ export class IssueCustomFieldValuesApps { * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues | undefined, + parameters: Parameters.UpdateMultipleCustomFieldValues, callback: Callback, ): Promise; /** @@ -41,26 +42,27 @@ export class IssueCustomFieldValuesApps { * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateMultipleCustomFieldValues( - parameters?: Parameters.UpdateMultipleCustomFieldValues, + parameters: Parameters.UpdateMultipleCustomFieldValues, callback?: never, ): Promise; async updateMultipleCustomFieldValues( - parameters?: Parameters.UpdateMultipleCustomFieldValues, + parameters: Parameters.UpdateMultipleCustomFieldValues, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/app/field/value', method: 'POST', params: { - generateChangelog: parameters?.generateChangelog, + generateChangelog: parameters.generateChangelog, }, data: { - updates: parameters?.updates, + updates: parameters.updates, }, }; return this.client.sendRequest(config, callback); } + /** * Updates the value of a custom field on one or more issues. * diff --git a/src/version2/issueFields.ts b/src/version2/issueFields.ts index 4ea9fbc852..b2ff7f09fb 100644 --- a/src/version2/issueFields.ts +++ b/src/version2/issueFields.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class IssueFields { constructor(private client: Client) {} + /** * Returns system and custom issue fields according to the following rules: * @@ -46,6 +47,7 @@ export class IssueFields { return this.client.sendRequest(config, callback); } + /** * Creates a custom field. * @@ -83,6 +85,7 @@ export class IssueFields { 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: @@ -139,6 +142,7 @@ export class IssueFields { 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. @@ -184,6 +188,7 @@ export class IssueFields { return this.client.sendRequest(config, callback); } + /** * Updates a custom field. * @@ -214,6 +219,7 @@ export class IssueFields { return this.client.sendRequest(config, callback); } + /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the * contexts a field is used in. Deprecated, use [ Get custom field @@ -253,6 +259,7 @@ export class IssueFields { 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. @@ -290,6 +297,7 @@ export class IssueFields { 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. @@ -320,6 +328,7 @@ export class IssueFields { 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. diff --git a/src/version2/issueNotificationSchemes.ts b/src/version2/issueNotificationSchemes.ts index 07decb80ff..e4384385dd 100644 --- a/src/version2/issueNotificationSchemes.ts +++ b/src/version2/issueNotificationSchemes.ts @@ -6,6 +6,7 @@ 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. @@ -53,6 +54,7 @@ export class IssueNotificationSchemes { return this.client.sendRequest(config, callback); } + /** * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. * @@ -60,7 +62,7 @@ export class IssueNotificationSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme | undefined, + parameters: Parameters.CreateNotificationScheme, callback: Callback, ): Promise; /** @@ -70,25 +72,26 @@ export class IssueNotificationSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createNotificationScheme( - parameters?: Parameters.CreateNotificationScheme, + parameters: Parameters.CreateNotificationScheme, callback?: never, ): Promise; async createNotificationScheme( - parameters?: Parameters.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, + 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 @@ -134,6 +137,7 @@ export class IssueNotificationSchemes { 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. @@ -143,7 +147,7 @@ export class IssueNotificationSchemes { * with the notification scheme. */ async getNotificationScheme( - parameters: Parameters.GetNotificationScheme, + parameters: Parameters.GetNotificationScheme | string, callback: Callback, ): Promise; /** @@ -155,23 +159,26 @@ export class IssueNotificationSchemes { * with the notification scheme. */ async getNotificationScheme( - parameters: Parameters.GetNotificationScheme, + parameters: Parameters.GetNotificationScheme | string, callback?: never, ): Promise; async getNotificationScheme( - parameters: Parameters.GetNotificationScheme, + parameters: Parameters.GetNotificationScheme | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/notificationscheme/${parameters.id}`, + url: `/rest/api/2/notificationscheme/${id}`, method: 'GET', params: { - expand: parameters.expand, + expand: typeof parameters !== 'string' && parameters.expand, }, }; return this.client.sendRequest(config, callback); } + /** * Updates a notification scheme. * @@ -207,6 +214,7 @@ export class IssueNotificationSchemes { return this.client.sendRequest(config, callback); } + /** * Adds notifications to a notification scheme. You can add up to 1000 notifications per request. * @@ -238,6 +246,7 @@ export class IssueNotificationSchemes { return this.client.sendRequest(config, callback); } + /** * Deletes a notification scheme. * @@ -269,6 +278,7 @@ export class IssueNotificationSchemes { return this.client.sendRequest(config, callback); } + /** * Removes a notification from a notification scheme. * diff --git a/src/version2/issueResolutions.ts b/src/version2/issueResolutions.ts index 569165c8ed..0214aa02cb 100644 --- a/src/version2/issueResolutions.ts +++ b/src/version2/issueResolutions.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class IssueResolutions { constructor(private client: Client) {} + /** * Returns a list of all issue resolution values. * @@ -28,6 +29,7 @@ export class IssueResolutions { return this.client.sendRequest(config, callback); } + /** * Creates an issue resolution. * @@ -35,7 +37,7 @@ export class IssueResolutions { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createResolution( - parameters: Parameters.CreateResolution | undefined, + parameters: Parameters.CreateResolution, callback: Callback, ): Promise; /** @@ -45,24 +47,25 @@ export class IssueResolutions { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createResolution( - parameters?: Parameters.CreateResolution, + parameters: Parameters.CreateResolution, callback?: never, ): Promise; async createResolution( - parameters?: Parameters.CreateResolution, + parameters: Parameters.CreateResolution, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/resolution', method: 'POST', data: { - description: parameters?.description, - name: parameters?.name, + description: parameters.description, + name: parameters.name, }, }; return this.client.sendRequest(config, callback); } + /** * Sets default issue resolution. * @@ -70,7 +73,7 @@ export class IssueResolutions { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async setDefaultResolution( - parameters: Parameters.SetDefaultResolution | undefined, + parameters: Parameters.SetDefaultResolution, callback: Callback, ): Promise; /** @@ -79,51 +82,50 @@ export class IssueResolutions { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setDefaultResolution(parameters?: Parameters.SetDefaultResolution, callback?: never): Promise; + async setDefaultResolution(parameters: Parameters.SetDefaultResolution, callback?: never): Promise; async setDefaultResolution( - parameters?: Parameters.SetDefaultResolution, + parameters: Parameters.SetDefaultResolution, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/resolution/default', method: 'PUT', data: { - id: parameters?.id, + 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 | undefined, - callback: Callback, - ): Promise; + 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 { + 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: { - after: parameters?.after, - ids: parameters?.ids, - position: parameters?.position, + 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/v2/intro/#pagination) list of * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: @@ -171,6 +173,7 @@ export class IssueResolutions { return this.client.sendRequest(config, callback); } + /** * Returns an issue resolution value. * @@ -199,6 +202,7 @@ export class IssueResolutions { return this.client.sendRequest(config, callback); } + /** * Updates an issue resolution. * @@ -225,6 +229,7 @@ export class IssueResolutions { return this.client.sendRequest(config, callback); } + /** * Deletes an issue resolution. * diff --git a/src/version2/issueSearch.ts b/src/version2/issueSearch.ts index d6b9175aac..3a84e9cce5 100644 --- a/src/version2/issueSearch.ts +++ b/src/version2/issueSearch.ts @@ -6,6 +6,7 @@ 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. @@ -63,6 +64,7 @@ export class IssueSearch { return this.client.sendRequest(config, callback); } + /** * Checks whether one or more issues would be returned by one or more JQL queries. * @@ -102,6 +104,7 @@ export class IssueSearch { return this.client.sendRequest(config, callback); } + /** * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). * @@ -164,6 +167,7 @@ export class IssueSearch { return this.client.sendRequest(config, callback); } + /** * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). * @@ -225,6 +229,7 @@ export class IssueSearch { return this.client.sendRequest(config, callback); } + /** * Provide an estimated count of the issues that match the [JQL](https://confluence.atlassian.com/x/egORLQ). Recent * updates might not be immediately visible in the returned output. This endpoint requires JQL to be bounded. @@ -269,6 +274,7 @@ export class IssueSearch { return this.client.sendRequest(config, callback); } + /** * Searches for IDs of issues using [JQL](https://confluence.atlassian.com/x/egORLQ). * @@ -329,6 +335,7 @@ export class IssueSearch { return this.client.sendRequest(config, callback); } + /** * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately * visible in the returned search results. If you need @@ -348,7 +355,7 @@ export class IssueSearch { * to view the issue. */ async searchForIssuesUsingJqlEnhancedSearch( - parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch | undefined, + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch, callback: Callback, ): Promise; /** @@ -395,6 +402,7 @@ export class IssueSearch { return this.client.sendRequest(config, callback); } + /** * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately * visible in the returned search results. If you need diff --git a/src/version2/issueTypes.ts b/src/version2/issueTypes.ts index 67da4e4b78..8ec2cb6f28 100644 --- a/src/version2/issueTypes.ts +++ b/src/version2/issueTypes.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class IssueTypes { constructor(private client: Client) {} + /** * Returns all issue types. * @@ -42,6 +43,7 @@ export class IssueTypes { return this.client.sendRequest(config, callback); } + /** * Creates an issue type and adds it to the default issue type scheme. * @@ -49,7 +51,7 @@ export class IssueTypes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueType( - parameters: Parameters.CreateIssueType | undefined, + parameters: Parameters.CreateIssueType, callback: Callback, ): Promise; /** @@ -59,25 +61,26 @@ export class IssueTypes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueType( - parameters?: Parameters.CreateIssueType, + parameters: Parameters.CreateIssueType, callback?: never, ): Promise; async createIssueType( - parameters?: Parameters.CreateIssueType, + parameters: Parameters.CreateIssueType, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/issuetype', method: 'POST', data: { - description: parameters?.description, - hierarchyLevel: parameters?.hierarchyLevel, - name: parameters?.name, + description: parameters.description, + hierarchyLevel: parameters.hierarchyLevel, + name: parameters.name, }, }; return this.client.sendRequest(config, callback); } + /** * Returns issue types for a project. * @@ -119,6 +122,7 @@ export class IssueTypes { return this.client.sendRequest(config, callback); } + /** * Returns an issue type. * @@ -129,7 +133,7 @@ export class IssueTypes { * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getIssueType( - parameters: Parameters.GetIssueType, + parameters: Parameters.GetIssueType | string, callback: Callback, ): Promise; /** @@ -141,18 +145,24 @@ export class IssueTypes { * 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, + 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/${parameters.id}`, + url: `/rest/api/2/issuetype/${id}`, method: 'GET', }; return this.client.sendRequest(config, callback); } + /** * Updates the issue type. * @@ -189,6 +199,7 @@ export class IssueTypes { 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 @@ -197,7 +208,10 @@ export class IssueTypes { * **[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, callback: Callback): Promise; + 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 @@ -206,18 +220,24 @@ export class IssueTypes { * **[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, callback?: never): Promise; - async deleteIssueType(parameters: Parameters.DeleteIssueType, callback?: Callback): Promise { + 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/${parameters.id}`, + url: `/rest/api/2/issuetype/${id}`, method: 'DELETE', params: { - alternativeIssueTypeId: parameters.alternativeIssueTypeId, + alternativeIssueTypeId: typeof parameters !== 'string' ? parameters.alternativeIssueTypeId : undefined, }, }; 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. @@ -227,7 +247,7 @@ export class IssueTypes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes, + parameters: Parameters.GetAlternativeIssueTypes | string, callback: Callback, ): Promise; /** @@ -239,34 +259,26 @@ export class IssueTypes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes, + parameters: Parameters.GetAlternativeIssueTypes | string, callback?: never, ): Promise; async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes, + parameters: Parameters.GetAlternativeIssueTypes | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/issuetype/${parameters.id}/alternatives`, + 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. * @@ -285,17 +297,6 @@ export class IssueTypes { /** * Loads an avatar for the issue type. * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example:\ - * `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check' \ --header - * 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url - * 'https://your-domain.atlassian.net/rest/api/2/issuetype/{issueTypeId}'This` - * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. * diff --git a/src/version2/issueWorklogs.ts b/src/version2/issueWorklogs.ts index 6b63e6a349..b709eefd9b 100644 --- a/src/version2/issueWorklogs.ts +++ b/src/version2/issueWorklogs.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class IssueWorklogs { constructor(private client: Client) {} + /** * Returns worklogs for an issue (ordered by created time), starting from the oldest worklog or from the worklog * started on or after a date and time. @@ -25,7 +26,7 @@ export class IssueWorklogs { * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ async getIssueWorklog( - parameters: Parameters.GetIssueWorklog, + parameters: Parameters.GetIssueWorklog | string, callback: Callback, ): Promise; /** @@ -47,27 +48,30 @@ export class IssueWorklogs { * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ async getIssueWorklog( - parameters: Parameters.GetIssueWorklog, + parameters: Parameters.GetIssueWorklog | string, callback?: never, ): Promise; async getIssueWorklog( - parameters: Parameters.GetIssueWorklog, + parameters: Parameters.GetIssueWorklog | string, callback?: Callback, ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog`, + url: `/rest/api/2/issue/${issueIdOrKey}/worklog`, method: 'GET', params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - startedAfter: parameters.startedAfter, - startedBefore: parameters.startedBefore, - expand: parameters.expand, + startAt: typeof parameters !== 'string' ? parameters.startAt : undefined, + maxResults: typeof parameters !== 'string' ? parameters.maxResults : undefined, + startedAfter: typeof parameters !== 'string' ? parameters.startedAfter : undefined, + startedBefore: typeof parameters !== 'string' ? parameters.startedBefore : undefined, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; return this.client.sendRequest(config, callback); } + /** * Adds a worklog to an issue. * @@ -131,6 +135,7 @@ export class IssueWorklogs { return this.client.sendRequest(config, callback); } + /** * Deletes a list of worklogs from an issue. This is an experimental API with limitations: * @@ -187,6 +192,7 @@ export class IssueWorklogs { return this.client.sendRequest(config, callback); } + /** * Moves a list of worklogs from one issue to another. This is an experimental API with several limitations: * @@ -248,6 +254,7 @@ export class IssueWorklogs { return this.client.sendRequest(config, callback); } + /** * Returns a worklog. * @@ -293,6 +300,7 @@ export class IssueWorklogs { return this.client.sendRequest(config, callback); } + /** * Updates a worklog. * @@ -357,6 +365,7 @@ export class IssueWorklogs { return this.client.sendRequest(config, callback); } + /** * Deletes a worklog from an issue. * @@ -410,6 +419,7 @@ export class IssueWorklogs { return this.client.sendRequest(config, callback); } + /** * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. * @@ -458,6 +468,7 @@ export class IssueWorklogs { return this.client.sendRequest(config, callback); } + /** * Returns worklog details for a list of worklog IDs. * @@ -505,6 +516,7 @@ export class IssueWorklogs { return this.client.sendRequest(config, callback); } + /** * Returns a list of IDs and update timestamps for worklogs updated after a date and time. * diff --git a/src/version2/issues.ts b/src/version2/issues.ts index 88eb2335de..7135994c59 100644 --- a/src/version2/issues.ts +++ b/src/version2/issues.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class Issues { constructor(private client: Client) {} + /** * Bulk fetch changelogs for multiple issues and filter by fields * @@ -23,7 +24,7 @@ export class Issues { * to view the issues. */ async getBulkChangelogs( - parameters: Parameters.GetBulkChangelogs | undefined, + parameters: Parameters.GetBulkChangelogs, callback: Callback, ): Promise; /** @@ -43,26 +44,27 @@ export class Issues { * to view the issues. */ async getBulkChangelogs( - parameters?: Parameters.GetBulkChangelogs, + parameters: Parameters.GetBulkChangelogs, callback?: never, ): Promise; async getBulkChangelogs( - parameters?: Parameters.GetBulkChangelogs, + parameters: Parameters.GetBulkChangelogs, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/changelog/bulkfetch', method: 'POST', data: { - fieldIds: parameters?.fieldIds, - issueIdsOrKeys: parameters?.issueIdsOrKeys, - maxResults: parameters?.maxResults, - nextPageToken: parameters?.nextPageToken, + fieldIds: parameters.fieldIds, + issueIdsOrKeys: parameters.issueIdsOrKeys, + maxResults: parameters.maxResults, + nextPageToken: parameters.nextPageToken, }, }; return this.client.sendRequest(config, callback); } + /** * Returns all issue events. * @@ -85,6 +87,7 @@ export class Issues { 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 @@ -104,10 +107,7 @@ export class Issues { * 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 | undefined, - callback: Callback, - ): Promise; + 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 @@ -127,28 +127,29 @@ export class Issues { * 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?: never): Promise; async createIssue( - parameters?: Parameters.CreateIssue, + parameters: Parameters.CreateIssue, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/issue', method: 'POST', params: { - updateHistory: parameters?.updateHistory, + updateHistory: parameters.updateHistory, }, data: { - fields: parameters?.fields, - historyMetadata: parameters?.historyMetadata, - properties: parameters?.properties, - transition: parameters?.transition, - update: parameters?.update, + 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. @@ -173,10 +174,7 @@ export class Issues { * * **Rate limiting:** Only a single request per jira instance can be active at any given time. */ - async archiveIssuesAsync( - parameters: Parameters.ArchiveIssuesAsync | undefined, - callback: Callback, - ): Promise; + async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback: Callback): Promise; /** * Enables admins to archive up to 100,000 issues in a single request using JQL, returning the URL to check the status * of the submitted request. @@ -201,21 +199,22 @@ export class Issues { * * **Rate limiting:** Only a single request per jira instance can be active at any given time. */ - async archiveIssuesAsync(parameters?: Parameters.ArchiveIssuesAsync, callback?: never): Promise; + async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; async archiveIssuesAsync( - parameters?: Parameters.ArchiveIssuesAsync, + parameters: Parameters.ArchiveIssuesAsync, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/issue/archive', method: 'POST', data: { - jql: parameters?.jql, + 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. @@ -233,7 +232,7 @@ export class Issues { * **Signed-in users only:** This API can't be accessed anonymously. */ async archiveIssues( - parameters: Parameters.ArchiveIssues | undefined, + parameters: Parameters.ArchiveIssues, callback: Callback, ): Promise; /** @@ -252,24 +251,22 @@ export class Issues { * * **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?: never, - ): Promise; - async archiveIssues( - parameters?: Parameters.ArchiveIssues, + parameters: Parameters.ArchiveIssues, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/issue/archive', method: 'PUT', data: { - issueIdsOrKeys: parameters?.issueIdsOrKeys, + 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 @@ -340,7 +337,7 @@ export class Issues { * * This operation can be accessed anonymously. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues * are included in the response where the user has: * * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is @@ -364,7 +361,7 @@ export class Issues { * * This operation can be accessed anonymously. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues * are included in the response where the user has: * * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is @@ -452,6 +449,7 @@ export class Issues { return this.client.sendRequest(config, callback); } + /** * Returns a page of issue type metadata for a specified project. Use the information to populate the requests in [ * Create issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). @@ -493,6 +491,7 @@ export class Issues { return this.client.sendRequest(config, callback); } + /** * Returns a page of field metadata for a specified project and issuetype id. Use the information to populate the * requests in [ Create issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). @@ -534,6 +533,7 @@ export class Issues { return this.client.sendRequest(config, callback); } + /** * Returns all issues breaching and approaching per-issue limits. * @@ -577,6 +577,7 @@ export class Issues { 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. @@ -594,7 +595,7 @@ export class Issues { * **Signed-in users only:** This API can't be accessed anonymously. */ async unarchiveIssues( - parameters: Parameters.UnarchiveIssues | undefined, + parameters: Parameters.UnarchiveIssues, callback: Callback, ): Promise; /** @@ -614,23 +615,24 @@ export class Issues { * **Signed-in users only:** This API can't be accessed anonymously. */ async unarchiveIssues( - parameters?: Parameters.UnarchiveIssues, + parameters: Parameters.UnarchiveIssues, callback?: never, ): Promise; async unarchiveIssues( - parameters?: Parameters.UnarchiveIssues, + parameters: Parameters.UnarchiveIssues, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/issue/unarchive', method: 'PUT', data: { - issueIdsOrKeys: parameters?.issueIdsOrKeys, + issueIdsOrKeys: parameters.issueIdsOrKeys, }, }; return this.client.sendRequest(config, callback); } + /** * Returns the details for an issue. * @@ -647,7 +649,7 @@ export class Issues { * - 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; + async getIssue(parameters: Parameters.GetIssue | string, callback: Callback): Promise; /** * Returns the details for an issue. * @@ -664,23 +666,28 @@ export class Issues { * - 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 { + 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/${parameters.issueIdOrKey}`, + url: `/rest/api/2/issue/${issueIdOrKey}`, method: 'GET', params: { - fields: parameters.fields, - fieldsByKeys: parameters.fieldsByKeys, - expand: parameters.expand, - properties: parameters.properties, - updateHistory: parameters.updateHistory, - failFast: parameters.failFast, + fields: typeof parameters !== 'string' ? parameters.fields : undefined, + fieldsByKeys: typeof parameters !== 'string' ? parameters.fieldsByKeys : undefined, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, + properties: typeof parameters !== 'string' ? parameters.properties : undefined, + updateHistory: typeof parameters !== 'string' ? parameters.updateHistory : undefined, }, }; return this.client.sendRequest(config, callback); } + /** * Edits an issue. Issue properties may be updated as part of the edit. Please note that issue transition is not * supported and is ignored here. To transition an issue, please use [Transition @@ -755,6 +762,7 @@ export class Issues { return this.client.sendRequest(config, callback); } + /** * Deletes an issue. * @@ -770,7 +778,7 @@ export class Issues { * - 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; + async deleteIssue(parameters: Parameters.DeleteIssue | string, callback: Callback): Promise; /** * Deletes an issue. * @@ -786,18 +794,21 @@ export class Issues { * - 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 { + 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/${parameters.issueIdOrKey}`, + url: `/rest/api/2/issue/${issueIdOrKey}`, method: 'DELETE', params: { - deleteSubtasks: parameters.deleteSubtasks, + deleteSubtasks: typeof parameters !== 'string' ? parameters.deleteSubtasks : undefined, }, }; 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. @@ -860,6 +871,7 @@ export class Issues { 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. @@ -874,7 +886,7 @@ export class Issues { * to view the issue. */ async getChangeLogs( - parameters: Parameters.GetChangeLogs, + parameters: Parameters.GetChangeLogs | string, callback: Callback, ): Promise; /** @@ -890,22 +902,28 @@ export class Issues { * - 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, + 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/${parameters.issueIdOrKey}/changelog`, + url: `/rest/api/2/issue/${issueIdOrKey}/changelog`, method: 'GET', params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, + startAt: typeof parameters !== 'string' ? parameters.startAt : undefined, + maxResults: typeof parameters !== 'string' ? parameters.maxResults : undefined, }, }; return this.client.sendRequest(config, callback); } + /** * Returns changelogs for an issue specified by a list of changelog IDs. * @@ -952,6 +970,7 @@ export class Issues { 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). @@ -1005,7 +1024,7 @@ export class Issues { * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. */ async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta, + parameters: Parameters.GetEditIssueMeta | string, callback: Callback, ): Promise; /** @@ -1061,24 +1080,27 @@ export class Issues { * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. */ async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta, + parameters: Parameters.GetEditIssueMeta | string, callback?: never, ): Promise; async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta, + parameters: Parameters.GetEditIssueMeta | string, callback?: Callback, ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/editmeta`, + url: `/rest/api/2/issue/${issueIdOrKey}/editmeta`, method: 'GET', params: { - overrideScreenSecurity: parameters.overrideScreenSecurity, - overrideEditableFlag: parameters.overrideEditableFlag, + overrideScreenSecurity: typeof parameters !== 'string' ? parameters.overrideScreenSecurity : undefined, + overrideEditableFlag: typeof parameters !== 'string' ? parameters.overrideEditableFlag : undefined, }, }; return this.client.sendRequest(config, callback); } + /** * Creates an email notification for an issue and adds it to the mail queue. * @@ -1116,6 +1138,7 @@ export class Issues { 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. @@ -1137,7 +1160,7 @@ export class Issues { * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. */ async getTransitions( - parameters: Parameters.GetTransitions, + parameters: Parameters.GetTransitions | string, callback: Callback, ): Promise; /** @@ -1160,25 +1183,32 @@ export class Issues { * 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, + 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/${parameters.issueIdOrKey}/transitions`, + url: `/rest/api/2/issue/${issueIdOrKey}/transitions`, method: 'GET', params: { - expand: parameters.expand, - transitionId: parameters.transitionId, - skipRemoteOnlyCondition: parameters.skipRemoteOnlyCondition, - includeUnavailableTransitions: parameters.includeUnavailableTransitions, - sortByOpsBarAndStatus: parameters.sortByOpsBarAndStatus, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, + transitionId: typeof parameters !== 'string' ? parameters.transitionId : undefined, + skipRemoteOnlyCondition: typeof parameters !== 'string' ? parameters.skipRemoteOnlyCondition : undefined, + includeUnavailableTransitions: + typeof parameters !== 'string' ? parameters.includeUnavailableTransitions : undefined, + sortByOpsBarAndStatus: typeof parameters !== 'string' ? parameters.sortByOpsBarAndStatus : undefined, }, }; return this.client.sendRequest(config, callback); } + /** * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. * @@ -1228,6 +1258,7 @@ export class Issues { 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. @@ -1245,7 +1276,7 @@ export class Issues { * **Rate limiting:** Only a single request can be active at any given time. */ async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues | undefined, + parameters: Parameters.ExportArchivedIssues, callback: Callback, ): Promise; /** @@ -1265,22 +1296,22 @@ export class Issues { * **Rate limiting:** Only a single request can be active at any given time. */ async exportArchivedIssues( - parameters?: Parameters.ExportArchivedIssues, + parameters: Parameters.ExportArchivedIssues, callback?: never, ): Promise; async exportArchivedIssues( - parameters?: Parameters.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, + archivedBy: parameters.archivedBy, + archivedDateRange: parameters.archivedDateRange, + issueTypes: parameters.issueTypes, + projects: parameters.projects, + reporters: parameters.reporters, }, }; diff --git a/src/version2/jiraExpressions.ts b/src/version2/jiraExpressions.ts index 6b15a0593e..e34c2b88ca 100644 --- a/src/version2/jiraExpressions.ts +++ b/src/version2/jiraExpressions.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class JiraExpressions { constructor(private client: Client) {} + /** * Analyses and validates Jira expressions. * @@ -52,6 +53,7 @@ export class JiraExpressions { return this.client.sendRequest(config, callback); } + /** * Evaluates a Jira expression and returns its value. * @@ -190,6 +192,7 @@ export class JiraExpressions { return this.client.sendRequest(config, callback); } + /** * Evaluates a Jira expression and returns its value. The difference between this and `eval` is that this endpoint * uses the enhanced search API when evaluating JQL queries. This API is eventually consistent, unlike the strongly diff --git a/src/version2/jiraSettings.ts b/src/version2/jiraSettings.ts index 55e8c4fdd0..03a13fef0e 100644 --- a/src/version2/jiraSettings.ts +++ b/src/version2/jiraSettings.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class JiraSettings { constructor(private client: Client) {} + /** * Returns all application properties or an application property. * @@ -50,6 +51,7 @@ export class JiraSettings { 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** @@ -76,6 +78,7 @@ export class JiraSettings { 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 @@ -206,6 +209,7 @@ export class JiraSettings { 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 diff --git a/src/version2/jqlFunctionsApps.ts b/src/version2/jqlFunctionsApps.ts index 36e424f332..7cb776da4e 100644 --- a/src/version2/jqlFunctionsApps.ts +++ b/src/version2/jqlFunctionsApps.ts @@ -52,6 +52,7 @@ export class JqlFunctionsApps { return this.client.sendRequest(config, callback); } + /** * Update the precomputation value of a function created by a Forge/Connect app. * @@ -92,6 +93,7 @@ export class JqlFunctionsApps { return this.client.sendRequest(config, callback); } + /** * Returns function precomputations by IDs, along with information about when they were created, updated, and last * used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. diff --git a/src/version2/myself.ts b/src/version2/myself.ts index a4c3cbc68d..be975fd2ec 100644 --- a/src/version2/myself.ts +++ b/src/version2/myself.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class Myself { constructor(private client: Client) {} + /** * Returns the value of a preference of the current user. * @@ -69,6 +70,7 @@ export class Myself { 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 @@ -141,13 +143,18 @@ export class Myself { 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. * @@ -191,6 +198,7 @@ export class Myself { return this.client.sendRequest(config, callback); } + /** * Returns the locale for the user. * @@ -223,69 +231,7 @@ export class Myself { return this.client.sendRequest(config, callback); } - /** - * Deprecated, 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 instead. - * - * Sets the locale of the user. The locale must be one supported by the instance of Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async setLocale(parameters: Parameters.SetLocale | undefined, callback: Callback): Promise; - /** - * Deprecated, 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 instead. - * - * Sets the locale of the user. The locale must be one supported by the instance of Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async setLocale(parameters?: Parameters.SetLocale, callback?: never): Promise; - async setLocale(parameters?: Parameters.SetLocale, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/mypreferences/locale', - method: 'PUT', - data: { - locale: parameters?.locale, - }, - }; - return this.client.sendRequest(config, callback); - } - /** - * Deprecated, 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 instead. - * - * Deletes the locale of the user, which restores the default setting. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async deleteLocale(callback: Callback): Promise; - /** - * Deprecated, 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 instead. - * - * Deletes the locale of the user, which restores the default setting. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async deleteLocale(callback?: never): Promise; - async deleteLocale(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/mypreferences/locale', - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } /** * Returns details for the current user. * diff --git a/src/version2/permissionSchemes.ts b/src/version2/permissionSchemes.ts index b81c1d514e..42ee9e52d0 100644 --- a/src/version2/permissionSchemes.ts +++ b/src/version2/permissionSchemes.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class PermissionSchemes { constructor(private client: Client) {} + /** * Returns all permission schemes. * @@ -242,6 +243,7 @@ export class PermissionSchemes { 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. @@ -282,6 +284,7 @@ export class PermissionSchemes { return this.client.sendRequest(config, callback); } + /** * Returns a permission scheme. * @@ -289,7 +292,7 @@ export class PermissionSchemes { * Permission to access Jira. */ async getPermissionScheme( - parameters: Parameters.GetPermissionScheme, + parameters: Parameters.GetPermissionScheme | string, callback: Callback, ): Promise; /** @@ -299,23 +302,26 @@ export class PermissionSchemes { * Permission to access Jira. */ async getPermissionScheme( - parameters: Parameters.GetPermissionScheme, + parameters: Parameters.GetPermissionScheme | string, callback?: never, ): Promise; async getPermissionScheme( - parameters: Parameters.GetPermissionScheme, + parameters: Parameters.GetPermissionScheme | string, callback?: Callback, ): Promise { + const schemeId = typeof parameters === 'string' ? parameters : parameters.schemeId; + const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, + url: `/rest/api/2/permissionscheme/${schemeId}`, method: 'GET', params: { - expand: parameters.expand, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; return this.client.sendRequest(config, callback); } + /** * Updates a permission scheme. Below are some important things to note when using this resource: * @@ -379,6 +385,7 @@ export class PermissionSchemes { return this.client.sendRequest(config, callback); } + /** * Deletes a permission scheme. * @@ -407,6 +414,7 @@ export class PermissionSchemes { return this.client.sendRequest(config, callback); } + /** * Returns all permission grants for a permission scheme. * @@ -441,6 +449,7 @@ export class PermissionSchemes { return this.client.sendRequest(config, callback); } + /** * Creates a permission grant in a permission scheme. * @@ -481,6 +490,7 @@ export class PermissionSchemes { return this.client.sendRequest(config, callback); } + /** * Returns a permission grant. * @@ -515,6 +525,7 @@ export class PermissionSchemes { 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. diff --git a/src/version2/permissions.ts b/src/version2/permissions.ts index c3f4d594a2..eaecef137a 100644 --- a/src/version2/permissions.ts +++ b/src/version2/permissions.ts @@ -6,6 +6,7 @@ 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. @@ -101,6 +102,7 @@ export class Permissions { return this.client.sendRequest(config, callback); } + /** * Returns all permissions, including: * @@ -133,6 +135,7 @@ export class Permissions { return this.client.sendRequest(config, callback); } + /** * Returns: * @@ -217,6 +220,7 @@ export class Permissions { return this.client.sendRequest(config, callback); } + /** * Returns all the projects where the user is granted a list of project permissions. * diff --git a/src/version2/plans.ts b/src/version2/plans.ts index 9b8f8f8527..d52910d586 100644 --- a/src/version2/plans.ts +++ b/src/version2/plans.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class Plans { constructor(private client: Client) {} + /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of plans. * @@ -43,41 +44,43 @@ export class Plans { return this.client.sendRequest(config, callback); } + /** * Creates a plan. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createPlan(parameters: Parameters.CreatePlan | undefined, callback: Callback): Promise; + async createPlan(parameters: Parameters.CreatePlan, callback: Callback): Promise; /** * Creates a plan. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createPlan(parameters?: Parameters.CreatePlan, callback?: never): Promise; - async createPlan(parameters?: Parameters.CreatePlan, callback?: Callback): Promise { + async createPlan(parameters: Parameters.CreatePlan, callback?: never): Promise; + async createPlan(parameters: Parameters.CreatePlan, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/2/plans/plan', method: 'POST', params: { - useGroupId: parameters?.useGroupId, + useGroupId: parameters.useGroupId, }, data: { - crossProjectReleases: parameters?.crossProjectReleases, - customFields: parameters?.customFields, - exclusionRules: parameters?.exclusionRules, - issueSources: parameters?.issueSources, - leadAccountId: parameters?.leadAccountId, - name: parameters?.name, - permissions: parameters?.permissions, - scheduling: parameters?.scheduling, + crossProjectReleases: parameters.crossProjectReleases, + customFields: parameters.customFields, + exclusionRules: parameters.exclusionRules, + issueSources: parameters.issueSources, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + permissions: parameters.permissions, + scheduling: parameters.scheduling, }, }; return this.client.sendRequest(config, callback); } + /** * Returns a plan. * @@ -103,6 +106,7 @@ export class Plans { return this.client.sendRequest(config, callback); } + /** * Updates any of the following details of a plan using [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902). * @@ -220,6 +224,7 @@ export class Plans { return this.client.sendRequest(config, callback); } + /** * Archives a plan. * @@ -242,6 +247,7 @@ export class Plans { return this.client.sendRequest(config, callback); } + /** * Duplicates a plan. * @@ -267,6 +273,7 @@ export class Plans { return this.client.sendRequest(config, callback); } + /** * Moves a plan to trash. * diff --git a/src/version2/prioritySchemes.ts b/src/version2/prioritySchemes.ts index a36cbcfe92..af30279d6c 100644 --- a/src/version2/prioritySchemes.ts +++ b/src/version2/prioritySchemes.ts @@ -8,6 +8,7 @@ import { Paginated } from '../paginated'; export class PrioritySchemes { constructor(private client: Client) {} + /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * priority schemes. @@ -51,6 +52,7 @@ export class PrioritySchemes { return this.client.sendRequest(config, callback); } + /** * Creates a new priority scheme. * @@ -90,6 +92,7 @@ export class PrioritySchemes { return this.client.sendRequest(config, callback); } + /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * priorities that would require mapping, given a change in priorities or projects associated with a priority scheme. @@ -130,6 +133,7 @@ export class PrioritySchemes { return this.client.sendRequest(config, callback); } + /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * priorities available for adding to a priority scheme. @@ -170,6 +174,7 @@ export class PrioritySchemes { return this.client.sendRequest(config, callback); } + /** * Updates a priority scheme. This includes its details, the lists of priorities and projects in it * @@ -209,6 +214,7 @@ export class PrioritySchemes { return this.client.sendRequest(config, callback); } + /** * Deletes a priority scheme. * @@ -243,6 +249,7 @@ export class PrioritySchemes { return this.client.sendRequest(config, callback); } + /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * priorities by scheme. @@ -280,6 +287,7 @@ export class PrioritySchemes { return this.client.sendRequest(config, callback); } + /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * projects by scheme. diff --git a/src/version2/projectClassificationLevels.ts b/src/version2/projectClassificationLevels.ts index 0083f8d199..4fcb8ab936 100644 --- a/src/version2/projectClassificationLevels.ts +++ b/src/version2/projectClassificationLevels.ts @@ -5,6 +5,7 @@ import { RequestConfig } from '../requestConfig'; export class ProjectClassificationLevels { constructor(private client: Client) {} + /** * Returns the default data classification for a project. * @@ -42,6 +43,7 @@ export class ProjectClassificationLevels { return this.client.sendRequest(config, callback); } + /** * Updates the default data classification level for a project. * @@ -80,6 +82,7 @@ export class ProjectClassificationLevels { return this.client.sendRequest(config, callback); } + /** * Remove the default data classification level for a project. * diff --git a/src/version2/projectComponents.ts b/src/version2/projectComponents.ts index 6fade9f351..c51564cbed 100644 --- a/src/version2/projectComponents.ts +++ b/src/version2/projectComponents.ts @@ -7,6 +7,7 @@ import { Paginated } from '../paginated'; export class ProjectComponents { constructor(private client: Client) {} + /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all * components in a project, including global (Compass) components when applicable. @@ -51,6 +52,7 @@ export class ProjectComponents { return this.client.sendRequest(config, callback); } + /** * Creates a component. Use components to provide containers for issues within a project. Use components to provide * containers for issues within a project. @@ -62,7 +64,7 @@ export class ProjectComponents { * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createComponent( - parameters: Parameters.CreateComponent | undefined, + parameters: Parameters.CreateComponent, callback: Callback, ): Promise; /** @@ -76,38 +78,39 @@ export class ProjectComponents { * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createComponent( - parameters?: Parameters.CreateComponent, + parameters: Parameters.CreateComponent, callback?: never, ): Promise; async createComponent( - parameters?: Parameters.CreateComponent, + parameters: Parameters.CreateComponent, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/component', method: 'POST', data: { - ari: parameters?.ari, - assignee: parameters?.assignee, - assigneeType: parameters?.assigneeType, - description: parameters?.description, - id: parameters?.id, - isAssigneeTypeValid: parameters?.isAssigneeTypeValid, - lead: parameters?.lead, - leadAccountId: parameters?.leadAccountId, - leadUserName: parameters?.leadUserName, - metadata: parameters?.metadata, - name: parameters?.name, - project: parameters?.project, - projectId: parameters?.projectId, - realAssignee: parameters?.realAssignee, - realAssigneeType: parameters?.realAssigneeType, - self: parameters?.self, + ari: parameters.ari, + assignee: parameters.assignee, + assigneeType: parameters.assigneeType, + description: parameters.description, + id: parameters.id, + isAssigneeTypeValid: parameters.isAssigneeTypeValid, + lead: parameters.lead, + leadAccountId: parameters.leadAccountId, + leadUserName: parameters.leadUserName, + metadata: parameters.metadata, + name: parameters.name, + project: parameters.project, + projectId: parameters.projectId, + realAssignee: parameters.realAssignee, + realAssigneeType: parameters.realAssigneeType, + self: parameters.self, }, }; return this.client.sendRequest(config, callback); } + /** * Returns a component. * @@ -117,7 +120,7 @@ export class ProjectComponents { * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. */ async getComponent( - parameters: Parameters.GetComponent, + parameters: Parameters.GetComponent | string, callback: Callback, ): Promise; /** @@ -128,18 +131,24 @@ export class ProjectComponents { * **[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, callback?: never): Promise; async getComponent( - parameters: Parameters.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/${parameters.id}`, + 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. @@ -187,6 +196,7 @@ export class ProjectComponents { return this.client.sendRequest(config, callback); } + /** * Deletes a component. * @@ -196,7 +206,10 @@ export class ProjectComponents { * _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; + async deleteComponent( + parameters: Parameters.DeleteComponent | string, + callback: Callback, + ): Promise; /** * Deletes a component. * @@ -206,18 +219,24 @@ export class ProjectComponents { * _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 { + 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/${parameters.id}`, + url: `/rest/api/2/component/${id}`, method: 'DELETE', params: { - moveIssuesTo: parameters.moveIssuesTo, + moveIssuesTo: typeof parameters !== 'string' ? parameters.moveIssuesTo : undefined, }, }; return this.client.sendRequest(config, callback); } + /** * Returns the counts of issues assigned to the component. * @@ -231,7 +250,7 @@ export class ProjectComponents { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues, + parameters: Parameters.GetComponentRelatedIssues | string, callback: Callback, ): Promise; /** @@ -247,20 +266,23 @@ export class ProjectComponents { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues, + parameters: Parameters.GetComponentRelatedIssues | string, callback?: never, ): Promise; async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues, + parameters: Parameters.GetComponentRelatedIssues | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/component/${parameters.id}/relatedIssueCounts`, + 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) @@ -313,6 +335,7 @@ export class ProjectComponents { 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 @@ -327,7 +350,7 @@ export class ProjectComponents { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectComponents( - parameters: Parameters.GetProjectComponents, + parameters: Parameters.GetProjectComponents | string, callback: Callback, ): Promise; /** @@ -344,18 +367,20 @@ export class ProjectComponents { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectComponents( - parameters: Parameters.GetProjectComponents, + parameters: Parameters.GetProjectComponents | string, callback?: never, ): Promise; async getProjectComponents( - parameters: Parameters.GetProjectComponents, + parameters: Parameters.GetProjectComponents | string, callback?: Callback, ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/components`, + url: `/rest/api/2/project/${projectIdOrKey}/components`, method: 'GET', params: { - componentSource: parameters.componentSource, + componentSource: typeof parameters !== 'string' ? parameters.componentSource : undefined, }, }; diff --git a/src/version2/projectEmail.ts b/src/version2/projectEmail.ts index 477013da8f..19a97e99de 100644 --- a/src/version2/projectEmail.ts +++ b/src/version2/projectEmail.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class ProjectEmail { constructor(private client: Client) {} + /** * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). * @@ -13,7 +14,7 @@ export class ProjectEmail { * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectEmail( - parameters: Parameters.GetProjectEmail, + parameters: Parameters.GetProjectEmail | string, callback: Callback, ): Promise; /** @@ -23,20 +24,23 @@ export class ProjectEmail { * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectEmail( - parameters: Parameters.GetProjectEmail, + parameters: Parameters.GetProjectEmail | string, callback?: never, ): Promise; async getProjectEmail( - parameters: Parameters.GetProjectEmail, + parameters: Parameters.GetProjectEmail | string, callback?: Callback, ): Promise { + const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; + const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectId}/email`, + 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). * diff --git a/src/version2/projectRoles.ts b/src/version2/projectRoles.ts index c32cd7636d..4e0ca63ffc 100644 --- a/src/version2/projectRoles.ts +++ b/src/version2/projectRoles.ts @@ -6,6 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class ProjectRoles { constructor(private client: Client) {} + /** * Returns a list of [project * roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) for the project @@ -20,7 +21,10 @@ export class ProjectRoles { * _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, callback: Callback): Promise; + async getProjectRoles( + parameters: Parameters.GetProjectRoles | string, + callback: Callback, + ): Promise; /** * Returns a list of [project * roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) for the project @@ -35,18 +39,21 @@ export class ProjectRoles { * _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, callback?: never): Promise; + async getProjectRoles(parameters: Parameters.GetProjectRoles | string, callback?: never): Promise; async getProjectRoles( - parameters: Parameters.GetProjectRoles, + parameters: Parameters.GetProjectRoles | string, callback?: Callback, ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/role`, + 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. @@ -94,6 +101,7 @@ export class ProjectRoles { return this.client.sendRequest(config, callback); } + /** * Returns all [project roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) and * the details for each role. Note that the list of project roles is common to all projects. @@ -105,7 +113,7 @@ export class ProjectRoles { * permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails, + parameters: Parameters.GetProjectRoleDetails | string, callback: Callback, ): Promise; /** @@ -119,24 +127,27 @@ export class ProjectRoles { * permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails, + parameters: Parameters.GetProjectRoleDetails | string, callback?: never, ): Promise; async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails, + parameters: Parameters.GetProjectRoleDetails | string, callback?: Callback, ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/roledetails`, + url: `/rest/api/2/project/${projectIdOrKey}/roledetails`, method: 'GET', params: { - currentMember: parameters.currentMember, - excludeConnectAddons: parameters.excludeConnectAddons, + currentMember: typeof parameters !== 'string' ? parameters.currentMember : undefined, + excludeConnectAddons: typeof parameters !== 'string' ? parameters.excludeConnectAddons : undefined, }, }; return this.client.sendRequest(config, callback); } + /** * Gets a list of all project roles, complete with project role details and default actors. * @@ -211,6 +222,7 @@ export class ProjectRoles { 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 @@ -223,7 +235,7 @@ export class ProjectRoles { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createProjectRole( - parameters: Parameters.CreateProjectRole | undefined, + parameters: Parameters.CreateProjectRole, callback: Callback, ): Promise; /** @@ -238,24 +250,25 @@ export class ProjectRoles { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createProjectRole( - parameters?: Parameters.CreateProjectRole, + parameters: Parameters.CreateProjectRole, callback?: never, ): Promise; async createProjectRole( - parameters?: Parameters.CreateProjectRole, + parameters: Parameters.CreateProjectRole, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/role', method: 'POST', data: { - description: parameters?.description, - name: parameters?.name, + description: parameters.description, + name: parameters.name, }, }; 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. @@ -264,7 +277,7 @@ export class ProjectRoles { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getProjectRoleById( - parameters: Parameters.GetProjectRoleById, + parameters: Parameters.GetProjectRoleById | string, callback: Callback, ): Promise; /** @@ -275,20 +288,23 @@ export class ProjectRoles { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getProjectRoleById( - parameters: Parameters.GetProjectRoleById, + parameters: Parameters.GetProjectRoleById | string, callback?: never, ): Promise; async getProjectRoleById( - parameters: Parameters.GetProjectRoleById, + parameters: Parameters.GetProjectRoleById | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/role/${parameters.id}`, + url: `/rest/api/2/role/${id}`, method: 'GET', }; return this.client.sendRequest(config, callback); } + /** * Updates either the project role's name or its description. * @@ -330,6 +346,7 @@ export class ProjectRoles { 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. * @@ -365,6 +382,7 @@ export class ProjectRoles { 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. @@ -372,7 +390,10 @@ export class ProjectRoles { * **[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, callback: Callback): Promise; + 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. @@ -380,16 +401,18 @@ export class ProjectRoles { * **[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, callback?: never): Promise; + async deleteProjectRole(parameters: Parameters.DeleteProjectRole | string, callback?: never): Promise; async deleteProjectRole( - parameters: Parameters.DeleteProjectRole, + parameters: Parameters.DeleteProjectRole | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/role/${parameters.id}`, + url: `/rest/api/2/role/${id}`, method: 'DELETE', params: { - swap: parameters.swap, + swap: typeof parameters !== 'string' ? parameters.swap : undefined, }, }; diff --git a/src/version2/projectVersions.ts b/src/version2/projectVersions.ts index 8a5f972970..84a97aaf51 100644 --- a/src/version2/projectVersions.ts +++ b/src/version2/projectVersions.ts @@ -6,6 +6,7 @@ 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 @@ -17,7 +18,7 @@ export class ProjectVersions { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated, + parameters: Parameters.GetProjectVersionsPaginated | string, callback: Callback, ): Promise; /** @@ -31,28 +32,31 @@ export class ProjectVersions { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated, + parameters: Parameters.GetProjectVersionsPaginated | string, callback?: never, ): Promise; async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated, + parameters: Parameters.GetProjectVersionsPaginated | string, callback?: Callback, ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/version`, + url: `/rest/api/2/project/${projectIdOrKey}/version`, method: 'GET', params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - orderBy: parameters.orderBy, - query: parameters.query, - status: parameters.status, - expand: parameters.expand, + startAt: typeof parameters !== 'string' ? parameters.startAt : undefined, + maxResults: typeof parameters !== 'string' ? parameters.maxResults : undefined, + orderBy: typeof parameters !== 'string' ? parameters.orderBy : undefined, + query: typeof parameters !== 'string' ? parameters.query : undefined, + status: typeof parameters !== 'string' ? parameters.status : undefined, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; 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 @@ -64,7 +68,7 @@ export class ProjectVersions { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectVersions( - parameters: Parameters.GetProjectVersions, + parameters: Parameters.GetProjectVersions | string, callback: Callback, ): Promise; /** @@ -78,23 +82,26 @@ export class ProjectVersions { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getProjectVersions( - parameters: Parameters.GetProjectVersions, + parameters: Parameters.GetProjectVersions | string, callback?: never, ): Promise; async getProjectVersions( - parameters: Parameters.GetProjectVersions, + parameters: Parameters.GetProjectVersions | string, callback?: Callback, ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/versions`, + url: `/rest/api/2/project/${projectIdOrKey}/versions`, method: 'GET', params: { - expand: parameters.expand, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; return this.client.sendRequest(config, callback); } + /** * Creates a project version. * @@ -104,10 +111,7 @@ export class ProjectVersions { * _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 | undefined, - callback: Callback, - ): Promise; + async createVersion(parameters: Parameters.CreateVersion, callback: Callback): Promise; /** * Creates a project version. * @@ -117,38 +121,39 @@ export class ProjectVersions { * _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?: never): Promise; async createVersion( - parameters?: Parameters.CreateVersion, + parameters: Parameters.CreateVersion, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/version', method: 'POST', data: { - approvers: parameters?.approvers, - archived: parameters?.archived, - description: parameters?.description, - driver: parameters?.driver, - expand: parameters?.expand, - id: parameters?.id, - issuesStatusForFixVersion: parameters?.issuesStatusForFixVersion, - moveUnfixedIssuesTo: parameters?.moveUnfixedIssuesTo, - name: parameters?.name, - operations: parameters?.operations, - overdue: parameters?.overdue, - projectId: parameters?.projectId, - releaseDate: parameters?.releaseDate, - released: parameters?.released, - self: parameters?.self, - startDate: parameters?.startDate, - userReleaseDate: parameters?.userReleaseDate, - userStartDate: parameters?.userStartDate, + approvers: parameters.approvers, + archived: parameters.archived, + description: parameters.description, + driver: parameters.driver, + expand: parameters.expand, + id: parameters.id, + issuesStatusForFixVersion: parameters.issuesStatusForFixVersion, + moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, + name: parameters.name, + operations: parameters.operations, + overdue: parameters.overdue, + projectId: parameters.projectId, + releaseDate: parameters.releaseDate, + released: parameters.released, + self: parameters.self, + startDate: parameters.startDate, + userReleaseDate: parameters.userReleaseDate, + userStartDate: parameters.userStartDate, }, }; return this.client.sendRequest(config, callback); } + /** * Returns a project version. * @@ -157,7 +162,10 @@ export class ProjectVersions { * **[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, callback: Callback): Promise; + async getVersion( + parameters: Parameters.GetVersion | string, + callback: Callback, + ): Promise; /** * Returns a project version. * @@ -166,18 +174,24 @@ export class ProjectVersions { * **[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, callback?: never): Promise; - async getVersion(parameters: Parameters.GetVersion, callback?: Callback): Promise { + 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/${parameters.id}`, + url: `/rest/api/2/version/${id}`, method: 'GET', params: { - expand: parameters.expand, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; return this.client.sendRequest(config, callback); } + /** * Updates a project version. * @@ -222,54 +236,7 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } - /** - * Deletes a project version. - * - * Deprecated, use [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) that supports swapping - * version values in custom fields, in addition to the swapping for `fixVersion` and `affectedVersion` provided in - * this resource. - * - * Alternative versions can be provided to update issues that use the deleted version in `fixVersion` or - * `affectedVersion`. If alternatives are not provided, occurrences of `fixVersion` and `affectedVersion` that contain - * the deleted version are cleared. - * - * 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 deleteVersion(parameters: Parameters.DeleteVersion, callback: Callback): Promise; - /** - * Deletes a project version. - * - * Deprecated, use [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) that supports swapping - * version values in custom fields, in addition to the swapping for `fixVersion` and `affectedVersion` provided in - * this resource. - * - * Alternative versions can be provided to update issues that use the deleted version in `fixVersion` or - * `affectedVersion`. If alternatives are not provided, occurrences of `fixVersion` and `affectedVersion` that contain - * the deleted version are cleared. - * - * 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 deleteVersion(parameters: Parameters.DeleteVersion, callback?: never): Promise; - async deleteVersion(parameters: Parameters.DeleteVersion, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/version/${parameters.id}`, - method: 'DELETE', - params: { - moveFixIssuesTo: parameters.moveFixIssuesTo, - moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, - }, - }; - 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`. @@ -306,6 +273,7 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } + /** * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. * @@ -336,6 +304,7 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } + /** * Returns the following counts for a version: * @@ -349,7 +318,7 @@ export class ProjectVersions { * projects_ project permission for the project that contains the version. */ async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues, + parameters: Parameters.GetVersionRelatedIssues | string, callback: Callback, ): Promise; /** @@ -365,20 +334,23 @@ export class ProjectVersions { * projects_ project permission for the project that contains the version. */ async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues, + parameters: Parameters.GetVersionRelatedIssues | string, callback?: never, ): Promise; async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues, + parameters: Parameters.GetVersionRelatedIssues | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/version/${parameters.id}/relatedIssueCounts`, + url: `/rest/api/2/version/${id}/relatedIssueCounts`, method: 'GET', }; return this.client.sendRequest(config, callback); } + /** * Returns related work items for the given version id. * @@ -414,6 +386,7 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } + /** * Creates a related work for the given version. You can only create a generic link type of related works via this * API. relatedWorkId will be auto-generated UUID, that does not need to be provided. @@ -462,6 +435,7 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } + /** * Updates the given related work. You can only update generic link related works via Rest APIs. Any archived version * related works can't be edited. @@ -510,6 +484,7 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } + /** * Deletes a project version. * @@ -561,6 +536,7 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } + /** * Returns counts of the issues and unresolved issues for the project version. * @@ -570,7 +546,7 @@ export class ProjectVersions { * projects_ project permission for the project that contains the version. */ async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues, + parameters: Parameters.GetVersionUnresolvedIssues | string, callback: Callback, ): Promise; /** @@ -582,20 +558,23 @@ export class ProjectVersions { * projects_ project permission for the project that contains the version. */ async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues, + parameters: Parameters.GetVersionUnresolvedIssues | string, callback?: never, ): Promise; async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues, + parameters: Parameters.GetVersionUnresolvedIssues | string, callback?: Callback, ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/version/${parameters.id}/unresolvedIssueCount`, + url: `/rest/api/2/version/${id}/unresolvedIssueCount`, method: 'GET', }; return this.client.sendRequest(config, callback); } + /** * Deletes the given related work for the given version. * diff --git a/src/version2/projects.ts b/src/version2/projects.ts index c149da8586..27b71982d9 100644 --- a/src/version2/projects.ts +++ b/src/version2/projects.ts @@ -6,47 +6,7 @@ import { RequestConfig } from '../requestConfig'; export class Projects { constructor(private client: Client) {} - /** - * Returns all projects visible to the user. Deprecated, use [ Get projects - * paginated](#api-rest-api-2-project-search-get) that supports search and pagination. - * - * 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 _Browse Projects_ or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getAllProjects( - parameters: Parameters.GetAllProjects | undefined, - callback: Callback, - ): Promise; - /** - * Returns all projects visible to the user. Deprecated, use [ Get projects - * paginated](#api-rest-api-2-project-search-get) that supports search and pagination. - * - * 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 _Browse Projects_ or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getAllProjects(parameters?: Parameters.GetAllProjects, callback?: never): Promise; - async getAllProjects( - parameters?: Parameters.GetAllProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/project', - method: 'GET', - params: { - expand: parameters?.expand, - recent: parameters?.recent, - properties: parameters?.properties, - }, - }; - return this.client.sendRequest(config, callback); - } /** * Creates a project based on a project type template, as shown in the following table: * @@ -71,7 +31,7 @@ export class Projects { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createProject( - parameters: Parameters.CreateProject | undefined, + parameters: Parameters.CreateProject, callback: Callback, ): Promise; /** @@ -98,39 +58,40 @@ export class Projects { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createProject( - parameters?: Parameters.CreateProject, + parameters: Parameters.CreateProject, callback?: never, ): Promise; async createProject( - parameters?: Parameters.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, + 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. * @@ -172,6 +133,7 @@ export class Projects { 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. @@ -229,6 +191,7 @@ export class Projects { return this.client.sendRequest(config, callback); } + /** * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. * @@ -237,7 +200,10 @@ export class Projects { * **[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, callback: Callback): Promise; + async getProject( + parameters: Parameters.GetProject | string, + callback: Callback, + ): Promise; /** * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. * @@ -246,19 +212,25 @@ export class Projects { * **[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, callback?: never): Promise; - async getProject(parameters: Parameters.GetProject, callback?: Callback): Promise { + 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/${parameters.projectIdOrKey}`, + url: `/rest/api/2/project/${projectIdOrKey}`, method: 'GET', params: { - expand: parameters.expand, - properties: parameters.properties, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, + properties: typeof parameters !== 'string' ? parameters.properties : undefined, }, }; return this.client.sendRequest(config, callback); } + /** * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. * @@ -304,6 +276,8 @@ export class Projects { name: parameters.name, notificationScheme: parameters.notificationScheme, permissionScheme: parameters.permissionScheme, + projectTemplateKey: parameters.projectTemplateKey, + projectTypeKey: parameters.projectTypeKey, releasedProjectKeys: parameters.releasedProjectKeys, url: parameters.url, }, @@ -311,6 +285,7 @@ export class Projects { return this.client.sendRequest(config, callback); } + /** * Deletes a project. * @@ -320,7 +295,7 @@ export class 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 deleteProject(parameters: Parameters.DeleteProject, callback: Callback): Promise; + async deleteProject(parameters: Parameters.DeleteProject | string, callback: Callback): Promise; /** * Deletes a project. * @@ -330,18 +305,24 @@ export class 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 deleteProject(parameters: Parameters.DeleteProject, callback?: never): Promise; - async deleteProject(parameters: Parameters.DeleteProject, callback?: Callback): Promise { + 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/${parameters.projectIdOrKey}`, + url: `/rest/api/2/project/${projectIdOrKey}`, method: 'DELETE', params: { - enableUndo: parameters.enableUndo, + enableUndo: typeof parameters !== 'string' ? parameters.enableUndo : undefined, }, }; 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. @@ -349,7 +330,7 @@ export class 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 archiveProject(parameters: Parameters.ArchiveProject, callback: Callback): Promise; + 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. @@ -357,15 +338,21 @@ export class 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 archiveProject(parameters: Parameters.ArchiveProject, callback?: never): Promise; - async archiveProject(parameters: Parameters.ArchiveProject, callback?: Callback): Promise { + 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/${parameters.projectIdOrKey}/archive`, + url: `/rest/api/2/project/${projectIdOrKey}/archive`, method: 'POST', }; return this.client.sendRequest(config, callback); } + /** * Deletes a project asynchronously. * @@ -380,7 +367,7 @@ export class Projects { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously, + parameters: Parameters.DeleteProjectAsynchronously | string, callback: Callback, ): Promise; /** @@ -397,20 +384,23 @@ export class Projects { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously, + parameters: Parameters.DeleteProjectAsynchronously | string, callback?: never, ): Promise; async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously, + parameters: Parameters.DeleteProjectAsynchronously | string, callback?: Callback, ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/delete`, + 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. * @@ -420,7 +410,7 @@ export class 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, callback: Callback): Promise; + async restore(parameters: Parameters.Restore | string, callback: Callback): Promise; /** * Restores a project that has been archived or placed in the Jira recycle bin. * @@ -430,15 +420,21 @@ export class 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, callback?: never): Promise; - async restore(parameters: Parameters.Restore, callback?: Callback): Promise { + 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/${parameters.projectIdOrKey}/restore`, + 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. @@ -449,7 +445,7 @@ export class Projects { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getAllStatuses( - parameters: Parameters.GetAllStatuses, + parameters: Parameters.GetAllStatuses | string, callback: Callback, ): Promise; /** @@ -462,20 +458,23 @@ export class Projects { * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getAllStatuses( - parameters: Parameters.GetAllStatuses, + parameters: Parameters.GetAllStatuses | string, callback?: never, ): Promise; async getAllStatuses( - parameters: Parameters.GetAllStatuses, + parameters: Parameters.GetAllStatuses | string, callback?: Callback, ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/statuses`, + 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. * @@ -491,7 +490,7 @@ export class Projects { * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getHierarchy( - parameters: Parameters.GetHierarchy, + parameters: Parameters.GetHierarchy | string, callback: Callback, ): Promise; /** @@ -509,20 +508,23 @@ export class Projects { * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ async getHierarchy( - parameters: Parameters.GetHierarchy, + parameters: Parameters.GetHierarchy | string, callback?: never, ): Promise; async getHierarchy( - parameters: Parameters.GetHierarchy, + parameters: Parameters.GetHierarchy | string, callback?: Callback, ): Promise { + const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; + const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectId}/hierarchy`, + 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. * @@ -531,7 +533,7 @@ export class Projects { * permission](https://confluence.atlassian.com/x/yodKLg). */ async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject, + parameters: Parameters.GetNotificationSchemeForProject | string, callback: Callback, ): Promise; /** @@ -542,18 +544,20 @@ export class Projects { * permission](https://confluence.atlassian.com/x/yodKLg). */ async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject, + parameters: Parameters.GetNotificationSchemeForProject | string, callback?: never, ): Promise; async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject, + parameters: Parameters.GetNotificationSchemeForProject | string, callback?: Callback, ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectKeyOrId}/notificationscheme`, + url: `/rest/api/2/project/${projectKeyOrId}/notificationscheme`, method: 'GET', params: { - expand: parameters.expand, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; diff --git a/src/version2/workflowSchemes.ts b/src/version2/workflowSchemes.ts index edee135db6..4857ecc6aa 100644 --- a/src/version2/workflowSchemes.ts +++ b/src/version2/workflowSchemes.ts @@ -101,7 +101,7 @@ export class WorkflowSchemes { * - _Administer projects_ project permissions to access project-scoped workflow schemes */ async readWorkflowSchemes( - parameters: Parameters.ReadWorkflowSchemes | undefined, + parameters: Parameters.ReadWorkflowSchemes, callback: Callback, ): Promise; /** @@ -113,22 +113,22 @@ export class WorkflowSchemes { * - _Administer projects_ project permissions to access project-scoped workflow schemes */ async readWorkflowSchemes( - parameters?: Parameters.ReadWorkflowSchemes, + parameters: Parameters.ReadWorkflowSchemes, callback?: never, ): Promise; async readWorkflowSchemes( - parameters?: Parameters.ReadWorkflowSchemes, + parameters: Parameters.ReadWorkflowSchemes, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/workflowscheme/read', method: 'POST', params: { - expand: parameters?.expand, + expand: parameters.expand, }, data: { - projectIds: parameters?.projectIds, - workflowSchemeIds: parameters?.workflowSchemeIds, + projectIds: parameters.projectIds, + workflowSchemeIds: parameters.workflowSchemeIds, }, }; diff --git a/src/version3/issueNotificationSchemes.ts b/src/version3/issueNotificationSchemes.ts index b917f3ae0a..4c476c3ac0 100644 --- a/src/version3/issueNotificationSchemes.ts +++ b/src/version3/issueNotificationSchemes.ts @@ -215,6 +215,38 @@ export class IssueNotificationSchemes { return this.client.sendRequest(config, callback); } + /** + * Adds notifications to a notification scheme. You can add up to 1000 notifications per request. + * + * _Deprecated: The notification type `EmailAddress` is no longer supported in Cloud. Refer to the + * [changelog](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1031) for more details._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addNotifications(parameters: Parameters.AddNotifications, callback: Callback): Promise; + /** + * Adds notifications to a notification scheme. You can add up to 1000 notifications per request. + * + * _Deprecated: The notification type `EmailAddress` is no longer supported in Cloud. Refer to the + * [changelog](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1031) for more details._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addNotifications(parameters: Parameters.AddNotifications, callback?: never): Promise; + async addNotifications(parameters: Parameters.AddNotifications, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/notificationscheme/${parameters.id}/notification`, + method: 'PUT', + data: { + notificationSchemeEvents: parameters.notificationSchemeEvents, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Deletes a notification scheme. * diff --git a/src/version3/parameters/addNotifications.ts b/src/version3/parameters/addNotifications.ts new file mode 100644 index 0000000000..180d1ed1de --- /dev/null +++ b/src/version3/parameters/addNotifications.ts @@ -0,0 +1,8 @@ +import { NotificationSchemeEventDetails } from '../models'; + +export interface AddNotifications { + /** The ID of the notification scheme. */ + id: string; + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents: NotificationSchemeEventDetails[]; +} diff --git a/src/version3/parameters/index.ts b/src/version3/parameters/index.ts index 2661ee7e99..b38a6c6c27 100644 --- a/src/version3/parameters/index.ts +++ b/src/version3/parameters/index.ts @@ -1,3 +1,4 @@ +export * from './addNotifications'; export * from './addActorUsers'; export * from './addAtlassianTeam'; export * from './addAttachment'; diff --git a/src/version3/workflowSchemes.ts b/src/version3/workflowSchemes.ts index 9e02f56897..4811b7ed0b 100644 --- a/src/version3/workflowSchemes.ts +++ b/src/version3/workflowSchemes.ts @@ -101,7 +101,7 @@ export class WorkflowSchemes { * - _Administer projects_ project permissions to access project-scoped workflow schemes */ async readWorkflowSchemes( - parameters: Parameters.ReadWorkflowSchemes | undefined, + parameters: Parameters.ReadWorkflowSchemes, callback: Callback, ): Promise; /** @@ -113,19 +113,19 @@ export class WorkflowSchemes { * - _Administer projects_ project permissions to access project-scoped workflow schemes */ async readWorkflowSchemes( - parameters?: Parameters.ReadWorkflowSchemes, + parameters: Parameters.ReadWorkflowSchemes, callback?: never, ): Promise; async readWorkflowSchemes( - parameters?: Parameters.ReadWorkflowSchemes, + parameters: Parameters.ReadWorkflowSchemes, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/workflowscheme/read', method: 'POST', data: { - projectIds: parameters?.projectIds, - workflowSchemeIds: parameters?.workflowSchemeIds, + projectIds: parameters.projectIds, + workflowSchemeIds: parameters.workflowSchemeIds, }, }; From 57977a2d9c856755d59a34c9de7825697cc14a3b Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sat, 1 Mar 2025 00:38:45 +0300 Subject: [PATCH 09/10] Incremental improvements --- package-lock.json | 472 +++++++++--------- package.json | 12 +- src/version2/dashboards.ts | 5 +- src/version2/issueFields.ts | 40 -- src/version2/issues.ts | 6 +- src/version2/jqlFunctionsApps.ts | 16 +- ...xportArchivedIssuesTaskProgressResponse.ts | 9 - src/version2/models/index.ts | 4 +- ...geDTO.ts => workflowSchemeProjectUsage.ts} | 2 +- src/version2/projectRoles.ts | 6 +- src/version2/workflowSchemes.ts | 6 +- src/version3/jqlFunctionsApps.ts | 16 +- 12 files changed, 273 insertions(+), 321 deletions(-) delete mode 100644 src/version2/models/exportArchivedIssuesTaskProgressResponse.ts rename src/version2/models/{workflowSchemeProjectUsageDTO.ts => workflowSchemeProjectUsage.ts} (79%) diff --git a/package-lock.json b/package-lock.json index 14d05ae42e..acf7d6764b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,16 +9,16 @@ "version": "4.1.0", "license": "MIT", "dependencies": { - "axios": "^1.7.9", + "axios": "^1.8.1", "formdata-node": "^6.0.3", "mime": "^4.0.6", "tslib": "^2.8.1" }, "devDependencies": { - "@types/node": "^18.19.76", + "@types/node": "^18.19.77", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.24.1", - "@typescript-eslint/parser": "^8.24.1", + "@typescript-eslint/eslint-plugin": "^8.25.0", + "@typescript-eslint/parser": "^8.25.0", "dotenv": "^16.4.7", "eslint": "^8.57.1", "eslint-config-airbnb-base": "^15.0.0", @@ -27,16 +27,16 @@ "prettier": "^3.5.2", "prettier-plugin-jsdoc": "^1.3.2", "sinon": "^18.0.1", - "typedoc": "^0.27.8", + "typedoc": "^0.27.9", "typescript": "^5.7.3", "vite-tsconfig-paths": "^5.1.4", - "vitest": "^3.0.6" + "vitest": "^3.0.7" } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.2.tgz", - "integrity": "sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz", + "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==", "cpu": [ "ppc64" ], @@ -51,9 +51,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.2.tgz", - "integrity": "sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz", + "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==", "cpu": [ "arm" ], @@ -68,9 +68,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.2.tgz", - "integrity": "sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz", + "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==", "cpu": [ "arm64" ], @@ -85,9 +85,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.2.tgz", - "integrity": "sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz", + "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==", "cpu": [ "x64" ], @@ -102,9 +102,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.2.tgz", - "integrity": "sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz", + "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==", "cpu": [ "arm64" ], @@ -119,9 +119,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.2.tgz", - "integrity": "sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz", + "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==", "cpu": [ "x64" ], @@ -136,9 +136,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.2.tgz", - "integrity": "sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz", + "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==", "cpu": [ "arm64" ], @@ -153,9 +153,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.2.tgz", - "integrity": "sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz", + "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==", "cpu": [ "x64" ], @@ -170,9 +170,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.2.tgz", - "integrity": "sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz", + "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==", "cpu": [ "arm" ], @@ -187,9 +187,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.2.tgz", - "integrity": "sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz", + "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==", "cpu": [ "arm64" ], @@ -204,9 +204,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.2.tgz", - "integrity": "sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz", + "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==", "cpu": [ "ia32" ], @@ -221,9 +221,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.2.tgz", - "integrity": "sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz", + "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==", "cpu": [ "loong64" ], @@ -238,9 +238,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.2.tgz", - "integrity": "sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz", + "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==", "cpu": [ "mips64el" ], @@ -255,9 +255,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.2.tgz", - "integrity": "sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz", + "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==", "cpu": [ "ppc64" ], @@ -272,9 +272,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.2.tgz", - "integrity": "sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz", + "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==", "cpu": [ "riscv64" ], @@ -289,9 +289,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.2.tgz", - "integrity": "sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz", + "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==", "cpu": [ "s390x" ], @@ -306,9 +306,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.2.tgz", - "integrity": "sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz", + "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==", "cpu": [ "x64" ], @@ -323,9 +323,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.24.2.tgz", - "integrity": "sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz", + "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==", "cpu": [ "arm64" ], @@ -340,9 +340,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.2.tgz", - "integrity": "sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz", + "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==", "cpu": [ "x64" ], @@ -357,9 +357,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.2.tgz", - "integrity": "sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz", + "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==", "cpu": [ "arm64" ], @@ -374,9 +374,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.2.tgz", - "integrity": "sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz", + "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==", "cpu": [ "x64" ], @@ -391,9 +391,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.2.tgz", - "integrity": "sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz", + "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==", "cpu": [ "x64" ], @@ -408,9 +408,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.2.tgz", - "integrity": "sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz", + "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==", "cpu": [ "arm64" ], @@ -425,9 +425,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.2.tgz", - "integrity": "sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz", + "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==", "cpu": [ "ia32" ], @@ -442,9 +442,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.2.tgz", - "integrity": "sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz", + "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==", "cpu": [ "x64" ], @@ -1077,9 +1077,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "18.19.76", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.76.tgz", - "integrity": "sha512-yvR7Q9LdPz2vGpmpJX5LolrgRdWvB67MJKDPSgIIzpFbaf9a1j/f5DnLp5VDyHGMR0QZHlTr1afsD87QCXFHKw==", + "version": "18.19.77", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.77.tgz", + "integrity": "sha512-D94SwXkCv6X58yYiJziuwmvyqCfH99TfPVSS4IUGdXB8lCOehCz37JqpvMhqiY9GuI1npAo7ZUTG3EJZ01M8bg==", "dev": true, "license": "MIT", "dependencies": { @@ -1111,17 +1111,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.24.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.24.1.tgz", - "integrity": "sha512-ll1StnKtBigWIGqvYDVuDmXJHVH4zLVot1yQ4fJtLpL7qacwkxJc1T0bptqw+miBQ/QfUbhl1TcQ4accW5KUyA==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.25.0.tgz", + "integrity": "sha512-VM7bpzAe7JO/BFf40pIT1lJqS/z1F8OaSsUB3rpFJucQA4cOSuH2RVVVkFULN+En0Djgr29/jb4EQnedUo95KA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.24.1", - "@typescript-eslint/type-utils": "8.24.1", - "@typescript-eslint/utils": "8.24.1", - "@typescript-eslint/visitor-keys": "8.24.1", + "@typescript-eslint/scope-manager": "8.25.0", + "@typescript-eslint/type-utils": "8.25.0", + "@typescript-eslint/utils": "8.25.0", + "@typescript-eslint/visitor-keys": "8.25.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1141,16 +1141,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.24.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.24.1.tgz", - "integrity": "sha512-Tqoa05bu+t5s8CTZFaGpCH2ub3QeT9YDkXbPd3uQ4SfsLoh1/vv2GEYAioPoxCWJJNsenXlC88tRjwoHNts1oQ==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.25.0.tgz", + "integrity": "sha512-4gbs64bnbSzu4FpgMiQ1A+D+urxkoJk/kqlDJ2W//5SygaEiAP2B4GoS7TEdxgwol2el03gckFV9lJ4QOMiiHg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.24.1", - "@typescript-eslint/types": "8.24.1", - "@typescript-eslint/typescript-estree": "8.24.1", - "@typescript-eslint/visitor-keys": "8.24.1", + "@typescript-eslint/scope-manager": "8.25.0", + "@typescript-eslint/types": "8.25.0", + "@typescript-eslint/typescript-estree": "8.25.0", + "@typescript-eslint/visitor-keys": "8.25.0", "debug": "^4.3.4" }, "engines": { @@ -1166,14 +1166,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.24.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.24.1.tgz", - "integrity": "sha512-OdQr6BNBzwRjNEXMQyaGyZzgg7wzjYKfX2ZBV3E04hUCBDv3GQCHiz9RpqdUIiVrMgJGkXm3tcEh4vFSHreS2Q==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.25.0.tgz", + "integrity": "sha512-6PPeiKIGbgStEyt4NNXa2ru5pMzQ8OYKO1hX1z53HMomrmiSB+R5FmChgQAP1ro8jMtNawz+TRQo/cSXrauTpg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.24.1", - "@typescript-eslint/visitor-keys": "8.24.1" + "@typescript-eslint/types": "8.25.0", + "@typescript-eslint/visitor-keys": "8.25.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1184,14 +1184,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.24.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.24.1.tgz", - "integrity": "sha512-/Do9fmNgCsQ+K4rCz0STI7lYB4phTtEXqqCAs3gZW0pnK7lWNkvWd5iW545GSmApm4AzmQXmSqXPO565B4WVrw==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.25.0.tgz", + "integrity": "sha512-d77dHgHWnxmXOPJuDWO4FDWADmGQkN5+tt6SFRZz/RtCWl4pHgFl3+WdYCn16+3teG09DY6XtEpf3gGD0a186g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.24.1", - "@typescript-eslint/utils": "8.24.1", + "@typescript-eslint/typescript-estree": "8.25.0", + "@typescript-eslint/utils": "8.25.0", "debug": "^4.3.4", "ts-api-utils": "^2.0.1" }, @@ -1208,9 +1208,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.24.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.24.1.tgz", - "integrity": "sha512-9kqJ+2DkUXiuhoiYIUvIYjGcwle8pcPpdlfkemGvTObzgmYfJ5d0Qm6jwb4NBXP9W1I5tss0VIAnWFumz3mC5A==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.25.0.tgz", + "integrity": "sha512-+vUe0Zb4tkNgznQwicsvLUJgZIRs6ITeWSCclX1q85pR1iOiaj+4uZJIUp//Z27QWu5Cseiw3O3AR8hVpax7Aw==", "dev": true, "license": "MIT", "engines": { @@ -1222,14 +1222,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.24.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.24.1.tgz", - "integrity": "sha512-UPyy4MJ/0RE648DSKQe9g0VDSehPINiejjA6ElqnFaFIhI6ZEiZAkUI0D5MCk0bQcTf/LVqZStvQ6K4lPn/BRg==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.25.0.tgz", + "integrity": "sha512-ZPaiAKEZ6Blt/TPAx5Ot0EIB/yGtLI2EsGoY6F7XKklfMxYQyvtL+gT/UCqkMzO0BVFHLDlzvFqQzurYahxv9Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.24.1", - "@typescript-eslint/visitor-keys": "8.24.1", + "@typescript-eslint/types": "8.25.0", + "@typescript-eslint/visitor-keys": "8.25.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1249,16 +1249,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.24.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.24.1.tgz", - "integrity": "sha512-OOcg3PMMQx9EXspId5iktsI3eMaXVwlhC8BvNnX6B5w9a4dVgpkQZuU8Hy67TolKcl+iFWq0XX+jbDGN4xWxjQ==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.25.0.tgz", + "integrity": "sha512-syqRbrEv0J1wywiLsK60XzHnQe/kRViI3zwFALrNEgnntn1l24Ra2KvOAWwWbWZ1lBZxZljPDGOq967dsl6fkA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.24.1", - "@typescript-eslint/types": "8.24.1", - "@typescript-eslint/typescript-estree": "8.24.1" + "@typescript-eslint/scope-manager": "8.25.0", + "@typescript-eslint/types": "8.25.0", + "@typescript-eslint/typescript-estree": "8.25.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1273,13 +1273,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.24.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.24.1.tgz", - "integrity": "sha512-EwVHlp5l+2vp8CoqJm9KikPZgi3gbdZAtabKT9KPShGeOcJhsv4Zdo3oc8T8I0uKEmYoU4ItyxbptjF08enaxg==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.25.0.tgz", + "integrity": "sha512-kCYXKAum9CecGVHGij7muybDfTS2sD3t0L4bJsEZLkyrXUImiCTq1M3LG2SRtOhiHFwMR9wAFplpT6XHYjTkwQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/types": "8.25.0", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -1311,14 +1311,14 @@ "license": "ISC" }, "node_modules/@vitest/expect": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.0.6.tgz", - "integrity": "sha512-zBduHf/ja7/QRX4HdP1DSq5XrPgdN+jzLOwaTq/0qZjYfgETNFCKf9nOAp2j3hmom3oTbczuUzrzg9Hafh7hNg==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.0.7.tgz", + "integrity": "sha512-QP25f+YJhzPfHrHfYHtvRn+uvkCFCqFtW9CktfBxmB+25QqWsx7VB2As6f4GmwllHLDhXNHvqedwhvMmSnNmjw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "3.0.6", - "@vitest/utils": "3.0.6", + "@vitest/spy": "3.0.7", + "@vitest/utils": "3.0.7", "chai": "^5.2.0", "tinyrainbow": "^2.0.0" }, @@ -1327,13 +1327,13 @@ } }, "node_modules/@vitest/mocker": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.0.6.tgz", - "integrity": "sha512-KPztr4/tn7qDGZfqlSPQoF2VgJcKxnDNhmfR3VgZ6Fy1bO8T9Fc1stUiTXtqz0yG24VpD00pZP5f8EOFknjNuQ==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.0.7.tgz", + "integrity": "sha512-qui+3BLz9Eonx4EAuR/i+QlCX6AUZ35taDQgwGkK/Tw6/WgwodSrjN1X2xf69IA/643ZX5zNKIn2svvtZDrs4w==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "3.0.6", + "@vitest/spy": "3.0.7", "estree-walker": "^3.0.3", "magic-string": "^0.30.17" }, @@ -1354,9 +1354,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.0.6.tgz", - "integrity": "sha512-Zyctv3dbNL+67qtHfRnUE/k8qxduOamRfAL1BurEIQSyOEFffoMvx2pnDSSbKAAVxY0Ej2J/GH2dQKI0W2JyVg==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.0.7.tgz", + "integrity": "sha512-CiRY0BViD/V8uwuEzz9Yapyao+M9M008/9oMOSQydwbwb+CMokEq3XVaF3XK/VWaOK0Jm9z7ENhybg70Gtxsmg==", "dev": true, "license": "MIT", "dependencies": { @@ -1367,13 +1367,13 @@ } }, "node_modules/@vitest/runner": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.0.6.tgz", - "integrity": "sha512-JopP4m/jGoaG1+CBqubV/5VMbi7L+NQCJTu1J1Pf6YaUbk7bZtaq5CX7p+8sY64Sjn1UQ1XJparHfcvTTdu9cA==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.0.7.tgz", + "integrity": "sha512-WeEl38Z0S2ZcuRTeyYqaZtm4e26tq6ZFqh5y8YD9YxfWuu0OFiGFUbnxNynwLjNRHPsXyee2M9tV7YxOTPZl2g==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "3.0.6", + "@vitest/utils": "3.0.7", "pathe": "^2.0.3" }, "funding": { @@ -1381,13 +1381,13 @@ } }, "node_modules/@vitest/snapshot": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.0.6.tgz", - "integrity": "sha512-qKSmxNQwT60kNwwJHMVwavvZsMGXWmngD023OHSgn873pV0lylK7dwBTfYP7e4URy5NiBCHHiQGA9DHkYkqRqg==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.0.7.tgz", + "integrity": "sha512-eqTUryJWQN0Rtf5yqCGTQWsCFOQe4eNz5Twsu21xYEcnFJtMU5XvmG0vgebhdLlrHQTSq5p8vWHJIeJQV8ovsA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "3.0.6", + "@vitest/pretty-format": "3.0.7", "magic-string": "^0.30.17", "pathe": "^2.0.3" }, @@ -1396,9 +1396,9 @@ } }, "node_modules/@vitest/spy": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.0.6.tgz", - "integrity": "sha512-HfOGx/bXtjy24fDlTOpgiAEJbRfFxoX3zIGagCqACkFKKZ/TTOE6gYMKXlqecvxEndKFuNHcHqP081ggZ2yM0Q==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.0.7.tgz", + "integrity": "sha512-4T4WcsibB0B6hrKdAZTM37ekuyFZt2cGbEGd2+L0P8ov15J1/HUsUaqkXEQPNAWr4BtPPe1gI+FYfMHhEKfR8w==", "dev": true, "license": "MIT", "dependencies": { @@ -1409,13 +1409,13 @@ } }, "node_modules/@vitest/utils": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.0.6.tgz", - "integrity": "sha512-18ktZpf4GQFTbf9jK543uspU03Q2qya7ZGya5yiZ0Gx0nnnalBvd5ZBislbl2EhLjM8A8rt4OilqKG7QwcGkvQ==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.0.7.tgz", + "integrity": "sha512-xePVpCRfooFX3rANQjwoditoXgWb1MaFbzmGuPP59MK6i13mrnDw/yEIyJudLeW6/38mCNcwCiJIGmpDPibAIg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "3.0.6", + "@vitest/pretty-format": "3.0.7", "loupe": "^3.1.3", "tinyrainbow": "^2.0.0" }, @@ -1658,9 +1658,9 @@ } }, "node_modules/axios": { - "version": "1.7.9", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", - "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.1.tgz", + "integrity": "sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -2299,9 +2299,9 @@ } }, "node_modules/esbuild": { - "version": "0.24.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.2.tgz", - "integrity": "sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz", + "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2312,31 +2312,31 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.24.2", - "@esbuild/android-arm": "0.24.2", - "@esbuild/android-arm64": "0.24.2", - "@esbuild/android-x64": "0.24.2", - "@esbuild/darwin-arm64": "0.24.2", - "@esbuild/darwin-x64": "0.24.2", - "@esbuild/freebsd-arm64": "0.24.2", - "@esbuild/freebsd-x64": "0.24.2", - "@esbuild/linux-arm": "0.24.2", - "@esbuild/linux-arm64": "0.24.2", - "@esbuild/linux-ia32": "0.24.2", - "@esbuild/linux-loong64": "0.24.2", - "@esbuild/linux-mips64el": "0.24.2", - "@esbuild/linux-ppc64": "0.24.2", - "@esbuild/linux-riscv64": "0.24.2", - "@esbuild/linux-s390x": "0.24.2", - "@esbuild/linux-x64": "0.24.2", - "@esbuild/netbsd-arm64": "0.24.2", - "@esbuild/netbsd-x64": "0.24.2", - "@esbuild/openbsd-arm64": "0.24.2", - "@esbuild/openbsd-x64": "0.24.2", - "@esbuild/sunos-x64": "0.24.2", - "@esbuild/win32-arm64": "0.24.2", - "@esbuild/win32-ia32": "0.24.2", - "@esbuild/win32-x64": "0.24.2" + "@esbuild/aix-ppc64": "0.25.0", + "@esbuild/android-arm": "0.25.0", + "@esbuild/android-arm64": "0.25.0", + "@esbuild/android-x64": "0.25.0", + "@esbuild/darwin-arm64": "0.25.0", + "@esbuild/darwin-x64": "0.25.0", + "@esbuild/freebsd-arm64": "0.25.0", + "@esbuild/freebsd-x64": "0.25.0", + "@esbuild/linux-arm": "0.25.0", + "@esbuild/linux-arm64": "0.25.0", + "@esbuild/linux-ia32": "0.25.0", + "@esbuild/linux-loong64": "0.25.0", + "@esbuild/linux-mips64el": "0.25.0", + "@esbuild/linux-ppc64": "0.25.0", + "@esbuild/linux-riscv64": "0.25.0", + "@esbuild/linux-s390x": "0.25.0", + "@esbuild/linux-x64": "0.25.0", + "@esbuild/netbsd-arm64": "0.25.0", + "@esbuild/netbsd-x64": "0.25.0", + "@esbuild/openbsd-arm64": "0.25.0", + "@esbuild/openbsd-x64": "0.25.0", + "@esbuild/sunos-x64": "0.25.0", + "@esbuild/win32-arm64": "0.25.0", + "@esbuild/win32-ia32": "0.25.0", + "@esbuild/win32-x64": "0.25.0" } }, "node_modules/escape-string-regexp": { @@ -2744,9 +2744,9 @@ } }, "node_modules/expect-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz", - "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.2.0.tgz", + "integrity": "sha512-80F22aiJ3GLyVnS/B3HzgR6RelZVumzj9jkL0Rhz4h0xYbNW9PjlQz5h3J/SShErbXBc295vseR4/MIbVmUbeA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -2805,9 +2805,9 @@ "license": "MIT" }, "node_modules/fastq": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.0.tgz", - "integrity": "sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "dev": true, "license": "ISC", "dependencies": { @@ -3002,17 +3002,17 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", - "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.1", + "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "get-proto": "^1.0.0", + "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", @@ -3995,9 +3995,9 @@ } }, "node_modules/micromark": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.1.tgz", - "integrity": "sha512-eBPdkcoCNvYcxQOAKAlceo5SNdzZWfF+FcSupREAzdAh9rRmE239CEQAiTwIgblwnoM8zzj35sZ5ZwvSEOF6Kw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", + "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", "dev": true, "funding": [ { @@ -4031,9 +4031,9 @@ } }, "node_modules/micromark-core-commonmark": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.2.tgz", - "integrity": "sha512-FKjQKbxd1cibWMM1P9N+H8TwlgGgSkWZMmfuVucLCHaYqeSvJ0hFeHsIa65pA2nYbes0f8LDHPMrd9X7Ujxg9w==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", + "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", "dev": true, "funding": [ { @@ -4401,9 +4401,9 @@ } }, "node_modules/micromark-util-subtokenize": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.4.tgz", - "integrity": "sha512-N6hXjrin2GTJDe3MVjf5FuXpm12PGm80BrUAeub9XFXca8JZbP+oIwY4LJSVwFUCL1IPm/WwSVUN7goFHmSGGQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", "dev": true, "funding": [ { @@ -4441,9 +4441,9 @@ "license": "MIT" }, "node_modules/micromark-util-types": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.1.tgz", - "integrity": "sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", "dev": true, "funding": [ { @@ -5093,9 +5093,9 @@ } }, "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, "license": "MIT", "engines": { @@ -5864,9 +5864,9 @@ } }, "node_modules/typedoc": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.8.tgz", - "integrity": "sha512-q0/2TUunNEDmWkn23ULKGXieK8cgGuAmBUXC/HcZ/rgzMI9Yr4Nq3in1K1vT1NZ9zx6M78yTk3kmIPbwJgK5KA==", + "version": "0.27.9", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.9.tgz", + "integrity": "sha512-/z585740YHURLl9DN2jCWe6OW7zKYm6VoQ93H0sxZ1cwHQEQrUn5BJrEnkWhfzUdyO+BLGjnKUZ9iz9hKloFDw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -5883,7 +5883,7 @@ "node": ">= 18" }, "peerDependencies": { - "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x" + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x" } }, "node_modules/typescript": { @@ -5958,14 +5958,14 @@ } }, "node_modules/vite": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.1.1.tgz", - "integrity": "sha512-4GgM54XrwRfrOp297aIYspIti66k56v16ZnqHvrIM7mG+HjDlAwS7p+Srr7J6fGvEdOJ5JcQ/D9T7HhtdXDTzA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.0.tgz", + "integrity": "sha512-7dPxoo+WsT/64rDcwoOjk76XHj+TqNTIvHKcuMQ1k4/SeHDaQt5GFAeLYzrimZrMpn/O6DtdI03WUjdxuPM0oQ==", "dev": true, "license": "MIT", "dependencies": { - "esbuild": "^0.24.2", - "postcss": "^8.5.2", + "esbuild": "^0.25.0", + "postcss": "^8.5.3", "rollup": "^4.30.1" }, "bin": { @@ -6030,9 +6030,9 @@ } }, "node_modules/vite-node": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.0.6.tgz", - "integrity": "sha512-s51RzrTkXKJrhNbUzQRsarjmAae7VmMPAsRT7lppVpIg6mK3zGthP9Hgz0YQQKuNcF+Ii7DfYk3Fxz40jRmePw==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.0.7.tgz", + "integrity": "sha512-2fX0QwX4GkkkpULXdT1Pf4q0tC1i1lFOyseKoonavXUNlQ77KpW2XqBGGNIm/J4Ows4KxgGJzDguYVPKwG/n5A==", "dev": true, "license": "MIT", "dependencies": { @@ -6073,19 +6073,19 @@ } }, "node_modules/vitest": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.0.6.tgz", - "integrity": "sha512-/iL1Sc5VeDZKPDe58oGK4HUFLhw6b5XdY1MYawjuSaDA4sEfYlY9HnS6aCEG26fX+MgUi7MwlduTBHHAI/OvMA==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.0.7.tgz", + "integrity": "sha512-IP7gPK3LS3Fvn44x30X1dM9vtawm0aesAa2yBIZ9vQf+qB69NXC5776+Qmcr7ohUXIQuLhk7xQR0aSUIDPqavg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/expect": "3.0.6", - "@vitest/mocker": "3.0.6", - "@vitest/pretty-format": "^3.0.6", - "@vitest/runner": "3.0.6", - "@vitest/snapshot": "3.0.6", - "@vitest/spy": "3.0.6", - "@vitest/utils": "3.0.6", + "@vitest/expect": "3.0.7", + "@vitest/mocker": "3.0.7", + "@vitest/pretty-format": "^3.0.7", + "@vitest/runner": "3.0.7", + "@vitest/snapshot": "3.0.7", + "@vitest/spy": "3.0.7", + "@vitest/utils": "3.0.7", "chai": "^5.2.0", "debug": "^4.4.0", "expect-type": "^1.1.0", @@ -6097,7 +6097,7 @@ "tinypool": "^1.0.2", "tinyrainbow": "^2.0.0", "vite": "^5.0.0 || ^6.0.0", - "vite-node": "3.0.6", + "vite-node": "3.0.7", "why-is-node-running": "^2.3.0" }, "bin": { @@ -6113,8 +6113,8 @@ "@edge-runtime/vm": "*", "@types/debug": "^4.1.12", "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "@vitest/browser": "3.0.6", - "@vitest/ui": "3.0.6", + "@vitest/browser": "3.0.7", + "@vitest/ui": "3.0.7", "happy-dom": "*", "jsdom": "*" }, diff --git a/package.json b/package.json index 7e583c3368..1033b93ce8 100644 --- a/package.json +++ b/package.json @@ -57,10 +57,10 @@ "code:formatting": "npm run replace:all && npm run prettier && npm run lint:fix" }, "devDependencies": { - "@types/node": "^18.19.76", + "@types/node": "^18.19.77", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.24.1", - "@typescript-eslint/parser": "^8.24.1", + "@typescript-eslint/eslint-plugin": "^8.25.0", + "@typescript-eslint/parser": "^8.25.0", "dotenv": "^16.4.7", "eslint": "^8.57.1", "eslint-config-airbnb-base": "^15.0.0", @@ -69,13 +69,13 @@ "prettier": "^3.5.2", "prettier-plugin-jsdoc": "^1.3.2", "sinon": "^18.0.1", - "typedoc": "^0.27.8", + "typedoc": "^0.27.9", "typescript": "^5.7.3", "vite-tsconfig-paths": "^5.1.4", - "vitest": "^3.0.6" + "vitest": "^3.0.7" }, "dependencies": { - "axios": "^1.7.9", + "axios": "^1.8.1", "formdata-node": "^6.0.3", "mime": "^4.0.6", "tslib": "^2.8.1" diff --git a/src/version2/dashboards.ts b/src/version2/dashboards.ts index 5bfafe4719..2aa8a89593 100644 --- a/src/version2/dashboards.ts +++ b/src/version2/dashboards.ts @@ -3,6 +3,7 @@ import * as Parameters from './parameters'; import { Client } from '../clients'; import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; +import { paramSerializer } from '../paramSerializer'; export class Dashboards { constructor(private client: Client) {} @@ -262,9 +263,9 @@ export class Dashboards { url: `/rest/api/2/dashboard/${dashboardId}/gadget`, method: 'GET', params: { - moduleKey: typeof parameters !== 'string' && parameters.moduleKey, + moduleKey: typeof parameters !== 'string' && paramSerializer('moduleKey', parameters.moduleKey), uri: typeof parameters !== 'string' && parameters.uri, - gadgetId: typeof parameters !== 'string' && parameters.gadgetId, + gadgetId: typeof parameters !== 'string' && paramSerializer('gadgetId', parameters.gadgetId), }, }; diff --git a/src/version2/issueFields.ts b/src/version2/issueFields.ts index b2ff7f09fb..6793140698 100644 --- a/src/version2/issueFields.ts +++ b/src/version2/issueFields.ts @@ -220,46 +220,6 @@ export class IssueFields { return this.client.sendRequest(config, callback); } - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * contexts a field is used in. Deprecated, use [ Get custom field - * contexts](#api-rest-api-2-field-fieldId-context-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 getContextsForFieldDeprecated( - parameters: Parameters.GetContextsForFieldDeprecated, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * contexts a field is used in. Deprecated, use [ Get custom field - * contexts](#api-rest-api-2-field-fieldId-context-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 getContextsForFieldDeprecated( - parameters: Parameters.GetContextsForFieldDeprecated, - callback?: never, - ): Promise; - async getContextsForFieldDeprecated( - parameters: Parameters.GetContextsForFieldDeprecated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/contexts`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - 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. diff --git a/src/version2/issues.ts b/src/version2/issues.ts index 7135994c59..d06fb26551 100644 --- a/src/version2/issues.ts +++ b/src/version2/issues.ts @@ -1275,7 +1275,7 @@ export class Issues { * * **Rate limiting:** Only a single request can be active at any given time. */ - async exportArchivedIssues( + async exportArchivedIssues( parameters: Parameters.ExportArchivedIssues, callback: Callback, ): Promise; @@ -1295,11 +1295,11 @@ export class Issues { * * **Rate limiting:** Only a single request can be active at any given time. */ - async exportArchivedIssues( + async exportArchivedIssues( parameters: Parameters.ExportArchivedIssues, callback?: never, ): Promise; - async exportArchivedIssues( + async exportArchivedIssues( parameters: Parameters.ExportArchivedIssues, callback?: Callback, ): Promise { diff --git a/src/version2/jqlFunctionsApps.ts b/src/version2/jqlFunctionsApps.ts index 7cb776da4e..3ee9334747 100644 --- a/src/version2/jqlFunctionsApps.ts +++ b/src/version2/jqlFunctionsApps.ts @@ -63,7 +63,7 @@ export class JqlFunctionsApps { * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updatePrecomputations( - parameters: Parameters.UpdatePrecomputations | undefined, + parameters: Parameters.UpdatePrecomputations, callback: Callback, ): Promise; /** @@ -75,19 +75,19 @@ export class JqlFunctionsApps { * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we * recommend adding it to your app's scope list because we will eventually make it mandatory. */ - async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; + async updatePrecomputations(parameters: Parameters.UpdatePrecomputations, callback?: never): Promise; async updatePrecomputations( - parameters?: Parameters.UpdatePrecomputations, + parameters: Parameters.UpdatePrecomputations, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/jql/function/computation', method: 'POST', params: { - skipNotFoundPrecomputations: parameters?.skipNotFoundPrecomputations, + skipNotFoundPrecomputations: parameters.skipNotFoundPrecomputations, }, data: { - values: parameters?.values, + values: parameters.values, }, }; @@ -105,7 +105,7 @@ export class JqlFunctionsApps { * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getPrecomputationsByID( - parameters: Parameters.GetPrecomputationsByID | undefined, + parameters: Parameters.GetPrecomputationsByID, callback: Callback, ): Promise; /** @@ -119,11 +119,11 @@ export class JqlFunctionsApps { * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getPrecomputationsByID( - parameters?: Parameters.GetPrecomputationsByID, + parameters: Parameters.GetPrecomputationsByID, callback?: never, ): Promise; async getPrecomputationsByID( - parameters?: Parameters.GetPrecomputationsByID, + parameters: Parameters.GetPrecomputationsByID, callback?: Callback, ): Promise { const config: RequestConfig = { diff --git a/src/version2/models/exportArchivedIssuesTaskProgressResponse.ts b/src/version2/models/exportArchivedIssuesTaskProgressResponse.ts deleted file mode 100644 index 527bbade2d..0000000000 --- a/src/version2/models/exportArchivedIssuesTaskProgressResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** The response for status request for a running/completed export task. */ -export interface ExportArchivedIssuesTaskProgressResponse { - fileUrl?: string; - payload?: string; - progress?: number; - status?: string; - submittedTime?: string; - taskId?: string; -} diff --git a/src/version2/models/index.ts b/src/version2/models/index.ts index 0687c0a5d9..6d72716459 100644 --- a/src/version2/models/index.ts +++ b/src/version2/models/index.ts @@ -143,7 +143,7 @@ export * from './errors'; export * from './evaluatedJiraExpression'; export * from './eventNotification'; export * from './exportArchivedIssuesTaskProgress'; -export * from './exportArchivedIssuesTaskProgressResponse'; +export * from './exportArchivedIssuesTaskProgress'; export * from './failedWebhook'; export * from './failedWebhooks'; export * from './field'; @@ -597,7 +597,7 @@ export * from './workflowSchemeAssociation'; export * from './workflowSchemeAssociations'; export * from './workflowSchemeIdName'; export * from './workflowSchemeProjectAssociation'; -export * from './workflowSchemeProjectUsageDTO'; +export * from './workflowSchemeProjectUsage'; export * from './workflowSchemeReadRequest'; export * from './workflowSchemeReadResponse'; export * from './workflowSchemeUpdateRequest'; diff --git a/src/version2/models/workflowSchemeProjectUsageDTO.ts b/src/version2/models/workflowSchemeProjectUsage.ts similarity index 79% rename from src/version2/models/workflowSchemeProjectUsageDTO.ts rename to src/version2/models/workflowSchemeProjectUsage.ts index bab88bd26f..525818ea3b 100644 --- a/src/version2/models/workflowSchemeProjectUsageDTO.ts +++ b/src/version2/models/workflowSchemeProjectUsage.ts @@ -1,7 +1,7 @@ import { ProjectUsagePage } from './projectUsagePage'; /** Projects using the workflow scheme. */ -export interface WorkflowSchemeProjectUsageDTO { +export interface WorkflowSchemeProjectUsage { projects?: ProjectUsagePage; /** The workflow scheme ID. */ workflowSchemeId?: string; diff --git a/src/version2/projectRoles.ts b/src/version2/projectRoles.ts index 4e0ca63ffc..dd987e8862 100644 --- a/src/version2/projectRoles.ts +++ b/src/version2/projectRoles.ts @@ -21,7 +21,7 @@ export class ProjectRoles { * _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( + async getProjectRoles>( parameters: Parameters.GetProjectRoles | string, callback: Callback, ): Promise; @@ -39,8 +39,8 @@ export class ProjectRoles { * _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( + async getProjectRoles>(parameters: Parameters.GetProjectRoles | string, callback?: never): Promise; + async getProjectRoles>( parameters: Parameters.GetProjectRoles | string, callback?: Callback, ): Promise { diff --git a/src/version2/workflowSchemes.ts b/src/version2/workflowSchemes.ts index 4857ecc6aa..5f337cc9b0 100644 --- a/src/version2/workflowSchemes.ts +++ b/src/version2/workflowSchemes.ts @@ -726,16 +726,16 @@ export class WorkflowSchemes { } /** Returns a page of projects using a given workflow scheme. */ - async getProjectUsagesForWorkflowScheme( + async getProjectUsagesForWorkflowScheme( parameters: Parameters.GetProjectUsagesForWorkflowScheme, callback: Callback, ): Promise; /** Returns a page of projects using a given workflow scheme. */ - async getProjectUsagesForWorkflowScheme( + async getProjectUsagesForWorkflowScheme( parameters: Parameters.GetProjectUsagesForWorkflowScheme, callback?: never, ): Promise; - async getProjectUsagesForWorkflowScheme( + async getProjectUsagesForWorkflowScheme( parameters: Parameters.GetProjectUsagesForWorkflowScheme, callback?: Callback, ): Promise { diff --git a/src/version3/jqlFunctionsApps.ts b/src/version3/jqlFunctionsApps.ts index 190583ed51..bad33be676 100644 --- a/src/version3/jqlFunctionsApps.ts +++ b/src/version3/jqlFunctionsApps.ts @@ -63,7 +63,7 @@ export class JqlFunctionsApps { * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updatePrecomputations( - parameters: Parameters.UpdatePrecomputations | undefined, + parameters: Parameters.UpdatePrecomputations, callback: Callback, ): Promise; /** @@ -75,19 +75,19 @@ export class JqlFunctionsApps { * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we * recommend adding it to your app's scope list because we will eventually make it mandatory. */ - async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; + async updatePrecomputations(parameters: Parameters.UpdatePrecomputations, callback?: never): Promise; async updatePrecomputations( - parameters?: Parameters.UpdatePrecomputations, + parameters: Parameters.UpdatePrecomputations, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/jql/function/computation', method: 'POST', params: { - skipNotFoundPrecomputations: parameters?.skipNotFoundPrecomputations, + skipNotFoundPrecomputations: parameters.skipNotFoundPrecomputations, }, data: { - values: parameters?.values, + values: parameters.values, }, }; @@ -105,7 +105,7 @@ export class JqlFunctionsApps { * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getPrecomputationsByID( - parameters: Parameters.GetPrecomputationsByID | undefined, + parameters: Parameters.GetPrecomputationsByID, callback: Callback, ): Promise; /** @@ -119,11 +119,11 @@ export class JqlFunctionsApps { * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getPrecomputationsByID( - parameters?: Parameters.GetPrecomputationsByID, + parameters: Parameters.GetPrecomputationsByID, callback?: never, ): Promise; async getPrecomputationsByID( - parameters?: Parameters.GetPrecomputationsByID, + parameters: Parameters.GetPrecomputationsByID, callback?: Callback, ): Promise { const config: RequestConfig = { From 5a6ab813f345de4849156eaf708bf49f8fff0f46 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sat, 1 Mar 2025 00:40:52 +0300 Subject: [PATCH 10/10] Incremental improvements --- src/version2/jqlFunctionsApps.ts | 4 ++-- src/version2/projectRoles.ts | 5 ++++- src/version3/jqlFunctionsApps.ts | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/version2/jqlFunctionsApps.ts b/src/version2/jqlFunctionsApps.ts index 3ee9334747..b2a7dcb30a 100644 --- a/src/version2/jqlFunctionsApps.ts +++ b/src/version2/jqlFunctionsApps.ts @@ -130,10 +130,10 @@ export class JqlFunctionsApps { url: '/rest/api/2/jql/function/computation/search', method: 'POST', params: { - orderBy: parameters?.orderBy, + orderBy: parameters.orderBy, }, data: { - precomputationIDs: parameters?.precomputationIDs, + precomputationIDs: parameters.precomputationIDs, }, }; diff --git a/src/version2/projectRoles.ts b/src/version2/projectRoles.ts index dd987e8862..c4df26d9a5 100644 --- a/src/version2/projectRoles.ts +++ b/src/version2/projectRoles.ts @@ -39,7 +39,10 @@ export class ProjectRoles { * _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?: never, + ): Promise; async getProjectRoles>( parameters: Parameters.GetProjectRoles | string, callback?: Callback, diff --git a/src/version3/jqlFunctionsApps.ts b/src/version3/jqlFunctionsApps.ts index bad33be676..02eeff1082 100644 --- a/src/version3/jqlFunctionsApps.ts +++ b/src/version3/jqlFunctionsApps.ts @@ -130,10 +130,10 @@ export class JqlFunctionsApps { url: '/rest/api/3/jql/function/computation/search', method: 'POST', params: { - orderBy: parameters?.orderBy, + orderBy: parameters.orderBy, }, data: { - precomputationIDs: parameters?.precomputationIDs, + precomputationIDs: parameters.precomputationIDs, }, };