From 7b45deb90b05c9e4949ee6e9907f25ef2c037bd2 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Sat, 23 Aug 2025 22:29:51 +0300 Subject: [PATCH] add zod schemas in version2 --- .github/workflows/ci.yaml | 3 - .github/workflows/publish-dev.yml | 1 - .github/workflows/publish.yml | 1 - package.json | 23 +- pnpm-lock.yaml | 592 +++---- src/version2/announcementBanner.ts | 47 +- src/version2/appDataPolicies.ts | 30 +- src/version2/appMigration.ts | 86 +- src/version2/appProperties.ts | 247 +-- src/version2/applicationRoles.ts | 60 +- src/version2/auditRecords.ts | 91 +- src/version2/avatars.ts | 351 ++-- src/version2/classificationLevels.ts | 36 +- src/version2/dashboards.ts | 734 +++------ src/version2/dynamicModules.ts | 87 +- src/version2/filterSharing.ts | 259 +-- src/version2/filters.ts | 681 +++----- src/version2/groupAndUserPicker.ts | 120 +- src/version2/groups.ts | 288 ++-- src/version2/index.ts | 99 -- src/version2/issueAttachments.ts | 710 ++++---- src/version2/issueCommentProperties.ts | 223 +-- src/version2/issueComments.ts | 352 ++-- src/version2/issueCustomFieldAssociations.ts | 138 +- .../issueCustomFieldConfigurationApps.ts | 184 +-- src/version2/issueCustomFieldContexts.ts | 791 +++------ src/version2/issueCustomFieldOptions.ts | 353 ++-- src/version2/issueCustomFieldOptionsApps.ts | 443 ++--- src/version2/issueCustomFieldValuesApps.ts | 107 +- src/version2/issueFieldConfigurations.ts | 648 +++----- src/version2/issueFields.ts | 318 ++-- src/version2/issueLinkTypes.ts | 201 +-- src/version2/issueLinks.ts | 186 +-- src/version2/issueNavigatorSettings.ts | 80 +- src/version2/issueNotificationSchemes.ts | 279 +--- src/version2/issuePriorities.ts | 274 +--- src/version2/issueProperties.ts | 617 +++---- src/version2/issueRedaction.ts | 43 + src/version2/issueRemoteLinks.ts | 387 ++--- src/version2/issueResolutions.ts | 254 +-- src/version2/issueSearch.ts | 453 +----- src/version2/issueSecurityLevel.ts | 100 +- src/version2/issueSecuritySchemes.ts | 579 ++----- src/version2/issueTypeProperties.ts | 182 +-- src/version2/issueTypeSchemes.ts | 427 ++--- src/version2/issueTypeScreenSchemes.ts | 406 ++--- src/version2/issueTypes.ts | 353 ++-- src/version2/issueVotes.ts | 183 +-- src/version2/issueWatchers.ts | 259 +-- src/version2/issueWorklogProperties.ts | 223 +-- src/version2/issueWorklogs.ts | 654 +++----- src/version2/issues.ts | 1443 +++++------------ src/version2/jQL.ts | 320 ++-- src/version2/jiraExpressions.ts | 381 +---- src/version2/jiraSettings.ts | 299 ++-- src/version2/jqlFunctionsApps.ts | 128 +- src/version2/labels.ts | 26 +- src/version2/licenseMetrics.ts | 73 +- src/version2/models/actorsMap.ts | 11 - .../models/addAtlassianTeamRequest.ts | 12 - src/version2/models/addField.ts | 4 - src/version2/models/addGroup.ts | 4 - .../models/addNotificationsDetails.ts | 7 - .../models/addSecuritySchemeLevelsRequest.ts | 6 - .../models/announcementBannerConfiguration.ts | 13 - .../announcementBannerConfigurationUpdate.ts | 11 - src/version2/models/application.ts | 12 - src/version2/models/applicationProperty.ts | 20 - src/version2/models/applicationRole.ts | 36 - ...ieldConfigurationsWithIssueTypesRequest.ts | 7 - src/version2/models/associatedItem.ts | 13 - .../models/associationContextObject.ts | 5 - src/version2/models/attachment.ts | 22 - src/version2/models/attachmentArchiveEntry.ts | 7 - src/version2/models/attachmentArchiveImpl.ts | 8 - .../models/attachmentArchiveItemReadable.ts | 13 - .../attachmentArchiveMetadataReadable.ts | 15 - src/version2/models/attachmentContent.ts | 4 - src/version2/models/attachmentMetadata.ts | 29 - src/version2/models/attachmentSettings.ts | 7 - src/version2/models/auditRecord.ts | 28 - src/version2/models/auditRecords.ts | 13 - src/version2/models/autoCompleteSuggestion.ts | 10 - .../models/autoCompleteSuggestions.ts | 7 - .../models/availableDashboardGadget.ts | 9 - .../availableDashboardGadgetsResponse.ts | 7 - .../models/availableWorkflowConnectRule.ts | 21 - .../models/availableWorkflowForgeRule.ts | 13 - .../models/availableWorkflowSystemRule.ts | 17 - .../models/availableWorkflowTriggerTypes.ts | 9 - .../models/availableWorkflowTriggers.ts | 9 - src/version2/models/avatar.ts | 22 - src/version2/models/avatarUrls.ts | 10 - src/version2/models/avatarWithDetails.ts | 6 - src/version2/models/avatars.ts | 9 - src/version2/models/boardColumnPayload.ts | 13 - src/version2/models/boardFeaturePayload.ts | 7 - src/version2/models/boardPayload.ts | 35 - src/version2/models/boardsPayload.ts | 6 - src/version2/models/bulkChangeOwnerDetails.ts | 7 - src/version2/models/bulkChangelog.ts | 12 - src/version2/models/bulkChangelogRequest.ts | 11 - .../models/bulkContextualConfiguration.ts | 13 - .../bulkCustomFieldOptionCreateRequest.ts | 7 - .../bulkCustomFieldOptionUpdateRequest.ts | 7 - .../models/bulkEditShareableEntity.ts | 7 - src/version2/models/bulkIssue.ts | 14 - src/version2/models/bulkIssueIsWatching.ts | 5 - .../models/bulkIssuePropertyUpdateRequest.ts | 19 - .../models/bulkOperationErrorResult.ts | 7 - src/version2/models/bulkPermissionGrants.ts | 9 - src/version2/models/bulkPermissionsRequest.ts | 11 - .../models/bulkProjectPermissionGrants.ts | 9 - src/version2/models/bulkProjectPermissions.ts | 9 - src/version2/models/cardLayout.ts | 5 - src/version2/models/cardLayoutField.ts | 7 - src/version2/models/changeDetails.ts | 17 - src/version2/models/changedValue.ts | 9 - src/version2/models/changedWorklog.ts | 11 - src/version2/models/changedWorklogs.ts | 16 - src/version2/models/changelog.ts | 15 - src/version2/models/columnItem.ts | 7 - src/version2/models/comment.ts | 40 - src/version2/models/component.ts | 8 - src/version2/models/componentIssuesCount.ts | 7 - .../models/componentWithIssueCount.ts | 51 - .../models/conditionGroupConfiguration.ts | 15 - src/version2/models/conditionGroupPayload.ts | 15 - src/version2/models/conditionGroupUpdate.ts | 15 - src/version2/models/configuration.ts | 27 - .../models/configurationsListParameters.ts | 5 - .../models/connectCustomFieldValue.ts | 22 - .../models/connectCustomFieldValues.ts | 7 - src/version2/models/connectModule.ts | 5 - src/version2/models/connectModules.ts | 9 - .../models/connectWorkflowTransitionRule.ts | 12 - .../models/containerForProjectFeatures.ts | 7 - .../models/containerForRegisteredWebhooks.ts | 7 - src/version2/models/containerForWebhookIDs.ts | 5 - .../containerOfWorkflowSchemeAssociations.ts | 7 - .../models/contextForProjectAndIssueType.ts | 9 - .../models/contextualConfiguration.ts | 11 - src/version2/models/convertedJQLQueries.ts | 9 - .../createCrossProjectReleaseRequest.ts | 6 - .../models/createCustomFieldContext.ts | 13 - .../models/createCustomFieldRequest.ts | 6 - src/version2/models/createDateFieldRequest.ts | 6 - .../models/createExclusionRulesRequest.ts | 14 - .../createIssueSecuritySchemeDetails.ts | 11 - .../models/createIssueSourceRequest.ts | 9 - .../models/createNotificationSchemeDetails.ts | 11 - .../models/createPermissionHolderRequest.ts | 9 - .../models/createPermissionRequest.ts | 7 - .../models/createPlanOnlyTeamRequest.ts | 14 - src/version2/models/createPlanRequest.ts | 23 - src/version2/models/createPriorityDetails.ts | 42 - .../models/createPrioritySchemeDetails.ts | 16 - src/version2/models/createProjectDetails.ts | 101 -- .../models/createResolutionDetails.ts | 7 - .../models/createSchedulingRequest.ts | 12 - .../models/createUiModificationDetails.ts | 13 - .../models/createUpdateRoleRequest.ts | 12 - .../models/createWorkflowCondition.ts | 11 - src/version2/models/createWorkflowDetails.ts | 29 - .../models/createWorkflowStatusDetails.ts | 7 - .../models/createWorkflowTransitionDetails.ts | 20 - .../models/createWorkflowTransitionRule.ts | 7 - .../createWorkflowTransitionRulesDetails.ts | 72 - .../createWorkflowTransitionScreenDetails.ts | 5 - src/version2/models/createdIssue.ts | 13 - src/version2/models/createdIssues.ts | 10 - src/version2/models/customContextVariable.ts | 4 - .../models/customFieldConfigurations.ts | 7 - src/version2/models/customFieldContext.ts | 13 - .../models/customFieldContextDefaultValue.ts | 1 - .../customFieldContextDefaultValueUpdate.ts | 6 - .../models/customFieldContextOption.ts | 11 - .../customFieldContextProjectMapping.ts | 9 - .../models/customFieldContextUpdateDetails.ts | 7 - .../customFieldCreatedContextOptionsList.ts | 7 - .../models/customFieldDefinitionJson.ts | 61 - src/version2/models/customFieldOption.ts | 7 - .../models/customFieldOptionCreate.ts | 9 - .../models/customFieldOptionUpdate.ts | 9 - src/version2/models/customFieldPayload.ts | 22 - src/version2/models/customFieldReplacement.ts | 7 - .../customFieldUpdatedContextOptionsList.ts | 7 - src/version2/models/customFieldValueUpdate.ts | 22 - .../models/customFieldValueUpdateDetails.ts | 7 - src/version2/models/customTemplateRequest.ts | 24 - .../models/customTemplatesProjectDetails.ts | 39 - src/version2/models/dashboard.ts | 32 - src/version2/models/dashboardDetails.ts | 13 - src/version2/models/dashboardGadget.ts | 16 - .../models/dashboardGadgetPosition.ts | 5 - .../models/dashboardGadgetResponse.ts | 7 - .../models/dashboardGadgetSettings.ts | 19 - .../models/dashboardGadgetUpdateRequest.ts | 10 - src/version2/models/dashboardUser.ts | 16 - .../models/dataClassificationLevels.ts | 7 - src/version2/models/dataClassificationTag.ts | 17 - src/version2/models/dateRangeFilter.ts | 7 - src/version2/models/defaultLevelValue.ts | 10 - src/version2/models/defaultShareScope.ts | 10 - src/version2/models/defaultWorkflow.ts | 10 - src/version2/models/documentVersion.ts | 7 - src/version2/models/duplicatePlanRequest.ts | 4 - src/version2/models/enhancedSearchRequest.ts | 99 -- src/version2/models/entityProperty.ts | 11 - src/version2/models/entityPropertyDetails.ts | 8 - src/version2/models/error.ts | 5 - src/version2/models/errorCollection.ts | 11 - src/version2/models/errors.ts | 8 - .../models/evaluatedJiraExpression.ts | 16 - src/version2/models/eventNotification.ts | 39 - .../exportArchivedIssuesTaskProgress.ts | 9 - src/version2/models/failedWebhook.ts | 11 - src/version2/models/failedWebhooks.ts | 18 - src/version2/models/field.ts | 28 - .../models/fieldAssociationsRequest.ts | 10 - src/version2/models/fieldCapabilityPayload.ts | 35 - src/version2/models/fieldConfiguration.ts | 11 - .../models/fieldConfigurationDetails.ts | 7 - .../models/fieldConfigurationIssueTypeItem.ts | 12 - src/version2/models/fieldConfigurationItem.ts | 13 - .../models/fieldConfigurationItemsDetails.ts | 7 - .../models/fieldConfigurationScheme.ts | 9 - ...ldConfigurationSchemeProjectAssociation.ts | 10 - .../fieldConfigurationSchemeProjects.ts | 8 - .../fieldConfigurationToIssueTypeMapping.ts | 10 - src/version2/models/fieldCreateMetadata.ts | 26 - src/version2/models/fieldDetails.ts | 27 - src/version2/models/fieldIdentifierObject.ts | 5 - src/version2/models/fieldLastUsed.ts | 12 - .../models/fieldLayoutConfiguration.ts | 13 - src/version2/models/fieldLayoutPayload.ts | 22 - .../models/fieldLayoutSchemePayload.ts | 21 - src/version2/models/fieldMetadata.ts | 25 - src/version2/models/fieldReferenceData.ts | 29 - src/version2/models/fields.ts | 97 -- src/version2/models/filter.ts | 46 - src/version2/models/filterDetails.ts | 53 - src/version2/models/filterSubscription.ts | 10 - .../models/filterSubscriptionsList.ts | 15 - src/version2/models/fixVersion.ts | 9 - src/version2/models/foundGroup.ts | 15 - src/version2/models/foundGroups.ts | 13 - src/version2/models/foundUsers.ts | 13 - src/version2/models/foundUsersAndGroups.ts | 8 - src/version2/models/fromLayoutPayload.ts | 10 - src/version2/models/functionReferenceData.ts | 11 - .../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/globalScope.ts | 8 - src/version2/models/group.ts | 16 - src/version2/models/groupDetails.ts | 10 - src/version2/models/groupLabel.ts | 9 - src/version2/models/groupName.ts | 12 - src/version2/models/hierarchy.ts | 7 - src/version2/models/hierarchyLevel.ts | 9 - src/version2/models/historyMetadata.ts | 24 - .../models/historyMetadataParticipant.ts | 15 - src/version2/models/icon.ts | 21 - src/version2/models/id.ts | 7 - src/version2/models/idOrKey.ts | 6 - src/version2/models/idSearchRequest.ts | 8 - src/version2/models/idSearchResults.ts | 10 - src/version2/models/includedFields.ts | 5 - src/version2/models/index.ts | 728 --------- src/version2/models/issue.ts | 35 - src/version2/models/issueArchivalSync.ts | 7 - src/version2/models/issueChangeLog.ts | 9 - src/version2/models/issueChangelogIds.ts | 5 - .../models/issueCommentListRequest.ts | 4 - src/version2/models/issueContextVariable.ts | 8 - src/version2/models/issueCreateMetadata.ts | 9 - src/version2/models/issueEntityProperties.ts | 10 - .../issueEntityPropertiesForMultiUpdate.ts | 10 - src/version2/models/issueError.ts | 7 - src/version2/models/issueEvent.ts | 7 - src/version2/models/issueFieldOption.ts | 18 - .../models/issueFieldOptionConfiguration.ts | 6 - src/version2/models/issueFieldOptionCreate.ts | 13 - src/version2/models/issueFieldOptionScope.ts | 12 - .../issueFilterForBulkPropertyDelete.ts | 8 - .../models/issueFilterForBulkPropertySet.ts | 10 - src/version2/models/issueLayoutItemPayload.ts | 10 - src/version2/models/issueLayoutPayload.ts | 12 - src/version2/models/issueLimitReport.ts | 8 - .../models/issueLimitReportRequest.ts | 9 - src/version2/models/issueLink.ts | 13 - src/version2/models/issueLinkType.ts | 43 - src/version2/models/issueLinkTypes.ts | 7 - src/version2/models/issueList.ts | 5 - src/version2/models/issueMatches.ts | 6 - src/version2/models/issueMatchesForJQL.ts | 7 - src/version2/models/issuePickerSuggestions.ts | 7 - .../models/issuePickerSuggestionsIssueType.ts | 15 - .../models/issueSecurityLevelMember.ts | 10 - .../issueSecuritySchemeToProjectMapping.ts | 5 - src/version2/models/issueTransition.ts | 31 - src/version2/models/issueTypeCreate.ts | 14 - src/version2/models/issueTypeDetails.ts | 24 - .../models/issueTypeHierarchyPayload.ts | 15 - src/version2/models/issueTypeIds.ts | 5 - src/version2/models/issueTypeIdsToRemove.ts | 8 - src/version2/models/issueTypeInfo.ts | 9 - .../models/issueTypeIssueCreateMetadata.ts | 28 - src/version2/models/issueTypePayload.ts | 23 - .../models/issueTypeProjectCreatePayload.ts | 18 - src/version2/models/issueTypeScheme.ts | 13 - src/version2/models/issueTypeSchemeDetails.ts | 11 - src/version2/models/issueTypeSchemeID.ts | 5 - src/version2/models/issueTypeSchemeMapping.ts | 7 - src/version2/models/issueTypeSchemePayload.ts | 13 - .../issueTypeSchemeProjectAssociation.ts | 7 - .../models/issueTypeSchemeProjects.ts | 8 - .../models/issueTypeSchemeUpdateDetails.ts | 9 - src/version2/models/issueTypeScreenScheme.ts | 9 - .../models/issueTypeScreenSchemeDetails.ts | 14 - .../models/issueTypeScreenSchemeId.ts | 5 - .../models/issueTypeScreenSchemeItem.ts | 13 - .../models/issueTypeScreenSchemeMapping.ts | 10 - .../issueTypeScreenSchemeMappingDetails.ts | 10 - .../models/issueTypeScreenSchemePayload.ts | 19 - ...issueTypeScreenSchemeProjectAssociation.ts | 7 - .../issueTypeScreenSchemeUpdateDetails.ts | 7 - .../models/issueTypeScreenSchemesProjects.ts | 8 - .../models/issueTypeToContextMapping.ts | 9 - src/version2/models/issueTypeUpdate.ts | 8 - src/version2/models/issueTypeWithStatus.ts | 15 - .../models/issueTypeWorkflowMapping.ts | 13 - .../models/issueTypesWorkflowMapping.ts | 14 - src/version2/models/issueUpdateDetails.ts | 24 - src/version2/models/issueUpdateMetadata.ts | 7 - src/version2/models/issuesAndJQLQueries.ts | 7 - src/version2/models/issuesJqlMetaData.ts | 13 - src/version2/models/issuesMeta.ts | 6 - src/version2/models/issuesUpdate.ts | 5 - .../models/jExpEvaluateIssuesJqlMetaData.ts | 5 - src/version2/models/jExpEvaluateIssuesMeta.ts | 10 - src/version2/models/jExpEvaluateMetaData.ts | 15 - src/version2/models/jQLCount.ts | 4 - src/version2/models/jQLCountRequest.ts | 7 - .../models/jQLPersonalDataMigrationRequest.ts | 5 - .../models/jQLQueryWithUnknownUsers.ts | 7 - src/version2/models/jQLReferenceData.ts | 12 - src/version2/models/jexpEvaluateCtxIssues.ts | 6 - .../models/jexpEvaluateCtxJqlIssues.ts | 15 - src/version2/models/jexpIssues.ts | 6 - src/version2/models/jexpJqlIssues.ts | 19 - src/version2/models/jiraExpressionAnalysis.ts | 18 - .../models/jiraExpressionComplexity.ts | 15 - .../models/jiraExpressionEvalContext.ts | 32 - .../models/jiraExpressionEvalRequest.ts | 7 - ...xpressionEvalUsingEnhancedSearchRequest.ts | 8 - .../models/jiraExpressionEvaluateContext.ts | 33 - .../jiraExpressionEvaluationMetaData.ts | 7 - .../models/jiraExpressionForAnalysis.ts | 12 - src/version2/models/jiraExpressionResult.ts | 14 - .../models/jiraExpressionValidationError.ts | 18 - .../models/jiraExpressionsAnalysis.ts | 7 - .../models/jiraExpressionsComplexity.ts | 8 - .../models/jiraExpressionsComplexityValue.ts | 6 - src/version2/models/jiraStatus.ts | 17 - src/version2/models/jiraWorkflow.ts | 32 - src/version2/models/jiraWorkflowStatus.ts | 22 - .../models/jqlFunctionPrecomputation.ts | 13 - ...jqlFunctionPrecomputationGetByIdRequest.ts | 4 - ...qlFunctionPrecomputationGetByIdResponse.ts | 9 - .../models/jqlFunctionPrecomputationUpdate.ts | 5 - .../jqlFunctionPrecomputationUpdateRequest.ts | 6 - src/version2/models/jqlQueriesToParse.ts | 5 - src/version2/models/jqlQueriesToSanitize.ts | 7 - src/version2/models/jqlQuery.ts | 8 - src/version2/models/jqlQueryClause.ts | 2 - src/version2/models/jqlQueryField.ts | 14 - .../models/jqlQueryFieldEntityProperty.ts | 15 - src/version2/models/jqlQueryOrderByClause.ts | 7 - .../models/jqlQueryOrderByClauseElement.ts | 8 - src/version2/models/jqlQueryToSanitize.ts | 13 - src/version2/models/jsonContextVariable.ts | 7 - src/version2/models/jsonNode.ts | 38 - src/version2/models/jsonType.ts | 15 - src/version2/models/license.ts | 7 - src/version2/models/licenseMetric.ts | 7 - src/version2/models/licensedApplication.ts | 7 - src/version2/models/linkGroup.ts | 11 - src/version2/models/linkIssueRequestJson.ts | 10 - src/version2/models/linkedIssue.ts | 12 - .../listWrapperCallbackApplicationRole.ts | 1 - .../models/listWrapperCallbackGroupName.ts | 1 - src/version2/models/locale.ts | 9 - .../models/mappingsByIssueTypeOverride.ts | 13 - src/version2/models/mappingsByWorkflow.ts | 15 - src/version2/models/moveField.ts | 9 - .../models/multiIssueEntityProperties.ts | 10 - .../models/multipleCustomFieldValuesUpdate.ts | 22 - .../multipleCustomFieldValuesUpdateDetails.ts | 6 - src/version2/models/nestedResponse.ts | 8 - src/version2/models/newUserDetails.ts | 30 - src/version2/models/nonWorkingDay.ts | 4 - src/version2/models/notification.ts | 17 - src/version2/models/notificationEvent.ts | 14 - src/version2/models/notificationRecipients.ts | 20 - .../notificationRecipientsRestrictions.ts | 12 - src/version2/models/notificationScheme.ts | 20 - .../notificationSchemeAndProjectMapping.ts | 4 - ...notificationSchemeAndProjectMappingPage.ts | 19 - .../models/notificationSchemeEvent.ts | 8 - .../models/notificationSchemeEventDetails.ts | 9 - .../notificationSchemeEventIDPayload.ts | 5 - .../models/notificationSchemeEventPayload.ts | 9 - .../models/notificationSchemeEventTypeId.ts | 5 - src/version2/models/notificationSchemeId.ts | 5 - .../notificationSchemeNotificationDetails.ts | 7 - ...icationSchemeNotificationDetailsPayload.ts | 7 - .../models/notificationSchemePayload.ts | 18 - .../models/oldToNewSecurityLevelMappings.ts | 6 - src/version2/models/operationMessage.ts | 6 - src/version2/models/operations.ts | 7 - .../models/orderOfCustomFieldOptions.ts | 15 - src/version2/models/orderOfIssueTypes.ts | 12 - .../models/pageBulkContextualConfiguration.ts | 19 - src/version2/models/pageChangelog.ts | 19 - src/version2/models/pageComment.ts | 19 - .../models/pageComponentWithIssueCount.ts | 19 - .../pageContextForProjectAndIssueType.ts | 19 - .../models/pageContextualConfiguration.ts | 19 - src/version2/models/pageCustomFieldContext.ts | 19 - .../pageCustomFieldContextDefaultValue.ts | 19 - .../models/pageCustomFieldContextOption.ts | 19 - .../pageCustomFieldContextProjectMapping.ts | 19 - src/version2/models/pageDashboard.ts | 19 - src/version2/models/pageField.ts | 19 - src/version2/models/pageFieldConfiguration.ts | 19 - .../pageFieldConfigurationIssueTypeItem.ts | 19 - .../models/pageFieldConfigurationItem.ts | 19 - .../models/pageFieldConfigurationScheme.ts | 19 - .../pageFieldConfigurationSchemeProjects.ts | 19 - src/version2/models/pageFilterDetails.ts | 19 - src/version2/models/pageGroupDetails.ts | 19 - src/version2/models/pageIssueFieldOption.ts | 19 - .../models/pageIssueSecurityLevelMember.ts | 19 - ...pageIssueSecuritySchemeToProjectMapping.ts | 19 - src/version2/models/pageIssueTypeScheme.ts | 19 - .../models/pageIssueTypeSchemeMapping.ts | 19 - .../models/pageIssueTypeSchemeProjects.ts | 19 - .../models/pageIssueTypeScreenScheme.ts | 19 - .../models/pageIssueTypeScreenSchemeItem.ts | 19 - .../pageIssueTypeScreenSchemesProjects.ts | 19 - .../models/pageIssueTypeToContextMapping.ts | 19 - .../models/pageJqlFunctionPrecomputation.ts | 19 - src/version2/models/pageNotificationScheme.ts | 19 - src/version2/models/pageOfChangelogs.ts | 13 - src/version2/models/pageOfComments.ts | 13 - .../pageOfCreateMetaIssueTypeWithField.ts | 14 - .../models/pageOfCreateMetaIssueTypes.ts | 14 - src/version2/models/pageOfDashboards.ts | 17 - src/version2/models/pageOfStatuses.ts | 18 - src/version2/models/pageOfWorklogs.ts | 13 - src/version2/models/pagePriority.ts | 19 - src/version2/models/pageProject.ts | 19 - src/version2/models/pageProjectDetails.ts | 19 - src/version2/models/pageResolution.ts | 19 - src/version2/models/pageScreen.ts | 19 - src/version2/models/pageScreenScheme.ts | 19 - src/version2/models/pageScreenWithTab.ts | 19 - src/version2/models/pageSecurityLevel.ts | 19 - .../models/pageSecurityLevelMember.ts | 19 - .../models/pageSecuritySchemeWithProjects.ts | 19 - src/version2/models/pageString.ts | 17 - .../models/pageUiModificationDetails.ts | 19 - src/version2/models/pageUser.ts | 19 - src/version2/models/pageUserDetails.ts | 19 - src/version2/models/pageUserKey.ts | 19 - src/version2/models/pageVersion.ts | 19 - src/version2/models/pageWebhook.ts | 19 - .../pageWithCursorGetPlanResponseForPage.ts | 10 - .../pageWithCursorGetTeamResponseForPage.ts | 10 - src/version2/models/pageWorkflow.ts | 19 - src/version2/models/pageWorkflowScheme.ts | 19 - .../models/pageWorkflowTransitionRules.ts | 19 - .../pagedListUserDetailsApplicationUser.ts | 18 - src/version2/models/parsedJqlQueries.ts | 7 - src/version2/models/parsedJqlQuery.ts | 10 - src/version2/models/permissionDetails.ts | 9 - src/version2/models/permissionGrant.ts | 19 - src/version2/models/permissionGrantDTO.ts | 13 - src/version2/models/permissionGrants.ts | 9 - src/version2/models/permissionHolder.ts | 17 - src/version2/models/permissionPayload.ts | 21 - src/version2/models/permissionScheme.ts | 22 - src/version2/models/permissionSchemes.ts | 7 - src/version2/models/permissions.ts | 5 - src/version2/models/permissionsKeys.ts | 4 - src/version2/models/permittedProjects.ts | 7 - src/version2/models/plan.ts | 29 - src/version2/models/priority.ts | 17 - src/version2/models/priorityId.ts | 5 - src/version2/models/priorityMapping.ts | 18 - .../prioritySchemeChangesWithoutMappings.ts | 4 - src/version2/models/prioritySchemeId.ts | 8 - ...chemeWithPaginatedPrioritiesAndProjects.ts | 21 - src/version2/models/priorityWithSequence.ts | 19 - src/version2/models/project.ts | 80 - .../models/projectAndIssueTypePair.ts | 7 - src/version2/models/projectAvatars.ts | 9 - src/version2/models/projectCategory.ts | 11 - src/version2/models/projectComponent.ts | 70 - .../models/projectCreateResourceIdentifier.ts | 17 - .../projectCustomTemplateCreateRequest.ts | 8 - src/version2/models/projectDataPolicies.ts | 7 - src/version2/models/projectDataPolicy.ts | 5 - src/version2/models/projectDetails.ts | 24 - src/version2/models/projectEmailAddress.ts | 7 - src/version2/models/projectFeature.ts | 22 - .../models/projectFeatureToggleRequest.ts | 5 - src/version2/models/projectId.ts | 5 - src/version2/models/projectIdentifier.ts | 7 - src/version2/models/projectIdentifiers.ts | 9 - src/version2/models/projectIds.ts | 5 - src/version2/models/projectInsight.ts | 7 - .../models/projectIssueCreateMetadata.ts | 19 - .../models/projectIssueSecurityLevels.ts | 7 - .../models/projectIssueTypeHierarchy.ts | 9 - .../models/projectIssueTypeMapping.ts | 7 - .../models/projectIssueTypeMappings.ts | 7 - src/version2/models/projectIssueTypes.ts | 8 - .../models/projectIssueTypesHierarchyLevel.ts | 11 - src/version2/models/projectLandingPageInfo.ts | 13 - src/version2/models/projectPayload.ts | 20 - src/version2/models/projectPermissions.ts | 5 - src/version2/models/projectRole.ts | 27 - .../models/projectRoleActorsUpdate.ts | 21 - src/version2/models/projectRoleDetails.ts | 22 - src/version2/models/projectRoleGroup.ts | 9 - src/version2/models/projectRoleUser.ts | 9 - src/version2/models/projectScope.ts | 10 - src/version2/models/projectType.ts | 13 - src/version2/models/projectUsage.ts | 5 - src/version2/models/projectUsagePage.ts | 9 - src/version2/models/projectWithDataPolicy.ts | 8 - src/version2/models/propertyKey.ts | 7 - src/version2/models/propertyKeys.ts | 7 - src/version2/models/publishedWorkflowId.ts | 7 - src/version2/models/quickFilterPayload.ts | 9 - src/version2/models/registeredWebhook.ts | 7 - src/version2/models/remoteIssueLink.ts | 16 - .../models/remoteIssueLinkIdentifies.ts | 7 - src/version2/models/remoteIssueLinkRequest.ts | 23 - src/version2/models/remoteObject.ts | 14 - .../models/removeOptionFromIssuesResult.ts | 9 - src/version2/models/reorderIssuePriorities.ts | 9 - .../models/reorderIssueResolutionsRequest.ts | 9 - .../models/requiredMappingByIssueType.ts | 7 - .../models/requiredMappingByWorkflows.ts | 9 - src/version2/models/resolution.ts | 13 - src/version2/models/resolutionId.ts | 5 - src/version2/models/restrictedPermission.ts | 13 - src/version2/models/richText.ts | 6 - src/version2/models/roleActor.ts | 25 - src/version2/models/rolePayload.ts | 22 - src/version2/models/rolesCapabilityPayload.ts | 8 - src/version2/models/ruleConfiguration.ts | 12 - src/version2/models/rulePayload.ts | 10 - src/version2/models/sanitizedJqlQueries.ts | 7 - src/version2/models/sanitizedJqlQuery.ts | 12 - src/version2/models/scope.ts | 11 - src/version2/models/scopePayload.ts | 5 - src/version2/models/screen.ts | 12 - src/version2/models/screenDetails.ts | 7 - src/version2/models/screenPayload.ts | 19 - src/version2/models/screenScheme.ts | 14 - src/version2/models/screenSchemeDetails.ts | 10 - src/version2/models/screenSchemeId.ts | 5 - src/version2/models/screenSchemePayload.ts | 21 - src/version2/models/screenTypes.ts | 11 - src/version2/models/screenWithTab.ts | 14 - src/version2/models/screenableField.ts | 7 - src/version2/models/screenableTab.ts | 7 - .../models/searchAndReconcileResults.ts | 16 - src/version2/models/searchAutoComplete.ts | 6 - src/version2/models/searchRequest.ts | 80 - src/version2/models/searchResults.ts | 21 - src/version2/models/securityLevel.ts | 15 - src/version2/models/securityLevelMember.ts | 12 - .../models/securityLevelMemberPayload.ts | 14 - src/version2/models/securityLevelPayload.ts | 16 - src/version2/models/securityScheme.ts | 16 - src/version2/models/securitySchemeId.ts | 5 - src/version2/models/securitySchemeLevel.ts | 12 - .../models/securitySchemeLevelMember.ts | 6 - .../models/securitySchemeMembersRequest.ts | 7 - src/version2/models/securitySchemePayload.ts | 16 - .../models/securitySchemeWithProjects.ts | 15 - src/version2/models/securitySchemes.ts | 7 - src/version2/models/serverInformation.ts | 21 - src/version2/models/serviceRegistry.ts | 15 - src/version2/models/serviceRegistryTier.ts | 12 - .../models/setDefaultLevelsRequest.ts | 7 - .../models/setDefaultPriorityRequest.ts | 8 - .../models/setDefaultResolutionRequest.ts | 8 - src/version2/models/sharePermission.ts | 28 - src/version2/models/sharePermissionInput.ts | 36 - .../models/simpleApplicationProperty.ts | 6 - src/version2/models/simpleErrorCollection.ts | 10 - src/version2/models/simpleLink.ts | 10 - .../simpleListWrapperApplicationRole.ts | 10 - .../models/simpleListWrapperGroupName.ts | 10 - src/version2/models/simpleUsage.ts | 7 - src/version2/models/status.ts | 11 - src/version2/models/statusCategory.ts | 13 - src/version2/models/statusCreate.ts | 9 - src/version2/models/statusCreateRequest.ts | 9 - src/version2/models/statusDetails.ts | 16 - src/version2/models/statusLayoutUpdate.ts | 10 - src/version2/models/statusMapping.ts | 9 - src/version2/models/statusMappingDTO.ts | 11 - src/version2/models/statusMetadata.ts | 9 - src/version2/models/statusMigration.ts | 7 - src/version2/models/statusPayload.ts | 17 - .../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/statusReferenceAndPort.ts | 7 - src/version2/models/statusScope.ts | 8 - src/version2/models/statusUpdate.ts | 11 - src/version2/models/statusUpdateRequest.ts | 7 - src/version2/models/statusWorkflowUsageDTO.ts | 8 - .../models/statusWorkflowUsagePage.ts | 9 - .../models/statusWorkflowUsageWorkflow.ts | 5 - src/version2/models/statusesPerWorkflow.ts | 9 - src/version2/models/suggestedIssue.ts | 15 - ...ggestedMappingsForPrioritiesRequestBean.ts | 7 - ...suggestedMappingsForProjectsRequestBean.ts | 5 - .../models/suggestedMappingsRequest.ts | 14 - src/version2/models/swimlanesPayload.ts | 22 - src/version2/models/systemAvatars.ts | 7 - src/version2/models/tabMetadata.ts | 9 - src/version2/models/tabPayload.ts | 15 - src/version2/models/taskProgressNode.ts | 30 - src/version2/models/taskProgressObject.ts | 30 - ...askProgressRemoveOptionFromIssuesResult.ts | 30 - .../models/timeTrackingConfiguration.ts | 11 - src/version2/models/timeTrackingDetails.ts | 15 - src/version2/models/timeTrackingProvider.ts | 13 - src/version2/models/toLayoutPayload.ts | 8 - src/version2/models/transition.ts | 22 - src/version2/models/transitionPayload.ts | 34 - .../models/transitionScreenDetails.ts | 7 - src/version2/models/transitionUpdateDTO.ts | 31 - src/version2/models/transitions.ts | 9 - .../models/uiModificationContextDetails.ts | 13 - src/version2/models/uiModificationDetails.ts | 17 - .../models/uiModificationIdentifiers.ts | 7 - src/version2/models/unrestrictedUserEmail.ts | 6 - .../models/updateCustomFieldDetails.ts | 20 - .../updateDefaultProjectClassification.ts | 5 - .../updateFieldConfigurationSchemeDetails.ts | 7 - .../models/updateIssueSecurityLevelDetails.ts | 7 - .../updateIssueSecuritySchemeRequest.ts | 6 - .../models/updateNotificationSchemeDetails.ts | 7 - .../models/updatePrioritiesInSchemeRequest.ts | 7 - src/version2/models/updatePriorityDetails.ts | 39 - .../models/updatePrioritySchemeRequest.ts | 16 - .../models/updatePrioritySchemeResponse.ts | 8 - src/version2/models/updateProjectDetails.ts | 47 - .../models/updateProjectsInSchemeRequest.ts | 7 - .../models/updateResolutionDetails.ts | 7 - src/version2/models/updateScreenDetails.ts | 7 - .../models/updateScreenSchemeDetails.ts | 10 - src/version2/models/updateScreenTypes.ts | 11 - .../models/updateUiModificationDetails.ts | 16 - src/version2/models/updateUserToGroup.ts | 13 - src/version2/models/updatedProjectCategory.ts | 11 - src/version2/models/user.ts | 62 - src/version2/models/userAvatarUrls.ts | 10 - src/version2/models/userContextVariable.ts | 6 - src/version2/models/userDetails.ts | 51 - src/version2/models/userKey.ts | 15 - src/version2/models/userList.ts | 18 - src/version2/models/userMigration.ts | 5 - src/version2/models/userNavProperty.ts | 4 - src/version2/models/userPickerUser.ts | 29 - .../models/validationOptionsForCreate.ts | 7 - .../models/validationOptionsForUpdate.ts | 7 - src/version2/models/version.ts | 76 - src/version2/models/versionApprover.ts | 11 - src/version2/models/versionIssueCounts.ts | 15 - src/version2/models/versionIssuesStatus.ts | 11 - src/version2/models/versionMove.ts | 6 - src/version2/models/versionRelatedWork.ts | 16 - .../models/versionUnresolvedIssuesCount.ts | 9 - .../models/versionUsageInCustomField.ts | 9 - src/version2/models/visibility.ts | 12 - src/version2/models/votes.ts | 16 - src/version2/models/warningCollection.ts | 3 - src/version2/models/watchers.ts | 13 - src/version2/models/webhook.ts | 26 - src/version2/models/webhookDetails.ts | 25 - .../models/webhookRegistrationDetails.ts | 12 - src/version2/models/webhooksExpirationDate.ts | 5 - src/version2/models/workflow.ts | 30 - .../workflowAssociationStatusMapping.ts | 7 - src/version2/models/workflowCapabilities.ts | 22 - .../models/workflowCapabilityPayload.ts | 15 - src/version2/models/workflowCondition.ts | 2 - src/version2/models/workflowCreate.ts | 16 - src/version2/models/workflowCreateRequest.ts | 12 - .../models/workflowElementReference.ts | 14 - src/version2/models/workflowId.ts | 7 - src/version2/models/workflowLayout.ts | 7 - .../workflowMetadataAndIssueTypeRestModel.ts | 8 - .../models/workflowMetadataRestModel.ts | 20 - src/version2/models/workflowOperations.ts | 7 - src/version2/models/workflowPayload.ts | 24 - .../models/workflowProjectIssueTypeUsage.ts | 5 - .../workflowProjectIssueTypeUsageDTO.ts | 10 - .../workflowProjectIssueTypeUsagePage.ts | 9 - .../models/workflowProjectUsageDTO.ts | 8 - src/version2/models/workflowRead.ts | 10 - .../models/workflowReferenceStatus.ts | 12 - .../models/workflowRuleConfiguration.ts | 9 - src/version2/models/workflowRules.ts | 11 - src/version2/models/workflowRulesSearch.ts | 12 - .../models/workflowRulesSearchDetails.ts | 11 - src/version2/models/workflowScheme.ts | 61 - .../models/workflowSchemeAssociation.ts | 7 - .../models/workflowSchemeAssociations.ts | 8 - src/version2/models/workflowSchemeIdName.ts | 7 - src/version2/models/workflowSchemePayload.ts | 16 - .../workflowSchemeProjectAssociation.ts | 10 - .../models/workflowSchemeProjectUsage.ts | 8 - .../models/workflowSchemeReadRequest.ts | 7 - .../models/workflowSchemeReadResponse.ts | 27 - .../models/workflowSchemeUpdateRequest.ts | 35 - ...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/workflowScope.ts | 8 - src/version2/models/workflowSearchResponse.ts | 22 - src/version2/models/workflowStatus.ts | 14 - src/version2/models/workflowStatusAndPort.ts | 7 - src/version2/models/workflowStatusLayout.ts | 7 - .../models/workflowStatusLayoutPayload.ts | 7 - src/version2/models/workflowStatusPayload.ts | 10 - .../models/workflowStatusProperties.ts | 5 - src/version2/models/workflowStatusUpdate.ts | 13 - src/version2/models/workflowTransition.ts | 7 - .../models/workflowTransitionProperty.ts | 9 - src/version2/models/workflowTransitionRule.ts | 8 - .../models/workflowTransitionRules.ts | 13 - .../models/workflowTransitionRulesDetails.ts | 8 - .../models/workflowTransitionRulesUpdate.ts | 7 - ...rkflowTransitionRulesUpdateErrorDetails.ts | 16 - .../workflowTransitionRulesUpdateErrors.ts | 7 - src/version2/models/workflowTransitions.ts | 31 - src/version2/models/workflowTrigger.ts | 9 - src/version2/models/workflowUpdate.ts | 24 - src/version2/models/workflowUpdateRequest.ts | 10 - .../models/workflowValidationError.ts | 14 - .../models/workflowValidationErrorList.ts | 6 - .../workflowsWithTransitionRulesDetails.ts | 7 - src/version2/models/workingDaysConfig.ts | 15 - src/version2/models/worklog.ts | 40 - src/version2/models/worklogIdsRequest.ts | 4 - src/version2/models/worklogsMoveRequest.ts | 6 - src/version2/models/workspaceDataPolicy.ts | 5 - src/version2/myself.ts | 314 ++-- src/version2/parameters/addActorUsers.ts | 11 - .../parameters/addActorUsersParameters.ts | 22 + src/version2/parameters/addAtlassianTeam.ts | 6 - .../parameters/addAtlassianTeamParameters.ts | 18 + src/version2/parameters/addAttachment.ts | 103 -- .../parameters/addAttachmentParameters.ts | 8 + src/version2/parameters/addComment.ts | 12 - .../parameters/addCommentParameters.ts | 51 + .../parameters/addFieldToDefaultScreen.ts | 4 - .../addFieldToDefaultScreenParameters.ts | 8 + src/version2/parameters/addGadget.ts | 6 - .../parameters/addGadgetParameters.ts | 26 + .../parameters/addIssueTypesToContext.ts | 8 - .../addIssueTypesToContextParameters.ts | 12 + .../addIssueTypesToIssueTypeScheme.ts | 6 - ...ddIssueTypesToIssueTypeSchemeParameters.ts | 10 + src/version2/parameters/addNotifications.ts | 6 - .../parameters/addNotificationsParameters.ts | 11 + .../parameters/addProjectRoleActorsToRole.ts | 9 - .../addProjectRoleActorsToRoleParameters.ts | 28 + src/version2/parameters/addScreenTab.ts | 6 - src/version2/parameters/addScreenTabField.ts | 8 - .../parameters/addScreenTabFieldParameters.ts | 12 + .../parameters/addScreenTabParameters.ts | 12 + src/version2/parameters/addSecurityLevel.ts | 6 - .../parameters/addSecurityLevelMembers.ts | 8 - .../addSecurityLevelMembersParameters.ts | 13 + .../parameters/addSecurityLevelParameters.ts | 11 + src/version2/parameters/addSharePermission.ts | 6 - .../addSharePermissionParameters.ts | 42 + src/version2/parameters/addUserToGroup.ts | 11 - .../parameters/addUserToGroupParameters.ts | 24 + src/version2/parameters/addVote.ts | 4 - src/version2/parameters/addVoteParameters.ts | 8 + src/version2/parameters/addWatcher.ts | 7 - .../parameters/addWatcherParameters.ts | 8 + src/version2/parameters/addWorklog.ts | 39 - .../parameters/addWorklogParameters.ts | 78 + src/version2/parameters/analyseExpression.ts | 17 - .../parameters/analyseExpressionParameters.ts | 28 + .../appendMappingsForIssueTypeScreenScheme.ts | 6 - ...pingsForIssueTypeScreenSchemeParameters.ts | 16 + src/version2/parameters/archiveIssues.ts | 3 - src/version2/parameters/archiveIssuesAsync.ts | 3 - .../archiveIssuesAsyncParameters.ts | 7 + .../parameters/archiveIssuesParameters.ts | 7 + src/version2/parameters/archivePlan.ts | 4 - .../parameters/archivePlanParameters.ts | 8 + src/version2/parameters/archiveProject.ts | 4 - .../parameters/archiveProjectParameters.ts | 8 + ...assignFieldConfigurationSchemeToProject.ts | 3 - ...dConfigurationSchemeToProjectParameters.ts | 15 + src/version2/parameters/assignIssue.ts | 15 - .../parameters/assignIssueParameters.ts | 56 + .../assignIssueTypeSchemeToProject.ts | 3 - ...ssignIssueTypeSchemeToProjectParameters.ts | 10 + .../assignIssueTypeScreenSchemeToProject.ts | 3 - ...ssueTypeScreenSchemeToProjectParameters.ts | 12 + .../parameters/assignPermissionScheme.ts | 27 - .../assignPermissionSchemeParameters.ts | 26 + .../assignProjectsToCustomFieldContext.ts | 8 - ...nProjectsToCustomFieldContextParameters.ts | 14 + .../parameters/assignSchemeToProject.ts | 3 - .../assignSchemeToProjectParameters.ts | 13 + .../parameters/associateSchemesToProjects.ts | 11 - .../associateSchemesToProjectsParameters.ts | 13 + .../parameters/bulkDeleteIssueProperty.ts | 6 - .../bulkDeleteIssuePropertyParameters.ts | 12 + src/version2/parameters/bulkDeleteWorklogs.ts | 19 - .../bulkDeleteWorklogsParameters.ts | 23 + src/version2/parameters/bulkEditDashboards.ts | 13 - .../bulkEditDashboardsParameters.ts | 16 + src/version2/parameters/bulkFetchIssues.ts | 66 - .../parameters/bulkFetchIssuesParameters.ts | 53 + src/version2/parameters/bulkGetGroups.ts | 23 - .../parameters/bulkGetGroupsParameters.ts | 27 + src/version2/parameters/bulkGetUsers.ts | 11 - .../parameters/bulkGetUsersMigration.ts | 16 - .../bulkGetUsersMigrationParameters.ts | 20 + .../parameters/bulkGetUsersParameters.ts | 27 + src/version2/parameters/bulkMoveWorklogs.ts | 20 - .../parameters/bulkMoveWorklogsParameters.ts | 25 + .../bulkSetIssuePropertiesByIssue.ts | 3 - ...bulkSetIssuePropertiesByIssueParameters.ts | 9 + .../parameters/bulkSetIssueProperty.ts | 6 - .../bulkSetIssuePropertyParameters.ts | 22 + .../parameters/bulkSetIssuesProperties.ts | 3 - .../bulkSetIssuesPropertiesListParameters.ts | 10 + src/version2/parameters/cancelTask.ts | 4 - .../parameters/cancelTaskParameters.ts | 8 + src/version2/parameters/changeFilterOwner.ts | 5 - .../parameters/changeFilterOwnerParameters.ts | 10 + src/version2/parameters/copyDashboard.ts | 10 - .../parameters/copyDashboardParameters.ts | 21 + src/version2/parameters/countIssues.ts | 3 - .../parameters/countIssuesParameters.ts | 11 + src/version2/parameters/createAssociations.ts | 3 - .../createAssociationsParameters.ts | 12 + src/version2/parameters/createComponent.ts | 3 - .../parameters/createComponentParameters.ts | 78 + src/version2/parameters/createCustomField.ts | 3 - .../parameters/createCustomFieldContext.ts | 18 - .../createCustomFieldContextParameters.ts | 18 + .../parameters/createCustomFieldOption.ts | 8 - .../createCustomFieldOptionParameters.ts | 13 + .../parameters/createCustomFieldParameters.ts | 107 ++ src/version2/parameters/createDashboard.ts | 11 - .../parameters/createDashboardParameters.ts | 20 + .../parameters/createFieldConfiguration.ts | 3 - .../createFieldConfigurationParameters.ts | 10 + .../createFieldConfigurationScheme.ts | 3 - ...reateFieldConfigurationSchemeParameters.ts | 10 + src/version2/parameters/createFilter.ts | 23 - .../parameters/createFilterParameters.ts | 74 + src/version2/parameters/createGroup.ts | 4 - .../parameters/createGroupParameters.ts | 8 + src/version2/parameters/createIssue.ts | 63 - .../parameters/createIssueFieldOption.ts | 14 - .../createIssueFieldOptionParameters.ts | 27 + .../parameters/createIssueLinkType.ts | 3 - .../createIssueLinkTypeParameters.ts | 41 + .../parameters/createIssueParameters.ts | 30 + .../parameters/createIssueSecurityScheme.ts | 3 - .../createIssueSecuritySchemeParameters.ts | 13 + src/version2/parameters/createIssueType.ts | 3 - .../parameters/createIssueTypeAvatar.ts | 16 - .../createIssueTypeAvatarParameters.ts | 14 + .../parameters/createIssueTypeParameters.ts | 27 + .../parameters/createIssueTypeScheme.ts | 3 - .../createIssueTypeSchemeParameters.ts | 14 + .../parameters/createIssueTypeScreenScheme.ts | 3 - .../createIssueTypeScreenSchemeParameters.ts | 16 + src/version2/parameters/createIssues.ts | 3 - .../parameters/createIssuesParameters.ts | 8 + .../parameters/createNotificationScheme.ts | 3 - .../createNotificationSchemeParameters.ts | 13 + .../createOrUpdateRemoteIssueLink.ts | 6 - ...createOrUpdateRemoteIssueLinkParameters.ts | 27 + .../parameters/createPermissionGrant.ts | 16 - .../createPermissionGrantParameters.ts | 39 + .../parameters/createPermissionScheme.ts | 25 - .../createPermissionSchemeParameters.ts | 36 + src/version2/parameters/createPlan.ts | 6 - src/version2/parameters/createPlanOnlyTeam.ts | 6 - .../createPlanOnlyTeamParameters.ts | 20 + .../parameters/createPlanParameters.ts | 28 + src/version2/parameters/createPriority.ts | 3 - .../parameters/createPriorityScheme.ts | 3 - .../createPrioritySchemeParameters.ts | 39 + src/version2/parameters/createProject.ts | 3 - .../parameters/createProjectAvatar.ts | 16 - .../createProjectAvatarParameters.ts | 14 + .../parameters/createProjectCategory.ts | 3 - .../createProjectCategoryParameters.ts | 14 + .../parameters/createProjectParameters.ts | 139 ++ src/version2/parameters/createProjectRole.ts | 3 - .../parameters/createProjectRoleParameters.ts | 16 + .../createProjectWithCustomTemplate.ts | 3 - ...eateProjectWithCustomTemplateParameters.ts | 10 + src/version2/parameters/createRelatedWork.ts | 5 - .../parameters/createRelatedWorkParameters.ts | 20 + src/version2/parameters/createResolution.ts | 4 - .../parameters/createResolutionParameters.ts | 10 + src/version2/parameters/createScreen.ts | 3 - .../parameters/createScreenParameters.ts | 10 + src/version2/parameters/createScreenScheme.ts | 3 - .../createScreenSchemeParameters.ts | 15 + src/version2/parameters/createStatuses.ts | 3 - .../parameters/createStatusesParameters.ts | 11 + .../parameters/createUiModification.ts | 3 - .../createUiModificationParameters.ts | 15 + src/version2/parameters/createUser.ts | 3 - .../parameters/createUserParameters.ts | 39 + src/version2/parameters/createVersion.ts | 3 - .../parameters/createVersionParameters.ts | 86 + src/version2/parameters/createWorkflow.ts | 3 - .../parameters/createWorkflowScheme.ts | 3 - .../createWorkflowSchemeDraftFromParent.ts | 4 - ...WorkflowSchemeDraftFromParentParameters.ts | 10 + .../createWorkflowSchemeParameters.ts | 67 + .../createWorkflowTransitionProperty.ts | 21 - src/version2/parameters/createWorkflows.ts | 3 - .../parameters/createWorkflowsParameters.ts | 14 + src/version2/parameters/deleteActor.ts | 18 - .../parameters/deleteActorParameters.ts | 22 + .../parameters/deleteAddonProperty.ts | 6 - .../deleteAddonPropertyParameters.ts | 10 + .../parameters/deleteAndReplaceVersion.ts | 15 - .../deleteAndReplaceVersionParameters.ts | 18 + src/version2/parameters/deleteAppProperty.ts | 4 - src/version2/parameters/deleteAvatar.ts | 8 - .../parameters/deleteAvatarParameters.ts | 12 + src/version2/parameters/deleteComment.ts | 7 - .../parameters/deleteCommentParameters.ts | 10 + .../parameters/deleteCommentProperty.ts | 6 - .../deleteCommentPropertyParameters.ts | 10 + src/version2/parameters/deleteComponent.ts | 6 - .../parameters/deleteComponentParameters.ts | 10 + src/version2/parameters/deleteCustomField.ts | 4 - .../parameters/deleteCustomFieldContext.ts | 6 - .../deleteCustomFieldContextParameters.ts | 10 + .../parameters/deleteCustomFieldOption.ts | 8 - .../deleteCustomFieldOptionParameters.ts | 12 + .../parameters/deleteCustomFieldParameters.ts | 8 + src/version2/parameters/deleteDashboard.ts | 4 - .../parameters/deleteDashboardItemProperty.ts | 8 - .../deleteDashboardItemPropertyParameters.ts | 12 + .../parameters/deleteDashboardParameters.ts | 8 + .../parameters/deleteDefaultWorkflow.ts | 9 - .../deleteDefaultWorkflowParameters.ts | 13 + .../parameters/deleteDraftDefaultWorkflow.ts | 4 - .../deleteDraftDefaultWorkflowParameters.ts | 8 + .../parameters/deleteDraftWorkflowMapping.ts | 6 - .../deleteDraftWorkflowMappingParameters.ts | 10 + .../parameters/deleteFavouriteForFilter.ts | 18 - .../deleteFavouriteForFilterParameters.ts | 23 + .../parameters/deleteFieldConfiguration.ts | 4 - .../deleteFieldConfigurationParameters.ts | 8 + .../deleteFieldConfigurationScheme.ts | 4 - ...eleteFieldConfigurationSchemeParameters.ts | 8 + src/version2/parameters/deleteFilter.ts | 4 - .../parameters/deleteFilterParameters.ts | 8 + .../deleteForgeAppPropertyParameters.ts | 8 + .../parameters/deleteInactiveWorkflow.ts | 4 - .../deleteInactiveWorkflowParameters.ts | 8 + src/version2/parameters/deleteIssue.ts | 6 - .../parameters/deleteIssueFieldOption.ts | 14 - .../deleteIssueFieldOptionParameters.ts | 19 + src/version2/parameters/deleteIssueLink.ts | 4 - .../parameters/deleteIssueLinkParameters.ts | 8 + .../parameters/deleteIssueLinkType.ts | 4 - .../deleteIssueLinkTypeParameters.ts | 8 + .../parameters/deleteIssueParameters.ts | 10 + .../parameters/deleteIssueProperty.ts | 6 - .../deleteIssuePropertyParameters.ts | 10 + src/version2/parameters/deleteIssueType.ts | 6 - .../parameters/deleteIssueTypeParameters.ts | 10 + .../parameters/deleteIssueTypeProperty.ts | 9 - .../deleteIssueTypePropertyParameters.ts | 13 + .../parameters/deleteIssueTypeScheme.ts | 4 - .../deleteIssueTypeSchemeParameters.ts | 8 + .../parameters/deleteIssueTypeScreenScheme.ts | 4 - .../deleteIssueTypeScreenSchemeParameters.ts | 8 + .../parameters/deleteNotificationScheme.ts | 4 - .../deleteNotificationSchemeParameters.ts | 8 + .../parameters/deletePermissionScheme.ts | 4 - .../deletePermissionSchemeEntity.ts | 6 - .../deletePermissionSchemeEntityParameters.ts | 10 + .../deletePermissionSchemeParameters.ts | 8 + src/version2/parameters/deletePlanOnlyTeam.ts | 6 - .../deletePlanOnlyTeamParameters.ts | 10 + src/version2/parameters/deletePriority.ts | 4 - .../parameters/deletePriorityParameters.ts | 8 + .../parameters/deletePriorityScheme.ts | 4 - .../deletePrioritySchemeParameters.ts | 8 + src/version2/parameters/deleteProject.ts | 6 - .../parameters/deleteProjectAsynchronously.ts | 4 - .../deleteProjectAsynchronouslyParameters.ts | 8 + .../parameters/deleteProjectAvatar.ts | 6 - .../deleteProjectAvatarParameters.ts | 10 + .../parameters/deleteProjectParameters.ts | 10 + .../parameters/deleteProjectProperty.ts | 9 - .../deleteProjectPropertyParameters.ts | 13 + src/version2/parameters/deleteProjectRole.ts | 9 - .../deleteProjectRoleActorsFromRole.ts | 19 - ...leteProjectRoleActorsFromRoleParameters.ts | 23 + .../parameters/deleteProjectRoleParameters.ts | 16 + src/version2/parameters/deleteRelatedWork.ts | 6 - .../parameters/deleteRelatedWorkParameters.ts | 10 + .../deleteRemoteIssueLinkByGlobalId.ts | 6 - ...leteRemoteIssueLinkByGlobalIdParameters.ts | 10 + .../parameters/deleteRemoteIssueLinkById.ts | 6 - .../deleteRemoteIssueLinkByIdParameters.ts | 10 + src/version2/parameters/deleteResolution.ts | 6 - .../parameters/deleteResolutionParameters.ts | 10 + src/version2/parameters/deleteScreen.ts | 4 - .../parameters/deleteScreenParameters.ts | 8 + src/version2/parameters/deleteScreenScheme.ts | 4 - .../deleteScreenSchemeParameters.ts | 8 + src/version2/parameters/deleteScreenTab.ts | 6 - .../parameters/deleteScreenTabParameters.ts | 10 + .../parameters/deleteSecurityScheme.ts | 4 - .../deleteSecuritySchemeParameters.ts | 8 + .../parameters/deleteSharePermission.ts | 6 - .../deleteSharePermissionParameters.ts | 10 + src/version2/parameters/deleteStatusesById.ts | 9 - .../deleteStatusesByIdParameters.ts | 13 + .../parameters/deleteUiModification.ts | 4 - .../deleteUiModificationParameters.ts | 8 + src/version2/parameters/deleteUserProperty.ts | 21 - .../deleteUserPropertyParameters.ts | 25 + src/version2/parameters/deleteWebhookById.ts | 3 - .../parameters/deleteWebhookByIdParameters.ts | 8 + .../parameters/deleteWorkflowMapping.ts | 11 - .../deleteWorkflowMappingParameters.ts | 15 + .../parameters/deleteWorkflowScheme.ts | 7 - .../parameters/deleteWorkflowSchemeDraft.ts | 4 - .../deleteWorkflowSchemeDraftIssueType.ts | 6 - ...eWorkflowSchemeDraftIssueTypeParameters.ts | 12 + .../deleteWorkflowSchemeDraftParameters.ts | 8 + .../deleteWorkflowSchemeIssueType.ts | 11 - ...deleteWorkflowSchemeIssueTypeParameters.ts | 15 + .../deleteWorkflowSchemeParameters.ts | 11 + .../deleteWorkflowTransitionProperty.ts | 16 - ...eteWorkflowTransitionRuleConfigurations.ts | 3 - ...wTransitionRuleConfigurationsParameters.ts | 11 + src/version2/parameters/deleteWorklog.ts | 33 - .../parameters/deleteWorklogParameters.ts | 37 + .../parameters/deleteWorklogProperty.ts | 8 - .../deleteWorklogPropertyParameters.ts | 12 + src/version2/parameters/doTransition.ts | 6 - .../parameters/doTransitionParameters.ts | 26 + src/version2/parameters/duplicatePlan.ts | 6 - .../parameters/duplicatePlanParameters.ts | 10 + src/version2/parameters/editIssue.ts | 31 - .../parameters/editIssueParameters.ts | 51 + .../parameters/editTemplateParameters.ts | 14 + .../evaluateJSISJiraExpressionParameters.ts | 19 + .../parameters/evaluateJiraExpression.ts | 13 - ...aluateJiraExpressionUsingEnhancedSearch.ts | 13 - .../parameters/expandAttachmentForHumans.ts | 4 - .../expandAttachmentForHumansParameters.ts | 8 + .../parameters/expandAttachmentForMachines.ts | 4 - .../expandAttachmentForMachinesParameters.ts | 8 + .../parameters/exportArchivedIssues.ts | 14 - .../exportArchivedIssuesParameters.ts | 16 + .../parameters/findAssignableUsers.ts | 36 - .../findAssignableUsersParameters.ts | 40 + .../parameters/findBulkAssignableUsers.ts | 23 - .../findBulkAssignableUsersParameters.ts | 27 + .../parameters/findComponentsForProjects.ts | 19 - .../findComponentsForProjectsParameters.ts | 24 + src/version2/parameters/findGroups.ts | 23 - .../parameters/findGroupsParameters.ts | 39 + .../parameters/findUserKeysByQuery.ts | 14 - .../findUserKeysByQueryParameters.ts | 12 + src/version2/parameters/findUsers.ts | 26 - src/version2/parameters/findUsersAndGroups.ts | 54 - .../findUsersAndGroupsParameters.ts | 60 + src/version2/parameters/findUsersByQuery.ts | 8 - .../parameters/findUsersByQueryParameters.ts | 12 + src/version2/parameters/findUsersForPicker.ts | 21 - .../findUsersForPickerParameters.ts | 31 + .../parameters/findUsersParameters.ts | 30 + .../parameters/findUsersWithAllPermissions.ts | 38 - .../findUsersWithAllPermissionsParameters.ts | 70 + .../findUsersWithBrowsePermission.ts | 25 - ...findUsersWithBrowsePermissionParameters.ts | 29 + .../parameters/fullyUpdateProjectRole.ts | 9 - .../fullyUpdateProjectRoleParameters.ts | 21 + .../getAccessibleProjectTypeByKey.ts | 4 - ...getAccessibleProjectTypeByKeyParameters.ts | 8 + src/version2/parameters/getAddonProperties.ts | 4 - .../getAddonPropertiesParameters.ts | 8 + src/version2/parameters/getAddonProperty.ts | 6 - .../parameters/getAddonPropertyParameters.ts | 10 + .../getAdvancedSettingsParameters.ts | 5 + .../getAllAccessibleProjectTypesParameters.ts | 5 + .../getAllApplicationRolesParameters.ts | 5 + ...tAllAvailableDashboardGadgetsParameters.ts | 5 + src/version2/parameters/getAllDashboards.ts | 13 - .../parameters/getAllDashboardsParameters.ts | 17 + .../getAllFieldConfigurationSchemes.ts | 11 - ...tAllFieldConfigurationSchemesParameters.ts | 15 + .../parameters/getAllFieldConfigurations.ts | 15 - .../getAllFieldConfigurationsParameters.ts | 19 + src/version2/parameters/getAllGadgets.ts | 16 - .../parameters/getAllGadgetsParameters.ts | 20 + .../parameters/getAllIssueFieldOptions.ts | 16 - .../getAllIssueFieldOptionsParameters.ts | 21 + .../parameters/getAllIssueTypeSchemes.ts | 29 - .../getAllIssueTypeSchemesParameters.ts | 33 + src/version2/parameters/getAllLabels.ts | 6 - .../parameters/getAllLabelsParameters.ts | 10 + .../parameters/getAllPermissionSchemes.ts | 23 - .../getAllPermissionSchemesParameters.ts | 18 + .../parameters/getAllPermissionsParameters.ts | 5 + .../parameters/getAllProjectAvatars.ts | 4 - .../getAllProjectAvatarsParameters.ts | 8 + .../getAllProjectCategoriesParameters.ts | 5 + .../getAllProjectRolesParameters.ts | 5 + .../getAllProjectTypesParameters.ts | 5 + .../parameters/getAllScreenTabFields.ts | 8 - .../getAllScreenTabFieldsParameters.ts | 12 + src/version2/parameters/getAllScreenTabs.ts | 6 - .../parameters/getAllScreenTabsParameters.ts | 10 + src/version2/parameters/getAllStatuses.ts | 4 - .../parameters/getAllStatusesParameters.ts | 8 + .../parameters/getAllSystemAvatars.ts | 4 - .../getAllSystemAvatarsParameters.ts | 8 + .../getAllUserDataClassificationLevels.ts | 6 - ...lUserDataClassificationLevelsParameters.ts | 12 + src/version2/parameters/getAllUsers.ts | 6 - src/version2/parameters/getAllUsersDefault.ts | 6 - .../getAllUsersDefaultParameters.ts | 10 + .../parameters/getAllUsersParameters.ts | 10 + .../parameters/getAllWorkflowSchemes.ts | 6 - .../getAllWorkflowSchemesParameters.ts | 10 + .../parameters/getAlternativeIssueTypes.ts | 4 - .../getAlternativeIssueTypesParameters.ts | 8 + .../parameters/getApplicationProperty.ts | 12 - .../getApplicationPropertyParameters.ts | 16 + src/version2/parameters/getApplicationRole.ts | 7 - .../getApplicationRoleParameters.ts | 11 + ...ximateApplicationLicenseCountParameters.ts | 10 + .../getApproximateLicenseCountParameters.ts | 5 + .../parameters/getAssignedPermissionScheme.ts | 26 - .../getAssignedPermissionSchemeParameters.ts | 21 + src/version2/parameters/getAtlassianTeam.ts | 6 - .../parameters/getAtlassianTeamParameters.ts | 10 + src/version2/parameters/getAttachment.ts | 4 - .../parameters/getAttachmentContent.ts | 9 - .../getAttachmentContentParameters.ts | 13 + .../parameters/getAttachmentMetaParameters.ts | 5 + .../parameters/getAttachmentParameters.ts | 8 + .../parameters/getAttachmentThumbnail.ts | 15 - .../getAttachmentThumbnailParameters.ts | 19 + src/version2/parameters/getAuditRecords.ts | 18 - .../parameters/getAuditRecordsParameters.ts | 22 + .../parameters/getAutoCompleteParameters.ts | 5 + .../parameters/getAutoCompletePost.ts | 3 - .../getAutoCompletePostParameters.ts | 10 + .../getAvailablePrioritiesByPriorityScheme.ts | 12 - ...blePrioritiesByPrioritySchemeParameters.ts | 18 + .../parameters/getAvailableScreenFields.ts | 4 - .../getAvailableScreenFieldsParameters.ts | 8 + ...leTimeTrackingImplementationsParameters.ts | 7 + src/version2/parameters/getAvatarImageByID.ts | 10 - .../getAvatarImageByIDParameters.ts | 14 + .../parameters/getAvatarImageByOwner.ts | 10 - .../getAvatarImageByOwnerParameters.ts | 14 + .../parameters/getAvatarImageByType.ts | 8 - .../getAvatarImageByTypeParameters.ts | 12 + src/version2/parameters/getAvatars.ts | 6 - .../parameters/getAvatarsParameters.ts | 10 + .../parameters/getBannerParameters.ts | 5 + src/version2/parameters/getBulkChangelogs.ts | 3 - .../parameters/getBulkChangelogsParameters.ts | 14 + src/version2/parameters/getBulkPermissions.ts | 3 - .../getBulkPermissionsParameters.ts | 13 + src/version2/parameters/getBulkScreenTabs.ts | 16 - .../parameters/getBulkScreenTabsParameters.ts | 20 + src/version2/parameters/getChangeLogs.ts | 8 - src/version2/parameters/getChangeLogsByIds.ts | 6 - .../getChangeLogsByIdsParameters.ts | 10 + .../parameters/getChangeLogsParameters.ts | 12 + src/version2/parameters/getColumns.ts | 4 - .../parameters/getColumnsParameters.ts | 8 + src/version2/parameters/getComment.ts | 12 - .../parameters/getCommentParameters.ts | 16 + src/version2/parameters/getCommentProperty.ts | 6 - .../parameters/getCommentPropertyKeys.ts | 4 - .../getCommentPropertyKeysParameters.ts | 8 + .../getCommentPropertyParameters.ts | 10 + src/version2/parameters/getComments.ts | 19 - src/version2/parameters/getCommentsByIds.ts | 11 - .../parameters/getCommentsByIdsParameters.ts | 16 + .../parameters/getCommentsParameters.ts | 23 + src/version2/parameters/getComponent.ts | 4 - .../parameters/getComponentParameters.ts | 8 + .../parameters/getComponentRelatedIssues.ts | 4 - .../getComponentRelatedIssuesParameters.ts | 8 + .../parameters/getConfigurationParameters.ts | 5 + .../parameters/getContextsForField.ts | 17 - .../getContextsForFieldParameters.ts | 21 + src/version2/parameters/getCreateIssueMeta.ts | 34 - .../getCreateIssueMetaIssueTypeId.ts | 10 - ...getCreateIssueMetaIssueTypeIdParameters.ts | 14 + .../getCreateIssueMetaIssueTypes.ts | 8 - .../getCreateIssueMetaIssueTypesParameters.ts | 12 + src/version2/parameters/getCurrentUser.ts | 10 - .../parameters/getCurrentUserParameters.ts | 14 + .../parameters/getCustomFieldConfiguration.ts | 34 - .../getCustomFieldConfigurationParameters.ts | 38 + ...omFieldContextsForProjectsAndIssueTypes.ts | 10 - ...textsForProjectsAndIssueTypesParameters.ts | 17 + .../parameters/getCustomFieldOption.ts | 4 - .../getCustomFieldOptionParameters.ts | 8 + .../getCustomFieldsConfigurations.ts | 34 - ...getCustomFieldsConfigurationsParameters.ts | 38 + src/version2/parameters/getDashboard.ts | 4 - .../parameters/getDashboardItemProperty.ts | 8 - .../getDashboardItemPropertyKeys.ts | 6 - .../getDashboardItemPropertyKeysParameters.ts | 10 + .../getDashboardItemPropertyParameters.ts | 12 + .../parameters/getDashboardParameters.ts | 8 + .../parameters/getDashboardsPaginated.ts | 94 -- .../getDashboardsPaginatedParameters.ts | 87 + .../parameters/getDefaultEditorParameters.ts | 5 + .../getDefaultProjectClassification.ts | 4 - ...tDefaultProjectClassificationParameters.ts | 8 + .../getDefaultShareScopeParameters.ts | 5 + src/version2/parameters/getDefaultValues.ts | 10 - .../parameters/getDefaultValuesParameters.ts | 14 + src/version2/parameters/getDefaultWorkflow.ts | 9 - .../getDefaultWorkflowParameters.ts | 13 + .../parameters/getDraftDefaultWorkflow.ts | 4 - .../getDraftDefaultWorkflowParameters.ts | 8 + src/version2/parameters/getDraftWorkflow.ts | 9 - .../parameters/getDraftWorkflowParameters.ts | 13 + .../parameters/getDynamicWebhooksForApp.ts | 6 - .../getDynamicWebhooksForAppParameters.ts | 10 + src/version2/parameters/getEditIssueMeta.ts | 16 - .../parameters/getEditIssueMetaParameters.ts | 20 + .../parameters/getEventsParameters.ts | 5 + src/version2/parameters/getFailedWebhooks.ts | 13 - .../parameters/getFailedWebhooksParameters.ts | 17 + .../parameters/getFavouriteFilters.ts | 17 - .../getFavouriteFiltersParameters.ts | 21 + .../parameters/getFeaturesForProject.ts | 4 - .../getFeaturesForProjectParameters.ts | 8 + .../getFieldAutoCompleteForQueryString.ts | 14 - ...eldAutoCompleteForQueryStringParameters.ts | 20 + .../parameters/getFieldConfigurationItems.ts | 8 - .../getFieldConfigurationItemsParameters.ts | 12 + .../getFieldConfigurationSchemeMappings.ts | 11 - ...ldConfigurationSchemeMappingsParameters.ts | 17 + ...tFieldConfigurationSchemeProjectMapping.ts | 11 - ...igurationSchemeProjectMappingParameters.ts | 17 + src/version2/parameters/getFieldsPaginated.ts | 52 - .../getFieldsPaginatedParameters.ts | 61 + .../parameters/getFieldsParameters.ts | 5 + src/version2/parameters/getFilter.ts | 24 - .../parameters/getFilterParameters.ts | 28 + .../parameters/getFiltersPaginated.ts | 121 -- .../getFiltersPaginatedParameters.ts | 108 ++ src/version2/parameters/getHierarchy.ts | 4 - .../parameters/getHierarchyParameters.ts | 8 + .../getIdsOfWorklogsDeletedSince.ts | 4 - .../getIdsOfWorklogsDeletedSinceParameters.ts | 8 + .../getIdsOfWorklogsModifiedSince.ts | 10 - ...getIdsOfWorklogsModifiedSinceParameters.ts | 14 + .../parameters/getIsWatchingIssueBulk.ts | 3 - .../getIsWatchingIssueBulkParameters.ts | 8 + src/version2/parameters/getIssue.ts | 76 - .../parameters/getIssueAllTypesParameters.ts | 5 + .../parameters/getIssueFieldOption.ts | 14 - .../getIssueFieldOptionParameters.ts | 19 + .../parameters/getIssueLimitReport.ts | 10 - .../getIssueLimitReportParameters.ts | 12 + src/version2/parameters/getIssueLink.ts | 4 - .../parameters/getIssueLinkParameters.ts | 8 + src/version2/parameters/getIssueLinkType.ts | 4 - .../parameters/getIssueLinkTypeParameters.ts | 8 + .../parameters/getIssueLinkTypesParameters.ts | 5 + ...tIssueNavigatorDefaultColumnsParameters.ts | 5 + src/version2/parameters/getIssueParameters.ts | 76 + .../parameters/getIssuePickerResource.ts | 23 - .../getIssuePickerResourceParameters.ts | 27 + src/version2/parameters/getIssueProperty.ts | 6 - .../parameters/getIssuePropertyKeys.ts | 4 - .../getIssuePropertyKeysParameters.ts | 8 + .../parameters/getIssuePropertyParameters.ts | 10 + .../parameters/getIssueSecurityLevel.ts | 4 - .../getIssueSecurityLevelMembers.ts | 26 - .../getIssueSecurityLevelMembersParameters.ts | 31 + .../getIssueSecurityLevelParameters.ts | 8 + .../parameters/getIssueSecurityScheme.ts | 7 - .../getIssueSecuritySchemeParameters.ts | 11 + .../getIssueSecuritySchemesParameters.ts | 5 + src/version2/parameters/getIssueType.ts | 4 - .../getIssueTypeMappingsForContexts.ts | 13 - ...tIssueTypeMappingsForContextsParameters.ts | 17 + .../parameters/getIssueTypeParameters.ts | 8 + .../parameters/getIssueTypeProperty.ts | 9 - .../parameters/getIssueTypePropertyKeys.ts | 4 - .../getIssueTypePropertyKeysParameters.ts | 8 + .../getIssueTypePropertyParameters.ts | 13 + .../getIssueTypeSchemeForProjects.ts | 11 - ...getIssueTypeSchemeForProjectsParameters.ts | 15 + .../parameters/getIssueTypeSchemesMapping.ts | 11 - .../getIssueTypeSchemesMappingParameters.ts | 15 + .../getIssueTypeScreenSchemeMappings.ts | 11 - ...IssueTypeScreenSchemeMappingsParameters.ts | 17 + ...ssueTypeScreenSchemeProjectAssociations.ts | 11 - ...reenSchemeProjectAssociationsParameters.ts | 17 + .../parameters/getIssueTypeScreenSchemes.ts | 26 - .../getIssueTypeScreenSchemesParameters.ts | 30 + .../parameters/getIssueTypesForProject.ts | 10 - .../getIssueTypesForProjectParameters.ts | 16 + src/version2/parameters/getIssueWatchers.ts | 4 - .../parameters/getIssueWatchersParameters.ts | 8 + src/version2/parameters/getIssueWorklog.ts | 17 - .../parameters/getIssueWorklogParameters.ts | 21 + .../parameters/getLicenseParameters.ts | 5 + .../parameters/getLocaleParameters.ts | 5 + .../parameters/getModulesParameters.ts | 5 + src/version2/parameters/getMyFilters.ts | 18 - .../parameters/getMyFiltersParameters.ts | 23 + src/version2/parameters/getMyPermissions.ts | 19 - .../parameters/getMyPermissionsParameters.ts | 23 + .../parameters/getNotificationScheme.ts | 29 - .../getNotificationSchemeForProject.ts | 26 - ...tNotificationSchemeForProjectParameters.ts | 21 + .../getNotificationSchemeParameters.ts | 24 + .../getNotificationSchemeToProjectMappings.ts | 10 - ...cationSchemeToProjectMappingsParameters.ts | 16 + .../parameters/getNotificationSchemes.ts | 37 - .../getNotificationSchemesParameters.ts | 32 + .../parameters/getOptionsForContext.ts | 14 - .../getOptionsForContextParameters.ts | 18 + .../parameters/getPermissionScheme.ts | 25 - .../parameters/getPermissionSchemeGrant.ts | 16 - .../getPermissionSchemeGrantParameters.ts | 22 + .../parameters/getPermissionSchemeGrants.ts | 14 - .../getPermissionSchemeGrantsParameters.ts | 20 + .../getPermissionSchemeParameters.ts | 20 + .../parameters/getPermittedProjects.ts | 3 - .../getPermittedProjectsParameters.ts | 8 + src/version2/parameters/getPlan.ts | 6 - src/version2/parameters/getPlanOnlyTeam.ts | 6 - .../parameters/getPlanOnlyTeamParameters.ts | 10 + src/version2/parameters/getPlanParameters.ts | 10 + src/version2/parameters/getPlans.ts | 10 - src/version2/parameters/getPlansParameters.ts | 14 + src/version2/parameters/getPolicies.ts | 4 - .../parameters/getPoliciesParameters.ts | 8 + .../parameters/getPolicyParameters.ts | 5 + src/version2/parameters/getPrecomputations.ts | 37 - .../parameters/getPrecomputationsByID.ts | 11 - .../getPrecomputationsByIDParameters.ts | 16 + .../getPrecomputationsParameters.ts | 26 + src/version2/parameters/getPreference.ts | 4 - .../parameters/getPreferenceParameters.ts | 8 + .../getPrioritiesByPriorityScheme.ts | 8 - ...getPrioritiesByPrioritySchemeParameters.ts | 12 + src/version2/parameters/getPriority.ts | 4 - .../parameters/getPriorityParameters.ts | 8 + src/version2/parameters/getPrioritySchemes.ts | 28 - .../getPrioritySchemesParameters.ts | 32 + src/version2/parameters/getProject.ts | 26 - .../parameters/getProjectCategoryById.ts | 4 - .../getProjectCategoryByIdParameters.ts | 8 + .../parameters/getProjectComponents.ts | 12 - .../getProjectComponentsPaginated.ts | 43 - ...getProjectComponentsPaginatedParameters.ts | 47 + .../getProjectComponentsParameters.ts | 14 + .../parameters/getProjectContextMapping.ts | 13 - .../getProjectContextMappingParameters.ts | 17 + src/version2/parameters/getProjectEmail.ts | 4 - .../parameters/getProjectEmailParameters.ts | 8 + .../getProjectIssueSecurityScheme.ts | 4 - ...getProjectIssueSecuritySchemeParameters.ts | 8 + .../getProjectIssueTypeUsagesForStatus.ts | 10 - ...ojectIssueTypeUsagesForStatusParameters.ts | 16 + .../parameters/getProjectParameters.ts | 22 + src/version2/parameters/getProjectProperty.ts | 9 - .../parameters/getProjectPropertyKeys.ts | 4 - .../getProjectPropertyKeysParameters.ts | 8 + .../getProjectPropertyParameters.ts | 13 + src/version2/parameters/getProjectRole.ts | 11 - .../parameters/getProjectRoleActorsForRole.ts | 7 - .../getProjectRoleActorsForRoleParameters.ts | 11 + src/version2/parameters/getProjectRoleById.ts | 7 - .../getProjectRoleByIdParameters.ts | 11 + .../parameters/getProjectRoleDetails.ts | 7 - .../getProjectRoleDetailsParameters.ts | 11 + .../parameters/getProjectRoleParameters.ts | 15 + src/version2/parameters/getProjectRoles.ts | 4 - .../parameters/getProjectRolesParameters.ts | 8 + .../parameters/getProjectTypeByKey.ts | 4 - .../getProjectTypeByKeyParameters.ts | 8 + .../parameters/getProjectUsagesForStatus.ts | 8 - .../getProjectUsagesForStatusParameters.ts | 12 + .../parameters/getProjectUsagesForWorkflow.ts | 8 - .../getProjectUsagesForWorkflowParameters.ts | 12 + .../getProjectUsagesForWorkflowScheme.ts | 8 - ...rojectUsagesForWorkflowSchemeParameters.ts | 14 + src/version2/parameters/getProjectVersions.ts | 10 - .../parameters/getProjectVersionsPaginated.ts | 61 - .../getProjectVersionsPaginatedParameters.ts | 60 + .../getProjectVersionsParameters.ts | 14 + .../parameters/getProjectsByPriorityScheme.ts | 12 - .../getProjectsByPrioritySchemeParameters.ts | 16 + .../getProjectsForIssueTypeScreenScheme.ts | 9 - ...jectsForIssueTypeScreenSchemeParameters.ts | 15 + src/version2/parameters/getRecent.ts | 33 - .../parameters/getRecentParameters.ts | 27 + .../getRedactionStatusParameters.ts | 8 + src/version2/parameters/getRelatedWork.ts | 4 - .../parameters/getRelatedWorkParameters.ts | 8 + .../parameters/getRemoteIssueLinkById.ts | 6 - .../getRemoteIssueLinkByIdParameters.ts | 10 + .../parameters/getRemoteIssueLinks.ts | 6 - .../getRemoteIssueLinksParameters.ts | 10 + src/version2/parameters/getResolution.ts | 4 - .../parameters/getResolutionParameters.ts | 8 + src/version2/parameters/getScreenSchemes.ts | 26 - .../parameters/getScreenSchemesParameters.ts | 30 + src/version2/parameters/getScreens.ts | 25 - src/version2/parameters/getScreensForField.ts | 14 - .../getScreensForFieldParameters.ts | 18 + .../parameters/getScreensParameters.ts | 29 + .../parameters/getSecurityLevelMembers.ts | 40 - .../getSecurityLevelMembersParameters.ts | 36 + src/version2/parameters/getSecurityLevels.ts | 21 - .../parameters/getSecurityLevelsForProject.ts | 4 - .../getSecurityLevelsForProjectParameters.ts | 8 + .../parameters/getSecurityLevelsParameters.ts | 25 + .../getSelectableIssueFieldOptions.ts | 18 - ...etSelectableIssueFieldOptionsParameters.ts | 23 + ...tedTimeTrackingImplementationParameters.ts | 7 + .../parameters/getServerInfoParameters.ts | 5 + src/version2/parameters/getSharePermission.ts | 6 - .../getSharePermissionParameters.ts | 10 + .../parameters/getSharePermissions.ts | 4 - .../getSharePermissionsParameters.ts | 8 + ...aredTimeTrackingConfigurationParameters.ts | 7 + src/version2/parameters/getStatus.ts | 4 - .../getStatusCategoriesParameters.ts | 5 + src/version2/parameters/getStatusCategory.ts | 4 - .../parameters/getStatusCategoryParameters.ts | 8 + .../parameters/getStatusParameters.ts | 8 + src/version2/parameters/getStatusesById.ts | 20 - .../parameters/getStatusesByIdParameters.ts | 13 + .../parameters/getStatusesParameters.ts | 5 + src/version2/parameters/getTask.ts | 4 - src/version2/parameters/getTaskParameters.ts | 8 + src/version2/parameters/getTeams.ts | 8 - src/version2/parameters/getTeamsParameters.ts | 12 + src/version2/parameters/getTransitions.ts | 23 - .../parameters/getTransitionsParameters.ts | 27 + .../parameters/getTrashedFieldsPaginated.ts | 31 - .../getTrashedFieldsPaginatedParameters.ts | 37 + src/version2/parameters/getUiModifications.ts | 14 - .../getUiModificationsParameters.ts | 18 + src/version2/parameters/getUser.ts | 15 - .../parameters/getUserDefaultColumns.ts | 13 - .../getUserDefaultColumnsParameters.ts | 17 + src/version2/parameters/getUserEmail.ts | 7 - src/version2/parameters/getUserEmailBulk.ts | 8 - .../parameters/getUserEmailBulkParameters.ts | 12 + .../parameters/getUserEmailParameters.ts | 11 + src/version2/parameters/getUserGroups.ts | 19 - .../parameters/getUserGroupsParameters.ts | 23 + src/version2/parameters/getUserNavProperty.ts | 9 - .../getUserNavPropertyParameters.ts | 13 + src/version2/parameters/getUserParameters.ts | 31 + src/version2/parameters/getUserProperty.ts | 21 - .../parameters/getUserPropertyKeys.ts | 19 - .../getUserPropertyKeysParameters.ts | 23 + .../parameters/getUserPropertyParameters.ts | 25 + src/version2/parameters/getUsersFromGroup.ts | 15 - .../parameters/getUsersFromGroupParameters.ts | 19 + src/version2/parameters/getValidProjectKey.ts | 4 - .../getValidProjectKeyParameters.ts | 8 + .../parameters/getValidProjectName.ts | 4 - .../getValidProjectNameParameters.ts | 8 + src/version2/parameters/getVersion.ts | 23 - .../parameters/getVersionParameters.ts | 20 + .../parameters/getVersionRelatedIssues.ts | 4 - .../getVersionRelatedIssuesParameters.ts | 8 + .../parameters/getVersionUnresolvedIssues.ts | 4 - .../getVersionUnresolvedIssuesParameters.ts | 8 + .../parameters/getVisibleIssueFieldOptions.ts | 18 - .../getVisibleIssueFieldOptionsParameters.ts | 23 + src/version2/parameters/getVotes.ts | 4 - src/version2/parameters/getVotesParameters.ts | 8 + src/version2/parameters/getWorkflow.ts | 14 - .../parameters/getWorkflowParameters.ts | 18 + .../getWorkflowProjectIssueTypeUsages.ts | 10 - ...orkflowProjectIssueTypeUsagesParameters.ts | 16 + src/version2/parameters/getWorkflowScheme.ts | 12 - .../parameters/getWorkflowSchemeDraft.ts | 4 - .../getWorkflowSchemeDraftIssueType.ts | 6 - ...tWorkflowSchemeDraftIssueTypeParameters.ts | 10 + .../getWorkflowSchemeDraftParameters.ts | 8 + .../parameters/getWorkflowSchemeIssueType.ts | 11 - .../getWorkflowSchemeIssueTypeParameters.ts | 15 + .../parameters/getWorkflowSchemeParameters.ts | 16 + .../getWorkflowSchemeProjectAssociations.ts | 7 - ...flowSchemeProjectAssociationsParameters.ts | 13 + .../getWorkflowSchemeUsagesForWorkflow.ts | 8 - ...rkflowSchemeUsagesForWorkflowParameters.ts | 14 + .../getWorkflowTransitionProperties.ts | 21 - ...getWorkflowTransitionRuleConfigurations.ts | 25 - ...wTransitionRuleConfigurationsParameters.ts | 31 + .../parameters/getWorkflowUsagesForStatus.ts | 8 - .../getWorkflowUsagesForStatusParameters.ts | 12 + .../parameters/getWorkflowsPaginated.ts | 77 - src/version2/parameters/getWorklog.ts | 13 - .../parameters/getWorklogParameters.ts | 17 + src/version2/parameters/getWorklogProperty.ts | 8 - .../parameters/getWorklogPropertyKeys.ts | 6 - .../getWorklogPropertyKeysParameters.ts | 10 + .../getWorklogPropertyParameters.ts | 12 + src/version2/parameters/getWorklogsForIds.ts | 10 - .../parameters/getWorklogsForIdsParameters.ts | 14 + src/version2/parameters/index.ts | 539 ------ src/version2/parameters/linkIssues.ts | 3 - .../parameters/linkIssuesParameters.ts | 13 + .../parameters/liveTemplateParameters.ts | 10 + src/version2/parameters/matchIssues.ts | 3 - .../parameters/matchIssuesParameters.ts | 10 + src/version2/parameters/mergeVersions.ts | 6 - .../parameters/mergeVersionsParameters.ts | 10 + src/version2/parameters/migrateQueries.ts | 3 - .../parameters/migrateQueriesParameters.ts | 8 + src/version2/parameters/movePriorities.ts | 3 - .../parameters/movePrioritiesParameters.ts | 12 + src/version2/parameters/moveResolutions.ts | 3 - .../parameters/moveResolutionsParameters.ts | 12 + src/version2/parameters/moveScreenTab.ts | 8 - src/version2/parameters/moveScreenTabField.ts | 10 - .../moveScreenTabFieldParameters.ts | 19 + .../parameters/moveScreenTabParameters.ts | 12 + src/version2/parameters/moveVersion.ts | 6 - .../parameters/moveVersionParameters.ts | 12 + src/version2/parameters/notify.ts | 6 - src/version2/parameters/notifyParameters.ts | 21 + src/version2/parameters/parseJqlQueries.ts | 13 - .../parameters/parseJqlQueriesParameters.ts | 17 + .../parameters/partialUpdateProjectRole.ts | 9 - .../partialUpdateProjectRoleParameters.ts | 21 + .../parameters/publishDraftWorkflowScheme.ts | 9 - .../publishDraftWorkflowSchemeParameters.ts | 13 + src/version2/parameters/putAddonProperty.ts | 8 - .../parameters/putAddonPropertyParameters.ts | 10 + src/version2/parameters/putAppProperty.ts | 6 - .../putForgeAppPropertyParameters.ts | 8 + .../parameters/readWorkflowSchemes.ts | 14 - .../readWorkflowSchemesParameters.ts | 10 + src/version2/parameters/readWorkflows.ts | 20 - .../parameters/readWorkflowsParameters.ts | 18 + src/version2/parameters/redactParameters.ts | 8 + src/version2/parameters/refreshWebhooks.ts | 3 - .../parameters/refreshWebhooksParameters.ts | 8 + .../parameters/registerDynamicWebhooks.ts | 3 - .../registerDynamicWebhooksParameters.ts | 14 + src/version2/parameters/registerModules.ts | 3 - .../parameters/registerModulesParameters.ts | 12 + src/version2/parameters/removeAssociations.ts | 3 - .../removeAssociationsParameters.ts | 12 + .../parameters/removeAtlassianTeam.ts | 6 - .../removeAtlassianTeamParameters.ts | 10 + src/version2/parameters/removeAttachment.ts | 4 - .../parameters/removeAttachmentParameters.ts | 8 + .../removeCustomFieldContextFromProjects.ts | 8 - ...ustomFieldContextFromProjectsParameters.ts | 14 + .../removeDefaultProjectClassification.ts | 4 - ...eDefaultProjectClassificationParameters.ts | 10 + src/version2/parameters/removeGadget.ts | 6 - .../parameters/removeGadgetParameters.ts | 10 + src/version2/parameters/removeGroup.ts | 21 - .../parameters/removeGroupParameters.ts | 21 + .../removeIssueTypeFromIssueTypeScheme.ts | 6 - ...eIssueTypeFromIssueTypeSchemeParameters.ts | 12 + .../parameters/removeIssueTypesFromContext.ts | 8 - .../removeIssueTypesFromContextParameters.ts | 12 + ...TypesFromGlobalFieldConfigurationScheme.ts | 6 - ...lobalFieldConfigurationSchemeParameters.ts | 15 + src/version2/parameters/removeLevel.ts | 8 - .../parameters/removeLevelParameters.ts | 12 + ...removeMappingsFromIssueTypeScreenScheme.ts | 6 - ...ingsFromIssueTypeScreenSchemeParameters.ts | 12 + .../removeMemberFromSecurityLevel.ts | 8 - ...removeMemberFromSecurityLevelParameters.ts | 12 + src/version2/parameters/removeModules.ts | 8 - .../parameters/removeModulesParameters.ts | 12 + ...emoveNotificationFromNotificationScheme.ts | 6 - ...icationFromNotificationSchemeParameters.ts | 12 + src/version2/parameters/removePreference.ts | 4 - .../parameters/removePreferenceParameters.ts | 8 + .../parameters/removeProjectCategory.ts | 4 - .../removeProjectCategoryParameters.ts | 8 + .../parameters/removeScreenTabField.ts | 8 - .../removeScreenTabFieldParameters.ts | 12 + .../parameters/removeTemplateParameters.ts | 8 + src/version2/parameters/removeUser.ts | 19 - .../parameters/removeUserFromGroup.ts | 20 - .../removeUserFromGroupParameters.ts | 24 + .../parameters/removeUserParameters.ts | 23 + src/version2/parameters/removeVote.ts | 4 - .../parameters/removeVoteParameters.ts | 8 + src/version2/parameters/removeWatcher.ts | 9 - .../parameters/removeWatcherParameters.ts | 19 + src/version2/parameters/renameScreenTab.ts | 8 - .../parameters/renameScreenTabParameters.ts | 14 + .../parameters/reorderCustomFieldOptions.ts | 8 - .../reorderCustomFieldOptionsParameters.ts | 22 + .../reorderIssueTypesInIssueTypeScheme.ts | 6 - ...erIssueTypesInIssueTypeSchemeParameters.ts | 19 + .../parameters/replaceCustomFieldOption.ts | 12 - .../replaceCustomFieldOptionParameters.ts | 16 + .../parameters/replaceIssueFieldOption.ts | 28 - .../replaceIssueFieldOptionParameters.ts | 33 + src/version2/parameters/resetColumns.ts | 4 - .../parameters/resetColumnsParameters.ts | 8 + src/version2/parameters/resetUserColumns.ts | 13 - .../parameters/resetUserColumnsParameters.ts | 17 + src/version2/parameters/restore.ts | 4 - src/version2/parameters/restoreCustomField.ts | 4 - .../restoreCustomFieldParameters.ts | 8 + src/version2/parameters/restoreParameters.ts | 8 + src/version2/parameters/sanitiseJqlQueries.ts | 3 - .../sanitiseJqlQueriesParameters.ts | 9 + .../parameters/saveTemplateParameters.ts | 12 + src/version2/parameters/search.ts | 20 - ...rchAndReconsileIssuesUsingJqlParameters.ts | 82 + ...ndReconsileIssuesUsingJqlPostParameters.ts | 76 + src/version2/parameters/searchForIssuesIds.ts | 3 - .../parameters/searchForIssuesUsingJql.ts | 85 - .../searchForIssuesUsingJqlEnhancedSearch.ts | 79 - ...archForIssuesUsingJqlEnhancedSearchPost.ts | 3 - .../parameters/searchForIssuesUsingJqlPost.ts | 3 - src/version2/parameters/searchParameters.ts | 16 + src/version2/parameters/searchPriorities.ts | 22 - src/version2/parameters/searchProjects.ts | 131 -- .../parameters/searchProjectsParameters.ts | 133 ++ .../searchProjectsUsingSecuritySchemes.ts | 10 - ...hProjectsUsingSecuritySchemesParameters.ts | 16 + src/version2/parameters/searchResolutions.ts | 13 - .../parameters/searchResolutionsParameters.ts | 17 + .../parameters/searchSecuritySchemes.ts | 16 - .../searchSecuritySchemesParameters.ts | 20 + src/version2/parameters/searchWorkflows.ts | 25 - .../parameters/searchWorkflowsParameters.ts | 31 + .../selectTimeTrackingImplementation.ts | 3 - ...ectTimeTrackingImplementationParameters.ts | 18 + src/version2/parameters/services.ts | 4 - src/version2/parameters/servicesParameters.ts | 8 + src/version2/parameters/setActors.ts | 11 - .../parameters/setActorsParameters.ts | 33 + .../parameters/setApplicationProperty.ts | 14 - .../setApplicationPropertyParameters.ts | 12 + src/version2/parameters/setBanner.ts | 3 - .../parameters/setBannerParameters.ts | 14 + src/version2/parameters/setColumns.ts | 5 - .../parameters/setColumnsParameters.ts | 9 + src/version2/parameters/setCommentProperty.ts | 8 - .../setCommentPropertyParameters.ts | 10 + .../parameters/setDashboardItemProperty.ts | 14 - .../setDashboardItemPropertyParameters.ts | 16 + src/version2/parameters/setDefaultLevels.ts | 3 - .../parameters/setDefaultLevelsParameters.ts | 9 + src/version2/parameters/setDefaultPriority.ts | 3 - .../setDefaultPriorityParameters.ts | 11 + .../parameters/setDefaultResolution.ts | 3 - .../setDefaultResolutionParameters.ts | 11 + .../parameters/setDefaultShareScope.ts | 3 - .../setDefaultShareScopeParameters.ts | 14 + src/version2/parameters/setDefaultValues.ts | 6 - .../parameters/setDefaultValuesParameters.ts | 10 + .../parameters/setFavouriteForFilter.ts | 18 - .../setFavouriteForFilterParameters.ts | 23 + .../setFieldConfigurationSchemeMapping.ts | 6 - ...eldConfigurationSchemeMappingParameters.ts | 13 + ...tIssueNavigatorDefaultColumnsParameters.ts | 5 + src/version2/parameters/setIssueProperty.ts | 9 - .../parameters/setIssuePropertyParameters.ts | 10 + .../parameters/setIssueTypeProperty.ts | 8 - .../setIssueTypePropertyParameters.ts | 10 + src/version2/parameters/setPreference.ts | 5 - .../parameters/setPreferenceParameters.ts | 8 + src/version2/parameters/setProjectProperty.ts | 8 - .../setProjectPropertyParameters.ts | 10 + .../setSharedTimeTrackingConfiguration.ts | 3 - ...aredTimeTrackingConfigurationParameters.ts | 16 + src/version2/parameters/setUserColumns.ts | 9 - .../parameters/setUserColumnsParameters.ts | 11 + src/version2/parameters/setUserNavProperty.ts | 9 - .../setUserNavPropertyParameters.ts | 13 + src/version2/parameters/setUserProperty.ts | 11 - .../parameters/setUserPropertyParameters.ts | 25 + .../setWorkflowSchemeDraftIssueType.ts | 22 - ...tWorkflowSchemeDraftIssueTypeParameters.ts | 20 + .../parameters/setWorkflowSchemeIssueType.ts | 24 - .../setWorkflowSchemeIssueTypeParameters.ts | 20 + src/version2/parameters/setWorklogProperty.ts | 8 - .../setWorklogPropertyParameters.ts | 12 + src/version2/parameters/storeAvatar.ts | 18 - .../parameters/storeAvatarParameters.ts | 16 + .../suggestedPrioritiesForMappings.ts | 3 - ...uggestedPrioritiesForMappingsParameters.ts | 16 + .../parameters/toggleFeatureForProject.ts | 8 - .../toggleFeatureForProjectParameters.ts | 12 + src/version2/parameters/trashCustomField.ts | 4 - .../parameters/trashCustomFieldParameters.ts | 8 + src/version2/parameters/trashPlan.ts | 4 - .../parameters/trashPlanParameters.ts | 8 + src/version2/parameters/unarchiveIssues.ts | 3 - .../parameters/unarchiveIssuesParameters.ts | 7 + .../parameters/updateAtlassianTeam.ts | 6 - .../updateAtlassianTeamParameters.ts | 11 + src/version2/parameters/updateComment.ts | 22 - .../parameters/updateCommentParameters.ts | 61 + src/version2/parameters/updateComponent.ts | 6 - .../parameters/updateComponentParameters.ts | 80 + src/version2/parameters/updateCustomField.ts | 6 - .../updateCustomFieldConfiguration.ts | 6 - ...pdateCustomFieldConfigurationParameters.ts | 11 + .../parameters/updateCustomFieldContext.ts | 8 - .../updateCustomFieldContextParameters.ts | 14 + .../parameters/updateCustomFieldOption.ts | 8 - .../updateCustomFieldOptionParameters.ts | 13 + .../parameters/updateCustomFieldParameters.ts | 55 + .../parameters/updateCustomFieldValue.ts | 8 - .../updateCustomFieldValueParameters.ts | 13 + src/version2/parameters/updateDashboard.ts | 11 - .../parameters/updateDashboardParameters.ts | 22 + .../updateDefaultProjectClassification.ts | 6 - ...eDefaultProjectClassificationParameters.ts | 12 + .../parameters/updateDefaultScreenScheme.ts | 7 - .../updateDefaultScreenSchemeParameters.ts | 10 + .../parameters/updateDefaultWorkflow.ts | 6 - .../updateDefaultWorkflowParameters.ts | 15 + .../parameters/updateDraftDefaultWorkflow.ts | 6 - .../updateDraftDefaultWorkflowParameters.ts | 15 + .../parameters/updateDraftWorkflowMapping.ts | 8 - .../updateDraftWorkflowMappingParameters.ts | 21 + .../parameters/updateEntityPropertiesValue.ts | 22 - .../updateEntityPropertiesValueParameters.ts | 20 + .../parameters/updateFieldConfiguration.ts | 6 - .../updateFieldConfigurationItems.ts | 6 - ...updateFieldConfigurationItemsParameters.ts | 11 + .../updateFieldConfigurationParameters.ts | 12 + .../updateFieldConfigurationScheme.ts | 6 - ...pdateFieldConfigurationSchemeParameters.ts | 12 + src/version2/parameters/updateFilter.ts | 25 - .../parameters/updateFilterParameters.ts | 76 + src/version2/parameters/updateGadget.ts | 8 - .../parameters/updateGadgetParameters.ts | 16 + .../parameters/updateIssueFieldOption.ts | 16 - .../updateIssueFieldOptionParameters.ts | 32 + src/version2/parameters/updateIssueFields.ts | 8 - .../parameters/updateIssueFieldsParameters.ts | 11 + .../parameters/updateIssueLinkType.ts | 6 - .../updateIssueLinkTypeParameters.ts | 43 + .../parameters/updateIssueSecurityScheme.ts | 6 - .../updateIssueSecuritySchemeParameters.ts | 12 + src/version2/parameters/updateIssueType.ts | 6 - .../parameters/updateIssueTypeParameters.ts | 21 + .../parameters/updateIssueTypeScheme.ts | 6 - .../updateIssueTypeSchemeParameters.ts | 14 + .../parameters/updateIssueTypeScreenScheme.ts | 6 - .../updateIssueTypeScreenSchemeParameters.ts | 12 + .../updateMultipleCustomFieldValues.ts | 6 - ...dateMultipleCustomFieldValuesParameters.ts | 10 + .../parameters/updateNotificationScheme.ts | 6 - .../updateNotificationSchemeParameters.ts | 12 + .../parameters/updatePermissionScheme.ts | 16 - .../updatePermissionSchemeParameters.ts | 38 + src/version2/parameters/updatePlan.ts | 6 - src/version2/parameters/updatePlanOnlyTeam.ts | 6 - .../updatePlanOnlyTeamParameters.ts | 11 + .../parameters/updatePlanParameters.ts | 11 + .../parameters/updatePrecomputations.ts | 5 - .../updatePrecomputationsParameters.ts | 9 + src/version2/parameters/updatePriority.ts | 6 - .../parameters/updatePriorityScheme.ts | 6 - .../updatePrioritySchemeParameters.ts | 46 + src/version2/parameters/updateProject.ts | 57 - .../parameters/updateProjectAvatar.ts | 6 - .../updateProjectAvatarParameters.ts | 25 + .../parameters/updateProjectCategory.ts | 5 - .../updateProjectCategoryParameters.ts | 15 + src/version2/parameters/updateProjectEmail.ts | 6 - .../updateProjectEmailParameters.ts | 12 + .../parameters/updateProjectParameters.ts | 69 + src/version2/parameters/updateRelatedWork.ts | 6 - .../parameters/updateRelatedWorkParameters.ts | 21 + .../parameters/updateRemoteIssueLink.ts | 8 - .../updateRemoteIssueLinkParameters.ts | 29 + src/version2/parameters/updateResolution.ts | 6 - .../parameters/updateResolutionParameters.ts | 12 + src/version2/parameters/updateSchemes.ts | 3 - .../parameters/updateSchemesParameters.ts | 37 + src/version2/parameters/updateScreen.ts | 6 - .../parameters/updateScreenParameters.ts | 12 + src/version2/parameters/updateScreenScheme.ts | 6 - .../updateScreenSchemeParameters.ts | 17 + .../parameters/updateSecurityLevel.ts | 8 - .../updateSecurityLevelParameters.ts | 14 + src/version2/parameters/updateStatuses.ts | 3 - .../parameters/updateStatusesParameters.ts | 9 + .../parameters/updateUiModification.ts | 6 - .../updateUiModificationParameters.ts | 20 + src/version2/parameters/updateVersion.ts | 6 - .../parameters/updateVersionParameters.ts | 88 + .../parameters/updateWorkflowMapping.ts | 8 - .../updateWorkflowMappingParameters.ts | 21 + .../parameters/updateWorkflowScheme.ts | 9 - .../parameters/updateWorkflowSchemeDraft.ts | 6 - .../updateWorkflowSchemeDraftParameters.ts | 69 + .../updateWorkflowSchemeMappings.ts | 3 - .../updateWorkflowSchemeMappingsParameters.ts | 16 + .../updateWorkflowSchemeParameters.ts | 72 + .../updateWorkflowTransitionProperty.ts | 21 - ...ateWorkflowTransitionRuleConfigurations.ts | 3 - ...wTransitionRuleConfigurationsParameters.ts | 11 + src/version2/parameters/updateWorkflows.ts | 12 - .../parameters/updateWorkflowsParameters.ts | 12 + src/version2/parameters/updateWorklog.ts | 35 - .../parameters/updateWorklogParameters.ts | 74 + .../parameters/validateCreateWorkflows.ts | 6 - .../validateCreateWorkflowsParameters.ts | 10 + src/version2/parameters/validateProjectKey.ts | 4 - .../validateProjectKeyParameters.ts | 8 + .../parameters/validateUpdateWorkflows.ts | 6 - .../validateUpdateWorkflowsParameters.ts | 10 + .../parameters/workflowCapabilities.ts | 5 - .../workflowCapabilitiesParameters.ts | 9 + src/version2/parameters/workflowRuleSearch.ts | 6 - .../workflowRuleSearchParameters.ts | 17 + src/version2/permissionSchemes.ts | 673 +++----- src/version2/permissions.ts | 310 ++-- src/version2/plans.ts | 307 ++-- src/version2/prioritySchemes.ts | 288 +--- src/version2/projectAvatars.ts | 178 +- src/version2/projectCategories.ts | 162 +- src/version2/projectClassificationLevels.ts | 125 +- src/version2/projectComponents.ts | 390 ++--- src/version2/projectEmail.ts | 69 +- src/version2/projectFeatures.ts | 46 +- src/version2/projectKeyAndNameValidation.ts | 93 +- src/version2/projectPermissionSchemes.ts | 156 +- src/version2/projectProperties.ts | 180 +- src/version2/projectRoleActors.ts | 264 +-- src/version2/projectRoles.ts | 448 ++--- src/version2/projectTemplates.ts | 150 +- src/version2/projectTypes.ts | 108 +- src/version2/projectVersions.ts | 585 +++---- src/version2/projects.ts | 620 +++---- .../{models => schemas}/actorInput.ts | 14 +- src/version2/schemas/actorsMap.ts | 15 + .../schemas/addAtlassianTeamRequest.ts | 16 + src/version2/schemas/addField.ts | 8 + src/version2/schemas/addGroup.ts | 8 + .../schemas/addNotificationsDetails.ts | 10 + .../schemas/addSecuritySchemeLevelsRequest.ts | 9 + .../announcementBannerConfiguration.ts | 17 + .../announcementBannerConfigurationUpdate.ts | 15 + .../schemas/appWorkflowTransitionRule.ts | 14 + src/version2/schemas/application.ts | 16 + src/version2/schemas/applicationProperty.ts | 24 + src/version2/schemas/applicationRole.ts | 41 + src/version2/schemas/approvalConfiguration.ts | 33 + .../schemas/archiveIssueAsyncRequest.ts | 7 + .../schemas/archivedIssuesFilterRequest.ts | 17 + ...ieldConfigurationsWithIssueTypesRequest.ts | 12 + ...sociateSecuritySchemeWithProjectDetails.ts | 14 + src/version2/schemas/associatedItemBean.ts | 17 + .../schemas/associationContextObject.ts | 9 + src/version2/schemas/attachment.ts | 25 + src/version2/schemas/attachmentArchive.ts | 11 + .../schemas/attachmentArchiveEntry.ts | 11 + src/version2/schemas/attachmentArchiveImpl.ts | 11 + .../schemas/attachmentArchiveItemReadable.ts | 17 + .../attachmentArchiveMetadataReadable.ts | 18 + src/version2/schemas/attachmentMetadata.ts | 27 + src/version2/schemas/attachmentSettings.ts | 11 + src/version2/schemas/auditRecordBean.ts | 33 + src/version2/schemas/auditRecords.ts | 16 + .../schemas/autoCompleteSuggestion.ts | 14 + .../schemas/autoCompleteSuggestions.ts | 10 + .../schemas/availableDashboardGadget.ts | 13 + .../availableDashboardGadgetsResponse.ts | 10 + .../schemas/availableWorkflowConnectRule.ts | 25 + .../schemas/availableWorkflowForgeRule.ts | 17 + .../schemas/availableWorkflowSystemRule.ts | 21 + .../schemas/availableWorkflowTriggerTypes.ts | 13 + .../schemas/availableWorkflowTriggers.ts | 12 + src/version2/schemas/avatar.ts | 24 + src/version2/schemas/avatarUrlsBean.ts | 14 + src/version2/schemas/avatars.ts | 12 + src/version2/schemas/boardColumnPayload.ts | 16 + src/version2/schemas/boardFeaturePayload.ts | 11 + src/version2/schemas/boardPayload.ts | 38 + src/version2/schemas/boardsPayload.ts | 9 + .../schemas/bulkChangeOwnerDetails.ts | 11 + .../schemas/bulkChangelogRequestBean.ts | 15 + .../schemas/bulkChangelogResponseBean.ts | 15 + .../schemas/bulkContextualConfiguration.ts | 17 + .../bulkCustomFieldOptionCreateRequest.ts | 10 + .../bulkCustomFieldOptionUpdateRequest.ts | 10 + src/version2/schemas/bulkEditActionError.ts | 11 + .../schemas/bulkEditShareableEntityRequest.ts | 17 + .../bulkEditShareableEntityResponse.ts | 11 + .../schemas/bulkFetchIssueRequestBean.ts | 53 + src/version2/schemas/bulkIssueIsWatching.ts | 9 + .../schemas/bulkIssuePropertyUpdateRequest.ts | 21 + src/version2/schemas/bulkIssueResults.ts | 17 + .../schemas/bulkOperationErrorResult.ts | 10 + src/version2/schemas/bulkPermissionGrants.ts | 12 + .../schemas/bulkPermissionsRequestBean.ts | 14 + .../schemas/bulkProjectPermissionGrants.ts | 13 + .../schemas/bulkProjectPermissions.ts | 13 + src/version2/schemas/bulkRedactionRequest.ts | 8 + src/version2/schemas/bulkRedactionResponse.ts | 9 + src/version2/schemas/cardLayout.ts | 9 + src/version2/schemas/cardLayoutField.ts | 11 + src/version2/schemas/changeDetails.ts | 21 + src/version2/schemas/changeFilterOwner.ts | 9 + src/version2/schemas/changedValueBean.ts | 13 + src/version2/schemas/changedWorklog.ts | 14 + src/version2/schemas/changedWorklogs.ts | 19 + src/version2/schemas/changelog.ts | 18 + src/version2/schemas/columnItem.ts | 11 + src/version2/schemas/columnRequestBody.ts | 7 + src/version2/schemas/comment.ts | 44 + src/version2/schemas/componentIssuesCount.ts | 11 + src/version2/schemas/componentJsonBean.ts | 12 + .../schemas/componentWithIssueCount.ts | 61 + src/version2/schemas/compoundClause.ts | 17 + .../schemas/conditionGroupConfiguration.ts | 19 + src/version2/schemas/conditionGroupPayload.ts | 19 + src/version2/schemas/conditionGroupUpdate.ts | 19 + src/version2/schemas/configuration.ts | 32 + .../schemas/configurationsListParameters.ts | 9 + .../schemas/connectCustomFieldValue.ts | 44 + .../schemas/connectCustomFieldValues.ts | 10 + src/version2/schemas/connectModule.ts | 11 + src/version2/schemas/connectModules.ts | 12 + .../schemas/connectWorkflowTransitionRule.ts | 15 + .../schemas/containerForProjectFeatures.ts | 10 + .../schemas/containerForRegisteredWebhooks.ts | 10 + .../schemas/containerForWebhookIDs.ts | 9 + .../containerOfWorkflowSchemeAssociations.ts | 10 + src/version2/schemas/contentItem.ts | 25 + src/version2/schemas/context.ts | 13 + .../schemas/contextForProjectAndIssueType.ts | 13 + .../schemas/contextualConfiguration.ts | 15 + src/version2/schemas/convertedJQLQueries.ts | 12 + .../createCrossProjectReleaseRequest.ts | 10 + .../schemas/createCustomFieldContext.ts | 17 + .../schemas/createCustomFieldRequest.ts | 10 + .../schemas/createDateFieldRequest.ts | 10 + .../schemas/createExclusionRulesRequest.ts | 18 + .../createIssueSecuritySchemeDetails.ts | 14 + .../schemas/createIssueSourceRequest.ts | 13 + .../createNotificationSchemeDetails.ts | 14 + .../schemas/createPermissionHolderRequest.ts | 13 + .../schemas/createPermissionRequest.ts | 10 + .../schemas/createPlanOnlyTeamRequest.ts | 18 + src/version2/schemas/createPlanRequest.ts | 26 + src/version2/schemas/createPriorityDetails.ts | 46 + .../schemas/createPrioritySchemeDetails.ts | 40 + src/version2/schemas/createProjectDetails.ts | 140 ++ .../schemas/createResolutionDetails.ts | 11 + .../schemas/createSchedulingRequest.ts | 16 + .../schemas/createUiModificationDetails.ts | 16 + .../schemas/createUpdateRoleRequestBean.ts | 16 + .../schemas/createWorkflowCondition.ts | 16 + src/version2/schemas/createWorkflowDetails.ts | 35 + .../schemas/createWorkflowStatusDetails.ts | 11 + .../createWorkflowTransitionDetails.ts | 23 + .../schemas/createWorkflowTransitionRule.ts | 11 + .../createWorkflowTransitionRulesDetails.ts | 75 + .../createWorkflowTransitionScreenDetails.ts | 9 + src/version2/schemas/createdIssue.ts | 17 + src/version2/schemas/createdIssues.ts | 13 + src/version2/schemas/customContextVariable.ts | 8 + .../schemas/customFieldConfigurations.ts | 10 + src/version2/schemas/customFieldContext.ts | 17 + .../schemas/customFieldContextDefaultValue.ts | 5 + ...FieldContextDefaultValueCascadingOption.ts | 16 + .../customFieldContextDefaultValueDate.ts | 12 + .../customFieldContextDefaultValueDateTime.ts | 12 + .../customFieldContextDefaultValueFloat.ts | 10 + ...ldContextDefaultValueForgeDateTimeField.ts | 16 + ...FieldContextDefaultValueForgeGroupField.ts | 14 + ...ContextDefaultValueForgeMultiGroupField.ts | 14 + ...ontextDefaultValueForgeMultiStringField.ts | 12 + ...dContextDefaultValueForgeMultiUserField.ts | 14 + ...ieldContextDefaultValueForgeNumberField.ts | 14 + ...ieldContextDefaultValueForgeObjectField.ts | 12 + ...ieldContextDefaultValueForgeStringField.ts | 14 + ...mFieldContextDefaultValueForgeUserField.ts | 16 + .../customFieldContextDefaultValueLabels.ts | 10 + ...FieldContextDefaultValueMultiUserPicker.ts | 14 + ...dContextDefaultValueMultipleGroupPicker.ts | 14 + ...mFieldContextDefaultValueMultipleOption.ts | 14 + ...ontextDefaultValueMultipleVersionPicker.ts | 17 + .../customFieldContextDefaultValueProject.ts | 12 + .../customFieldContextDefaultValueReadOnly.ts | 10 + ...eldContextDefaultValueSingleGroupPicker.ts | 14 + ...tomFieldContextDefaultValueSingleOption.ts | 14 + ...dContextDefaultValueSingleVersionPicker.ts | 17 + .../customFieldContextDefaultValueTextArea.ts | 10 + ...customFieldContextDefaultValueTextField.ts | 10 + .../customFieldContextDefaultValueURL.ts | 12 + .../customFieldContextDefaultValueUpdate.ts | 9 + .../schemas/customFieldContextOption.ts | 15 + .../customFieldContextProjectMapping.ts | 13 + ...tomFieldContextSingleUserPickerDefaults.ts | 16 + .../customFieldContextUpdateDetails.ts | 11 + .../customFieldCreatedContextOptionsList.ts | 10 + .../schemas/customFieldDefinitionJsonBean.ts | 107 ++ src/version2/schemas/customFieldOption.ts | 11 + .../schemas/customFieldOptionCreate.ts | 13 + .../schemas/customFieldOptionUpdate.ts | 13 + src/version2/schemas/customFieldPayload.ts | 25 + .../schemas/customFieldReplacement.ts | 11 + .../customFieldUpdatedContextOptionsList.ts | 10 + .../schemas/customFieldValueUpdate.ts | 27 + .../schemas/customFieldValueUpdateDetails.ts | 10 + src/version2/schemas/customTemplateOptions.ts | 16 + .../schemas/customTemplateRequestDTO.ts | 27 + .../schemas/customTemplatesProjectDetails.ts | 43 + src/version2/schemas/dashboard.ts | 35 + src/version2/schemas/dashboardDetails.ts | 16 + src/version2/schemas/dashboardGadget.ts | 19 + .../schemas/dashboardGadgetPosition.ts | 14 + .../schemas/dashboardGadgetResponse.ts | 10 + .../schemas/dashboardGadgetSettings.ts | 25 + .../schemas/dashboardGadgetUpdateRequest.ts | 13 + .../schemas/dataClassificationLevelsBean.ts | 10 + .../schemas/dataClassificationTagBean.ts | 21 + .../schemas/dateRangeFilterRequest.ts | 11 + src/version2/schemas/defaultLevelValue.ts | 14 + src/version2/schemas/defaultShareScope.ts | 15 + src/version2/schemas/defaultWorkflow.ts | 14 + .../schemas/defaultWorkflowEditorResponse.ts | 7 + .../schemas/deleteAndReplaceVersionBean.ts | 16 + src/version2/schemas/deprecatedWorkflow.ts | 26 + .../schemas/detailedErrorCollection.ts | 15 + src/version2/schemas/documentVersion.ts | 11 + src/version2/schemas/duplicatePlanRequest.ts | 8 + src/version2/schemas/editTemplateRequest.ts | 15 + src/version2/schemas/entityProperty.ts | 14 + src/version2/schemas/entityPropertyDetails.ts | 12 + src/version2/schemas/error.ts | 9 + src/version2/schemas/errorCollection.ts | 15 + src/version2/schemas/errorCollections.ts | 5 + src/version2/schemas/errorMessage.ts | 8 + src/version2/schemas/errors.ts | 12 + src/version2/schemas/eventNotification.ts | 61 + .../schemas/expandPrioritySchemeBean.ts | 13 + .../schemas/expandPrioritySchemePage.ts | 9 + ...xportArchivedIssuesTaskProgressResponse.ts | 13 + src/version2/schemas/failedWebhook.ts | 15 + src/version2/schemas/failedWebhooks.ts | 21 + src/version2/schemas/field.ts | 35 + .../schemas/fieldAssociationsRequest.ts | 13 + .../schemas/fieldCapabilityPayload.ts | 38 + src/version2/schemas/fieldChangedClause.ts | 18 + src/version2/schemas/fieldConfiguration.ts | 15 + .../schemas/fieldConfigurationDetails.ts | 11 + .../fieldConfigurationIssueTypeItem.ts | 16 + .../schemas/fieldConfigurationItem.ts | 17 + .../schemas/fieldConfigurationItemsDetails.ts | 10 + .../schemas/fieldConfigurationScheme.ts | 13 + ...ldConfigurationSchemeProjectAssociation.ts | 16 + .../fieldConfigurationSchemeProjects.ts | 11 + .../fieldConfigurationToIssueTypeMapping.ts | 14 + src/version2/schemas/fieldCreateMetadata.ts | 29 + src/version2/schemas/fieldDetails.ts | 30 + src/version2/schemas/fieldIdIdentifier.ts | 5 + src/version2/schemas/fieldIdentifierObject.ts | 9 + src/version2/schemas/fieldLastUsed.ts | 17 + .../schemas/fieldLayoutConfiguration.ts | 16 + src/version2/schemas/fieldLayoutPayload.ts | 25 + .../schemas/fieldLayoutSchemePayload.ts | 24 + src/version2/schemas/fieldMetadata.ts | 27 + src/version2/schemas/fieldReferenceData.ts | 36 + src/version2/schemas/fieldUpdateOperation.ts | 17 + src/version2/schemas/fieldValueClause.ts | 13 + src/version2/schemas/fieldWasClause.ts | 20 + src/version2/schemas/fields.ts | 22 + src/version2/schemas/filter.ts | 55 + src/version2/schemas/filterDetails.ts | 59 + src/version2/schemas/filterSubscription.ts | 13 + .../schemas/filterSubscriptionsList.ts | 26 + src/version2/schemas/foundGroup.ts | 32 + src/version2/schemas/foundGroups.ts | 16 + src/version2/schemas/foundUsers.ts | 16 + src/version2/schemas/foundUsersAndGroups.ts | 11 + src/version2/schemas/fromLayoutPayload.ts | 13 + src/version2/schemas/functionOperand.ts | 16 + src/version2/schemas/functionReferenceData.ts | 17 + .../schemas/getAtlassianTeamResponse.ts | 16 + .../schemas/getCrossProjectReleaseResponse.ts | 10 + .../schemas/getCustomFieldResponse.ts | 10 + src/version2/schemas/getDateFieldResponse.ts | 10 + .../schemas/getExclusionRulesResponse.ts | 18 + .../schemas/getIssueSourceResponse.ts | 13 + .../schemas/getPermissionHolderResponse.ts | 13 + src/version2/schemas/getPermissionResponse.ts | 10 + .../schemas/getPlanOnlyTeamResponse.ts | 20 + src/version2/schemas/getPlanResponse.ts | 32 + .../schemas/getPlanResponseForPage.ts | 17 + src/version2/schemas/getSchedulingResponse.ts | 16 + .../schemas/getTeamResponseForPage.ts | 12 + src/version2/schemas/globalScopeBean.ts | 12 + src/version2/schemas/group.ts | 23 + src/version2/schemas/groupDetails.ts | 14 + src/version2/schemas/groupLabel.ts | 13 + src/version2/schemas/groupName.ts | 16 + src/version2/schemas/healthCheckResult.ts | 13 + src/version2/schemas/hierarchy.ts | 16 + src/version2/schemas/historyMetadata.ts | 29 + .../schemas/historyMetadataParticipant.ts | 19 + src/version2/schemas/icon.ts | 26 + src/version2/schemas/iconBean.ts | 13 + src/version2/schemas/idBean.ts | 11 + src/version2/schemas/idOrKeyBean.ts | 10 + src/version2/schemas/includedFields.ts | 9 + src/version2/schemas/inputStreamSource.ts | 7 + .../schemas/issueArchivalSyncRequest.ts | 8 + .../schemas/issueArchivalSyncResponse.ts | 10 + src/version2/schemas/issueBean.ts | 37 + src/version2/schemas/issueChangeLog.ts | 12 + src/version2/schemas/issueChangelogIds.ts | 9 + .../schemas/issueCommentListRequestBean.ts | 8 + src/version2/schemas/issueContextVariable.ts | 16 + src/version2/schemas/issueCreateMetadata.ts | 12 + src/version2/schemas/issueEntityProperties.ts | 14 + .../issueEntityPropertiesForMultiUpdate.ts | 14 + src/version2/schemas/issueError.ts | 11 + src/version2/schemas/issueEvent.ts | 11 + src/version2/schemas/issueFieldOption.ts | 20 + .../schemas/issueFieldOptionConfiguration.ts | 14 + .../schemas/issueFieldOptionCreateBean.ts | 16 + .../schemas/issueFieldOptionScopeBean.ts | 20 + .../issueFilterForBulkPropertyDelete.ts | 11 + .../schemas/issueFilterForBulkPropertySet.ts | 13 + .../schemas/issueLayoutItemPayload.ts | 13 + src/version2/schemas/issueLayoutPayload.ts | 15 + .../schemas/issueLimitReportResponseBean.ts | 12 + src/version2/schemas/issueLink.ts | 23 + src/version2/schemas/issueLinkType.ts | 48 + src/version2/schemas/issueLinkTypes.ts | 10 + src/version2/schemas/issueList.ts | 9 + src/version2/schemas/issueMatches.ts | 9 + src/version2/schemas/issueMatchesForJQL.ts | 11 + .../schemas/issuePickerSuggestions.ts | 10 + .../issuePickerSuggestionsIssueType.ts | 18 + .../schemas/issueSecurityLevelMember.ts | 17 + .../issueSecuritySchemeToProjectMapping.ts | 9 + src/version2/schemas/issueTransition.ts | 31 + src/version2/schemas/issueTypeCreateBean.ts | 27 + src/version2/schemas/issueTypeDetails.ts | 27 + .../schemas/issueTypeHierarchyPayload.ts | 18 + src/version2/schemas/issueTypeIds.ts | 9 + src/version2/schemas/issueTypeIdsToRemove.ts | 12 + src/version2/schemas/issueTypeInfo.ts | 13 + .../schemas/issueTypeIssueCreateMetadata.ts | 31 + src/version2/schemas/issueTypePayload.ts | 26 + .../schemas/issueTypeProjectCreatePayload.ts | 21 + src/version2/schemas/issueTypeScheme.ts | 17 + .../schemas/issueTypeSchemeDetails.ts | 15 + src/version2/schemas/issueTypeSchemeID.ts | 9 + .../schemas/issueTypeSchemeMapping.ts | 11 + .../schemas/issueTypeSchemePayload.ts | 16 + .../issueTypeSchemeProjectAssociation.ts | 11 + .../schemas/issueTypeSchemeProjects.ts | 11 + .../schemas/issueTypeSchemeUpdateDetails.ts | 13 + src/version2/schemas/issueTypeScreenScheme.ts | 13 + .../schemas/issueTypeScreenSchemeDetails.ts | 17 + .../schemas/issueTypeScreenSchemeId.ts | 9 + .../schemas/issueTypeScreenSchemeItem.ts | 17 + .../schemas/issueTypeScreenSchemeMapping.ts | 14 + .../issueTypeScreenSchemeMappingDetails.ts | 13 + .../schemas/issueTypeScreenSchemePayload.ts | 22 + ...issueTypeScreenSchemeProjectAssociation.ts | 11 + .../issueTypeScreenSchemeUpdateDetails.ts | 11 + .../schemas/issueTypeScreenSchemesProjects.ts | 11 + .../schemas/issueTypeToContextMapping.ts | 13 + src/version2/schemas/issueTypeUpdateBean.ts | 19 + src/version2/schemas/issueTypeWithStatus.ts | 18 + .../schemas/issueTypeWorkflowMapping.ts | 17 + .../schemas/issueTypesWorkflowMapping.ts | 18 + src/version2/schemas/issueUpdateDetails.ts | 25 + src/version2/schemas/issueUpdateMetadata.ts | 8 + src/version2/schemas/issuesAndJQLQueries.ts | 11 + src/version2/schemas/issuesJqlMetaDataBean.ts | 17 + src/version2/schemas/issuesMetaBean.ts | 9 + src/version2/schemas/issuesUpdateBean.ts | 8 + .../jExpEvaluateIssuesJqlMetaDataBean.ts | 14 + .../schemas/jExpEvaluateIssuesMetaBean.ts | 12 + .../jExpEvaluateJiraExpressionResultBean.ts | 19 + .../schemas/jExpEvaluateMetaDataBean.ts | 20 + src/version2/schemas/jQLCountRequestBean.ts | 11 + src/version2/schemas/jQLCountResultsBean.ts | 8 + .../jQLPersonalDataMigrationRequest.ts | 9 + .../schemas/jQLQueryWithUnknownUsers.ts | 11 + src/version2/schemas/jQLReferenceData.ts | 15 + src/version2/schemas/jexpEvaluateCtxIssues.ts | 12 + .../schemas/jexpEvaluateCtxJqlIssues.ts | 23 + src/version2/schemas/jexpIssues.ts | 9 + src/version2/schemas/jexpJqlIssues.ts | 23 + .../schemas/jiraExpressionAnalysis.ts | 21 + .../schemas/jiraExpressionComplexity.ts | 20 + .../schemas/jiraExpressionEvalContextBean.ts | 36 + .../schemas/jiraExpressionEvalRequestBean.ts | 10 + .../jiraExpressionEvaluateContextBean.ts | 36 + .../jiraExpressionEvaluateRequestBean.ts | 14 + .../jiraExpressionEvaluationMetaDataBean.ts | 16 + .../schemas/jiraExpressionForAnalysis.ts | 16 + src/version2/schemas/jiraExpressionResult.ts | 16 + .../schemas/jiraExpressionValidationError.ts | 22 + .../schemas/jiraExpressionsAnalysis.ts | 10 + .../schemas/jiraExpressionsComplexityBean.ts | 21 + .../jiraExpressionsComplexityValueBean.ts | 10 + src/version2/schemas/jiraStatus.ts | 17 + src/version2/schemas/jiraWorkflow.ts | 37 + src/version2/schemas/jiraWorkflowStatus.ts | 19 + .../schemas/jqlFunctionPrecomputationBean.ts | 29 + ...jqlFunctionPrecomputationGetByIdRequest.ts | 8 + ...qlFunctionPrecomputationGetByIdResponse.ts | 12 + .../jqlFunctionPrecomputationUpdateBean.ts | 16 + ...nctionPrecomputationUpdateErrorResponse.ts | 13 + ...FunctionPrecomputationUpdateRequestBean.ts | 11 + ...jqlFunctionPrecomputationUpdateResponse.ts | 12 + src/version2/schemas/jqlQueriesToParse.ts | 9 + src/version2/schemas/jqlQueriesToSanitize.ts | 10 + src/version2/schemas/jqlQuery.ts | 11 + src/version2/schemas/jqlQueryClause.ts | 6 + src/version2/schemas/jqlQueryClauseOperand.ts | 6 + .../schemas/jqlQueryClauseTimePredicate.ts | 11 + src/version2/schemas/jqlQueryField.ts | 17 + .../schemas/jqlQueryFieldEntityProperty.ts | 19 + src/version2/schemas/jqlQueryOrderByClause.ts | 10 + .../schemas/jqlQueryOrderByClauseElement.ts | 11 + src/version2/schemas/jqlQueryToSanitize.ts | 17 + .../schemas/jqlQueryUnitaryOperand.ts | 6 + src/version2/schemas/jsonContextVariable.ts | 11 + src/version2/schemas/jsonNode.ts | 42 + src/version2/schemas/jsonTypeBean.ts | 19 + src/version2/schemas/keywordOperand.ts | 13 + .../schemas/legacyJackson1ListAttachment.ts | 6 + .../schemas/legacyJackson1ListColumnItem.ts | 6 + .../schemas/legacyJackson1ListIssueEvent.ts | 6 + .../legacyJackson1ListIssueTypeWithStatus.ts | 6 + .../schemas/legacyJackson1ListProject.ts | 6 + .../legacyJackson1ListProjectComponent.ts | 6 + .../legacyJackson1ListProjectRoleDetails.ts | 6 + .../schemas/legacyJackson1ListProjectType.ts | 6 + .../legacyJackson1ListUserMigrationBean.ts | 6 + .../schemas/legacyJackson1ListVersion.ts | 6 + .../schemas/legacyJackson1ListWorklog.ts | 6 + src/version2/schemas/license.ts | 10 + src/version2/schemas/licenseMetric.ts | 14 + src/version2/schemas/licensedApplication.ts | 11 + src/version2/schemas/linkGroup.ts | 15 + .../schemas/linkIssueRequestJsonBean.ts | 13 + src/version2/schemas/linkedIssue.ts | 15 + src/version2/schemas/listOperand.ts | 12 + .../listWrapperCallbackApplicationRole.ts | 5 + .../schemas/listWrapperCallbackGroupName.ts | 5 + src/version2/schemas/locale.ts | 13 + .../schemas/mappingsByIssueTypeOverride.ts | 16 + src/version2/schemas/mappingsByWorkflow.ts | 18 + src/version2/schemas/moveFieldBean.ts | 13 + .../schemas/multiIssueEntityProperties.ts | 13 + src/version2/schemas/multipartFile.ts | 15 + .../multipleCustomFieldValuesUpdate.ts | 29 + .../multipleCustomFieldValuesUpdateDetails.ts | 9 + src/version2/schemas/nestedResponse.ts | 11 + src/version2/schemas/newUserDetails.ts | 40 + src/version2/schemas/nonWorkingDay.ts | 8 + src/version2/schemas/notification.ts | 20 + src/version2/schemas/notificationEvent.ts | 19 + .../schemas/notificationRecipients.ts | 23 + .../notificationRecipientsRestrictions.ts | 15 + src/version2/schemas/notificationScheme.ts | 23 + ...ficationSchemeAndProjectMappingJsonBean.ts | 10 + .../schemas/notificationSchemeEvent.ts | 11 + .../schemas/notificationSchemeEventDetails.ts | 12 + .../notificationSchemeEventIDPayload.ts | 9 + .../schemas/notificationSchemeEventPayload.ts | 12 + .../schemas/notificationSchemeEventTypeId.ts | 9 + src/version2/schemas/notificationSchemeId.ts | 9 + .../notificationSchemeNotificationDetails.ts | 11 + ...icationSchemeNotificationDetailsPayload.ts | 13 + .../schemas/notificationSchemePayload.ts | 21 + .../oldToNewSecurityLevelMappingsBean.ts | 10 + src/version2/schemas/operationMessage.ts | 10 + src/version2/schemas/operations.ts | 10 + .../schemas/orderOfCustomFieldOptions.ts | 19 + src/version2/schemas/orderOfIssueTypes.ts | 16 + .../schemas/pageBean2ComponentJsonBean.ts | 22 + .../pageBean2JqlFunctionPrecomputationBean.ts | 22 + .../pageBeanBulkContextualConfiguration.ts | 22 + src/version2/schemas/pageBeanChangelog.ts | 22 + src/version2/schemas/pageBeanComment.ts | 22 + .../pageBeanComponentWithIssueCount.ts | 22 + src/version2/schemas/pageBeanContext.ts | 22 + .../pageBeanContextForProjectAndIssueType.ts | 22 + .../pageBeanContextualConfiguration.ts | 22 + .../schemas/pageBeanCustomFieldContext.ts | 22 + .../pageBeanCustomFieldContextDefaultValue.ts | 22 + .../pageBeanCustomFieldContextOption.ts | 22 + ...ageBeanCustomFieldContextProjectMapping.ts | 22 + src/version2/schemas/pageBeanDashboard.ts | 22 + src/version2/schemas/pageBeanField.ts | 22 + .../pageBeanFieldConfigurationDetails.ts | 22 + ...pageBeanFieldConfigurationIssueTypeItem.ts | 22 + .../schemas/pageBeanFieldConfigurationItem.ts | 22 + .../pageBeanFieldConfigurationScheme.ts | 22 + ...ageBeanFieldConfigurationSchemeProjects.ts | 22 + src/version2/schemas/pageBeanFilterDetails.ts | 22 + src/version2/schemas/pageBeanGroupDetails.ts | 22 + .../schemas/pageBeanIssueFieldOption.ts | 22 + .../pageBeanIssueSecurityLevelMember.ts | 22 + ...BeanIssueSecuritySchemeToProjectMapping.ts | 24 + .../schemas/pageBeanIssueTypeScheme.ts | 22 + .../schemas/pageBeanIssueTypeSchemeMapping.ts | 22 + .../pageBeanIssueTypeSchemeProjects.ts | 22 + .../schemas/pageBeanIssueTypeScreenScheme.ts | 22 + .../pageBeanIssueTypeScreenSchemeItem.ts | 22 + .../pageBeanIssueTypeScreenSchemesProjects.ts | 22 + .../pageBeanIssueTypeToContextMapping.ts | 22 + .../schemas/pageBeanNotificationScheme.ts | 22 + ...ficationSchemeAndProjectMappingJsonBean.ts | 24 + src/version2/schemas/pageBeanPriority.ts | 22 + ...chemeWithPaginatedPrioritiesAndProjects.ts | 24 + .../schemas/pageBeanPriorityWithSequence.ts | 22 + src/version2/schemas/pageBeanProject.ts | 22 + .../schemas/pageBeanProjectDetails.ts | 22 + .../schemas/pageBeanResolutionJsonBean.ts | 22 + src/version2/schemas/pageBeanScreen.ts | 22 + src/version2/schemas/pageBeanScreenScheme.ts | 22 + src/version2/schemas/pageBeanScreenWithTab.ts | 22 + src/version2/schemas/pageBeanSecurityLevel.ts | 22 + .../schemas/pageBeanSecurityLevelMember.ts | 22 + .../pageBeanSecuritySchemeWithProjects.ts | 22 + src/version2/schemas/pageBeanString.ts | 21 + .../schemas/pageBeanUiModificationDetails.ts | 22 + src/version2/schemas/pageBeanUser.ts | 22 + src/version2/schemas/pageBeanUserDetails.ts | 22 + src/version2/schemas/pageBeanUserKey.ts | 22 + src/version2/schemas/pageBeanVersion.ts | 22 + src/version2/schemas/pageBeanWebhook.ts | 22 + src/version2/schemas/pageBeanWorkflow.ts | 22 + .../schemas/pageBeanWorkflowScheme.ts | 22 + .../pageBeanWorkflowTransitionRules.ts | 22 + src/version2/schemas/pageOfChangelogs.ts | 16 + src/version2/schemas/pageOfComments.ts | 16 + .../pageOfCreateMetaIssueTypeWithField.ts | 17 + .../schemas/pageOfCreateMetaIssueTypes.ts | 17 + src/version2/schemas/pageOfDashboards.ts | 20 + src/version2/schemas/pageOfStatuses.ts | 21 + src/version2/schemas/pageOfWorklogs.ts | 16 + .../pageWithCursorGetPlanResponseForPage.ts | 13 + .../pageWithCursorGetTeamResponseForPage.ts | 13 + .../pagedListUserDetailsApplicationUser.ts | 29 + .../schemas/paginatedResponseComment.ts | 11 + .../paginatedResponseFieldCreateMetadata.ts | 11 + ...tedResponseIssueTypeIssueCreateMetadata.ts | 13 + src/version2/schemas/parsedJqlQueries.ts | 10 + src/version2/schemas/parsedJqlQuery.ts | 15 + src/version2/schemas/permissionDetails.ts | 12 + src/version2/schemas/permissionGrant.ts | 26 + src/version2/schemas/permissionGrantDTO.ts | 16 + src/version2/schemas/permissionGrants.ts | 12 + src/version2/schemas/permissionHolder.ts | 21 + src/version2/schemas/permissionPayloadDTO.ts | 24 + src/version2/schemas/permissionScheme.ts | 25 + src/version2/schemas/permissionSchemes.ts | 10 + src/version2/schemas/permissions.ts | 9 + src/version2/schemas/permissionsKeysBean.ts | 8 + src/version2/schemas/permittedProjects.ts | 10 + src/version2/schemas/priority.ts | 28 + src/version2/schemas/priorityId.ts | 9 + src/version2/schemas/priorityMapping.ts | 24 + .../prioritySchemeChangesWithoutMappings.ts | 8 + src/version2/schemas/prioritySchemeId.ts | 11 + ...chemeWithPaginatedPrioritiesAndProjects.ts | 25 + src/version2/schemas/priorityWithSequence.ts | 23 + src/version2/schemas/project.ts | 88 + .../schemas/projectAndIssueTypePair.ts | 11 + src/version2/schemas/projectArchetype.ts | 9 + src/version2/schemas/projectAvatars.ts | 12 + src/version2/schemas/projectCategory.ts | 15 + src/version2/schemas/projectComponent.ts | 79 + .../projectCreateResourceIdentifier.ts | 21 + .../projectCustomTemplateCreateRequestDTO.ts | 11 + src/version2/schemas/projectDataPolicies.ts | 10 + src/version2/schemas/projectDataPolicy.ts | 9 + src/version2/schemas/projectDetails.ts | 27 + src/version2/schemas/projectEmailAddress.ts | 11 + src/version2/schemas/projectFeature.ts | 26 + src/version2/schemas/projectFeatureState.ts | 9 + src/version2/schemas/projectId.ts | 9 + .../schemas/projectIdAssociationContext.ts | 5 + src/version2/schemas/projectIdentifierBean.ts | 11 + src/version2/schemas/projectIdentifiers.ts | 13 + src/version2/schemas/projectIds.ts | 9 + src/version2/schemas/projectInsight.ts | 11 + .../schemas/projectIssueCreateMetadata.ts | 22 + .../schemas/projectIssueSecurityLevels.ts | 10 + .../schemas/projectIssueTypeHierarchy.ts | 12 + .../schemas/projectIssueTypeMapping.ts | 11 + .../schemas/projectIssueTypeMappings.ts | 10 + .../projectIssueTypesHierarchyLevel.ts | 20 + .../schemas/projectLandingPageInfo.ts | 17 + src/version2/schemas/projectPayload.ts | 23 + src/version2/schemas/projectPermissions.ts | 9 + src/version2/schemas/projectRole.ts | 33 + .../schemas/projectRoleActorsUpdateBean.ts | 26 + src/version2/schemas/projectRoleDetails.ts | 28 + src/version2/schemas/projectRoleGroup.ts | 13 + src/version2/schemas/projectRoleUser.ts | 13 + src/version2/schemas/projectScopeBean.ts | 14 + src/version2/schemas/projectTemplateKey.ts | 8 + src/version2/schemas/projectTemplateModel.ts | 18 + src/version2/schemas/projectType.ts | 17 + src/version2/schemas/projectUsage.ts | 9 + src/version2/schemas/projectUsagePage.ts | 12 + src/version2/schemas/projectWithDataPolicy.ts | 11 + src/version2/schemas/propertyKey.ts | 11 + src/version2/schemas/propertyKeys.ts | 10 + .../schemas/publishDraftWorkflowScheme.ts | 10 + src/version2/schemas/publishedWorkflowId.ts | 11 + src/version2/schemas/quickFilterPayload.ts | 13 + .../schemas/redactionJobStatusResponse.ts | 9 + src/version2/schemas/redactionPosition.ts | 18 + src/version2/schemas/registeredWebhook.ts | 11 + src/version2/schemas/remoteIssueLink.ts | 19 + .../schemas/remoteIssueLinkIdentifies.ts | 11 + .../schemas/remoteIssueLinkRequest.ts | 26 + src/version2/schemas/remoteObject.ts | 17 + .../schemas/removeOptionFromIssuesResult.ts | 15 + .../schemas/reorderIssuePriorities.ts | 13 + .../schemas/reorderIssueResolutionsRequest.ts | 13 + .../schemas/requiredMappingByIssueType.ts | 11 + .../schemas/requiredMappingByWorkflows.ts | 13 + src/version2/schemas/resolution.ts | 15 + src/version2/schemas/resolutionId.ts | 9 + src/version2/schemas/resolutionJsonBean.ts | 12 + src/version2/schemas/resource.ts | 14 + src/version2/schemas/restrictedPermission.ts | 17 + src/version2/schemas/richText.ts | 10 + src/version2/schemas/roleActor.ts | 26 + src/version2/schemas/rolePayload.ts | 25 + .../schemas/rolesCapabilityPayload.ts | 11 + src/version2/schemas/ruleConfiguration.ts | 16 + src/version2/schemas/rulePayload.ts | 14 + src/version2/schemas/sanitizedJqlQueries.ts | 10 + src/version2/schemas/sanitizedJqlQuery.ts | 15 + .../schemas/saveProjectTemplateRequest.ts | 13 + src/version2/schemas/saveTemplateRequest.ts | 13 + src/version2/schemas/saveTemplateResponse.ts | 8 + src/version2/schemas/scope.ts | 14 + src/version2/schemas/scopePayload.ts | 9 + src/version2/schemas/screen.ts | 15 + src/version2/schemas/screenDetails.ts | 11 + src/version2/schemas/screenPayload.ts | 22 + src/version2/schemas/screenScheme.ts | 17 + src/version2/schemas/screenSchemeDetails.ts | 16 + src/version2/schemas/screenSchemeId.ts | 9 + src/version2/schemas/screenSchemePayload.ts | 24 + src/version2/schemas/screenTypes.ts | 15 + src/version2/schemas/screenWithTab.ts | 17 + src/version2/schemas/screenableField.ts | 11 + src/version2/schemas/screenableTab.ts | 11 + .../schemas/searchAndReconcileRequestBean.ts | 74 + .../schemas/searchAndReconcileResults.ts | 21 + .../schemas/searchAutoCompleteFilter.ts | 11 + src/version2/schemas/searchRequestBean.ts | 68 + src/version2/schemas/searchResults.ts | 24 + src/version2/schemas/securityLevel.ts | 19 + src/version2/schemas/securityLevelMember.ts | 20 + .../schemas/securityLevelMemberPayload.ts | 18 + src/version2/schemas/securityLevelPayload.ts | 19 + src/version2/schemas/securityScheme.ts | 19 + src/version2/schemas/securitySchemeId.ts | 9 + src/version2/schemas/securitySchemeLevel.ts | 15 + .../schemas/securitySchemeLevelMemberBean.ts | 10 + .../schemas/securitySchemeMembersRequest.ts | 10 + src/version2/schemas/securitySchemePayload.ts | 19 + .../schemas/securitySchemeWithProjects.ts | 19 + src/version2/schemas/securitySchemes.ts | 10 + src/version2/schemas/serverInformation.ts | 39 + .../serviceManagementNavigationInfo.ts | 9 + src/version2/schemas/serviceRegistry.ts | 18 + src/version2/schemas/serviceRegistryTier.ts | 16 + .../schemas/setDefaultLevelsRequest.ts | 10 + .../schemas/setDefaultPriorityRequest.ts | 12 + .../schemas/setDefaultResolutionRequest.ts | 12 + src/version2/schemas/sharePermission.ts | 42 + .../schemas/sharePermissionInputBean.ts | 40 + .../schemas/simpleApplicationPropertyBean.ts | 10 + src/version2/schemas/simpleErrorCollection.ts | 14 + src/version2/schemas/simpleLink.ts | 14 + .../simpleListWrapperApplicationRole.ts | 21 + .../schemas/simpleListWrapperGroupName.ts | 21 + .../schemas/simplifiedHierarchyLevel.ts | 43 + .../schemas/singleRedactionRequest.ts | 14 + .../schemas/singleRedactionResponse.ts | 11 + .../schemas/softwareNavigationInfo.ts | 10 + src/version2/schemas/status.ts | 14 + src/version2/schemas/statusCategory.ts | 17 + src/version2/schemas/statusCreate.ts | 13 + src/version2/schemas/statusCreateRequest.ts | 12 + src/version2/schemas/statusDetails.ts | 21 + src/version2/schemas/statusLayoutUpdate.ts | 15 + src/version2/schemas/statusMapping.ts | 13 + src/version2/schemas/statusMappingDTO.ts | 14 + src/version2/schemas/statusMetadata.ts | 13 + src/version2/schemas/statusMigration.ts | 11 + src/version2/schemas/statusPayload.ts | 20 + .../schemas/statusProjectIssueTypeUsage.ts | 9 + .../schemas/statusProjectIssueTypeUsageDTO.ts | 13 + .../statusProjectIssueTypeUsagePage.ts | 12 + src/version2/schemas/statusProjectUsage.ts | 9 + src/version2/schemas/statusProjectUsageDTO.ts | 11 + .../schemas/statusProjectUsagePage.ts | 12 + src/version2/schemas/statusScope.ts | 11 + src/version2/schemas/statusUpdate.ts | 15 + src/version2/schemas/statusUpdateRequest.ts | 10 + .../schemas/statusWorkflowUsageDTO.ts | 11 + .../schemas/statusWorkflowUsagePage.ts | 12 + .../schemas/statusWorkflowUsageWorkflow.ts | 9 + src/version2/schemas/statusesPerWorkflow.ts | 13 + src/version2/schemas/streamingResponseBody.ts | 5 + src/version2/schemas/stringList.ts | 5 + src/version2/schemas/suggestedIssue.ts | 19 + ...ggestedMappingsForPrioritiesRequestBean.ts | 11 + ...suggestedMappingsForProjectsRequestBean.ts | 9 + .../schemas/suggestedMappingsRequestBean.ts | 17 + src/version2/schemas/swimlanePayload.ts | 13 + src/version2/schemas/swimlanesPayload.ts | 27 + src/version2/schemas/systemAvatars.ts | 10 + src/version2/schemas/tabPayload.ts | 18 + .../schemas/taskProgressBeanJsonNode.ts | 33 + .../schemas/taskProgressBeanObject.ts | 33 + ...rogressBeanRemoveOptionFromIssuesResult.ts | 35 + .../schemas/timeTrackingConfiguration.ts | 15 + src/version2/schemas/timeTrackingDetails.ts | 19 + src/version2/schemas/timeTrackingProvider.ts | 17 + src/version2/schemas/toLayoutPayload.ts | 11 + src/version2/schemas/transition.ts | 25 + src/version2/schemas/transitionPayload.ts | 37 + .../schemas/transitionScreenDetails.ts | 11 + src/version2/schemas/transitionUpdateDTO.ts | 35 + src/version2/schemas/transitions.ts | 12 + .../schemas/uiModificationContextDetails.ts | 27 + src/version2/schemas/uiModificationDetails.ts | 20 + .../schemas/uiModificationIdentifiers.ts | 11 + src/version2/schemas/unrestrictedUserEmail.ts | 10 + .../schemas/updateCustomFieldDetails.ts | 54 + .../updateDefaultProjectClassificationBean.ts | 9 + .../schemas/updateDefaultScreenScheme.ts | 9 + .../updateFieldConfigurationSchemeDetails.ts | 11 + .../updateIssueSecurityLevelDetails.ts | 11 + .../updateIssueSecuritySchemeRequestBean.ts | 10 + .../updateNotificationSchemeDetails.ts | 11 + .../updatePrioritiesInSchemeRequestBean.ts | 11 + src/version2/schemas/updatePriorityDetails.ts | 43 + .../updatePrioritySchemeRequestBean.ts | 45 + .../updatePrioritySchemeResponseBean.ts | 11 + src/version2/schemas/updateProjectDetails.ts | 57 + .../updateProjectsInSchemeRequestBean.ts | 11 + .../schemas/updateResolutionDetails.ts | 11 + src/version2/schemas/updateScreenDetails.ts | 11 + .../schemas/updateScreenSchemeDetails.ts | 16 + src/version2/schemas/updateScreenTypes.ts | 15 + .../schemas/updateUiModificationDetails.ts | 19 + src/version2/schemas/updateUserToGroupBean.ts | 17 + .../schemas/updatedProjectCategory.ts | 15 + src/version2/schemas/user.ts | 66 + src/version2/schemas/userBean.ts | 31 + src/version2/schemas/userBeanAvatarUrls.ts | 14 + src/version2/schemas/userColumnRequestBody.ts | 7 + src/version2/schemas/userContextVariable.ts | 14 + src/version2/schemas/userDetails.ts | 54 + src/version2/schemas/userFilter.ts | 19 + src/version2/schemas/userKey.ts | 19 + src/version2/schemas/userList.ts | 29 + src/version2/schemas/userMigrationBean.ts | 9 + .../schemas/userNavPropertyJsonBean.ts | 8 + src/version2/schemas/userPermission.ts | 30 + src/version2/schemas/userPickerUser.ts | 41 + .../schemas/validationOptionsForCreate.ts | 11 + .../schemas/validationOptionsForUpdate.ts | 11 + src/version2/schemas/valueOperand.ts | 11 + src/version2/schemas/version.ts | 87 + src/version2/schemas/versionApprover.ts | 15 + src/version2/schemas/versionIssueCounts.ts | 18 + src/version2/schemas/versionIssuesStatus.ts | 15 + src/version2/schemas/versionMoveBean.ts | 10 + src/version2/schemas/versionRelatedWork.ts | 20 + .../schemas/versionUnresolvedIssuesCount.ts | 13 + .../schemas/versionUsageInCustomField.ts | 13 + src/version2/schemas/visibility.ts | 16 + src/version2/schemas/votes.ts | 19 + src/version2/schemas/warningCollection.ts | 7 + src/version2/schemas/watchers.ts | 16 + src/version2/schemas/webhook.ts | 43 + src/version2/schemas/webhookDetails.ts | 40 + .../schemas/webhookRegistrationDetails.ts | 15 + .../schemas/webhooksExpirationDate.ts | 9 + .../schemas/workManagementNavigationInfo.ts | 7 + src/version2/schemas/workflow.ts | 33 + .../workflowAssociationStatusMapping.ts | 11 + src/version2/schemas/workflowCapabilities.ts | 25 + .../schemas/workflowCapabilityPayload.ts | 18 + .../schemas/workflowCompoundCondition.ts | 13 + src/version2/schemas/workflowCondition.ts | 6 + src/version2/schemas/workflowCreate.ts | 20 + src/version2/schemas/workflowCreateRequest.ts | 15 + .../schemas/workflowCreateResponse.ts | 13 + .../schemas/workflowCreateValidateRequest.ts | 10 + .../schemas/workflowElementReference.ts | 17 + src/version2/schemas/workflowIDs.ts | 11 + src/version2/schemas/workflowId.ts | 11 + src/version2/schemas/workflowLayout.ts | 11 + .../workflowMetadataAndIssueTypeRestModel.ts | 11 + .../schemas/workflowMetadataRestModel.ts | 15 + src/version2/schemas/workflowOperations.ts | 11 + src/version2/schemas/workflowPayload.ts | 27 + .../schemas/workflowProjectIssueTypeUsage.ts | 9 + .../workflowProjectIssueTypeUsageDTO.ts | 13 + .../workflowProjectIssueTypeUsagePage.ts | 12 + .../schemas/workflowProjectUsageDTO.ts | 11 + src/version2/schemas/workflowReadRequest.ts | 13 + src/version2/schemas/workflowReadResponse.ts | 13 + .../schemas/workflowReferenceStatus.ts | 17 + .../schemas/workflowRuleConfiguration.ts | 13 + src/version2/schemas/workflowRules.ts | 14 + src/version2/schemas/workflowRulesSearch.ts | 16 + .../schemas/workflowRulesSearchDetails.ts | 14 + src/version2/schemas/workflowScheme.ts | 68 + .../schemas/workflowSchemeAssociation.ts | 11 + .../schemas/workflowSchemeAssociations.ts | 11 + src/version2/schemas/workflowSchemeIdName.ts | 11 + src/version2/schemas/workflowSchemePayload.ts | 19 + .../workflowSchemeProjectAssociation.ts | 14 + .../schemas/workflowSchemeProjectUsageDTO.ts | 11 + .../schemas/workflowSchemeReadRequest.ts | 11 + .../schemas/workflowSchemeReadResponse.ts | 23 + .../schemas/workflowSchemeUpdateRequest.ts | 38 + ...flowSchemeUpdateRequiredMappingsRequest.ts | 19 + ...lowSchemeUpdateRequiredMappingsResponse.ts | 20 + src/version2/schemas/workflowSchemeUsage.ts | 9 + .../schemas/workflowSchemeUsageDTO.ts | 11 + .../schemas/workflowSchemeUsagePage.ts | 12 + src/version2/schemas/workflowScope.ts | 11 + .../schemas/workflowSearchResponse.ts | 25 + .../schemas/workflowSimpleCondition.ts | 12 + src/version2/schemas/workflowStatus.ts | 16 + src/version2/schemas/workflowStatusLayout.ts | 11 + .../schemas/workflowStatusLayoutPayload.ts | 11 + src/version2/schemas/workflowStatusPayload.ts | 13 + src/version2/schemas/workflowStatusUpdate.ts | 17 + src/version2/schemas/workflowTransition.ts | 11 + .../schemas/workflowTransitionLinks.ts | 13 + .../schemas/workflowTransitionProperty.ts | 13 + .../schemas/workflowTransitionRule.ts | 11 + .../schemas/workflowTransitionRules.ts | 16 + .../schemas/workflowTransitionRulesDetails.ts | 11 + .../schemas/workflowTransitionRulesUpdate.ts | 10 + ...rkflowTransitionRulesUpdateErrorDetails.ts | 19 + .../workflowTransitionRulesUpdateErrors.ts | 10 + src/version2/schemas/workflowTransitions.ts | 35 + src/version2/schemas/workflowTrigger.ts | 13 + src/version2/schemas/workflowUpdate.ts | 28 + src/version2/schemas/workflowUpdateRequest.ts | 13 + .../schemas/workflowUpdateResponse.ts | 14 + .../workflowUpdateValidateRequestBean.ts | 10 + .../schemas/workflowValidationError.ts | 30 + .../schemas/workflowValidationErrorList.ts | 9 + .../workflowsWithTransitionRulesDetails.ts | 10 + src/version2/schemas/workingDaysConfig.ts | 18 + src/version2/schemas/worklog.ts | 44 + src/version2/schemas/worklogIdsRequestBean.ts | 8 + .../schemas/worklogsMoveRequestBean.ts | 10 + src/version2/schemas/workspaceDataPolicy.ts | 9 + src/version2/screenSchemes.ts | 156 +- src/version2/screenTabFields.ts | 125 +- src/version2/screenTabs.ts | 192 +-- src/version2/screens.ts | 227 +-- src/version2/serverInfo.ts | 28 +- src/version2/serviceRegistry.ts | 27 +- src/version2/status.ts | 249 +-- src/version2/tasks.ts | 104 +- src/version2/teamsInPlan.ts | 301 ++-- src/version2/timeTracking.ts | 143 +- src/version2/uIModificationsApps.ts | 214 +-- src/version2/userNavProperties.ts | 80 +- src/version2/userProperties.ts | 194 +-- src/version2/userSearch.ts | 724 +++------ src/version2/users.ts | 471 ++---- src/version2/webhooks.ts | 223 +-- src/version2/workflowSchemeDrafts.ts | 536 ++---- .../workflowSchemeProjectAssociations.ts | 78 +- src/version2/workflowSchemes.ts | 691 +++----- src/version2/workflowStatusCategories.ts | 60 +- src/version2/workflowStatuses.ts | 79 +- src/version2/workflowTransitionProperties.ts | 194 --- src/version2/workflowTransitionRules.ts | 208 +-- src/version2/workflows.ts | 1040 +++++++----- 2769 files changed, 33632 insertions(+), 36833 deletions(-) delete mode 100644 src/version2/index.ts create mode 100644 src/version2/issueRedaction.ts delete mode 100644 src/version2/models/actorsMap.ts delete mode 100644 src/version2/models/addAtlassianTeamRequest.ts delete mode 100644 src/version2/models/addField.ts delete mode 100644 src/version2/models/addGroup.ts delete mode 100644 src/version2/models/addNotificationsDetails.ts delete mode 100644 src/version2/models/addSecuritySchemeLevelsRequest.ts delete mode 100644 src/version2/models/announcementBannerConfiguration.ts delete mode 100644 src/version2/models/announcementBannerConfigurationUpdate.ts delete mode 100644 src/version2/models/application.ts delete mode 100644 src/version2/models/applicationProperty.ts delete mode 100644 src/version2/models/applicationRole.ts delete mode 100644 src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.ts delete mode 100644 src/version2/models/associatedItem.ts delete mode 100644 src/version2/models/associationContextObject.ts delete mode 100644 src/version2/models/attachment.ts delete mode 100644 src/version2/models/attachmentArchiveEntry.ts delete mode 100644 src/version2/models/attachmentArchiveImpl.ts delete mode 100644 src/version2/models/attachmentArchiveItemReadable.ts delete mode 100644 src/version2/models/attachmentArchiveMetadataReadable.ts delete mode 100644 src/version2/models/attachmentContent.ts delete mode 100644 src/version2/models/attachmentMetadata.ts delete mode 100644 src/version2/models/attachmentSettings.ts delete mode 100644 src/version2/models/auditRecord.ts delete mode 100644 src/version2/models/auditRecords.ts delete mode 100644 src/version2/models/autoCompleteSuggestion.ts delete mode 100644 src/version2/models/autoCompleteSuggestions.ts delete mode 100644 src/version2/models/availableDashboardGadget.ts delete mode 100644 src/version2/models/availableDashboardGadgetsResponse.ts delete mode 100644 src/version2/models/availableWorkflowConnectRule.ts delete mode 100644 src/version2/models/availableWorkflowForgeRule.ts delete mode 100644 src/version2/models/availableWorkflowSystemRule.ts delete mode 100644 src/version2/models/availableWorkflowTriggerTypes.ts delete mode 100644 src/version2/models/availableWorkflowTriggers.ts delete mode 100644 src/version2/models/avatar.ts delete mode 100644 src/version2/models/avatarUrls.ts delete mode 100644 src/version2/models/avatarWithDetails.ts delete mode 100644 src/version2/models/avatars.ts delete mode 100644 src/version2/models/boardColumnPayload.ts delete mode 100644 src/version2/models/boardFeaturePayload.ts delete mode 100644 src/version2/models/boardPayload.ts delete mode 100644 src/version2/models/boardsPayload.ts delete mode 100644 src/version2/models/bulkChangeOwnerDetails.ts delete mode 100644 src/version2/models/bulkChangelog.ts delete mode 100644 src/version2/models/bulkChangelogRequest.ts delete mode 100644 src/version2/models/bulkContextualConfiguration.ts delete mode 100644 src/version2/models/bulkCustomFieldOptionCreateRequest.ts delete mode 100644 src/version2/models/bulkCustomFieldOptionUpdateRequest.ts delete mode 100644 src/version2/models/bulkEditShareableEntity.ts delete mode 100644 src/version2/models/bulkIssue.ts delete mode 100644 src/version2/models/bulkIssueIsWatching.ts delete mode 100644 src/version2/models/bulkIssuePropertyUpdateRequest.ts delete mode 100644 src/version2/models/bulkOperationErrorResult.ts delete mode 100644 src/version2/models/bulkPermissionGrants.ts delete mode 100644 src/version2/models/bulkPermissionsRequest.ts delete mode 100644 src/version2/models/bulkProjectPermissionGrants.ts delete mode 100644 src/version2/models/bulkProjectPermissions.ts delete mode 100644 src/version2/models/cardLayout.ts delete mode 100644 src/version2/models/cardLayoutField.ts delete mode 100644 src/version2/models/changeDetails.ts delete mode 100644 src/version2/models/changedValue.ts delete mode 100644 src/version2/models/changedWorklog.ts delete mode 100644 src/version2/models/changedWorklogs.ts delete mode 100644 src/version2/models/changelog.ts delete mode 100644 src/version2/models/columnItem.ts delete mode 100644 src/version2/models/comment.ts delete mode 100644 src/version2/models/component.ts delete mode 100644 src/version2/models/componentIssuesCount.ts delete mode 100644 src/version2/models/componentWithIssueCount.ts delete mode 100644 src/version2/models/conditionGroupConfiguration.ts delete mode 100644 src/version2/models/conditionGroupPayload.ts delete mode 100644 src/version2/models/conditionGroupUpdate.ts delete mode 100644 src/version2/models/configuration.ts delete mode 100644 src/version2/models/configurationsListParameters.ts delete mode 100644 src/version2/models/connectCustomFieldValue.ts delete mode 100644 src/version2/models/connectCustomFieldValues.ts delete mode 100644 src/version2/models/connectModule.ts delete mode 100644 src/version2/models/connectModules.ts delete mode 100644 src/version2/models/connectWorkflowTransitionRule.ts delete mode 100644 src/version2/models/containerForProjectFeatures.ts delete mode 100644 src/version2/models/containerForRegisteredWebhooks.ts delete mode 100644 src/version2/models/containerForWebhookIDs.ts delete mode 100644 src/version2/models/containerOfWorkflowSchemeAssociations.ts delete mode 100644 src/version2/models/contextForProjectAndIssueType.ts delete mode 100644 src/version2/models/contextualConfiguration.ts delete mode 100644 src/version2/models/convertedJQLQueries.ts delete mode 100644 src/version2/models/createCrossProjectReleaseRequest.ts delete mode 100644 src/version2/models/createCustomFieldContext.ts delete mode 100644 src/version2/models/createCustomFieldRequest.ts delete mode 100644 src/version2/models/createDateFieldRequest.ts delete mode 100644 src/version2/models/createExclusionRulesRequest.ts delete mode 100644 src/version2/models/createIssueSecuritySchemeDetails.ts delete mode 100644 src/version2/models/createIssueSourceRequest.ts delete mode 100644 src/version2/models/createNotificationSchemeDetails.ts delete mode 100644 src/version2/models/createPermissionHolderRequest.ts delete mode 100644 src/version2/models/createPermissionRequest.ts delete mode 100644 src/version2/models/createPlanOnlyTeamRequest.ts delete mode 100644 src/version2/models/createPlanRequest.ts delete mode 100644 src/version2/models/createPriorityDetails.ts delete mode 100644 src/version2/models/createPrioritySchemeDetails.ts delete mode 100644 src/version2/models/createProjectDetails.ts delete mode 100644 src/version2/models/createResolutionDetails.ts delete mode 100644 src/version2/models/createSchedulingRequest.ts delete mode 100644 src/version2/models/createUiModificationDetails.ts delete mode 100644 src/version2/models/createUpdateRoleRequest.ts delete mode 100644 src/version2/models/createWorkflowCondition.ts delete mode 100644 src/version2/models/createWorkflowDetails.ts delete mode 100644 src/version2/models/createWorkflowStatusDetails.ts delete mode 100644 src/version2/models/createWorkflowTransitionDetails.ts delete mode 100644 src/version2/models/createWorkflowTransitionRule.ts delete mode 100644 src/version2/models/createWorkflowTransitionRulesDetails.ts delete mode 100644 src/version2/models/createWorkflowTransitionScreenDetails.ts delete mode 100644 src/version2/models/createdIssue.ts delete mode 100644 src/version2/models/createdIssues.ts delete mode 100644 src/version2/models/customContextVariable.ts delete mode 100644 src/version2/models/customFieldConfigurations.ts delete mode 100644 src/version2/models/customFieldContext.ts delete mode 100644 src/version2/models/customFieldContextDefaultValue.ts delete mode 100644 src/version2/models/customFieldContextDefaultValueUpdate.ts delete mode 100644 src/version2/models/customFieldContextOption.ts delete mode 100644 src/version2/models/customFieldContextProjectMapping.ts delete mode 100644 src/version2/models/customFieldContextUpdateDetails.ts delete mode 100644 src/version2/models/customFieldCreatedContextOptionsList.ts delete mode 100644 src/version2/models/customFieldDefinitionJson.ts delete mode 100644 src/version2/models/customFieldOption.ts delete mode 100644 src/version2/models/customFieldOptionCreate.ts delete mode 100644 src/version2/models/customFieldOptionUpdate.ts delete mode 100644 src/version2/models/customFieldPayload.ts delete mode 100644 src/version2/models/customFieldReplacement.ts delete mode 100644 src/version2/models/customFieldUpdatedContextOptionsList.ts delete mode 100644 src/version2/models/customFieldValueUpdate.ts delete mode 100644 src/version2/models/customFieldValueUpdateDetails.ts delete mode 100644 src/version2/models/customTemplateRequest.ts delete mode 100644 src/version2/models/customTemplatesProjectDetails.ts delete mode 100644 src/version2/models/dashboard.ts delete mode 100644 src/version2/models/dashboardDetails.ts delete mode 100644 src/version2/models/dashboardGadget.ts delete mode 100644 src/version2/models/dashboardGadgetPosition.ts delete mode 100644 src/version2/models/dashboardGadgetResponse.ts delete mode 100644 src/version2/models/dashboardGadgetSettings.ts delete mode 100644 src/version2/models/dashboardGadgetUpdateRequest.ts delete mode 100644 src/version2/models/dashboardUser.ts delete mode 100644 src/version2/models/dataClassificationLevels.ts delete mode 100644 src/version2/models/dataClassificationTag.ts delete mode 100644 src/version2/models/dateRangeFilter.ts delete mode 100644 src/version2/models/defaultLevelValue.ts delete mode 100644 src/version2/models/defaultShareScope.ts delete mode 100644 src/version2/models/defaultWorkflow.ts delete mode 100644 src/version2/models/documentVersion.ts delete mode 100644 src/version2/models/duplicatePlanRequest.ts delete mode 100644 src/version2/models/enhancedSearchRequest.ts delete mode 100644 src/version2/models/entityProperty.ts delete mode 100644 src/version2/models/entityPropertyDetails.ts delete mode 100644 src/version2/models/error.ts delete mode 100644 src/version2/models/errorCollection.ts delete mode 100644 src/version2/models/errors.ts delete mode 100644 src/version2/models/evaluatedJiraExpression.ts delete mode 100644 src/version2/models/eventNotification.ts delete mode 100644 src/version2/models/exportArchivedIssuesTaskProgress.ts delete mode 100644 src/version2/models/failedWebhook.ts delete mode 100644 src/version2/models/failedWebhooks.ts delete mode 100644 src/version2/models/field.ts delete mode 100644 src/version2/models/fieldAssociationsRequest.ts delete mode 100644 src/version2/models/fieldCapabilityPayload.ts delete mode 100644 src/version2/models/fieldConfiguration.ts delete mode 100644 src/version2/models/fieldConfigurationDetails.ts delete mode 100644 src/version2/models/fieldConfigurationIssueTypeItem.ts delete mode 100644 src/version2/models/fieldConfigurationItem.ts delete mode 100644 src/version2/models/fieldConfigurationItemsDetails.ts delete mode 100644 src/version2/models/fieldConfigurationScheme.ts delete mode 100644 src/version2/models/fieldConfigurationSchemeProjectAssociation.ts delete mode 100644 src/version2/models/fieldConfigurationSchemeProjects.ts delete mode 100644 src/version2/models/fieldConfigurationToIssueTypeMapping.ts delete mode 100644 src/version2/models/fieldCreateMetadata.ts delete mode 100644 src/version2/models/fieldDetails.ts delete mode 100644 src/version2/models/fieldIdentifierObject.ts delete mode 100644 src/version2/models/fieldLastUsed.ts delete mode 100644 src/version2/models/fieldLayoutConfiguration.ts delete mode 100644 src/version2/models/fieldLayoutPayload.ts delete mode 100644 src/version2/models/fieldLayoutSchemePayload.ts delete mode 100644 src/version2/models/fieldMetadata.ts delete mode 100644 src/version2/models/fieldReferenceData.ts delete mode 100644 src/version2/models/fields.ts delete mode 100644 src/version2/models/filter.ts delete mode 100644 src/version2/models/filterDetails.ts delete mode 100644 src/version2/models/filterSubscription.ts delete mode 100644 src/version2/models/filterSubscriptionsList.ts delete mode 100644 src/version2/models/fixVersion.ts delete mode 100644 src/version2/models/foundGroup.ts delete mode 100644 src/version2/models/foundGroups.ts delete mode 100644 src/version2/models/foundUsers.ts delete mode 100644 src/version2/models/foundUsersAndGroups.ts delete mode 100644 src/version2/models/fromLayoutPayload.ts delete mode 100644 src/version2/models/functionReferenceData.ts delete mode 100644 src/version2/models/getAtlassianTeamResponse.ts delete mode 100644 src/version2/models/getCrossProjectReleaseResponse.ts delete mode 100644 src/version2/models/getCustomFieldResponse.ts delete mode 100644 src/version2/models/getDateFieldResponse.ts delete mode 100644 src/version2/models/getExclusionRulesResponse.ts delete mode 100644 src/version2/models/getIssueSourceResponse.ts delete mode 100644 src/version2/models/getPermissionHolderResponse.ts delete mode 100644 src/version2/models/getPermissionResponse.ts delete mode 100644 src/version2/models/getPlanOnlyTeamResponse.ts delete mode 100644 src/version2/models/getPlanResponseForPage.ts delete mode 100644 src/version2/models/getSchedulingResponse.ts delete mode 100644 src/version2/models/getTeamResponseForPage.ts delete mode 100644 src/version2/models/globalScope.ts delete mode 100644 src/version2/models/group.ts delete mode 100644 src/version2/models/groupDetails.ts delete mode 100644 src/version2/models/groupLabel.ts delete mode 100644 src/version2/models/groupName.ts delete mode 100644 src/version2/models/hierarchy.ts delete mode 100644 src/version2/models/hierarchyLevel.ts delete mode 100644 src/version2/models/historyMetadata.ts delete mode 100644 src/version2/models/historyMetadataParticipant.ts delete mode 100644 src/version2/models/icon.ts delete mode 100644 src/version2/models/id.ts delete mode 100644 src/version2/models/idOrKey.ts delete mode 100644 src/version2/models/idSearchRequest.ts delete mode 100644 src/version2/models/idSearchResults.ts delete mode 100644 src/version2/models/includedFields.ts delete mode 100644 src/version2/models/index.ts delete mode 100644 src/version2/models/issue.ts delete mode 100644 src/version2/models/issueArchivalSync.ts delete mode 100644 src/version2/models/issueChangeLog.ts delete mode 100644 src/version2/models/issueChangelogIds.ts delete mode 100644 src/version2/models/issueCommentListRequest.ts delete mode 100644 src/version2/models/issueContextVariable.ts delete mode 100644 src/version2/models/issueCreateMetadata.ts delete mode 100644 src/version2/models/issueEntityProperties.ts delete mode 100644 src/version2/models/issueEntityPropertiesForMultiUpdate.ts delete mode 100644 src/version2/models/issueError.ts delete mode 100644 src/version2/models/issueEvent.ts delete mode 100644 src/version2/models/issueFieldOption.ts delete mode 100644 src/version2/models/issueFieldOptionConfiguration.ts delete mode 100644 src/version2/models/issueFieldOptionCreate.ts delete mode 100644 src/version2/models/issueFieldOptionScope.ts delete mode 100644 src/version2/models/issueFilterForBulkPropertyDelete.ts delete mode 100644 src/version2/models/issueFilterForBulkPropertySet.ts delete mode 100644 src/version2/models/issueLayoutItemPayload.ts delete mode 100644 src/version2/models/issueLayoutPayload.ts delete mode 100644 src/version2/models/issueLimitReport.ts delete mode 100644 src/version2/models/issueLimitReportRequest.ts delete mode 100644 src/version2/models/issueLink.ts delete mode 100644 src/version2/models/issueLinkType.ts delete mode 100644 src/version2/models/issueLinkTypes.ts delete mode 100644 src/version2/models/issueList.ts delete mode 100644 src/version2/models/issueMatches.ts delete mode 100644 src/version2/models/issueMatchesForJQL.ts delete mode 100644 src/version2/models/issuePickerSuggestions.ts delete mode 100644 src/version2/models/issuePickerSuggestionsIssueType.ts delete mode 100644 src/version2/models/issueSecurityLevelMember.ts delete mode 100644 src/version2/models/issueSecuritySchemeToProjectMapping.ts delete mode 100644 src/version2/models/issueTransition.ts delete mode 100644 src/version2/models/issueTypeCreate.ts delete mode 100644 src/version2/models/issueTypeDetails.ts delete mode 100644 src/version2/models/issueTypeHierarchyPayload.ts delete mode 100644 src/version2/models/issueTypeIds.ts delete mode 100644 src/version2/models/issueTypeIdsToRemove.ts delete mode 100644 src/version2/models/issueTypeInfo.ts delete mode 100644 src/version2/models/issueTypeIssueCreateMetadata.ts delete mode 100644 src/version2/models/issueTypePayload.ts delete mode 100644 src/version2/models/issueTypeProjectCreatePayload.ts delete mode 100644 src/version2/models/issueTypeScheme.ts delete mode 100644 src/version2/models/issueTypeSchemeDetails.ts delete mode 100644 src/version2/models/issueTypeSchemeID.ts delete mode 100644 src/version2/models/issueTypeSchemeMapping.ts delete mode 100644 src/version2/models/issueTypeSchemePayload.ts delete mode 100644 src/version2/models/issueTypeSchemeProjectAssociation.ts delete mode 100644 src/version2/models/issueTypeSchemeProjects.ts delete mode 100644 src/version2/models/issueTypeSchemeUpdateDetails.ts delete mode 100644 src/version2/models/issueTypeScreenScheme.ts delete mode 100644 src/version2/models/issueTypeScreenSchemeDetails.ts delete mode 100644 src/version2/models/issueTypeScreenSchemeId.ts delete mode 100644 src/version2/models/issueTypeScreenSchemeItem.ts delete mode 100644 src/version2/models/issueTypeScreenSchemeMapping.ts delete mode 100644 src/version2/models/issueTypeScreenSchemeMappingDetails.ts delete mode 100644 src/version2/models/issueTypeScreenSchemePayload.ts delete mode 100644 src/version2/models/issueTypeScreenSchemeProjectAssociation.ts delete mode 100644 src/version2/models/issueTypeScreenSchemeUpdateDetails.ts delete mode 100644 src/version2/models/issueTypeScreenSchemesProjects.ts delete mode 100644 src/version2/models/issueTypeToContextMapping.ts delete mode 100644 src/version2/models/issueTypeUpdate.ts delete mode 100644 src/version2/models/issueTypeWithStatus.ts delete mode 100644 src/version2/models/issueTypeWorkflowMapping.ts delete mode 100644 src/version2/models/issueTypesWorkflowMapping.ts delete mode 100644 src/version2/models/issueUpdateDetails.ts delete mode 100644 src/version2/models/issueUpdateMetadata.ts delete mode 100644 src/version2/models/issuesAndJQLQueries.ts delete mode 100644 src/version2/models/issuesJqlMetaData.ts delete mode 100644 src/version2/models/issuesMeta.ts delete mode 100644 src/version2/models/issuesUpdate.ts delete mode 100644 src/version2/models/jExpEvaluateIssuesJqlMetaData.ts delete mode 100644 src/version2/models/jExpEvaluateIssuesMeta.ts delete mode 100644 src/version2/models/jExpEvaluateMetaData.ts delete mode 100644 src/version2/models/jQLCount.ts delete mode 100644 src/version2/models/jQLCountRequest.ts delete mode 100644 src/version2/models/jQLPersonalDataMigrationRequest.ts delete mode 100644 src/version2/models/jQLQueryWithUnknownUsers.ts delete mode 100644 src/version2/models/jQLReferenceData.ts delete mode 100644 src/version2/models/jexpEvaluateCtxIssues.ts delete mode 100644 src/version2/models/jexpEvaluateCtxJqlIssues.ts delete mode 100644 src/version2/models/jexpIssues.ts delete mode 100644 src/version2/models/jexpJqlIssues.ts delete mode 100644 src/version2/models/jiraExpressionAnalysis.ts delete mode 100644 src/version2/models/jiraExpressionComplexity.ts delete mode 100644 src/version2/models/jiraExpressionEvalContext.ts delete mode 100644 src/version2/models/jiraExpressionEvalRequest.ts delete mode 100644 src/version2/models/jiraExpressionEvalUsingEnhancedSearchRequest.ts delete mode 100644 src/version2/models/jiraExpressionEvaluateContext.ts delete mode 100644 src/version2/models/jiraExpressionEvaluationMetaData.ts delete mode 100644 src/version2/models/jiraExpressionForAnalysis.ts delete mode 100644 src/version2/models/jiraExpressionResult.ts delete mode 100644 src/version2/models/jiraExpressionValidationError.ts delete mode 100644 src/version2/models/jiraExpressionsAnalysis.ts delete mode 100644 src/version2/models/jiraExpressionsComplexity.ts delete mode 100644 src/version2/models/jiraExpressionsComplexityValue.ts delete mode 100644 src/version2/models/jiraStatus.ts delete mode 100644 src/version2/models/jiraWorkflow.ts delete mode 100644 src/version2/models/jiraWorkflowStatus.ts delete mode 100644 src/version2/models/jqlFunctionPrecomputation.ts delete mode 100644 src/version2/models/jqlFunctionPrecomputationGetByIdRequest.ts delete mode 100644 src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts delete mode 100644 src/version2/models/jqlFunctionPrecomputationUpdate.ts delete mode 100644 src/version2/models/jqlFunctionPrecomputationUpdateRequest.ts delete mode 100644 src/version2/models/jqlQueriesToParse.ts delete mode 100644 src/version2/models/jqlQueriesToSanitize.ts delete mode 100644 src/version2/models/jqlQuery.ts delete mode 100644 src/version2/models/jqlQueryClause.ts delete mode 100644 src/version2/models/jqlQueryField.ts delete mode 100644 src/version2/models/jqlQueryFieldEntityProperty.ts delete mode 100644 src/version2/models/jqlQueryOrderByClause.ts delete mode 100644 src/version2/models/jqlQueryOrderByClauseElement.ts delete mode 100644 src/version2/models/jqlQueryToSanitize.ts delete mode 100644 src/version2/models/jsonContextVariable.ts delete mode 100644 src/version2/models/jsonNode.ts delete mode 100644 src/version2/models/jsonType.ts delete mode 100644 src/version2/models/license.ts delete mode 100644 src/version2/models/licenseMetric.ts delete mode 100644 src/version2/models/licensedApplication.ts delete mode 100644 src/version2/models/linkGroup.ts delete mode 100644 src/version2/models/linkIssueRequestJson.ts delete mode 100644 src/version2/models/linkedIssue.ts delete mode 100644 src/version2/models/listWrapperCallbackApplicationRole.ts delete mode 100644 src/version2/models/listWrapperCallbackGroupName.ts delete mode 100644 src/version2/models/locale.ts delete mode 100644 src/version2/models/mappingsByIssueTypeOverride.ts delete mode 100644 src/version2/models/mappingsByWorkflow.ts delete mode 100644 src/version2/models/moveField.ts delete mode 100644 src/version2/models/multiIssueEntityProperties.ts delete mode 100644 src/version2/models/multipleCustomFieldValuesUpdate.ts delete mode 100644 src/version2/models/multipleCustomFieldValuesUpdateDetails.ts delete mode 100644 src/version2/models/nestedResponse.ts delete mode 100644 src/version2/models/newUserDetails.ts delete mode 100644 src/version2/models/nonWorkingDay.ts delete mode 100644 src/version2/models/notification.ts delete mode 100644 src/version2/models/notificationEvent.ts delete mode 100644 src/version2/models/notificationRecipients.ts delete mode 100644 src/version2/models/notificationRecipientsRestrictions.ts delete mode 100644 src/version2/models/notificationScheme.ts delete mode 100644 src/version2/models/notificationSchemeAndProjectMapping.ts delete mode 100644 src/version2/models/notificationSchemeAndProjectMappingPage.ts delete mode 100644 src/version2/models/notificationSchemeEvent.ts delete mode 100644 src/version2/models/notificationSchemeEventDetails.ts delete mode 100644 src/version2/models/notificationSchemeEventIDPayload.ts delete mode 100644 src/version2/models/notificationSchemeEventPayload.ts delete mode 100644 src/version2/models/notificationSchemeEventTypeId.ts delete mode 100644 src/version2/models/notificationSchemeId.ts delete mode 100644 src/version2/models/notificationSchemeNotificationDetails.ts delete mode 100644 src/version2/models/notificationSchemeNotificationDetailsPayload.ts delete mode 100644 src/version2/models/notificationSchemePayload.ts delete mode 100644 src/version2/models/oldToNewSecurityLevelMappings.ts delete mode 100644 src/version2/models/operationMessage.ts delete mode 100644 src/version2/models/operations.ts delete mode 100644 src/version2/models/orderOfCustomFieldOptions.ts delete mode 100644 src/version2/models/orderOfIssueTypes.ts delete mode 100644 src/version2/models/pageBulkContextualConfiguration.ts delete mode 100644 src/version2/models/pageChangelog.ts delete mode 100644 src/version2/models/pageComment.ts delete mode 100644 src/version2/models/pageComponentWithIssueCount.ts delete mode 100644 src/version2/models/pageContextForProjectAndIssueType.ts delete mode 100644 src/version2/models/pageContextualConfiguration.ts delete mode 100644 src/version2/models/pageCustomFieldContext.ts delete mode 100644 src/version2/models/pageCustomFieldContextDefaultValue.ts delete mode 100644 src/version2/models/pageCustomFieldContextOption.ts delete mode 100644 src/version2/models/pageCustomFieldContextProjectMapping.ts delete mode 100644 src/version2/models/pageDashboard.ts delete mode 100644 src/version2/models/pageField.ts delete mode 100644 src/version2/models/pageFieldConfiguration.ts delete mode 100644 src/version2/models/pageFieldConfigurationIssueTypeItem.ts delete mode 100644 src/version2/models/pageFieldConfigurationItem.ts delete mode 100644 src/version2/models/pageFieldConfigurationScheme.ts delete mode 100644 src/version2/models/pageFieldConfigurationSchemeProjects.ts delete mode 100644 src/version2/models/pageFilterDetails.ts delete mode 100644 src/version2/models/pageGroupDetails.ts delete mode 100644 src/version2/models/pageIssueFieldOption.ts delete mode 100644 src/version2/models/pageIssueSecurityLevelMember.ts delete mode 100644 src/version2/models/pageIssueSecuritySchemeToProjectMapping.ts delete mode 100644 src/version2/models/pageIssueTypeScheme.ts delete mode 100644 src/version2/models/pageIssueTypeSchemeMapping.ts delete mode 100644 src/version2/models/pageIssueTypeSchemeProjects.ts delete mode 100644 src/version2/models/pageIssueTypeScreenScheme.ts delete mode 100644 src/version2/models/pageIssueTypeScreenSchemeItem.ts delete mode 100644 src/version2/models/pageIssueTypeScreenSchemesProjects.ts delete mode 100644 src/version2/models/pageIssueTypeToContextMapping.ts delete mode 100644 src/version2/models/pageJqlFunctionPrecomputation.ts delete mode 100644 src/version2/models/pageNotificationScheme.ts delete mode 100644 src/version2/models/pageOfChangelogs.ts delete mode 100644 src/version2/models/pageOfComments.ts delete mode 100644 src/version2/models/pageOfCreateMetaIssueTypeWithField.ts delete mode 100644 src/version2/models/pageOfCreateMetaIssueTypes.ts delete mode 100644 src/version2/models/pageOfDashboards.ts delete mode 100644 src/version2/models/pageOfStatuses.ts delete mode 100644 src/version2/models/pageOfWorklogs.ts delete mode 100644 src/version2/models/pagePriority.ts delete mode 100644 src/version2/models/pageProject.ts delete mode 100644 src/version2/models/pageProjectDetails.ts delete mode 100644 src/version2/models/pageResolution.ts delete mode 100644 src/version2/models/pageScreen.ts delete mode 100644 src/version2/models/pageScreenScheme.ts delete mode 100644 src/version2/models/pageScreenWithTab.ts delete mode 100644 src/version2/models/pageSecurityLevel.ts delete mode 100644 src/version2/models/pageSecurityLevelMember.ts delete mode 100644 src/version2/models/pageSecuritySchemeWithProjects.ts delete mode 100644 src/version2/models/pageString.ts delete mode 100644 src/version2/models/pageUiModificationDetails.ts delete mode 100644 src/version2/models/pageUser.ts delete mode 100644 src/version2/models/pageUserDetails.ts delete mode 100644 src/version2/models/pageUserKey.ts delete mode 100644 src/version2/models/pageVersion.ts delete mode 100644 src/version2/models/pageWebhook.ts delete mode 100644 src/version2/models/pageWithCursorGetPlanResponseForPage.ts delete mode 100644 src/version2/models/pageWithCursorGetTeamResponseForPage.ts delete mode 100644 src/version2/models/pageWorkflow.ts delete mode 100644 src/version2/models/pageWorkflowScheme.ts delete mode 100644 src/version2/models/pageWorkflowTransitionRules.ts delete mode 100644 src/version2/models/pagedListUserDetailsApplicationUser.ts delete mode 100644 src/version2/models/parsedJqlQueries.ts delete mode 100644 src/version2/models/parsedJqlQuery.ts delete mode 100644 src/version2/models/permissionDetails.ts delete mode 100644 src/version2/models/permissionGrant.ts delete mode 100644 src/version2/models/permissionGrantDTO.ts delete mode 100644 src/version2/models/permissionGrants.ts delete mode 100644 src/version2/models/permissionHolder.ts delete mode 100644 src/version2/models/permissionPayload.ts delete mode 100644 src/version2/models/permissionScheme.ts delete mode 100644 src/version2/models/permissionSchemes.ts delete mode 100644 src/version2/models/permissions.ts delete mode 100644 src/version2/models/permissionsKeys.ts delete mode 100644 src/version2/models/permittedProjects.ts delete mode 100644 src/version2/models/plan.ts delete mode 100644 src/version2/models/priority.ts delete mode 100644 src/version2/models/priorityId.ts delete mode 100644 src/version2/models/priorityMapping.ts delete mode 100644 src/version2/models/prioritySchemeChangesWithoutMappings.ts delete mode 100644 src/version2/models/prioritySchemeId.ts delete mode 100644 src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts delete mode 100644 src/version2/models/priorityWithSequence.ts delete mode 100644 src/version2/models/project.ts delete mode 100644 src/version2/models/projectAndIssueTypePair.ts delete mode 100644 src/version2/models/projectAvatars.ts delete mode 100644 src/version2/models/projectCategory.ts delete mode 100644 src/version2/models/projectComponent.ts delete mode 100644 src/version2/models/projectCreateResourceIdentifier.ts delete mode 100644 src/version2/models/projectCustomTemplateCreateRequest.ts delete mode 100644 src/version2/models/projectDataPolicies.ts delete mode 100644 src/version2/models/projectDataPolicy.ts delete mode 100644 src/version2/models/projectDetails.ts delete mode 100644 src/version2/models/projectEmailAddress.ts delete mode 100644 src/version2/models/projectFeature.ts delete mode 100644 src/version2/models/projectFeatureToggleRequest.ts delete mode 100644 src/version2/models/projectId.ts delete mode 100644 src/version2/models/projectIdentifier.ts delete mode 100644 src/version2/models/projectIdentifiers.ts delete mode 100644 src/version2/models/projectIds.ts delete mode 100644 src/version2/models/projectInsight.ts delete mode 100644 src/version2/models/projectIssueCreateMetadata.ts delete mode 100644 src/version2/models/projectIssueSecurityLevels.ts delete mode 100644 src/version2/models/projectIssueTypeHierarchy.ts delete mode 100644 src/version2/models/projectIssueTypeMapping.ts delete mode 100644 src/version2/models/projectIssueTypeMappings.ts delete mode 100644 src/version2/models/projectIssueTypes.ts delete mode 100644 src/version2/models/projectIssueTypesHierarchyLevel.ts delete mode 100644 src/version2/models/projectLandingPageInfo.ts delete mode 100644 src/version2/models/projectPayload.ts delete mode 100644 src/version2/models/projectPermissions.ts delete mode 100644 src/version2/models/projectRole.ts delete mode 100644 src/version2/models/projectRoleActorsUpdate.ts delete mode 100644 src/version2/models/projectRoleDetails.ts delete mode 100644 src/version2/models/projectRoleGroup.ts delete mode 100644 src/version2/models/projectRoleUser.ts delete mode 100644 src/version2/models/projectScope.ts delete mode 100644 src/version2/models/projectType.ts delete mode 100644 src/version2/models/projectUsage.ts delete mode 100644 src/version2/models/projectUsagePage.ts delete mode 100644 src/version2/models/projectWithDataPolicy.ts delete mode 100644 src/version2/models/propertyKey.ts delete mode 100644 src/version2/models/propertyKeys.ts delete mode 100644 src/version2/models/publishedWorkflowId.ts delete mode 100644 src/version2/models/quickFilterPayload.ts delete mode 100644 src/version2/models/registeredWebhook.ts delete mode 100644 src/version2/models/remoteIssueLink.ts delete mode 100644 src/version2/models/remoteIssueLinkIdentifies.ts delete mode 100644 src/version2/models/remoteIssueLinkRequest.ts delete mode 100644 src/version2/models/remoteObject.ts delete mode 100644 src/version2/models/removeOptionFromIssuesResult.ts delete mode 100644 src/version2/models/reorderIssuePriorities.ts delete mode 100644 src/version2/models/reorderIssueResolutionsRequest.ts delete mode 100644 src/version2/models/requiredMappingByIssueType.ts delete mode 100644 src/version2/models/requiredMappingByWorkflows.ts delete mode 100644 src/version2/models/resolution.ts delete mode 100644 src/version2/models/resolutionId.ts delete mode 100644 src/version2/models/restrictedPermission.ts delete mode 100644 src/version2/models/richText.ts delete mode 100644 src/version2/models/roleActor.ts delete mode 100644 src/version2/models/rolePayload.ts delete mode 100644 src/version2/models/rolesCapabilityPayload.ts delete mode 100644 src/version2/models/ruleConfiguration.ts delete mode 100644 src/version2/models/rulePayload.ts delete mode 100644 src/version2/models/sanitizedJqlQueries.ts delete mode 100644 src/version2/models/sanitizedJqlQuery.ts delete mode 100644 src/version2/models/scope.ts delete mode 100644 src/version2/models/scopePayload.ts delete mode 100644 src/version2/models/screen.ts delete mode 100644 src/version2/models/screenDetails.ts delete mode 100644 src/version2/models/screenPayload.ts delete mode 100644 src/version2/models/screenScheme.ts delete mode 100644 src/version2/models/screenSchemeDetails.ts delete mode 100644 src/version2/models/screenSchemeId.ts delete mode 100644 src/version2/models/screenSchemePayload.ts delete mode 100644 src/version2/models/screenTypes.ts delete mode 100644 src/version2/models/screenWithTab.ts delete mode 100644 src/version2/models/screenableField.ts delete mode 100644 src/version2/models/screenableTab.ts delete mode 100644 src/version2/models/searchAndReconcileResults.ts delete mode 100644 src/version2/models/searchAutoComplete.ts delete mode 100644 src/version2/models/searchRequest.ts delete mode 100644 src/version2/models/searchResults.ts delete mode 100644 src/version2/models/securityLevel.ts delete mode 100644 src/version2/models/securityLevelMember.ts delete mode 100644 src/version2/models/securityLevelMemberPayload.ts delete mode 100644 src/version2/models/securityLevelPayload.ts delete mode 100644 src/version2/models/securityScheme.ts delete mode 100644 src/version2/models/securitySchemeId.ts delete mode 100644 src/version2/models/securitySchemeLevel.ts delete mode 100644 src/version2/models/securitySchemeLevelMember.ts delete mode 100644 src/version2/models/securitySchemeMembersRequest.ts delete mode 100644 src/version2/models/securitySchemePayload.ts delete mode 100644 src/version2/models/securitySchemeWithProjects.ts delete mode 100644 src/version2/models/securitySchemes.ts delete mode 100644 src/version2/models/serverInformation.ts delete mode 100644 src/version2/models/serviceRegistry.ts delete mode 100644 src/version2/models/serviceRegistryTier.ts delete mode 100644 src/version2/models/setDefaultLevelsRequest.ts delete mode 100644 src/version2/models/setDefaultPriorityRequest.ts delete mode 100644 src/version2/models/setDefaultResolutionRequest.ts delete mode 100644 src/version2/models/sharePermission.ts delete mode 100644 src/version2/models/sharePermissionInput.ts delete mode 100644 src/version2/models/simpleApplicationProperty.ts delete mode 100644 src/version2/models/simpleErrorCollection.ts delete mode 100644 src/version2/models/simpleLink.ts delete mode 100644 src/version2/models/simpleListWrapperApplicationRole.ts delete mode 100644 src/version2/models/simpleListWrapperGroupName.ts delete mode 100644 src/version2/models/simpleUsage.ts delete mode 100644 src/version2/models/status.ts delete mode 100644 src/version2/models/statusCategory.ts delete mode 100644 src/version2/models/statusCreate.ts delete mode 100644 src/version2/models/statusCreateRequest.ts delete mode 100644 src/version2/models/statusDetails.ts delete mode 100644 src/version2/models/statusLayoutUpdate.ts delete mode 100644 src/version2/models/statusMapping.ts delete mode 100644 src/version2/models/statusMappingDTO.ts delete mode 100644 src/version2/models/statusMetadata.ts delete mode 100644 src/version2/models/statusMigration.ts delete mode 100644 src/version2/models/statusPayload.ts delete mode 100644 src/version2/models/statusProjectIssueTypeUsage.ts delete mode 100644 src/version2/models/statusProjectIssueTypeUsageDTO.ts delete mode 100644 src/version2/models/statusProjectIssueTypeUsagePage.ts delete mode 100644 src/version2/models/statusProjectUsage.ts delete mode 100644 src/version2/models/statusProjectUsageDTO.ts delete mode 100644 src/version2/models/statusProjectUsagePage.ts delete mode 100644 src/version2/models/statusReferenceAndPort.ts delete mode 100644 src/version2/models/statusScope.ts delete mode 100644 src/version2/models/statusUpdate.ts delete mode 100644 src/version2/models/statusUpdateRequest.ts delete mode 100644 src/version2/models/statusWorkflowUsageDTO.ts delete mode 100644 src/version2/models/statusWorkflowUsagePage.ts delete mode 100644 src/version2/models/statusWorkflowUsageWorkflow.ts delete mode 100644 src/version2/models/statusesPerWorkflow.ts delete mode 100644 src/version2/models/suggestedIssue.ts delete mode 100644 src/version2/models/suggestedMappingsForPrioritiesRequestBean.ts delete mode 100644 src/version2/models/suggestedMappingsForProjectsRequestBean.ts delete mode 100644 src/version2/models/suggestedMappingsRequest.ts delete mode 100644 src/version2/models/swimlanesPayload.ts delete mode 100644 src/version2/models/systemAvatars.ts delete mode 100644 src/version2/models/tabMetadata.ts delete mode 100644 src/version2/models/tabPayload.ts delete mode 100644 src/version2/models/taskProgressNode.ts delete mode 100644 src/version2/models/taskProgressObject.ts delete mode 100644 src/version2/models/taskProgressRemoveOptionFromIssuesResult.ts delete mode 100644 src/version2/models/timeTrackingConfiguration.ts delete mode 100644 src/version2/models/timeTrackingDetails.ts delete mode 100644 src/version2/models/timeTrackingProvider.ts delete mode 100644 src/version2/models/toLayoutPayload.ts delete mode 100644 src/version2/models/transition.ts delete mode 100644 src/version2/models/transitionPayload.ts delete mode 100644 src/version2/models/transitionScreenDetails.ts delete mode 100644 src/version2/models/transitionUpdateDTO.ts delete mode 100644 src/version2/models/transitions.ts delete mode 100644 src/version2/models/uiModificationContextDetails.ts delete mode 100644 src/version2/models/uiModificationDetails.ts delete mode 100644 src/version2/models/uiModificationIdentifiers.ts delete mode 100644 src/version2/models/unrestrictedUserEmail.ts delete mode 100644 src/version2/models/updateCustomFieldDetails.ts delete mode 100644 src/version2/models/updateDefaultProjectClassification.ts delete mode 100644 src/version2/models/updateFieldConfigurationSchemeDetails.ts delete mode 100644 src/version2/models/updateIssueSecurityLevelDetails.ts delete mode 100644 src/version2/models/updateIssueSecuritySchemeRequest.ts delete mode 100644 src/version2/models/updateNotificationSchemeDetails.ts delete mode 100644 src/version2/models/updatePrioritiesInSchemeRequest.ts delete mode 100644 src/version2/models/updatePriorityDetails.ts delete mode 100644 src/version2/models/updatePrioritySchemeRequest.ts delete mode 100644 src/version2/models/updatePrioritySchemeResponse.ts delete mode 100644 src/version2/models/updateProjectDetails.ts delete mode 100644 src/version2/models/updateProjectsInSchemeRequest.ts delete mode 100644 src/version2/models/updateResolutionDetails.ts delete mode 100644 src/version2/models/updateScreenDetails.ts delete mode 100644 src/version2/models/updateScreenSchemeDetails.ts delete mode 100644 src/version2/models/updateScreenTypes.ts delete mode 100644 src/version2/models/updateUiModificationDetails.ts delete mode 100644 src/version2/models/updateUserToGroup.ts delete mode 100644 src/version2/models/updatedProjectCategory.ts delete mode 100644 src/version2/models/user.ts delete mode 100644 src/version2/models/userAvatarUrls.ts delete mode 100644 src/version2/models/userContextVariable.ts delete mode 100644 src/version2/models/userDetails.ts delete mode 100644 src/version2/models/userKey.ts delete mode 100644 src/version2/models/userList.ts delete mode 100644 src/version2/models/userMigration.ts delete mode 100644 src/version2/models/userNavProperty.ts delete mode 100644 src/version2/models/userPickerUser.ts delete mode 100644 src/version2/models/validationOptionsForCreate.ts delete mode 100644 src/version2/models/validationOptionsForUpdate.ts delete mode 100644 src/version2/models/version.ts delete mode 100644 src/version2/models/versionApprover.ts delete mode 100644 src/version2/models/versionIssueCounts.ts delete mode 100644 src/version2/models/versionIssuesStatus.ts delete mode 100644 src/version2/models/versionMove.ts delete mode 100644 src/version2/models/versionRelatedWork.ts delete mode 100644 src/version2/models/versionUnresolvedIssuesCount.ts delete mode 100644 src/version2/models/versionUsageInCustomField.ts delete mode 100644 src/version2/models/visibility.ts delete mode 100644 src/version2/models/votes.ts delete mode 100644 src/version2/models/warningCollection.ts delete mode 100644 src/version2/models/watchers.ts delete mode 100644 src/version2/models/webhook.ts delete mode 100644 src/version2/models/webhookDetails.ts delete mode 100644 src/version2/models/webhookRegistrationDetails.ts delete mode 100644 src/version2/models/webhooksExpirationDate.ts delete mode 100644 src/version2/models/workflow.ts delete mode 100644 src/version2/models/workflowAssociationStatusMapping.ts delete mode 100644 src/version2/models/workflowCapabilities.ts delete mode 100644 src/version2/models/workflowCapabilityPayload.ts delete mode 100644 src/version2/models/workflowCondition.ts delete mode 100644 src/version2/models/workflowCreate.ts delete mode 100644 src/version2/models/workflowCreateRequest.ts delete mode 100644 src/version2/models/workflowElementReference.ts delete mode 100644 src/version2/models/workflowId.ts delete mode 100644 src/version2/models/workflowLayout.ts delete mode 100644 src/version2/models/workflowMetadataAndIssueTypeRestModel.ts delete mode 100644 src/version2/models/workflowMetadataRestModel.ts delete mode 100644 src/version2/models/workflowOperations.ts delete mode 100644 src/version2/models/workflowPayload.ts delete mode 100644 src/version2/models/workflowProjectIssueTypeUsage.ts delete mode 100644 src/version2/models/workflowProjectIssueTypeUsageDTO.ts delete mode 100644 src/version2/models/workflowProjectIssueTypeUsagePage.ts delete mode 100644 src/version2/models/workflowProjectUsageDTO.ts delete mode 100644 src/version2/models/workflowRead.ts delete mode 100644 src/version2/models/workflowReferenceStatus.ts delete mode 100644 src/version2/models/workflowRuleConfiguration.ts delete mode 100644 src/version2/models/workflowRules.ts delete mode 100644 src/version2/models/workflowRulesSearch.ts delete mode 100644 src/version2/models/workflowRulesSearchDetails.ts delete mode 100644 src/version2/models/workflowScheme.ts delete mode 100644 src/version2/models/workflowSchemeAssociation.ts delete mode 100644 src/version2/models/workflowSchemeAssociations.ts delete mode 100644 src/version2/models/workflowSchemeIdName.ts delete mode 100644 src/version2/models/workflowSchemePayload.ts delete mode 100644 src/version2/models/workflowSchemeProjectAssociation.ts delete mode 100644 src/version2/models/workflowSchemeProjectUsage.ts delete mode 100644 src/version2/models/workflowSchemeReadRequest.ts delete mode 100644 src/version2/models/workflowSchemeReadResponse.ts delete mode 100644 src/version2/models/workflowSchemeUpdateRequest.ts delete mode 100644 src/version2/models/workflowSchemeUpdateRequiredMappingsRequest.ts delete mode 100644 src/version2/models/workflowSchemeUpdateRequiredMappingsResponse.ts delete mode 100644 src/version2/models/workflowSchemeUsage.ts delete mode 100644 src/version2/models/workflowSchemeUsageDTO.ts delete mode 100644 src/version2/models/workflowSchemeUsagePage.ts delete mode 100644 src/version2/models/workflowScope.ts delete mode 100644 src/version2/models/workflowSearchResponse.ts delete mode 100644 src/version2/models/workflowStatus.ts delete mode 100644 src/version2/models/workflowStatusAndPort.ts delete mode 100644 src/version2/models/workflowStatusLayout.ts delete mode 100644 src/version2/models/workflowStatusLayoutPayload.ts delete mode 100644 src/version2/models/workflowStatusPayload.ts delete mode 100644 src/version2/models/workflowStatusProperties.ts delete mode 100644 src/version2/models/workflowStatusUpdate.ts delete mode 100644 src/version2/models/workflowTransition.ts delete mode 100644 src/version2/models/workflowTransitionProperty.ts delete mode 100644 src/version2/models/workflowTransitionRule.ts delete mode 100644 src/version2/models/workflowTransitionRules.ts delete mode 100644 src/version2/models/workflowTransitionRulesDetails.ts delete mode 100644 src/version2/models/workflowTransitionRulesUpdate.ts delete mode 100644 src/version2/models/workflowTransitionRulesUpdateErrorDetails.ts delete mode 100644 src/version2/models/workflowTransitionRulesUpdateErrors.ts delete mode 100644 src/version2/models/workflowTransitions.ts delete mode 100644 src/version2/models/workflowTrigger.ts delete mode 100644 src/version2/models/workflowUpdate.ts delete mode 100644 src/version2/models/workflowUpdateRequest.ts delete mode 100644 src/version2/models/workflowValidationError.ts delete mode 100644 src/version2/models/workflowValidationErrorList.ts delete mode 100644 src/version2/models/workflowsWithTransitionRulesDetails.ts delete mode 100644 src/version2/models/workingDaysConfig.ts delete mode 100644 src/version2/models/worklog.ts delete mode 100644 src/version2/models/worklogIdsRequest.ts delete mode 100644 src/version2/models/worklogsMoveRequest.ts delete mode 100644 src/version2/models/workspaceDataPolicy.ts delete mode 100644 src/version2/parameters/addActorUsers.ts create mode 100644 src/version2/parameters/addActorUsersParameters.ts delete mode 100644 src/version2/parameters/addAtlassianTeam.ts create mode 100644 src/version2/parameters/addAtlassianTeamParameters.ts delete mode 100644 src/version2/parameters/addAttachment.ts create mode 100644 src/version2/parameters/addAttachmentParameters.ts delete mode 100644 src/version2/parameters/addComment.ts create mode 100644 src/version2/parameters/addCommentParameters.ts delete mode 100644 src/version2/parameters/addFieldToDefaultScreen.ts create mode 100644 src/version2/parameters/addFieldToDefaultScreenParameters.ts delete mode 100644 src/version2/parameters/addGadget.ts create mode 100644 src/version2/parameters/addGadgetParameters.ts delete mode 100644 src/version2/parameters/addIssueTypesToContext.ts create mode 100644 src/version2/parameters/addIssueTypesToContextParameters.ts delete mode 100644 src/version2/parameters/addIssueTypesToIssueTypeScheme.ts create mode 100644 src/version2/parameters/addIssueTypesToIssueTypeSchemeParameters.ts delete mode 100644 src/version2/parameters/addNotifications.ts create mode 100644 src/version2/parameters/addNotificationsParameters.ts delete mode 100644 src/version2/parameters/addProjectRoleActorsToRole.ts create mode 100644 src/version2/parameters/addProjectRoleActorsToRoleParameters.ts delete mode 100644 src/version2/parameters/addScreenTab.ts delete mode 100644 src/version2/parameters/addScreenTabField.ts create mode 100644 src/version2/parameters/addScreenTabFieldParameters.ts create mode 100644 src/version2/parameters/addScreenTabParameters.ts delete mode 100644 src/version2/parameters/addSecurityLevel.ts delete mode 100644 src/version2/parameters/addSecurityLevelMembers.ts create mode 100644 src/version2/parameters/addSecurityLevelMembersParameters.ts create mode 100644 src/version2/parameters/addSecurityLevelParameters.ts delete mode 100644 src/version2/parameters/addSharePermission.ts create mode 100644 src/version2/parameters/addSharePermissionParameters.ts delete mode 100644 src/version2/parameters/addUserToGroup.ts create mode 100644 src/version2/parameters/addUserToGroupParameters.ts delete mode 100644 src/version2/parameters/addVote.ts create mode 100644 src/version2/parameters/addVoteParameters.ts delete mode 100644 src/version2/parameters/addWatcher.ts create mode 100644 src/version2/parameters/addWatcherParameters.ts delete mode 100644 src/version2/parameters/addWorklog.ts create mode 100644 src/version2/parameters/addWorklogParameters.ts delete mode 100644 src/version2/parameters/analyseExpression.ts create mode 100644 src/version2/parameters/analyseExpressionParameters.ts delete mode 100644 src/version2/parameters/appendMappingsForIssueTypeScreenScheme.ts create mode 100644 src/version2/parameters/appendMappingsForIssueTypeScreenSchemeParameters.ts delete mode 100644 src/version2/parameters/archiveIssues.ts delete mode 100644 src/version2/parameters/archiveIssuesAsync.ts create mode 100644 src/version2/parameters/archiveIssuesAsyncParameters.ts create mode 100644 src/version2/parameters/archiveIssuesParameters.ts delete mode 100644 src/version2/parameters/archivePlan.ts create mode 100644 src/version2/parameters/archivePlanParameters.ts delete mode 100644 src/version2/parameters/archiveProject.ts create mode 100644 src/version2/parameters/archiveProjectParameters.ts delete mode 100644 src/version2/parameters/assignFieldConfigurationSchemeToProject.ts create mode 100644 src/version2/parameters/assignFieldConfigurationSchemeToProjectParameters.ts delete mode 100644 src/version2/parameters/assignIssue.ts create mode 100644 src/version2/parameters/assignIssueParameters.ts delete mode 100644 src/version2/parameters/assignIssueTypeSchemeToProject.ts create mode 100644 src/version2/parameters/assignIssueTypeSchemeToProjectParameters.ts delete mode 100644 src/version2/parameters/assignIssueTypeScreenSchemeToProject.ts create mode 100644 src/version2/parameters/assignIssueTypeScreenSchemeToProjectParameters.ts delete mode 100644 src/version2/parameters/assignPermissionScheme.ts create mode 100644 src/version2/parameters/assignPermissionSchemeParameters.ts delete mode 100644 src/version2/parameters/assignProjectsToCustomFieldContext.ts create mode 100644 src/version2/parameters/assignProjectsToCustomFieldContextParameters.ts delete mode 100644 src/version2/parameters/assignSchemeToProject.ts create mode 100644 src/version2/parameters/assignSchemeToProjectParameters.ts delete mode 100644 src/version2/parameters/associateSchemesToProjects.ts create mode 100644 src/version2/parameters/associateSchemesToProjectsParameters.ts delete mode 100644 src/version2/parameters/bulkDeleteIssueProperty.ts create mode 100644 src/version2/parameters/bulkDeleteIssuePropertyParameters.ts delete mode 100644 src/version2/parameters/bulkDeleteWorklogs.ts create mode 100644 src/version2/parameters/bulkDeleteWorklogsParameters.ts delete mode 100644 src/version2/parameters/bulkEditDashboards.ts create mode 100644 src/version2/parameters/bulkEditDashboardsParameters.ts delete mode 100644 src/version2/parameters/bulkFetchIssues.ts create mode 100644 src/version2/parameters/bulkFetchIssuesParameters.ts delete mode 100644 src/version2/parameters/bulkGetGroups.ts create mode 100644 src/version2/parameters/bulkGetGroupsParameters.ts delete mode 100644 src/version2/parameters/bulkGetUsers.ts delete mode 100644 src/version2/parameters/bulkGetUsersMigration.ts create mode 100644 src/version2/parameters/bulkGetUsersMigrationParameters.ts create mode 100644 src/version2/parameters/bulkGetUsersParameters.ts delete mode 100644 src/version2/parameters/bulkMoveWorklogs.ts create mode 100644 src/version2/parameters/bulkMoveWorklogsParameters.ts delete mode 100644 src/version2/parameters/bulkSetIssuePropertiesByIssue.ts create mode 100644 src/version2/parameters/bulkSetIssuePropertiesByIssueParameters.ts delete mode 100644 src/version2/parameters/bulkSetIssueProperty.ts create mode 100644 src/version2/parameters/bulkSetIssuePropertyParameters.ts delete mode 100644 src/version2/parameters/bulkSetIssuesProperties.ts create mode 100644 src/version2/parameters/bulkSetIssuesPropertiesListParameters.ts delete mode 100644 src/version2/parameters/cancelTask.ts create mode 100644 src/version2/parameters/cancelTaskParameters.ts delete mode 100644 src/version2/parameters/changeFilterOwner.ts create mode 100644 src/version2/parameters/changeFilterOwnerParameters.ts delete mode 100644 src/version2/parameters/copyDashboard.ts create mode 100644 src/version2/parameters/copyDashboardParameters.ts delete mode 100644 src/version2/parameters/countIssues.ts create mode 100644 src/version2/parameters/countIssuesParameters.ts delete mode 100644 src/version2/parameters/createAssociations.ts create mode 100644 src/version2/parameters/createAssociationsParameters.ts delete mode 100644 src/version2/parameters/createComponent.ts create mode 100644 src/version2/parameters/createComponentParameters.ts delete mode 100644 src/version2/parameters/createCustomField.ts delete mode 100644 src/version2/parameters/createCustomFieldContext.ts create mode 100644 src/version2/parameters/createCustomFieldContextParameters.ts delete mode 100644 src/version2/parameters/createCustomFieldOption.ts create mode 100644 src/version2/parameters/createCustomFieldOptionParameters.ts create mode 100644 src/version2/parameters/createCustomFieldParameters.ts delete mode 100644 src/version2/parameters/createDashboard.ts create mode 100644 src/version2/parameters/createDashboardParameters.ts delete mode 100644 src/version2/parameters/createFieldConfiguration.ts create mode 100644 src/version2/parameters/createFieldConfigurationParameters.ts delete mode 100644 src/version2/parameters/createFieldConfigurationScheme.ts create mode 100644 src/version2/parameters/createFieldConfigurationSchemeParameters.ts delete mode 100644 src/version2/parameters/createFilter.ts create mode 100644 src/version2/parameters/createFilterParameters.ts delete mode 100644 src/version2/parameters/createGroup.ts create mode 100644 src/version2/parameters/createGroupParameters.ts delete mode 100644 src/version2/parameters/createIssue.ts delete mode 100644 src/version2/parameters/createIssueFieldOption.ts create mode 100644 src/version2/parameters/createIssueFieldOptionParameters.ts delete mode 100644 src/version2/parameters/createIssueLinkType.ts create mode 100644 src/version2/parameters/createIssueLinkTypeParameters.ts create mode 100644 src/version2/parameters/createIssueParameters.ts delete mode 100644 src/version2/parameters/createIssueSecurityScheme.ts create mode 100644 src/version2/parameters/createIssueSecuritySchemeParameters.ts delete mode 100644 src/version2/parameters/createIssueType.ts delete mode 100644 src/version2/parameters/createIssueTypeAvatar.ts create mode 100644 src/version2/parameters/createIssueTypeAvatarParameters.ts create mode 100644 src/version2/parameters/createIssueTypeParameters.ts delete mode 100644 src/version2/parameters/createIssueTypeScheme.ts create mode 100644 src/version2/parameters/createIssueTypeSchemeParameters.ts delete mode 100644 src/version2/parameters/createIssueTypeScreenScheme.ts create mode 100644 src/version2/parameters/createIssueTypeScreenSchemeParameters.ts delete mode 100644 src/version2/parameters/createIssues.ts create mode 100644 src/version2/parameters/createIssuesParameters.ts delete mode 100644 src/version2/parameters/createNotificationScheme.ts create mode 100644 src/version2/parameters/createNotificationSchemeParameters.ts delete mode 100644 src/version2/parameters/createOrUpdateRemoteIssueLink.ts create mode 100644 src/version2/parameters/createOrUpdateRemoteIssueLinkParameters.ts delete mode 100644 src/version2/parameters/createPermissionGrant.ts create mode 100644 src/version2/parameters/createPermissionGrantParameters.ts delete mode 100644 src/version2/parameters/createPermissionScheme.ts create mode 100644 src/version2/parameters/createPermissionSchemeParameters.ts delete mode 100644 src/version2/parameters/createPlan.ts delete mode 100644 src/version2/parameters/createPlanOnlyTeam.ts create mode 100644 src/version2/parameters/createPlanOnlyTeamParameters.ts create mode 100644 src/version2/parameters/createPlanParameters.ts delete mode 100644 src/version2/parameters/createPriority.ts delete mode 100644 src/version2/parameters/createPriorityScheme.ts create mode 100644 src/version2/parameters/createPrioritySchemeParameters.ts delete mode 100644 src/version2/parameters/createProject.ts delete mode 100644 src/version2/parameters/createProjectAvatar.ts create mode 100644 src/version2/parameters/createProjectAvatarParameters.ts delete mode 100644 src/version2/parameters/createProjectCategory.ts create mode 100644 src/version2/parameters/createProjectCategoryParameters.ts create mode 100644 src/version2/parameters/createProjectParameters.ts delete mode 100644 src/version2/parameters/createProjectRole.ts create mode 100644 src/version2/parameters/createProjectRoleParameters.ts delete mode 100644 src/version2/parameters/createProjectWithCustomTemplate.ts create mode 100644 src/version2/parameters/createProjectWithCustomTemplateParameters.ts delete mode 100644 src/version2/parameters/createRelatedWork.ts create mode 100644 src/version2/parameters/createRelatedWorkParameters.ts delete mode 100644 src/version2/parameters/createResolution.ts create mode 100644 src/version2/parameters/createResolutionParameters.ts delete mode 100644 src/version2/parameters/createScreen.ts create mode 100644 src/version2/parameters/createScreenParameters.ts delete mode 100644 src/version2/parameters/createScreenScheme.ts create mode 100644 src/version2/parameters/createScreenSchemeParameters.ts delete mode 100644 src/version2/parameters/createStatuses.ts create mode 100644 src/version2/parameters/createStatusesParameters.ts delete mode 100644 src/version2/parameters/createUiModification.ts create mode 100644 src/version2/parameters/createUiModificationParameters.ts delete mode 100644 src/version2/parameters/createUser.ts create mode 100644 src/version2/parameters/createUserParameters.ts delete mode 100644 src/version2/parameters/createVersion.ts create mode 100644 src/version2/parameters/createVersionParameters.ts delete mode 100644 src/version2/parameters/createWorkflow.ts delete mode 100644 src/version2/parameters/createWorkflowScheme.ts delete mode 100644 src/version2/parameters/createWorkflowSchemeDraftFromParent.ts create mode 100644 src/version2/parameters/createWorkflowSchemeDraftFromParentParameters.ts create mode 100644 src/version2/parameters/createWorkflowSchemeParameters.ts delete mode 100644 src/version2/parameters/createWorkflowTransitionProperty.ts delete mode 100644 src/version2/parameters/createWorkflows.ts create mode 100644 src/version2/parameters/createWorkflowsParameters.ts delete mode 100644 src/version2/parameters/deleteActor.ts create mode 100644 src/version2/parameters/deleteActorParameters.ts delete mode 100644 src/version2/parameters/deleteAddonProperty.ts create mode 100644 src/version2/parameters/deleteAddonPropertyParameters.ts delete mode 100644 src/version2/parameters/deleteAndReplaceVersion.ts create mode 100644 src/version2/parameters/deleteAndReplaceVersionParameters.ts delete mode 100644 src/version2/parameters/deleteAppProperty.ts delete mode 100644 src/version2/parameters/deleteAvatar.ts create mode 100644 src/version2/parameters/deleteAvatarParameters.ts delete mode 100644 src/version2/parameters/deleteComment.ts create mode 100644 src/version2/parameters/deleteCommentParameters.ts delete mode 100644 src/version2/parameters/deleteCommentProperty.ts create mode 100644 src/version2/parameters/deleteCommentPropertyParameters.ts delete mode 100644 src/version2/parameters/deleteComponent.ts create mode 100644 src/version2/parameters/deleteComponentParameters.ts delete mode 100644 src/version2/parameters/deleteCustomField.ts delete mode 100644 src/version2/parameters/deleteCustomFieldContext.ts create mode 100644 src/version2/parameters/deleteCustomFieldContextParameters.ts delete mode 100644 src/version2/parameters/deleteCustomFieldOption.ts create mode 100644 src/version2/parameters/deleteCustomFieldOptionParameters.ts create mode 100644 src/version2/parameters/deleteCustomFieldParameters.ts delete mode 100644 src/version2/parameters/deleteDashboard.ts delete mode 100644 src/version2/parameters/deleteDashboardItemProperty.ts create mode 100644 src/version2/parameters/deleteDashboardItemPropertyParameters.ts create mode 100644 src/version2/parameters/deleteDashboardParameters.ts delete mode 100644 src/version2/parameters/deleteDefaultWorkflow.ts create mode 100644 src/version2/parameters/deleteDefaultWorkflowParameters.ts delete mode 100644 src/version2/parameters/deleteDraftDefaultWorkflow.ts create mode 100644 src/version2/parameters/deleteDraftDefaultWorkflowParameters.ts delete mode 100644 src/version2/parameters/deleteDraftWorkflowMapping.ts create mode 100644 src/version2/parameters/deleteDraftWorkflowMappingParameters.ts delete mode 100644 src/version2/parameters/deleteFavouriteForFilter.ts create mode 100644 src/version2/parameters/deleteFavouriteForFilterParameters.ts delete mode 100644 src/version2/parameters/deleteFieldConfiguration.ts create mode 100644 src/version2/parameters/deleteFieldConfigurationParameters.ts delete mode 100644 src/version2/parameters/deleteFieldConfigurationScheme.ts create mode 100644 src/version2/parameters/deleteFieldConfigurationSchemeParameters.ts delete mode 100644 src/version2/parameters/deleteFilter.ts create mode 100644 src/version2/parameters/deleteFilterParameters.ts create mode 100644 src/version2/parameters/deleteForgeAppPropertyParameters.ts delete mode 100644 src/version2/parameters/deleteInactiveWorkflow.ts create mode 100644 src/version2/parameters/deleteInactiveWorkflowParameters.ts delete mode 100644 src/version2/parameters/deleteIssue.ts delete mode 100644 src/version2/parameters/deleteIssueFieldOption.ts create mode 100644 src/version2/parameters/deleteIssueFieldOptionParameters.ts delete mode 100644 src/version2/parameters/deleteIssueLink.ts create mode 100644 src/version2/parameters/deleteIssueLinkParameters.ts delete mode 100644 src/version2/parameters/deleteIssueLinkType.ts create mode 100644 src/version2/parameters/deleteIssueLinkTypeParameters.ts create mode 100644 src/version2/parameters/deleteIssueParameters.ts delete mode 100644 src/version2/parameters/deleteIssueProperty.ts create mode 100644 src/version2/parameters/deleteIssuePropertyParameters.ts delete mode 100644 src/version2/parameters/deleteIssueType.ts create mode 100644 src/version2/parameters/deleteIssueTypeParameters.ts delete mode 100644 src/version2/parameters/deleteIssueTypeProperty.ts create mode 100644 src/version2/parameters/deleteIssueTypePropertyParameters.ts delete mode 100644 src/version2/parameters/deleteIssueTypeScheme.ts create mode 100644 src/version2/parameters/deleteIssueTypeSchemeParameters.ts delete mode 100644 src/version2/parameters/deleteIssueTypeScreenScheme.ts create mode 100644 src/version2/parameters/deleteIssueTypeScreenSchemeParameters.ts delete mode 100644 src/version2/parameters/deleteNotificationScheme.ts create mode 100644 src/version2/parameters/deleteNotificationSchemeParameters.ts delete mode 100644 src/version2/parameters/deletePermissionScheme.ts delete mode 100644 src/version2/parameters/deletePermissionSchemeEntity.ts create mode 100644 src/version2/parameters/deletePermissionSchemeEntityParameters.ts create mode 100644 src/version2/parameters/deletePermissionSchemeParameters.ts delete mode 100644 src/version2/parameters/deletePlanOnlyTeam.ts create mode 100644 src/version2/parameters/deletePlanOnlyTeamParameters.ts delete mode 100644 src/version2/parameters/deletePriority.ts create mode 100644 src/version2/parameters/deletePriorityParameters.ts delete mode 100644 src/version2/parameters/deletePriorityScheme.ts create mode 100644 src/version2/parameters/deletePrioritySchemeParameters.ts delete mode 100644 src/version2/parameters/deleteProject.ts delete mode 100644 src/version2/parameters/deleteProjectAsynchronously.ts create mode 100644 src/version2/parameters/deleteProjectAsynchronouslyParameters.ts delete mode 100644 src/version2/parameters/deleteProjectAvatar.ts create mode 100644 src/version2/parameters/deleteProjectAvatarParameters.ts create mode 100644 src/version2/parameters/deleteProjectParameters.ts delete mode 100644 src/version2/parameters/deleteProjectProperty.ts create mode 100644 src/version2/parameters/deleteProjectPropertyParameters.ts delete mode 100644 src/version2/parameters/deleteProjectRole.ts delete mode 100644 src/version2/parameters/deleteProjectRoleActorsFromRole.ts create mode 100644 src/version2/parameters/deleteProjectRoleActorsFromRoleParameters.ts create mode 100644 src/version2/parameters/deleteProjectRoleParameters.ts delete mode 100644 src/version2/parameters/deleteRelatedWork.ts create mode 100644 src/version2/parameters/deleteRelatedWorkParameters.ts delete mode 100644 src/version2/parameters/deleteRemoteIssueLinkByGlobalId.ts create mode 100644 src/version2/parameters/deleteRemoteIssueLinkByGlobalIdParameters.ts delete mode 100644 src/version2/parameters/deleteRemoteIssueLinkById.ts create mode 100644 src/version2/parameters/deleteRemoteIssueLinkByIdParameters.ts delete mode 100644 src/version2/parameters/deleteResolution.ts create mode 100644 src/version2/parameters/deleteResolutionParameters.ts delete mode 100644 src/version2/parameters/deleteScreen.ts create mode 100644 src/version2/parameters/deleteScreenParameters.ts delete mode 100644 src/version2/parameters/deleteScreenScheme.ts create mode 100644 src/version2/parameters/deleteScreenSchemeParameters.ts delete mode 100644 src/version2/parameters/deleteScreenTab.ts create mode 100644 src/version2/parameters/deleteScreenTabParameters.ts delete mode 100644 src/version2/parameters/deleteSecurityScheme.ts create mode 100644 src/version2/parameters/deleteSecuritySchemeParameters.ts delete mode 100644 src/version2/parameters/deleteSharePermission.ts create mode 100644 src/version2/parameters/deleteSharePermissionParameters.ts delete mode 100644 src/version2/parameters/deleteStatusesById.ts create mode 100644 src/version2/parameters/deleteStatusesByIdParameters.ts delete mode 100644 src/version2/parameters/deleteUiModification.ts create mode 100644 src/version2/parameters/deleteUiModificationParameters.ts delete mode 100644 src/version2/parameters/deleteUserProperty.ts create mode 100644 src/version2/parameters/deleteUserPropertyParameters.ts delete mode 100644 src/version2/parameters/deleteWebhookById.ts create mode 100644 src/version2/parameters/deleteWebhookByIdParameters.ts delete mode 100644 src/version2/parameters/deleteWorkflowMapping.ts create mode 100644 src/version2/parameters/deleteWorkflowMappingParameters.ts delete mode 100644 src/version2/parameters/deleteWorkflowScheme.ts delete mode 100644 src/version2/parameters/deleteWorkflowSchemeDraft.ts delete mode 100644 src/version2/parameters/deleteWorkflowSchemeDraftIssueType.ts create mode 100644 src/version2/parameters/deleteWorkflowSchemeDraftIssueTypeParameters.ts create mode 100644 src/version2/parameters/deleteWorkflowSchemeDraftParameters.ts delete mode 100644 src/version2/parameters/deleteWorkflowSchemeIssueType.ts create mode 100644 src/version2/parameters/deleteWorkflowSchemeIssueTypeParameters.ts create mode 100644 src/version2/parameters/deleteWorkflowSchemeParameters.ts delete mode 100644 src/version2/parameters/deleteWorkflowTransitionProperty.ts delete mode 100644 src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.ts create mode 100644 src/version2/parameters/deleteWorkflowTransitionRuleConfigurationsParameters.ts delete mode 100644 src/version2/parameters/deleteWorklog.ts create mode 100644 src/version2/parameters/deleteWorklogParameters.ts delete mode 100644 src/version2/parameters/deleteWorklogProperty.ts create mode 100644 src/version2/parameters/deleteWorklogPropertyParameters.ts delete mode 100644 src/version2/parameters/doTransition.ts create mode 100644 src/version2/parameters/doTransitionParameters.ts delete mode 100644 src/version2/parameters/duplicatePlan.ts create mode 100644 src/version2/parameters/duplicatePlanParameters.ts delete mode 100644 src/version2/parameters/editIssue.ts create mode 100644 src/version2/parameters/editIssueParameters.ts create mode 100644 src/version2/parameters/editTemplateParameters.ts create mode 100644 src/version2/parameters/evaluateJSISJiraExpressionParameters.ts delete mode 100644 src/version2/parameters/evaluateJiraExpression.ts delete mode 100644 src/version2/parameters/evaluateJiraExpressionUsingEnhancedSearch.ts delete mode 100644 src/version2/parameters/expandAttachmentForHumans.ts create mode 100644 src/version2/parameters/expandAttachmentForHumansParameters.ts delete mode 100644 src/version2/parameters/expandAttachmentForMachines.ts create mode 100644 src/version2/parameters/expandAttachmentForMachinesParameters.ts delete mode 100644 src/version2/parameters/exportArchivedIssues.ts create mode 100644 src/version2/parameters/exportArchivedIssuesParameters.ts delete mode 100644 src/version2/parameters/findAssignableUsers.ts create mode 100644 src/version2/parameters/findAssignableUsersParameters.ts delete mode 100644 src/version2/parameters/findBulkAssignableUsers.ts create mode 100644 src/version2/parameters/findBulkAssignableUsersParameters.ts delete mode 100644 src/version2/parameters/findComponentsForProjects.ts create mode 100644 src/version2/parameters/findComponentsForProjectsParameters.ts delete mode 100644 src/version2/parameters/findGroups.ts create mode 100644 src/version2/parameters/findGroupsParameters.ts delete mode 100644 src/version2/parameters/findUserKeysByQuery.ts create mode 100644 src/version2/parameters/findUserKeysByQueryParameters.ts delete mode 100644 src/version2/parameters/findUsers.ts delete mode 100644 src/version2/parameters/findUsersAndGroups.ts create mode 100644 src/version2/parameters/findUsersAndGroupsParameters.ts delete mode 100644 src/version2/parameters/findUsersByQuery.ts create mode 100644 src/version2/parameters/findUsersByQueryParameters.ts delete mode 100644 src/version2/parameters/findUsersForPicker.ts create mode 100644 src/version2/parameters/findUsersForPickerParameters.ts create mode 100644 src/version2/parameters/findUsersParameters.ts delete mode 100644 src/version2/parameters/findUsersWithAllPermissions.ts create mode 100644 src/version2/parameters/findUsersWithAllPermissionsParameters.ts delete mode 100644 src/version2/parameters/findUsersWithBrowsePermission.ts create mode 100644 src/version2/parameters/findUsersWithBrowsePermissionParameters.ts delete mode 100644 src/version2/parameters/fullyUpdateProjectRole.ts create mode 100644 src/version2/parameters/fullyUpdateProjectRoleParameters.ts delete mode 100644 src/version2/parameters/getAccessibleProjectTypeByKey.ts create mode 100644 src/version2/parameters/getAccessibleProjectTypeByKeyParameters.ts delete mode 100644 src/version2/parameters/getAddonProperties.ts create mode 100644 src/version2/parameters/getAddonPropertiesParameters.ts delete mode 100644 src/version2/parameters/getAddonProperty.ts create mode 100644 src/version2/parameters/getAddonPropertyParameters.ts create mode 100644 src/version2/parameters/getAdvancedSettingsParameters.ts create mode 100644 src/version2/parameters/getAllAccessibleProjectTypesParameters.ts create mode 100644 src/version2/parameters/getAllApplicationRolesParameters.ts create mode 100644 src/version2/parameters/getAllAvailableDashboardGadgetsParameters.ts delete mode 100644 src/version2/parameters/getAllDashboards.ts create mode 100644 src/version2/parameters/getAllDashboardsParameters.ts delete mode 100644 src/version2/parameters/getAllFieldConfigurationSchemes.ts create mode 100644 src/version2/parameters/getAllFieldConfigurationSchemesParameters.ts delete mode 100644 src/version2/parameters/getAllFieldConfigurations.ts create mode 100644 src/version2/parameters/getAllFieldConfigurationsParameters.ts delete mode 100644 src/version2/parameters/getAllGadgets.ts create mode 100644 src/version2/parameters/getAllGadgetsParameters.ts delete mode 100644 src/version2/parameters/getAllIssueFieldOptions.ts create mode 100644 src/version2/parameters/getAllIssueFieldOptionsParameters.ts delete mode 100644 src/version2/parameters/getAllIssueTypeSchemes.ts create mode 100644 src/version2/parameters/getAllIssueTypeSchemesParameters.ts delete mode 100644 src/version2/parameters/getAllLabels.ts create mode 100644 src/version2/parameters/getAllLabelsParameters.ts delete mode 100644 src/version2/parameters/getAllPermissionSchemes.ts create mode 100644 src/version2/parameters/getAllPermissionSchemesParameters.ts create mode 100644 src/version2/parameters/getAllPermissionsParameters.ts delete mode 100644 src/version2/parameters/getAllProjectAvatars.ts create mode 100644 src/version2/parameters/getAllProjectAvatarsParameters.ts create mode 100644 src/version2/parameters/getAllProjectCategoriesParameters.ts create mode 100644 src/version2/parameters/getAllProjectRolesParameters.ts create mode 100644 src/version2/parameters/getAllProjectTypesParameters.ts delete mode 100644 src/version2/parameters/getAllScreenTabFields.ts create mode 100644 src/version2/parameters/getAllScreenTabFieldsParameters.ts delete mode 100644 src/version2/parameters/getAllScreenTabs.ts create mode 100644 src/version2/parameters/getAllScreenTabsParameters.ts delete mode 100644 src/version2/parameters/getAllStatuses.ts create mode 100644 src/version2/parameters/getAllStatusesParameters.ts delete mode 100644 src/version2/parameters/getAllSystemAvatars.ts create mode 100644 src/version2/parameters/getAllSystemAvatarsParameters.ts delete mode 100644 src/version2/parameters/getAllUserDataClassificationLevels.ts create mode 100644 src/version2/parameters/getAllUserDataClassificationLevelsParameters.ts delete mode 100644 src/version2/parameters/getAllUsers.ts delete mode 100644 src/version2/parameters/getAllUsersDefault.ts create mode 100644 src/version2/parameters/getAllUsersDefaultParameters.ts create mode 100644 src/version2/parameters/getAllUsersParameters.ts delete mode 100644 src/version2/parameters/getAllWorkflowSchemes.ts create mode 100644 src/version2/parameters/getAllWorkflowSchemesParameters.ts delete mode 100644 src/version2/parameters/getAlternativeIssueTypes.ts create mode 100644 src/version2/parameters/getAlternativeIssueTypesParameters.ts delete mode 100644 src/version2/parameters/getApplicationProperty.ts create mode 100644 src/version2/parameters/getApplicationPropertyParameters.ts delete mode 100644 src/version2/parameters/getApplicationRole.ts create mode 100644 src/version2/parameters/getApplicationRoleParameters.ts create mode 100644 src/version2/parameters/getApproximateApplicationLicenseCountParameters.ts create mode 100644 src/version2/parameters/getApproximateLicenseCountParameters.ts delete mode 100644 src/version2/parameters/getAssignedPermissionScheme.ts create mode 100644 src/version2/parameters/getAssignedPermissionSchemeParameters.ts delete mode 100644 src/version2/parameters/getAtlassianTeam.ts create mode 100644 src/version2/parameters/getAtlassianTeamParameters.ts delete mode 100644 src/version2/parameters/getAttachment.ts delete mode 100644 src/version2/parameters/getAttachmentContent.ts create mode 100644 src/version2/parameters/getAttachmentContentParameters.ts create mode 100644 src/version2/parameters/getAttachmentMetaParameters.ts create mode 100644 src/version2/parameters/getAttachmentParameters.ts delete mode 100644 src/version2/parameters/getAttachmentThumbnail.ts create mode 100644 src/version2/parameters/getAttachmentThumbnailParameters.ts delete mode 100644 src/version2/parameters/getAuditRecords.ts create mode 100644 src/version2/parameters/getAuditRecordsParameters.ts create mode 100644 src/version2/parameters/getAutoCompleteParameters.ts delete mode 100644 src/version2/parameters/getAutoCompletePost.ts create mode 100644 src/version2/parameters/getAutoCompletePostParameters.ts delete mode 100644 src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts create mode 100644 src/version2/parameters/getAvailablePrioritiesByPrioritySchemeParameters.ts delete mode 100644 src/version2/parameters/getAvailableScreenFields.ts create mode 100644 src/version2/parameters/getAvailableScreenFieldsParameters.ts create mode 100644 src/version2/parameters/getAvailableTimeTrackingImplementationsParameters.ts delete mode 100644 src/version2/parameters/getAvatarImageByID.ts create mode 100644 src/version2/parameters/getAvatarImageByIDParameters.ts delete mode 100644 src/version2/parameters/getAvatarImageByOwner.ts create mode 100644 src/version2/parameters/getAvatarImageByOwnerParameters.ts delete mode 100644 src/version2/parameters/getAvatarImageByType.ts create mode 100644 src/version2/parameters/getAvatarImageByTypeParameters.ts delete mode 100644 src/version2/parameters/getAvatars.ts create mode 100644 src/version2/parameters/getAvatarsParameters.ts create mode 100644 src/version2/parameters/getBannerParameters.ts delete mode 100644 src/version2/parameters/getBulkChangelogs.ts create mode 100644 src/version2/parameters/getBulkChangelogsParameters.ts delete mode 100644 src/version2/parameters/getBulkPermissions.ts create mode 100644 src/version2/parameters/getBulkPermissionsParameters.ts delete mode 100644 src/version2/parameters/getBulkScreenTabs.ts create mode 100644 src/version2/parameters/getBulkScreenTabsParameters.ts delete mode 100644 src/version2/parameters/getChangeLogs.ts delete mode 100644 src/version2/parameters/getChangeLogsByIds.ts create mode 100644 src/version2/parameters/getChangeLogsByIdsParameters.ts create mode 100644 src/version2/parameters/getChangeLogsParameters.ts delete mode 100644 src/version2/parameters/getColumns.ts create mode 100644 src/version2/parameters/getColumnsParameters.ts delete mode 100644 src/version2/parameters/getComment.ts create mode 100644 src/version2/parameters/getCommentParameters.ts delete mode 100644 src/version2/parameters/getCommentProperty.ts delete mode 100644 src/version2/parameters/getCommentPropertyKeys.ts create mode 100644 src/version2/parameters/getCommentPropertyKeysParameters.ts create mode 100644 src/version2/parameters/getCommentPropertyParameters.ts delete mode 100644 src/version2/parameters/getComments.ts delete mode 100644 src/version2/parameters/getCommentsByIds.ts create mode 100644 src/version2/parameters/getCommentsByIdsParameters.ts create mode 100644 src/version2/parameters/getCommentsParameters.ts delete mode 100644 src/version2/parameters/getComponent.ts create mode 100644 src/version2/parameters/getComponentParameters.ts delete mode 100644 src/version2/parameters/getComponentRelatedIssues.ts create mode 100644 src/version2/parameters/getComponentRelatedIssuesParameters.ts create mode 100644 src/version2/parameters/getConfigurationParameters.ts delete mode 100644 src/version2/parameters/getContextsForField.ts create mode 100644 src/version2/parameters/getContextsForFieldParameters.ts delete mode 100644 src/version2/parameters/getCreateIssueMeta.ts delete mode 100644 src/version2/parameters/getCreateIssueMetaIssueTypeId.ts create mode 100644 src/version2/parameters/getCreateIssueMetaIssueTypeIdParameters.ts delete mode 100644 src/version2/parameters/getCreateIssueMetaIssueTypes.ts create mode 100644 src/version2/parameters/getCreateIssueMetaIssueTypesParameters.ts delete mode 100644 src/version2/parameters/getCurrentUser.ts create mode 100644 src/version2/parameters/getCurrentUserParameters.ts delete mode 100644 src/version2/parameters/getCustomFieldConfiguration.ts create mode 100644 src/version2/parameters/getCustomFieldConfigurationParameters.ts delete mode 100644 src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts create mode 100644 src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypesParameters.ts delete mode 100644 src/version2/parameters/getCustomFieldOption.ts create mode 100644 src/version2/parameters/getCustomFieldOptionParameters.ts delete mode 100644 src/version2/parameters/getCustomFieldsConfigurations.ts create mode 100644 src/version2/parameters/getCustomFieldsConfigurationsParameters.ts delete mode 100644 src/version2/parameters/getDashboard.ts delete mode 100644 src/version2/parameters/getDashboardItemProperty.ts delete mode 100644 src/version2/parameters/getDashboardItemPropertyKeys.ts create mode 100644 src/version2/parameters/getDashboardItemPropertyKeysParameters.ts create mode 100644 src/version2/parameters/getDashboardItemPropertyParameters.ts create mode 100644 src/version2/parameters/getDashboardParameters.ts delete mode 100644 src/version2/parameters/getDashboardsPaginated.ts create mode 100644 src/version2/parameters/getDashboardsPaginatedParameters.ts create mode 100644 src/version2/parameters/getDefaultEditorParameters.ts delete mode 100644 src/version2/parameters/getDefaultProjectClassification.ts create mode 100644 src/version2/parameters/getDefaultProjectClassificationParameters.ts create mode 100644 src/version2/parameters/getDefaultShareScopeParameters.ts delete mode 100644 src/version2/parameters/getDefaultValues.ts create mode 100644 src/version2/parameters/getDefaultValuesParameters.ts delete mode 100644 src/version2/parameters/getDefaultWorkflow.ts create mode 100644 src/version2/parameters/getDefaultWorkflowParameters.ts delete mode 100644 src/version2/parameters/getDraftDefaultWorkflow.ts create mode 100644 src/version2/parameters/getDraftDefaultWorkflowParameters.ts delete mode 100644 src/version2/parameters/getDraftWorkflow.ts create mode 100644 src/version2/parameters/getDraftWorkflowParameters.ts delete mode 100644 src/version2/parameters/getDynamicWebhooksForApp.ts create mode 100644 src/version2/parameters/getDynamicWebhooksForAppParameters.ts delete mode 100644 src/version2/parameters/getEditIssueMeta.ts create mode 100644 src/version2/parameters/getEditIssueMetaParameters.ts create mode 100644 src/version2/parameters/getEventsParameters.ts delete mode 100644 src/version2/parameters/getFailedWebhooks.ts create mode 100644 src/version2/parameters/getFailedWebhooksParameters.ts delete mode 100644 src/version2/parameters/getFavouriteFilters.ts create mode 100644 src/version2/parameters/getFavouriteFiltersParameters.ts delete mode 100644 src/version2/parameters/getFeaturesForProject.ts create mode 100644 src/version2/parameters/getFeaturesForProjectParameters.ts delete mode 100644 src/version2/parameters/getFieldAutoCompleteForQueryString.ts create mode 100644 src/version2/parameters/getFieldAutoCompleteForQueryStringParameters.ts delete mode 100644 src/version2/parameters/getFieldConfigurationItems.ts create mode 100644 src/version2/parameters/getFieldConfigurationItemsParameters.ts delete mode 100644 src/version2/parameters/getFieldConfigurationSchemeMappings.ts create mode 100644 src/version2/parameters/getFieldConfigurationSchemeMappingsParameters.ts delete mode 100644 src/version2/parameters/getFieldConfigurationSchemeProjectMapping.ts create mode 100644 src/version2/parameters/getFieldConfigurationSchemeProjectMappingParameters.ts delete mode 100644 src/version2/parameters/getFieldsPaginated.ts create mode 100644 src/version2/parameters/getFieldsPaginatedParameters.ts create mode 100644 src/version2/parameters/getFieldsParameters.ts delete mode 100644 src/version2/parameters/getFilter.ts create mode 100644 src/version2/parameters/getFilterParameters.ts delete mode 100644 src/version2/parameters/getFiltersPaginated.ts create mode 100644 src/version2/parameters/getFiltersPaginatedParameters.ts delete mode 100644 src/version2/parameters/getHierarchy.ts create mode 100644 src/version2/parameters/getHierarchyParameters.ts delete mode 100644 src/version2/parameters/getIdsOfWorklogsDeletedSince.ts create mode 100644 src/version2/parameters/getIdsOfWorklogsDeletedSinceParameters.ts delete mode 100644 src/version2/parameters/getIdsOfWorklogsModifiedSince.ts create mode 100644 src/version2/parameters/getIdsOfWorklogsModifiedSinceParameters.ts delete mode 100644 src/version2/parameters/getIsWatchingIssueBulk.ts create mode 100644 src/version2/parameters/getIsWatchingIssueBulkParameters.ts delete mode 100644 src/version2/parameters/getIssue.ts create mode 100644 src/version2/parameters/getIssueAllTypesParameters.ts delete mode 100644 src/version2/parameters/getIssueFieldOption.ts create mode 100644 src/version2/parameters/getIssueFieldOptionParameters.ts delete mode 100644 src/version2/parameters/getIssueLimitReport.ts create mode 100644 src/version2/parameters/getIssueLimitReportParameters.ts delete mode 100644 src/version2/parameters/getIssueLink.ts create mode 100644 src/version2/parameters/getIssueLinkParameters.ts delete mode 100644 src/version2/parameters/getIssueLinkType.ts create mode 100644 src/version2/parameters/getIssueLinkTypeParameters.ts create mode 100644 src/version2/parameters/getIssueLinkTypesParameters.ts create mode 100644 src/version2/parameters/getIssueNavigatorDefaultColumnsParameters.ts create mode 100644 src/version2/parameters/getIssueParameters.ts delete mode 100644 src/version2/parameters/getIssuePickerResource.ts create mode 100644 src/version2/parameters/getIssuePickerResourceParameters.ts delete mode 100644 src/version2/parameters/getIssueProperty.ts delete mode 100644 src/version2/parameters/getIssuePropertyKeys.ts create mode 100644 src/version2/parameters/getIssuePropertyKeysParameters.ts create mode 100644 src/version2/parameters/getIssuePropertyParameters.ts delete mode 100644 src/version2/parameters/getIssueSecurityLevel.ts delete mode 100644 src/version2/parameters/getIssueSecurityLevelMembers.ts create mode 100644 src/version2/parameters/getIssueSecurityLevelMembersParameters.ts create mode 100644 src/version2/parameters/getIssueSecurityLevelParameters.ts delete mode 100644 src/version2/parameters/getIssueSecurityScheme.ts create mode 100644 src/version2/parameters/getIssueSecuritySchemeParameters.ts create mode 100644 src/version2/parameters/getIssueSecuritySchemesParameters.ts delete mode 100644 src/version2/parameters/getIssueType.ts delete mode 100644 src/version2/parameters/getIssueTypeMappingsForContexts.ts create mode 100644 src/version2/parameters/getIssueTypeMappingsForContextsParameters.ts create mode 100644 src/version2/parameters/getIssueTypeParameters.ts delete mode 100644 src/version2/parameters/getIssueTypeProperty.ts delete mode 100644 src/version2/parameters/getIssueTypePropertyKeys.ts create mode 100644 src/version2/parameters/getIssueTypePropertyKeysParameters.ts create mode 100644 src/version2/parameters/getIssueTypePropertyParameters.ts delete mode 100644 src/version2/parameters/getIssueTypeSchemeForProjects.ts create mode 100644 src/version2/parameters/getIssueTypeSchemeForProjectsParameters.ts delete mode 100644 src/version2/parameters/getIssueTypeSchemesMapping.ts create mode 100644 src/version2/parameters/getIssueTypeSchemesMappingParameters.ts delete mode 100644 src/version2/parameters/getIssueTypeScreenSchemeMappings.ts create mode 100644 src/version2/parameters/getIssueTypeScreenSchemeMappingsParameters.ts delete mode 100644 src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.ts create mode 100644 src/version2/parameters/getIssueTypeScreenSchemeProjectAssociationsParameters.ts delete mode 100644 src/version2/parameters/getIssueTypeScreenSchemes.ts create mode 100644 src/version2/parameters/getIssueTypeScreenSchemesParameters.ts delete mode 100644 src/version2/parameters/getIssueTypesForProject.ts create mode 100644 src/version2/parameters/getIssueTypesForProjectParameters.ts delete mode 100644 src/version2/parameters/getIssueWatchers.ts create mode 100644 src/version2/parameters/getIssueWatchersParameters.ts delete mode 100644 src/version2/parameters/getIssueWorklog.ts create mode 100644 src/version2/parameters/getIssueWorklogParameters.ts create mode 100644 src/version2/parameters/getLicenseParameters.ts create mode 100644 src/version2/parameters/getLocaleParameters.ts create mode 100644 src/version2/parameters/getModulesParameters.ts delete mode 100644 src/version2/parameters/getMyFilters.ts create mode 100644 src/version2/parameters/getMyFiltersParameters.ts delete mode 100644 src/version2/parameters/getMyPermissions.ts create mode 100644 src/version2/parameters/getMyPermissionsParameters.ts delete mode 100644 src/version2/parameters/getNotificationScheme.ts delete mode 100644 src/version2/parameters/getNotificationSchemeForProject.ts create mode 100644 src/version2/parameters/getNotificationSchemeForProjectParameters.ts create mode 100644 src/version2/parameters/getNotificationSchemeParameters.ts delete mode 100644 src/version2/parameters/getNotificationSchemeToProjectMappings.ts create mode 100644 src/version2/parameters/getNotificationSchemeToProjectMappingsParameters.ts delete mode 100644 src/version2/parameters/getNotificationSchemes.ts create mode 100644 src/version2/parameters/getNotificationSchemesParameters.ts delete mode 100644 src/version2/parameters/getOptionsForContext.ts create mode 100644 src/version2/parameters/getOptionsForContextParameters.ts delete mode 100644 src/version2/parameters/getPermissionScheme.ts delete mode 100644 src/version2/parameters/getPermissionSchemeGrant.ts create mode 100644 src/version2/parameters/getPermissionSchemeGrantParameters.ts delete mode 100644 src/version2/parameters/getPermissionSchemeGrants.ts create mode 100644 src/version2/parameters/getPermissionSchemeGrantsParameters.ts create mode 100644 src/version2/parameters/getPermissionSchemeParameters.ts delete mode 100644 src/version2/parameters/getPermittedProjects.ts create mode 100644 src/version2/parameters/getPermittedProjectsParameters.ts delete mode 100644 src/version2/parameters/getPlan.ts delete mode 100644 src/version2/parameters/getPlanOnlyTeam.ts create mode 100644 src/version2/parameters/getPlanOnlyTeamParameters.ts create mode 100644 src/version2/parameters/getPlanParameters.ts delete mode 100644 src/version2/parameters/getPlans.ts create mode 100644 src/version2/parameters/getPlansParameters.ts delete mode 100644 src/version2/parameters/getPolicies.ts create mode 100644 src/version2/parameters/getPoliciesParameters.ts create mode 100644 src/version2/parameters/getPolicyParameters.ts delete mode 100644 src/version2/parameters/getPrecomputations.ts delete mode 100644 src/version2/parameters/getPrecomputationsByID.ts create mode 100644 src/version2/parameters/getPrecomputationsByIDParameters.ts create mode 100644 src/version2/parameters/getPrecomputationsParameters.ts delete mode 100644 src/version2/parameters/getPreference.ts create mode 100644 src/version2/parameters/getPreferenceParameters.ts delete mode 100644 src/version2/parameters/getPrioritiesByPriorityScheme.ts create mode 100644 src/version2/parameters/getPrioritiesByPrioritySchemeParameters.ts delete mode 100644 src/version2/parameters/getPriority.ts create mode 100644 src/version2/parameters/getPriorityParameters.ts delete mode 100644 src/version2/parameters/getPrioritySchemes.ts create mode 100644 src/version2/parameters/getPrioritySchemesParameters.ts delete mode 100644 src/version2/parameters/getProject.ts delete mode 100644 src/version2/parameters/getProjectCategoryById.ts create mode 100644 src/version2/parameters/getProjectCategoryByIdParameters.ts delete mode 100644 src/version2/parameters/getProjectComponents.ts delete mode 100644 src/version2/parameters/getProjectComponentsPaginated.ts create mode 100644 src/version2/parameters/getProjectComponentsPaginatedParameters.ts create mode 100644 src/version2/parameters/getProjectComponentsParameters.ts delete mode 100644 src/version2/parameters/getProjectContextMapping.ts create mode 100644 src/version2/parameters/getProjectContextMappingParameters.ts delete mode 100644 src/version2/parameters/getProjectEmail.ts create mode 100644 src/version2/parameters/getProjectEmailParameters.ts delete mode 100644 src/version2/parameters/getProjectIssueSecurityScheme.ts create mode 100644 src/version2/parameters/getProjectIssueSecuritySchemeParameters.ts delete mode 100644 src/version2/parameters/getProjectIssueTypeUsagesForStatus.ts create mode 100644 src/version2/parameters/getProjectIssueTypeUsagesForStatusParameters.ts create mode 100644 src/version2/parameters/getProjectParameters.ts delete mode 100644 src/version2/parameters/getProjectProperty.ts delete mode 100644 src/version2/parameters/getProjectPropertyKeys.ts create mode 100644 src/version2/parameters/getProjectPropertyKeysParameters.ts create mode 100644 src/version2/parameters/getProjectPropertyParameters.ts delete mode 100644 src/version2/parameters/getProjectRole.ts delete mode 100644 src/version2/parameters/getProjectRoleActorsForRole.ts create mode 100644 src/version2/parameters/getProjectRoleActorsForRoleParameters.ts delete mode 100644 src/version2/parameters/getProjectRoleById.ts create mode 100644 src/version2/parameters/getProjectRoleByIdParameters.ts delete mode 100644 src/version2/parameters/getProjectRoleDetails.ts create mode 100644 src/version2/parameters/getProjectRoleDetailsParameters.ts create mode 100644 src/version2/parameters/getProjectRoleParameters.ts delete mode 100644 src/version2/parameters/getProjectRoles.ts create mode 100644 src/version2/parameters/getProjectRolesParameters.ts delete mode 100644 src/version2/parameters/getProjectTypeByKey.ts create mode 100644 src/version2/parameters/getProjectTypeByKeyParameters.ts delete mode 100644 src/version2/parameters/getProjectUsagesForStatus.ts create mode 100644 src/version2/parameters/getProjectUsagesForStatusParameters.ts delete mode 100644 src/version2/parameters/getProjectUsagesForWorkflow.ts create mode 100644 src/version2/parameters/getProjectUsagesForWorkflowParameters.ts delete mode 100644 src/version2/parameters/getProjectUsagesForWorkflowScheme.ts create mode 100644 src/version2/parameters/getProjectUsagesForWorkflowSchemeParameters.ts delete mode 100644 src/version2/parameters/getProjectVersions.ts delete mode 100644 src/version2/parameters/getProjectVersionsPaginated.ts create mode 100644 src/version2/parameters/getProjectVersionsPaginatedParameters.ts create mode 100644 src/version2/parameters/getProjectVersionsParameters.ts delete mode 100644 src/version2/parameters/getProjectsByPriorityScheme.ts create mode 100644 src/version2/parameters/getProjectsByPrioritySchemeParameters.ts delete mode 100644 src/version2/parameters/getProjectsForIssueTypeScreenScheme.ts create mode 100644 src/version2/parameters/getProjectsForIssueTypeScreenSchemeParameters.ts delete mode 100644 src/version2/parameters/getRecent.ts create mode 100644 src/version2/parameters/getRecentParameters.ts create mode 100644 src/version2/parameters/getRedactionStatusParameters.ts delete mode 100644 src/version2/parameters/getRelatedWork.ts create mode 100644 src/version2/parameters/getRelatedWorkParameters.ts delete mode 100644 src/version2/parameters/getRemoteIssueLinkById.ts create mode 100644 src/version2/parameters/getRemoteIssueLinkByIdParameters.ts delete mode 100644 src/version2/parameters/getRemoteIssueLinks.ts create mode 100644 src/version2/parameters/getRemoteIssueLinksParameters.ts delete mode 100644 src/version2/parameters/getResolution.ts create mode 100644 src/version2/parameters/getResolutionParameters.ts delete mode 100644 src/version2/parameters/getScreenSchemes.ts create mode 100644 src/version2/parameters/getScreenSchemesParameters.ts delete mode 100644 src/version2/parameters/getScreens.ts delete mode 100644 src/version2/parameters/getScreensForField.ts create mode 100644 src/version2/parameters/getScreensForFieldParameters.ts create mode 100644 src/version2/parameters/getScreensParameters.ts delete mode 100644 src/version2/parameters/getSecurityLevelMembers.ts create mode 100644 src/version2/parameters/getSecurityLevelMembersParameters.ts delete mode 100644 src/version2/parameters/getSecurityLevels.ts delete mode 100644 src/version2/parameters/getSecurityLevelsForProject.ts create mode 100644 src/version2/parameters/getSecurityLevelsForProjectParameters.ts create mode 100644 src/version2/parameters/getSecurityLevelsParameters.ts delete mode 100644 src/version2/parameters/getSelectableIssueFieldOptions.ts create mode 100644 src/version2/parameters/getSelectableIssueFieldOptionsParameters.ts create mode 100644 src/version2/parameters/getSelectedTimeTrackingImplementationParameters.ts create mode 100644 src/version2/parameters/getServerInfoParameters.ts delete mode 100644 src/version2/parameters/getSharePermission.ts create mode 100644 src/version2/parameters/getSharePermissionParameters.ts delete mode 100644 src/version2/parameters/getSharePermissions.ts create mode 100644 src/version2/parameters/getSharePermissionsParameters.ts create mode 100644 src/version2/parameters/getSharedTimeTrackingConfigurationParameters.ts delete mode 100644 src/version2/parameters/getStatus.ts create mode 100644 src/version2/parameters/getStatusCategoriesParameters.ts delete mode 100644 src/version2/parameters/getStatusCategory.ts create mode 100644 src/version2/parameters/getStatusCategoryParameters.ts create mode 100644 src/version2/parameters/getStatusParameters.ts delete mode 100644 src/version2/parameters/getStatusesById.ts create mode 100644 src/version2/parameters/getStatusesByIdParameters.ts create mode 100644 src/version2/parameters/getStatusesParameters.ts delete mode 100644 src/version2/parameters/getTask.ts create mode 100644 src/version2/parameters/getTaskParameters.ts delete mode 100644 src/version2/parameters/getTeams.ts create mode 100644 src/version2/parameters/getTeamsParameters.ts delete mode 100644 src/version2/parameters/getTransitions.ts create mode 100644 src/version2/parameters/getTransitionsParameters.ts delete mode 100644 src/version2/parameters/getTrashedFieldsPaginated.ts create mode 100644 src/version2/parameters/getTrashedFieldsPaginatedParameters.ts delete mode 100644 src/version2/parameters/getUiModifications.ts create mode 100644 src/version2/parameters/getUiModificationsParameters.ts delete mode 100644 src/version2/parameters/getUser.ts delete mode 100644 src/version2/parameters/getUserDefaultColumns.ts create mode 100644 src/version2/parameters/getUserDefaultColumnsParameters.ts delete mode 100644 src/version2/parameters/getUserEmail.ts delete mode 100644 src/version2/parameters/getUserEmailBulk.ts create mode 100644 src/version2/parameters/getUserEmailBulkParameters.ts create mode 100644 src/version2/parameters/getUserEmailParameters.ts delete mode 100644 src/version2/parameters/getUserGroups.ts create mode 100644 src/version2/parameters/getUserGroupsParameters.ts delete mode 100644 src/version2/parameters/getUserNavProperty.ts create mode 100644 src/version2/parameters/getUserNavPropertyParameters.ts create mode 100644 src/version2/parameters/getUserParameters.ts delete mode 100644 src/version2/parameters/getUserProperty.ts delete mode 100644 src/version2/parameters/getUserPropertyKeys.ts create mode 100644 src/version2/parameters/getUserPropertyKeysParameters.ts create mode 100644 src/version2/parameters/getUserPropertyParameters.ts delete mode 100644 src/version2/parameters/getUsersFromGroup.ts create mode 100644 src/version2/parameters/getUsersFromGroupParameters.ts delete mode 100644 src/version2/parameters/getValidProjectKey.ts create mode 100644 src/version2/parameters/getValidProjectKeyParameters.ts delete mode 100644 src/version2/parameters/getValidProjectName.ts create mode 100644 src/version2/parameters/getValidProjectNameParameters.ts delete mode 100644 src/version2/parameters/getVersion.ts create mode 100644 src/version2/parameters/getVersionParameters.ts delete mode 100644 src/version2/parameters/getVersionRelatedIssues.ts create mode 100644 src/version2/parameters/getVersionRelatedIssuesParameters.ts delete mode 100644 src/version2/parameters/getVersionUnresolvedIssues.ts create mode 100644 src/version2/parameters/getVersionUnresolvedIssuesParameters.ts delete mode 100644 src/version2/parameters/getVisibleIssueFieldOptions.ts create mode 100644 src/version2/parameters/getVisibleIssueFieldOptionsParameters.ts delete mode 100644 src/version2/parameters/getVotes.ts create mode 100644 src/version2/parameters/getVotesParameters.ts delete mode 100644 src/version2/parameters/getWorkflow.ts create mode 100644 src/version2/parameters/getWorkflowParameters.ts delete mode 100644 src/version2/parameters/getWorkflowProjectIssueTypeUsages.ts create mode 100644 src/version2/parameters/getWorkflowProjectIssueTypeUsagesParameters.ts delete mode 100644 src/version2/parameters/getWorkflowScheme.ts delete mode 100644 src/version2/parameters/getWorkflowSchemeDraft.ts delete mode 100644 src/version2/parameters/getWorkflowSchemeDraftIssueType.ts create mode 100644 src/version2/parameters/getWorkflowSchemeDraftIssueTypeParameters.ts create mode 100644 src/version2/parameters/getWorkflowSchemeDraftParameters.ts delete mode 100644 src/version2/parameters/getWorkflowSchemeIssueType.ts create mode 100644 src/version2/parameters/getWorkflowSchemeIssueTypeParameters.ts create mode 100644 src/version2/parameters/getWorkflowSchemeParameters.ts delete mode 100644 src/version2/parameters/getWorkflowSchemeProjectAssociations.ts create mode 100644 src/version2/parameters/getWorkflowSchemeProjectAssociationsParameters.ts delete mode 100644 src/version2/parameters/getWorkflowSchemeUsagesForWorkflow.ts create mode 100644 src/version2/parameters/getWorkflowSchemeUsagesForWorkflowParameters.ts delete mode 100644 src/version2/parameters/getWorkflowTransitionProperties.ts delete mode 100644 src/version2/parameters/getWorkflowTransitionRuleConfigurations.ts create mode 100644 src/version2/parameters/getWorkflowTransitionRuleConfigurationsParameters.ts delete mode 100644 src/version2/parameters/getWorkflowUsagesForStatus.ts create mode 100644 src/version2/parameters/getWorkflowUsagesForStatusParameters.ts delete mode 100644 src/version2/parameters/getWorkflowsPaginated.ts delete mode 100644 src/version2/parameters/getWorklog.ts create mode 100644 src/version2/parameters/getWorklogParameters.ts delete mode 100644 src/version2/parameters/getWorklogProperty.ts delete mode 100644 src/version2/parameters/getWorklogPropertyKeys.ts create mode 100644 src/version2/parameters/getWorklogPropertyKeysParameters.ts create mode 100644 src/version2/parameters/getWorklogPropertyParameters.ts delete mode 100644 src/version2/parameters/getWorklogsForIds.ts create mode 100644 src/version2/parameters/getWorklogsForIdsParameters.ts delete mode 100644 src/version2/parameters/index.ts delete mode 100644 src/version2/parameters/linkIssues.ts create mode 100644 src/version2/parameters/linkIssuesParameters.ts create mode 100644 src/version2/parameters/liveTemplateParameters.ts delete mode 100644 src/version2/parameters/matchIssues.ts create mode 100644 src/version2/parameters/matchIssuesParameters.ts delete mode 100644 src/version2/parameters/mergeVersions.ts create mode 100644 src/version2/parameters/mergeVersionsParameters.ts delete mode 100644 src/version2/parameters/migrateQueries.ts create mode 100644 src/version2/parameters/migrateQueriesParameters.ts delete mode 100644 src/version2/parameters/movePriorities.ts create mode 100644 src/version2/parameters/movePrioritiesParameters.ts delete mode 100644 src/version2/parameters/moveResolutions.ts create mode 100644 src/version2/parameters/moveResolutionsParameters.ts delete mode 100644 src/version2/parameters/moveScreenTab.ts delete mode 100644 src/version2/parameters/moveScreenTabField.ts create mode 100644 src/version2/parameters/moveScreenTabFieldParameters.ts create mode 100644 src/version2/parameters/moveScreenTabParameters.ts delete mode 100644 src/version2/parameters/moveVersion.ts create mode 100644 src/version2/parameters/moveVersionParameters.ts delete mode 100644 src/version2/parameters/notify.ts create mode 100644 src/version2/parameters/notifyParameters.ts delete mode 100644 src/version2/parameters/parseJqlQueries.ts create mode 100644 src/version2/parameters/parseJqlQueriesParameters.ts delete mode 100644 src/version2/parameters/partialUpdateProjectRole.ts create mode 100644 src/version2/parameters/partialUpdateProjectRoleParameters.ts delete mode 100644 src/version2/parameters/publishDraftWorkflowScheme.ts create mode 100644 src/version2/parameters/publishDraftWorkflowSchemeParameters.ts delete mode 100644 src/version2/parameters/putAddonProperty.ts create mode 100644 src/version2/parameters/putAddonPropertyParameters.ts delete mode 100644 src/version2/parameters/putAppProperty.ts create mode 100644 src/version2/parameters/putForgeAppPropertyParameters.ts delete mode 100644 src/version2/parameters/readWorkflowSchemes.ts create mode 100644 src/version2/parameters/readWorkflowSchemesParameters.ts delete mode 100644 src/version2/parameters/readWorkflows.ts create mode 100644 src/version2/parameters/readWorkflowsParameters.ts create mode 100644 src/version2/parameters/redactParameters.ts delete mode 100644 src/version2/parameters/refreshWebhooks.ts create mode 100644 src/version2/parameters/refreshWebhooksParameters.ts delete mode 100644 src/version2/parameters/registerDynamicWebhooks.ts create mode 100644 src/version2/parameters/registerDynamicWebhooksParameters.ts delete mode 100644 src/version2/parameters/registerModules.ts create mode 100644 src/version2/parameters/registerModulesParameters.ts delete mode 100644 src/version2/parameters/removeAssociations.ts create mode 100644 src/version2/parameters/removeAssociationsParameters.ts delete mode 100644 src/version2/parameters/removeAtlassianTeam.ts create mode 100644 src/version2/parameters/removeAtlassianTeamParameters.ts delete mode 100644 src/version2/parameters/removeAttachment.ts create mode 100644 src/version2/parameters/removeAttachmentParameters.ts delete mode 100644 src/version2/parameters/removeCustomFieldContextFromProjects.ts create mode 100644 src/version2/parameters/removeCustomFieldContextFromProjectsParameters.ts delete mode 100644 src/version2/parameters/removeDefaultProjectClassification.ts create mode 100644 src/version2/parameters/removeDefaultProjectClassificationParameters.ts delete mode 100644 src/version2/parameters/removeGadget.ts create mode 100644 src/version2/parameters/removeGadgetParameters.ts delete mode 100644 src/version2/parameters/removeGroup.ts create mode 100644 src/version2/parameters/removeGroupParameters.ts delete mode 100644 src/version2/parameters/removeIssueTypeFromIssueTypeScheme.ts create mode 100644 src/version2/parameters/removeIssueTypeFromIssueTypeSchemeParameters.ts delete mode 100644 src/version2/parameters/removeIssueTypesFromContext.ts create mode 100644 src/version2/parameters/removeIssueTypesFromContextParameters.ts delete mode 100644 src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts create mode 100644 src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationSchemeParameters.ts delete mode 100644 src/version2/parameters/removeLevel.ts create mode 100644 src/version2/parameters/removeLevelParameters.ts delete mode 100644 src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.ts create mode 100644 src/version2/parameters/removeMappingsFromIssueTypeScreenSchemeParameters.ts delete mode 100644 src/version2/parameters/removeMemberFromSecurityLevel.ts create mode 100644 src/version2/parameters/removeMemberFromSecurityLevelParameters.ts delete mode 100644 src/version2/parameters/removeModules.ts create mode 100644 src/version2/parameters/removeModulesParameters.ts delete mode 100644 src/version2/parameters/removeNotificationFromNotificationScheme.ts create mode 100644 src/version2/parameters/removeNotificationFromNotificationSchemeParameters.ts delete mode 100644 src/version2/parameters/removePreference.ts create mode 100644 src/version2/parameters/removePreferenceParameters.ts delete mode 100644 src/version2/parameters/removeProjectCategory.ts create mode 100644 src/version2/parameters/removeProjectCategoryParameters.ts delete mode 100644 src/version2/parameters/removeScreenTabField.ts create mode 100644 src/version2/parameters/removeScreenTabFieldParameters.ts create mode 100644 src/version2/parameters/removeTemplateParameters.ts delete mode 100644 src/version2/parameters/removeUser.ts delete mode 100644 src/version2/parameters/removeUserFromGroup.ts create mode 100644 src/version2/parameters/removeUserFromGroupParameters.ts create mode 100644 src/version2/parameters/removeUserParameters.ts delete mode 100644 src/version2/parameters/removeVote.ts create mode 100644 src/version2/parameters/removeVoteParameters.ts delete mode 100644 src/version2/parameters/removeWatcher.ts create mode 100644 src/version2/parameters/removeWatcherParameters.ts delete mode 100644 src/version2/parameters/renameScreenTab.ts create mode 100644 src/version2/parameters/renameScreenTabParameters.ts delete mode 100644 src/version2/parameters/reorderCustomFieldOptions.ts create mode 100644 src/version2/parameters/reorderCustomFieldOptionsParameters.ts delete mode 100644 src/version2/parameters/reorderIssueTypesInIssueTypeScheme.ts create mode 100644 src/version2/parameters/reorderIssueTypesInIssueTypeSchemeParameters.ts delete mode 100644 src/version2/parameters/replaceCustomFieldOption.ts create mode 100644 src/version2/parameters/replaceCustomFieldOptionParameters.ts delete mode 100644 src/version2/parameters/replaceIssueFieldOption.ts create mode 100644 src/version2/parameters/replaceIssueFieldOptionParameters.ts delete mode 100644 src/version2/parameters/resetColumns.ts create mode 100644 src/version2/parameters/resetColumnsParameters.ts delete mode 100644 src/version2/parameters/resetUserColumns.ts create mode 100644 src/version2/parameters/resetUserColumnsParameters.ts delete mode 100644 src/version2/parameters/restore.ts delete mode 100644 src/version2/parameters/restoreCustomField.ts create mode 100644 src/version2/parameters/restoreCustomFieldParameters.ts create mode 100644 src/version2/parameters/restoreParameters.ts delete mode 100644 src/version2/parameters/sanitiseJqlQueries.ts create mode 100644 src/version2/parameters/sanitiseJqlQueriesParameters.ts create mode 100644 src/version2/parameters/saveTemplateParameters.ts delete mode 100644 src/version2/parameters/search.ts create mode 100644 src/version2/parameters/searchAndReconsileIssuesUsingJqlParameters.ts create mode 100644 src/version2/parameters/searchAndReconsileIssuesUsingJqlPostParameters.ts delete mode 100644 src/version2/parameters/searchForIssuesIds.ts delete mode 100644 src/version2/parameters/searchForIssuesUsingJql.ts delete mode 100644 src/version2/parameters/searchForIssuesUsingJqlEnhancedSearch.ts delete mode 100644 src/version2/parameters/searchForIssuesUsingJqlEnhancedSearchPost.ts delete mode 100644 src/version2/parameters/searchForIssuesUsingJqlPost.ts create mode 100644 src/version2/parameters/searchParameters.ts delete mode 100644 src/version2/parameters/searchPriorities.ts delete mode 100644 src/version2/parameters/searchProjects.ts create mode 100644 src/version2/parameters/searchProjectsParameters.ts delete mode 100644 src/version2/parameters/searchProjectsUsingSecuritySchemes.ts create mode 100644 src/version2/parameters/searchProjectsUsingSecuritySchemesParameters.ts delete mode 100644 src/version2/parameters/searchResolutions.ts create mode 100644 src/version2/parameters/searchResolutionsParameters.ts delete mode 100644 src/version2/parameters/searchSecuritySchemes.ts create mode 100644 src/version2/parameters/searchSecuritySchemesParameters.ts delete mode 100644 src/version2/parameters/searchWorkflows.ts create mode 100644 src/version2/parameters/searchWorkflowsParameters.ts delete mode 100644 src/version2/parameters/selectTimeTrackingImplementation.ts create mode 100644 src/version2/parameters/selectTimeTrackingImplementationParameters.ts delete mode 100644 src/version2/parameters/services.ts create mode 100644 src/version2/parameters/servicesParameters.ts delete mode 100644 src/version2/parameters/setActors.ts create mode 100644 src/version2/parameters/setActorsParameters.ts delete mode 100644 src/version2/parameters/setApplicationProperty.ts create mode 100644 src/version2/parameters/setApplicationPropertyParameters.ts delete mode 100644 src/version2/parameters/setBanner.ts create mode 100644 src/version2/parameters/setBannerParameters.ts delete mode 100644 src/version2/parameters/setColumns.ts create mode 100644 src/version2/parameters/setColumnsParameters.ts delete mode 100644 src/version2/parameters/setCommentProperty.ts create mode 100644 src/version2/parameters/setCommentPropertyParameters.ts delete mode 100644 src/version2/parameters/setDashboardItemProperty.ts create mode 100644 src/version2/parameters/setDashboardItemPropertyParameters.ts delete mode 100644 src/version2/parameters/setDefaultLevels.ts create mode 100644 src/version2/parameters/setDefaultLevelsParameters.ts delete mode 100644 src/version2/parameters/setDefaultPriority.ts create mode 100644 src/version2/parameters/setDefaultPriorityParameters.ts delete mode 100644 src/version2/parameters/setDefaultResolution.ts create mode 100644 src/version2/parameters/setDefaultResolutionParameters.ts delete mode 100644 src/version2/parameters/setDefaultShareScope.ts create mode 100644 src/version2/parameters/setDefaultShareScopeParameters.ts delete mode 100644 src/version2/parameters/setDefaultValues.ts create mode 100644 src/version2/parameters/setDefaultValuesParameters.ts delete mode 100644 src/version2/parameters/setFavouriteForFilter.ts create mode 100644 src/version2/parameters/setFavouriteForFilterParameters.ts delete mode 100644 src/version2/parameters/setFieldConfigurationSchemeMapping.ts create mode 100644 src/version2/parameters/setFieldConfigurationSchemeMappingParameters.ts create mode 100644 src/version2/parameters/setIssueNavigatorDefaultColumnsParameters.ts delete mode 100644 src/version2/parameters/setIssueProperty.ts create mode 100644 src/version2/parameters/setIssuePropertyParameters.ts delete mode 100644 src/version2/parameters/setIssueTypeProperty.ts create mode 100644 src/version2/parameters/setIssueTypePropertyParameters.ts delete mode 100644 src/version2/parameters/setPreference.ts create mode 100644 src/version2/parameters/setPreferenceParameters.ts delete mode 100644 src/version2/parameters/setProjectProperty.ts create mode 100644 src/version2/parameters/setProjectPropertyParameters.ts delete mode 100644 src/version2/parameters/setSharedTimeTrackingConfiguration.ts create mode 100644 src/version2/parameters/setSharedTimeTrackingConfigurationParameters.ts delete mode 100644 src/version2/parameters/setUserColumns.ts create mode 100644 src/version2/parameters/setUserColumnsParameters.ts delete mode 100644 src/version2/parameters/setUserNavProperty.ts create mode 100644 src/version2/parameters/setUserNavPropertyParameters.ts delete mode 100644 src/version2/parameters/setUserProperty.ts create mode 100644 src/version2/parameters/setUserPropertyParameters.ts delete mode 100644 src/version2/parameters/setWorkflowSchemeDraftIssueType.ts create mode 100644 src/version2/parameters/setWorkflowSchemeDraftIssueTypeParameters.ts delete mode 100644 src/version2/parameters/setWorkflowSchemeIssueType.ts create mode 100644 src/version2/parameters/setWorkflowSchemeIssueTypeParameters.ts delete mode 100644 src/version2/parameters/setWorklogProperty.ts create mode 100644 src/version2/parameters/setWorklogPropertyParameters.ts delete mode 100644 src/version2/parameters/storeAvatar.ts create mode 100644 src/version2/parameters/storeAvatarParameters.ts delete mode 100644 src/version2/parameters/suggestedPrioritiesForMappings.ts create mode 100644 src/version2/parameters/suggestedPrioritiesForMappingsParameters.ts delete mode 100644 src/version2/parameters/toggleFeatureForProject.ts create mode 100644 src/version2/parameters/toggleFeatureForProjectParameters.ts delete mode 100644 src/version2/parameters/trashCustomField.ts create mode 100644 src/version2/parameters/trashCustomFieldParameters.ts delete mode 100644 src/version2/parameters/trashPlan.ts create mode 100644 src/version2/parameters/trashPlanParameters.ts delete mode 100644 src/version2/parameters/unarchiveIssues.ts create mode 100644 src/version2/parameters/unarchiveIssuesParameters.ts delete mode 100644 src/version2/parameters/updateAtlassianTeam.ts create mode 100644 src/version2/parameters/updateAtlassianTeamParameters.ts delete mode 100644 src/version2/parameters/updateComment.ts create mode 100644 src/version2/parameters/updateCommentParameters.ts delete mode 100644 src/version2/parameters/updateComponent.ts create mode 100644 src/version2/parameters/updateComponentParameters.ts delete mode 100644 src/version2/parameters/updateCustomField.ts delete mode 100644 src/version2/parameters/updateCustomFieldConfiguration.ts create mode 100644 src/version2/parameters/updateCustomFieldConfigurationParameters.ts delete mode 100644 src/version2/parameters/updateCustomFieldContext.ts create mode 100644 src/version2/parameters/updateCustomFieldContextParameters.ts delete mode 100644 src/version2/parameters/updateCustomFieldOption.ts create mode 100644 src/version2/parameters/updateCustomFieldOptionParameters.ts create mode 100644 src/version2/parameters/updateCustomFieldParameters.ts delete mode 100644 src/version2/parameters/updateCustomFieldValue.ts create mode 100644 src/version2/parameters/updateCustomFieldValueParameters.ts delete mode 100644 src/version2/parameters/updateDashboard.ts create mode 100644 src/version2/parameters/updateDashboardParameters.ts delete mode 100644 src/version2/parameters/updateDefaultProjectClassification.ts create mode 100644 src/version2/parameters/updateDefaultProjectClassificationParameters.ts delete mode 100644 src/version2/parameters/updateDefaultScreenScheme.ts create mode 100644 src/version2/parameters/updateDefaultScreenSchemeParameters.ts delete mode 100644 src/version2/parameters/updateDefaultWorkflow.ts create mode 100644 src/version2/parameters/updateDefaultWorkflowParameters.ts delete mode 100644 src/version2/parameters/updateDraftDefaultWorkflow.ts create mode 100644 src/version2/parameters/updateDraftDefaultWorkflowParameters.ts delete mode 100644 src/version2/parameters/updateDraftWorkflowMapping.ts create mode 100644 src/version2/parameters/updateDraftWorkflowMappingParameters.ts delete mode 100644 src/version2/parameters/updateEntityPropertiesValue.ts create mode 100644 src/version2/parameters/updateEntityPropertiesValueParameters.ts delete mode 100644 src/version2/parameters/updateFieldConfiguration.ts delete mode 100644 src/version2/parameters/updateFieldConfigurationItems.ts create mode 100644 src/version2/parameters/updateFieldConfigurationItemsParameters.ts create mode 100644 src/version2/parameters/updateFieldConfigurationParameters.ts delete mode 100644 src/version2/parameters/updateFieldConfigurationScheme.ts create mode 100644 src/version2/parameters/updateFieldConfigurationSchemeParameters.ts delete mode 100644 src/version2/parameters/updateFilter.ts create mode 100644 src/version2/parameters/updateFilterParameters.ts delete mode 100644 src/version2/parameters/updateGadget.ts create mode 100644 src/version2/parameters/updateGadgetParameters.ts delete mode 100644 src/version2/parameters/updateIssueFieldOption.ts create mode 100644 src/version2/parameters/updateIssueFieldOptionParameters.ts delete mode 100644 src/version2/parameters/updateIssueFields.ts create mode 100644 src/version2/parameters/updateIssueFieldsParameters.ts delete mode 100644 src/version2/parameters/updateIssueLinkType.ts create mode 100644 src/version2/parameters/updateIssueLinkTypeParameters.ts delete mode 100644 src/version2/parameters/updateIssueSecurityScheme.ts create mode 100644 src/version2/parameters/updateIssueSecuritySchemeParameters.ts delete mode 100644 src/version2/parameters/updateIssueType.ts create mode 100644 src/version2/parameters/updateIssueTypeParameters.ts delete mode 100644 src/version2/parameters/updateIssueTypeScheme.ts create mode 100644 src/version2/parameters/updateIssueTypeSchemeParameters.ts delete mode 100644 src/version2/parameters/updateIssueTypeScreenScheme.ts create mode 100644 src/version2/parameters/updateIssueTypeScreenSchemeParameters.ts delete mode 100644 src/version2/parameters/updateMultipleCustomFieldValues.ts create mode 100644 src/version2/parameters/updateMultipleCustomFieldValuesParameters.ts delete mode 100644 src/version2/parameters/updateNotificationScheme.ts create mode 100644 src/version2/parameters/updateNotificationSchemeParameters.ts delete mode 100644 src/version2/parameters/updatePermissionScheme.ts create mode 100644 src/version2/parameters/updatePermissionSchemeParameters.ts delete mode 100644 src/version2/parameters/updatePlan.ts delete mode 100644 src/version2/parameters/updatePlanOnlyTeam.ts create mode 100644 src/version2/parameters/updatePlanOnlyTeamParameters.ts create mode 100644 src/version2/parameters/updatePlanParameters.ts delete mode 100644 src/version2/parameters/updatePrecomputations.ts create mode 100644 src/version2/parameters/updatePrecomputationsParameters.ts delete mode 100644 src/version2/parameters/updatePriority.ts delete mode 100644 src/version2/parameters/updatePriorityScheme.ts create mode 100644 src/version2/parameters/updatePrioritySchemeParameters.ts delete mode 100644 src/version2/parameters/updateProject.ts delete mode 100644 src/version2/parameters/updateProjectAvatar.ts create mode 100644 src/version2/parameters/updateProjectAvatarParameters.ts delete mode 100644 src/version2/parameters/updateProjectCategory.ts create mode 100644 src/version2/parameters/updateProjectCategoryParameters.ts delete mode 100644 src/version2/parameters/updateProjectEmail.ts create mode 100644 src/version2/parameters/updateProjectEmailParameters.ts create mode 100644 src/version2/parameters/updateProjectParameters.ts delete mode 100644 src/version2/parameters/updateRelatedWork.ts create mode 100644 src/version2/parameters/updateRelatedWorkParameters.ts delete mode 100644 src/version2/parameters/updateRemoteIssueLink.ts create mode 100644 src/version2/parameters/updateRemoteIssueLinkParameters.ts delete mode 100644 src/version2/parameters/updateResolution.ts create mode 100644 src/version2/parameters/updateResolutionParameters.ts delete mode 100644 src/version2/parameters/updateSchemes.ts create mode 100644 src/version2/parameters/updateSchemesParameters.ts delete mode 100644 src/version2/parameters/updateScreen.ts create mode 100644 src/version2/parameters/updateScreenParameters.ts delete mode 100644 src/version2/parameters/updateScreenScheme.ts create mode 100644 src/version2/parameters/updateScreenSchemeParameters.ts delete mode 100644 src/version2/parameters/updateSecurityLevel.ts create mode 100644 src/version2/parameters/updateSecurityLevelParameters.ts delete mode 100644 src/version2/parameters/updateStatuses.ts create mode 100644 src/version2/parameters/updateStatusesParameters.ts delete mode 100644 src/version2/parameters/updateUiModification.ts create mode 100644 src/version2/parameters/updateUiModificationParameters.ts delete mode 100644 src/version2/parameters/updateVersion.ts create mode 100644 src/version2/parameters/updateVersionParameters.ts delete mode 100644 src/version2/parameters/updateWorkflowMapping.ts create mode 100644 src/version2/parameters/updateWorkflowMappingParameters.ts delete mode 100644 src/version2/parameters/updateWorkflowScheme.ts delete mode 100644 src/version2/parameters/updateWorkflowSchemeDraft.ts create mode 100644 src/version2/parameters/updateWorkflowSchemeDraftParameters.ts delete mode 100644 src/version2/parameters/updateWorkflowSchemeMappings.ts create mode 100644 src/version2/parameters/updateWorkflowSchemeMappingsParameters.ts create mode 100644 src/version2/parameters/updateWorkflowSchemeParameters.ts delete mode 100644 src/version2/parameters/updateWorkflowTransitionProperty.ts delete mode 100644 src/version2/parameters/updateWorkflowTransitionRuleConfigurations.ts create mode 100644 src/version2/parameters/updateWorkflowTransitionRuleConfigurationsParameters.ts delete mode 100644 src/version2/parameters/updateWorkflows.ts create mode 100644 src/version2/parameters/updateWorkflowsParameters.ts delete mode 100644 src/version2/parameters/updateWorklog.ts create mode 100644 src/version2/parameters/updateWorklogParameters.ts delete mode 100644 src/version2/parameters/validateCreateWorkflows.ts create mode 100644 src/version2/parameters/validateCreateWorkflowsParameters.ts delete mode 100644 src/version2/parameters/validateProjectKey.ts create mode 100644 src/version2/parameters/validateProjectKeyParameters.ts delete mode 100644 src/version2/parameters/validateUpdateWorkflows.ts create mode 100644 src/version2/parameters/validateUpdateWorkflowsParameters.ts delete mode 100644 src/version2/parameters/workflowCapabilities.ts create mode 100644 src/version2/parameters/workflowCapabilitiesParameters.ts delete mode 100644 src/version2/parameters/workflowRuleSearch.ts create mode 100644 src/version2/parameters/workflowRuleSearchParameters.ts rename src/version2/{models => schemas}/actorInput.ts (75%) create mode 100644 src/version2/schemas/actorsMap.ts create mode 100644 src/version2/schemas/addAtlassianTeamRequest.ts create mode 100644 src/version2/schemas/addField.ts create mode 100644 src/version2/schemas/addGroup.ts create mode 100644 src/version2/schemas/addNotificationsDetails.ts create mode 100644 src/version2/schemas/addSecuritySchemeLevelsRequest.ts create mode 100644 src/version2/schemas/announcementBannerConfiguration.ts create mode 100644 src/version2/schemas/announcementBannerConfigurationUpdate.ts create mode 100644 src/version2/schemas/appWorkflowTransitionRule.ts create mode 100644 src/version2/schemas/application.ts create mode 100644 src/version2/schemas/applicationProperty.ts create mode 100644 src/version2/schemas/applicationRole.ts create mode 100644 src/version2/schemas/approvalConfiguration.ts create mode 100644 src/version2/schemas/archiveIssueAsyncRequest.ts create mode 100644 src/version2/schemas/archivedIssuesFilterRequest.ts create mode 100644 src/version2/schemas/associateFieldConfigurationsWithIssueTypesRequest.ts create mode 100644 src/version2/schemas/associateSecuritySchemeWithProjectDetails.ts create mode 100644 src/version2/schemas/associatedItemBean.ts create mode 100644 src/version2/schemas/associationContextObject.ts create mode 100644 src/version2/schemas/attachment.ts create mode 100644 src/version2/schemas/attachmentArchive.ts create mode 100644 src/version2/schemas/attachmentArchiveEntry.ts create mode 100644 src/version2/schemas/attachmentArchiveImpl.ts create mode 100644 src/version2/schemas/attachmentArchiveItemReadable.ts create mode 100644 src/version2/schemas/attachmentArchiveMetadataReadable.ts create mode 100644 src/version2/schemas/attachmentMetadata.ts create mode 100644 src/version2/schemas/attachmentSettings.ts create mode 100644 src/version2/schemas/auditRecordBean.ts create mode 100644 src/version2/schemas/auditRecords.ts create mode 100644 src/version2/schemas/autoCompleteSuggestion.ts create mode 100644 src/version2/schemas/autoCompleteSuggestions.ts create mode 100644 src/version2/schemas/availableDashboardGadget.ts create mode 100644 src/version2/schemas/availableDashboardGadgetsResponse.ts create mode 100644 src/version2/schemas/availableWorkflowConnectRule.ts create mode 100644 src/version2/schemas/availableWorkflowForgeRule.ts create mode 100644 src/version2/schemas/availableWorkflowSystemRule.ts create mode 100644 src/version2/schemas/availableWorkflowTriggerTypes.ts create mode 100644 src/version2/schemas/availableWorkflowTriggers.ts create mode 100644 src/version2/schemas/avatar.ts create mode 100644 src/version2/schemas/avatarUrlsBean.ts create mode 100644 src/version2/schemas/avatars.ts create mode 100644 src/version2/schemas/boardColumnPayload.ts create mode 100644 src/version2/schemas/boardFeaturePayload.ts create mode 100644 src/version2/schemas/boardPayload.ts create mode 100644 src/version2/schemas/boardsPayload.ts create mode 100644 src/version2/schemas/bulkChangeOwnerDetails.ts create mode 100644 src/version2/schemas/bulkChangelogRequestBean.ts create mode 100644 src/version2/schemas/bulkChangelogResponseBean.ts create mode 100644 src/version2/schemas/bulkContextualConfiguration.ts create mode 100644 src/version2/schemas/bulkCustomFieldOptionCreateRequest.ts create mode 100644 src/version2/schemas/bulkCustomFieldOptionUpdateRequest.ts create mode 100644 src/version2/schemas/bulkEditActionError.ts create mode 100644 src/version2/schemas/bulkEditShareableEntityRequest.ts create mode 100644 src/version2/schemas/bulkEditShareableEntityResponse.ts create mode 100644 src/version2/schemas/bulkFetchIssueRequestBean.ts create mode 100644 src/version2/schemas/bulkIssueIsWatching.ts create mode 100644 src/version2/schemas/bulkIssuePropertyUpdateRequest.ts create mode 100644 src/version2/schemas/bulkIssueResults.ts create mode 100644 src/version2/schemas/bulkOperationErrorResult.ts create mode 100644 src/version2/schemas/bulkPermissionGrants.ts create mode 100644 src/version2/schemas/bulkPermissionsRequestBean.ts create mode 100644 src/version2/schemas/bulkProjectPermissionGrants.ts create mode 100644 src/version2/schemas/bulkProjectPermissions.ts create mode 100644 src/version2/schemas/bulkRedactionRequest.ts create mode 100644 src/version2/schemas/bulkRedactionResponse.ts create mode 100644 src/version2/schemas/cardLayout.ts create mode 100644 src/version2/schemas/cardLayoutField.ts create mode 100644 src/version2/schemas/changeDetails.ts create mode 100644 src/version2/schemas/changeFilterOwner.ts create mode 100644 src/version2/schemas/changedValueBean.ts create mode 100644 src/version2/schemas/changedWorklog.ts create mode 100644 src/version2/schemas/changedWorklogs.ts create mode 100644 src/version2/schemas/changelog.ts create mode 100644 src/version2/schemas/columnItem.ts create mode 100644 src/version2/schemas/columnRequestBody.ts create mode 100644 src/version2/schemas/comment.ts create mode 100644 src/version2/schemas/componentIssuesCount.ts create mode 100644 src/version2/schemas/componentJsonBean.ts create mode 100644 src/version2/schemas/componentWithIssueCount.ts create mode 100644 src/version2/schemas/compoundClause.ts create mode 100644 src/version2/schemas/conditionGroupConfiguration.ts create mode 100644 src/version2/schemas/conditionGroupPayload.ts create mode 100644 src/version2/schemas/conditionGroupUpdate.ts create mode 100644 src/version2/schemas/configuration.ts create mode 100644 src/version2/schemas/configurationsListParameters.ts create mode 100644 src/version2/schemas/connectCustomFieldValue.ts create mode 100644 src/version2/schemas/connectCustomFieldValues.ts create mode 100644 src/version2/schemas/connectModule.ts create mode 100644 src/version2/schemas/connectModules.ts create mode 100644 src/version2/schemas/connectWorkflowTransitionRule.ts create mode 100644 src/version2/schemas/containerForProjectFeatures.ts create mode 100644 src/version2/schemas/containerForRegisteredWebhooks.ts create mode 100644 src/version2/schemas/containerForWebhookIDs.ts create mode 100644 src/version2/schemas/containerOfWorkflowSchemeAssociations.ts create mode 100644 src/version2/schemas/contentItem.ts create mode 100644 src/version2/schemas/context.ts create mode 100644 src/version2/schemas/contextForProjectAndIssueType.ts create mode 100644 src/version2/schemas/contextualConfiguration.ts create mode 100644 src/version2/schemas/convertedJQLQueries.ts create mode 100644 src/version2/schemas/createCrossProjectReleaseRequest.ts create mode 100644 src/version2/schemas/createCustomFieldContext.ts create mode 100644 src/version2/schemas/createCustomFieldRequest.ts create mode 100644 src/version2/schemas/createDateFieldRequest.ts create mode 100644 src/version2/schemas/createExclusionRulesRequest.ts create mode 100644 src/version2/schemas/createIssueSecuritySchemeDetails.ts create mode 100644 src/version2/schemas/createIssueSourceRequest.ts create mode 100644 src/version2/schemas/createNotificationSchemeDetails.ts create mode 100644 src/version2/schemas/createPermissionHolderRequest.ts create mode 100644 src/version2/schemas/createPermissionRequest.ts create mode 100644 src/version2/schemas/createPlanOnlyTeamRequest.ts create mode 100644 src/version2/schemas/createPlanRequest.ts create mode 100644 src/version2/schemas/createPriorityDetails.ts create mode 100644 src/version2/schemas/createPrioritySchemeDetails.ts create mode 100644 src/version2/schemas/createProjectDetails.ts create mode 100644 src/version2/schemas/createResolutionDetails.ts create mode 100644 src/version2/schemas/createSchedulingRequest.ts create mode 100644 src/version2/schemas/createUiModificationDetails.ts create mode 100644 src/version2/schemas/createUpdateRoleRequestBean.ts create mode 100644 src/version2/schemas/createWorkflowCondition.ts create mode 100644 src/version2/schemas/createWorkflowDetails.ts create mode 100644 src/version2/schemas/createWorkflowStatusDetails.ts create mode 100644 src/version2/schemas/createWorkflowTransitionDetails.ts create mode 100644 src/version2/schemas/createWorkflowTransitionRule.ts create mode 100644 src/version2/schemas/createWorkflowTransitionRulesDetails.ts create mode 100644 src/version2/schemas/createWorkflowTransitionScreenDetails.ts create mode 100644 src/version2/schemas/createdIssue.ts create mode 100644 src/version2/schemas/createdIssues.ts create mode 100644 src/version2/schemas/customContextVariable.ts create mode 100644 src/version2/schemas/customFieldConfigurations.ts create mode 100644 src/version2/schemas/customFieldContext.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValue.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueCascadingOption.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueDate.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueDateTime.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueFloat.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueForgeDateTimeField.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueForgeGroupField.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueForgeMultiGroupField.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueForgeMultiStringField.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueForgeMultiUserField.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueForgeNumberField.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueForgeObjectField.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueForgeStringField.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueForgeUserField.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueLabels.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueMultiUserPicker.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueMultipleGroupPicker.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueMultipleOption.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueMultipleVersionPicker.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueProject.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueReadOnly.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueSingleGroupPicker.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueSingleOption.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueSingleVersionPicker.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueTextArea.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueTextField.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueURL.ts create mode 100644 src/version2/schemas/customFieldContextDefaultValueUpdate.ts create mode 100644 src/version2/schemas/customFieldContextOption.ts create mode 100644 src/version2/schemas/customFieldContextProjectMapping.ts create mode 100644 src/version2/schemas/customFieldContextSingleUserPickerDefaults.ts create mode 100644 src/version2/schemas/customFieldContextUpdateDetails.ts create mode 100644 src/version2/schemas/customFieldCreatedContextOptionsList.ts create mode 100644 src/version2/schemas/customFieldDefinitionJsonBean.ts create mode 100644 src/version2/schemas/customFieldOption.ts create mode 100644 src/version2/schemas/customFieldOptionCreate.ts create mode 100644 src/version2/schemas/customFieldOptionUpdate.ts create mode 100644 src/version2/schemas/customFieldPayload.ts create mode 100644 src/version2/schemas/customFieldReplacement.ts create mode 100644 src/version2/schemas/customFieldUpdatedContextOptionsList.ts create mode 100644 src/version2/schemas/customFieldValueUpdate.ts create mode 100644 src/version2/schemas/customFieldValueUpdateDetails.ts create mode 100644 src/version2/schemas/customTemplateOptions.ts create mode 100644 src/version2/schemas/customTemplateRequestDTO.ts create mode 100644 src/version2/schemas/customTemplatesProjectDetails.ts create mode 100644 src/version2/schemas/dashboard.ts create mode 100644 src/version2/schemas/dashboardDetails.ts create mode 100644 src/version2/schemas/dashboardGadget.ts create mode 100644 src/version2/schemas/dashboardGadgetPosition.ts create mode 100644 src/version2/schemas/dashboardGadgetResponse.ts create mode 100644 src/version2/schemas/dashboardGadgetSettings.ts create mode 100644 src/version2/schemas/dashboardGadgetUpdateRequest.ts create mode 100644 src/version2/schemas/dataClassificationLevelsBean.ts create mode 100644 src/version2/schemas/dataClassificationTagBean.ts create mode 100644 src/version2/schemas/dateRangeFilterRequest.ts create mode 100644 src/version2/schemas/defaultLevelValue.ts create mode 100644 src/version2/schemas/defaultShareScope.ts create mode 100644 src/version2/schemas/defaultWorkflow.ts create mode 100644 src/version2/schemas/defaultWorkflowEditorResponse.ts create mode 100644 src/version2/schemas/deleteAndReplaceVersionBean.ts create mode 100644 src/version2/schemas/deprecatedWorkflow.ts create mode 100644 src/version2/schemas/detailedErrorCollection.ts create mode 100644 src/version2/schemas/documentVersion.ts create mode 100644 src/version2/schemas/duplicatePlanRequest.ts create mode 100644 src/version2/schemas/editTemplateRequest.ts create mode 100644 src/version2/schemas/entityProperty.ts create mode 100644 src/version2/schemas/entityPropertyDetails.ts create mode 100644 src/version2/schemas/error.ts create mode 100644 src/version2/schemas/errorCollection.ts create mode 100644 src/version2/schemas/errorCollections.ts create mode 100644 src/version2/schemas/errorMessage.ts create mode 100644 src/version2/schemas/errors.ts create mode 100644 src/version2/schemas/eventNotification.ts create mode 100644 src/version2/schemas/expandPrioritySchemeBean.ts create mode 100644 src/version2/schemas/expandPrioritySchemePage.ts create mode 100644 src/version2/schemas/exportArchivedIssuesTaskProgressResponse.ts create mode 100644 src/version2/schemas/failedWebhook.ts create mode 100644 src/version2/schemas/failedWebhooks.ts create mode 100644 src/version2/schemas/field.ts create mode 100644 src/version2/schemas/fieldAssociationsRequest.ts create mode 100644 src/version2/schemas/fieldCapabilityPayload.ts create mode 100644 src/version2/schemas/fieldChangedClause.ts create mode 100644 src/version2/schemas/fieldConfiguration.ts create mode 100644 src/version2/schemas/fieldConfigurationDetails.ts create mode 100644 src/version2/schemas/fieldConfigurationIssueTypeItem.ts create mode 100644 src/version2/schemas/fieldConfigurationItem.ts create mode 100644 src/version2/schemas/fieldConfigurationItemsDetails.ts create mode 100644 src/version2/schemas/fieldConfigurationScheme.ts create mode 100644 src/version2/schemas/fieldConfigurationSchemeProjectAssociation.ts create mode 100644 src/version2/schemas/fieldConfigurationSchemeProjects.ts create mode 100644 src/version2/schemas/fieldConfigurationToIssueTypeMapping.ts create mode 100644 src/version2/schemas/fieldCreateMetadata.ts create mode 100644 src/version2/schemas/fieldDetails.ts create mode 100644 src/version2/schemas/fieldIdIdentifier.ts create mode 100644 src/version2/schemas/fieldIdentifierObject.ts create mode 100644 src/version2/schemas/fieldLastUsed.ts create mode 100644 src/version2/schemas/fieldLayoutConfiguration.ts create mode 100644 src/version2/schemas/fieldLayoutPayload.ts create mode 100644 src/version2/schemas/fieldLayoutSchemePayload.ts create mode 100644 src/version2/schemas/fieldMetadata.ts create mode 100644 src/version2/schemas/fieldReferenceData.ts create mode 100644 src/version2/schemas/fieldUpdateOperation.ts create mode 100644 src/version2/schemas/fieldValueClause.ts create mode 100644 src/version2/schemas/fieldWasClause.ts create mode 100644 src/version2/schemas/fields.ts create mode 100644 src/version2/schemas/filter.ts create mode 100644 src/version2/schemas/filterDetails.ts create mode 100644 src/version2/schemas/filterSubscription.ts create mode 100644 src/version2/schemas/filterSubscriptionsList.ts create mode 100644 src/version2/schemas/foundGroup.ts create mode 100644 src/version2/schemas/foundGroups.ts create mode 100644 src/version2/schemas/foundUsers.ts create mode 100644 src/version2/schemas/foundUsersAndGroups.ts create mode 100644 src/version2/schemas/fromLayoutPayload.ts create mode 100644 src/version2/schemas/functionOperand.ts create mode 100644 src/version2/schemas/functionReferenceData.ts create mode 100644 src/version2/schemas/getAtlassianTeamResponse.ts create mode 100644 src/version2/schemas/getCrossProjectReleaseResponse.ts create mode 100644 src/version2/schemas/getCustomFieldResponse.ts create mode 100644 src/version2/schemas/getDateFieldResponse.ts create mode 100644 src/version2/schemas/getExclusionRulesResponse.ts create mode 100644 src/version2/schemas/getIssueSourceResponse.ts create mode 100644 src/version2/schemas/getPermissionHolderResponse.ts create mode 100644 src/version2/schemas/getPermissionResponse.ts create mode 100644 src/version2/schemas/getPlanOnlyTeamResponse.ts create mode 100644 src/version2/schemas/getPlanResponse.ts create mode 100644 src/version2/schemas/getPlanResponseForPage.ts create mode 100644 src/version2/schemas/getSchedulingResponse.ts create mode 100644 src/version2/schemas/getTeamResponseForPage.ts create mode 100644 src/version2/schemas/globalScopeBean.ts create mode 100644 src/version2/schemas/group.ts create mode 100644 src/version2/schemas/groupDetails.ts create mode 100644 src/version2/schemas/groupLabel.ts create mode 100644 src/version2/schemas/groupName.ts create mode 100644 src/version2/schemas/healthCheckResult.ts create mode 100644 src/version2/schemas/hierarchy.ts create mode 100644 src/version2/schemas/historyMetadata.ts create mode 100644 src/version2/schemas/historyMetadataParticipant.ts create mode 100644 src/version2/schemas/icon.ts create mode 100644 src/version2/schemas/iconBean.ts create mode 100644 src/version2/schemas/idBean.ts create mode 100644 src/version2/schemas/idOrKeyBean.ts create mode 100644 src/version2/schemas/includedFields.ts create mode 100644 src/version2/schemas/inputStreamSource.ts create mode 100644 src/version2/schemas/issueArchivalSyncRequest.ts create mode 100644 src/version2/schemas/issueArchivalSyncResponse.ts create mode 100644 src/version2/schemas/issueBean.ts create mode 100644 src/version2/schemas/issueChangeLog.ts create mode 100644 src/version2/schemas/issueChangelogIds.ts create mode 100644 src/version2/schemas/issueCommentListRequestBean.ts create mode 100644 src/version2/schemas/issueContextVariable.ts create mode 100644 src/version2/schemas/issueCreateMetadata.ts create mode 100644 src/version2/schemas/issueEntityProperties.ts create mode 100644 src/version2/schemas/issueEntityPropertiesForMultiUpdate.ts create mode 100644 src/version2/schemas/issueError.ts create mode 100644 src/version2/schemas/issueEvent.ts create mode 100644 src/version2/schemas/issueFieldOption.ts create mode 100644 src/version2/schemas/issueFieldOptionConfiguration.ts create mode 100644 src/version2/schemas/issueFieldOptionCreateBean.ts create mode 100644 src/version2/schemas/issueFieldOptionScopeBean.ts create mode 100644 src/version2/schemas/issueFilterForBulkPropertyDelete.ts create mode 100644 src/version2/schemas/issueFilterForBulkPropertySet.ts create mode 100644 src/version2/schemas/issueLayoutItemPayload.ts create mode 100644 src/version2/schemas/issueLayoutPayload.ts create mode 100644 src/version2/schemas/issueLimitReportResponseBean.ts create mode 100644 src/version2/schemas/issueLink.ts create mode 100644 src/version2/schemas/issueLinkType.ts create mode 100644 src/version2/schemas/issueLinkTypes.ts create mode 100644 src/version2/schemas/issueList.ts create mode 100644 src/version2/schemas/issueMatches.ts create mode 100644 src/version2/schemas/issueMatchesForJQL.ts create mode 100644 src/version2/schemas/issuePickerSuggestions.ts create mode 100644 src/version2/schemas/issuePickerSuggestionsIssueType.ts create mode 100644 src/version2/schemas/issueSecurityLevelMember.ts create mode 100644 src/version2/schemas/issueSecuritySchemeToProjectMapping.ts create mode 100644 src/version2/schemas/issueTransition.ts create mode 100644 src/version2/schemas/issueTypeCreateBean.ts create mode 100644 src/version2/schemas/issueTypeDetails.ts create mode 100644 src/version2/schemas/issueTypeHierarchyPayload.ts create mode 100644 src/version2/schemas/issueTypeIds.ts create mode 100644 src/version2/schemas/issueTypeIdsToRemove.ts create mode 100644 src/version2/schemas/issueTypeInfo.ts create mode 100644 src/version2/schemas/issueTypeIssueCreateMetadata.ts create mode 100644 src/version2/schemas/issueTypePayload.ts create mode 100644 src/version2/schemas/issueTypeProjectCreatePayload.ts create mode 100644 src/version2/schemas/issueTypeScheme.ts create mode 100644 src/version2/schemas/issueTypeSchemeDetails.ts create mode 100644 src/version2/schemas/issueTypeSchemeID.ts create mode 100644 src/version2/schemas/issueTypeSchemeMapping.ts create mode 100644 src/version2/schemas/issueTypeSchemePayload.ts create mode 100644 src/version2/schemas/issueTypeSchemeProjectAssociation.ts create mode 100644 src/version2/schemas/issueTypeSchemeProjects.ts create mode 100644 src/version2/schemas/issueTypeSchemeUpdateDetails.ts create mode 100644 src/version2/schemas/issueTypeScreenScheme.ts create mode 100644 src/version2/schemas/issueTypeScreenSchemeDetails.ts create mode 100644 src/version2/schemas/issueTypeScreenSchemeId.ts create mode 100644 src/version2/schemas/issueTypeScreenSchemeItem.ts create mode 100644 src/version2/schemas/issueTypeScreenSchemeMapping.ts create mode 100644 src/version2/schemas/issueTypeScreenSchemeMappingDetails.ts create mode 100644 src/version2/schemas/issueTypeScreenSchemePayload.ts create mode 100644 src/version2/schemas/issueTypeScreenSchemeProjectAssociation.ts create mode 100644 src/version2/schemas/issueTypeScreenSchemeUpdateDetails.ts create mode 100644 src/version2/schemas/issueTypeScreenSchemesProjects.ts create mode 100644 src/version2/schemas/issueTypeToContextMapping.ts create mode 100644 src/version2/schemas/issueTypeUpdateBean.ts create mode 100644 src/version2/schemas/issueTypeWithStatus.ts create mode 100644 src/version2/schemas/issueTypeWorkflowMapping.ts create mode 100644 src/version2/schemas/issueTypesWorkflowMapping.ts create mode 100644 src/version2/schemas/issueUpdateDetails.ts create mode 100644 src/version2/schemas/issueUpdateMetadata.ts create mode 100644 src/version2/schemas/issuesAndJQLQueries.ts create mode 100644 src/version2/schemas/issuesJqlMetaDataBean.ts create mode 100644 src/version2/schemas/issuesMetaBean.ts create mode 100644 src/version2/schemas/issuesUpdateBean.ts create mode 100644 src/version2/schemas/jExpEvaluateIssuesJqlMetaDataBean.ts create mode 100644 src/version2/schemas/jExpEvaluateIssuesMetaBean.ts create mode 100644 src/version2/schemas/jExpEvaluateJiraExpressionResultBean.ts create mode 100644 src/version2/schemas/jExpEvaluateMetaDataBean.ts create mode 100644 src/version2/schemas/jQLCountRequestBean.ts create mode 100644 src/version2/schemas/jQLCountResultsBean.ts create mode 100644 src/version2/schemas/jQLPersonalDataMigrationRequest.ts create mode 100644 src/version2/schemas/jQLQueryWithUnknownUsers.ts create mode 100644 src/version2/schemas/jQLReferenceData.ts create mode 100644 src/version2/schemas/jexpEvaluateCtxIssues.ts create mode 100644 src/version2/schemas/jexpEvaluateCtxJqlIssues.ts create mode 100644 src/version2/schemas/jexpIssues.ts create mode 100644 src/version2/schemas/jexpJqlIssues.ts create mode 100644 src/version2/schemas/jiraExpressionAnalysis.ts create mode 100644 src/version2/schemas/jiraExpressionComplexity.ts create mode 100644 src/version2/schemas/jiraExpressionEvalContextBean.ts create mode 100644 src/version2/schemas/jiraExpressionEvalRequestBean.ts create mode 100644 src/version2/schemas/jiraExpressionEvaluateContextBean.ts create mode 100644 src/version2/schemas/jiraExpressionEvaluateRequestBean.ts create mode 100644 src/version2/schemas/jiraExpressionEvaluationMetaDataBean.ts create mode 100644 src/version2/schemas/jiraExpressionForAnalysis.ts create mode 100644 src/version2/schemas/jiraExpressionResult.ts create mode 100644 src/version2/schemas/jiraExpressionValidationError.ts create mode 100644 src/version2/schemas/jiraExpressionsAnalysis.ts create mode 100644 src/version2/schemas/jiraExpressionsComplexityBean.ts create mode 100644 src/version2/schemas/jiraExpressionsComplexityValueBean.ts create mode 100644 src/version2/schemas/jiraStatus.ts create mode 100644 src/version2/schemas/jiraWorkflow.ts create mode 100644 src/version2/schemas/jiraWorkflowStatus.ts create mode 100644 src/version2/schemas/jqlFunctionPrecomputationBean.ts create mode 100644 src/version2/schemas/jqlFunctionPrecomputationGetByIdRequest.ts create mode 100644 src/version2/schemas/jqlFunctionPrecomputationGetByIdResponse.ts create mode 100644 src/version2/schemas/jqlFunctionPrecomputationUpdateBean.ts create mode 100644 src/version2/schemas/jqlFunctionPrecomputationUpdateErrorResponse.ts create mode 100644 src/version2/schemas/jqlFunctionPrecomputationUpdateRequestBean.ts create mode 100644 src/version2/schemas/jqlFunctionPrecomputationUpdateResponse.ts create mode 100644 src/version2/schemas/jqlQueriesToParse.ts create mode 100644 src/version2/schemas/jqlQueriesToSanitize.ts create mode 100644 src/version2/schemas/jqlQuery.ts create mode 100644 src/version2/schemas/jqlQueryClause.ts create mode 100644 src/version2/schemas/jqlQueryClauseOperand.ts create mode 100644 src/version2/schemas/jqlQueryClauseTimePredicate.ts create mode 100644 src/version2/schemas/jqlQueryField.ts create mode 100644 src/version2/schemas/jqlQueryFieldEntityProperty.ts create mode 100644 src/version2/schemas/jqlQueryOrderByClause.ts create mode 100644 src/version2/schemas/jqlQueryOrderByClauseElement.ts create mode 100644 src/version2/schemas/jqlQueryToSanitize.ts create mode 100644 src/version2/schemas/jqlQueryUnitaryOperand.ts create mode 100644 src/version2/schemas/jsonContextVariable.ts create mode 100644 src/version2/schemas/jsonNode.ts create mode 100644 src/version2/schemas/jsonTypeBean.ts create mode 100644 src/version2/schemas/keywordOperand.ts create mode 100644 src/version2/schemas/legacyJackson1ListAttachment.ts create mode 100644 src/version2/schemas/legacyJackson1ListColumnItem.ts create mode 100644 src/version2/schemas/legacyJackson1ListIssueEvent.ts create mode 100644 src/version2/schemas/legacyJackson1ListIssueTypeWithStatus.ts create mode 100644 src/version2/schemas/legacyJackson1ListProject.ts create mode 100644 src/version2/schemas/legacyJackson1ListProjectComponent.ts create mode 100644 src/version2/schemas/legacyJackson1ListProjectRoleDetails.ts create mode 100644 src/version2/schemas/legacyJackson1ListProjectType.ts create mode 100644 src/version2/schemas/legacyJackson1ListUserMigrationBean.ts create mode 100644 src/version2/schemas/legacyJackson1ListVersion.ts create mode 100644 src/version2/schemas/legacyJackson1ListWorklog.ts create mode 100644 src/version2/schemas/license.ts create mode 100644 src/version2/schemas/licenseMetric.ts create mode 100644 src/version2/schemas/licensedApplication.ts create mode 100644 src/version2/schemas/linkGroup.ts create mode 100644 src/version2/schemas/linkIssueRequestJsonBean.ts create mode 100644 src/version2/schemas/linkedIssue.ts create mode 100644 src/version2/schemas/listOperand.ts create mode 100644 src/version2/schemas/listWrapperCallbackApplicationRole.ts create mode 100644 src/version2/schemas/listWrapperCallbackGroupName.ts create mode 100644 src/version2/schemas/locale.ts create mode 100644 src/version2/schemas/mappingsByIssueTypeOverride.ts create mode 100644 src/version2/schemas/mappingsByWorkflow.ts create mode 100644 src/version2/schemas/moveFieldBean.ts create mode 100644 src/version2/schemas/multiIssueEntityProperties.ts create mode 100644 src/version2/schemas/multipartFile.ts create mode 100644 src/version2/schemas/multipleCustomFieldValuesUpdate.ts create mode 100644 src/version2/schemas/multipleCustomFieldValuesUpdateDetails.ts create mode 100644 src/version2/schemas/nestedResponse.ts create mode 100644 src/version2/schemas/newUserDetails.ts create mode 100644 src/version2/schemas/nonWorkingDay.ts create mode 100644 src/version2/schemas/notification.ts create mode 100644 src/version2/schemas/notificationEvent.ts create mode 100644 src/version2/schemas/notificationRecipients.ts create mode 100644 src/version2/schemas/notificationRecipientsRestrictions.ts create mode 100644 src/version2/schemas/notificationScheme.ts create mode 100644 src/version2/schemas/notificationSchemeAndProjectMappingJsonBean.ts create mode 100644 src/version2/schemas/notificationSchemeEvent.ts create mode 100644 src/version2/schemas/notificationSchemeEventDetails.ts create mode 100644 src/version2/schemas/notificationSchemeEventIDPayload.ts create mode 100644 src/version2/schemas/notificationSchemeEventPayload.ts create mode 100644 src/version2/schemas/notificationSchemeEventTypeId.ts create mode 100644 src/version2/schemas/notificationSchemeId.ts create mode 100644 src/version2/schemas/notificationSchemeNotificationDetails.ts create mode 100644 src/version2/schemas/notificationSchemeNotificationDetailsPayload.ts create mode 100644 src/version2/schemas/notificationSchemePayload.ts create mode 100644 src/version2/schemas/oldToNewSecurityLevelMappingsBean.ts create mode 100644 src/version2/schemas/operationMessage.ts create mode 100644 src/version2/schemas/operations.ts create mode 100644 src/version2/schemas/orderOfCustomFieldOptions.ts create mode 100644 src/version2/schemas/orderOfIssueTypes.ts create mode 100644 src/version2/schemas/pageBean2ComponentJsonBean.ts create mode 100644 src/version2/schemas/pageBean2JqlFunctionPrecomputationBean.ts create mode 100644 src/version2/schemas/pageBeanBulkContextualConfiguration.ts create mode 100644 src/version2/schemas/pageBeanChangelog.ts create mode 100644 src/version2/schemas/pageBeanComment.ts create mode 100644 src/version2/schemas/pageBeanComponentWithIssueCount.ts create mode 100644 src/version2/schemas/pageBeanContext.ts create mode 100644 src/version2/schemas/pageBeanContextForProjectAndIssueType.ts create mode 100644 src/version2/schemas/pageBeanContextualConfiguration.ts create mode 100644 src/version2/schemas/pageBeanCustomFieldContext.ts create mode 100644 src/version2/schemas/pageBeanCustomFieldContextDefaultValue.ts create mode 100644 src/version2/schemas/pageBeanCustomFieldContextOption.ts create mode 100644 src/version2/schemas/pageBeanCustomFieldContextProjectMapping.ts create mode 100644 src/version2/schemas/pageBeanDashboard.ts create mode 100644 src/version2/schemas/pageBeanField.ts create mode 100644 src/version2/schemas/pageBeanFieldConfigurationDetails.ts create mode 100644 src/version2/schemas/pageBeanFieldConfigurationIssueTypeItem.ts create mode 100644 src/version2/schemas/pageBeanFieldConfigurationItem.ts create mode 100644 src/version2/schemas/pageBeanFieldConfigurationScheme.ts create mode 100644 src/version2/schemas/pageBeanFieldConfigurationSchemeProjects.ts create mode 100644 src/version2/schemas/pageBeanFilterDetails.ts create mode 100644 src/version2/schemas/pageBeanGroupDetails.ts create mode 100644 src/version2/schemas/pageBeanIssueFieldOption.ts create mode 100644 src/version2/schemas/pageBeanIssueSecurityLevelMember.ts create mode 100644 src/version2/schemas/pageBeanIssueSecuritySchemeToProjectMapping.ts create mode 100644 src/version2/schemas/pageBeanIssueTypeScheme.ts create mode 100644 src/version2/schemas/pageBeanIssueTypeSchemeMapping.ts create mode 100644 src/version2/schemas/pageBeanIssueTypeSchemeProjects.ts create mode 100644 src/version2/schemas/pageBeanIssueTypeScreenScheme.ts create mode 100644 src/version2/schemas/pageBeanIssueTypeScreenSchemeItem.ts create mode 100644 src/version2/schemas/pageBeanIssueTypeScreenSchemesProjects.ts create mode 100644 src/version2/schemas/pageBeanIssueTypeToContextMapping.ts create mode 100644 src/version2/schemas/pageBeanNotificationScheme.ts create mode 100644 src/version2/schemas/pageBeanNotificationSchemeAndProjectMappingJsonBean.ts create mode 100644 src/version2/schemas/pageBeanPriority.ts create mode 100644 src/version2/schemas/pageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects.ts create mode 100644 src/version2/schemas/pageBeanPriorityWithSequence.ts create mode 100644 src/version2/schemas/pageBeanProject.ts create mode 100644 src/version2/schemas/pageBeanProjectDetails.ts create mode 100644 src/version2/schemas/pageBeanResolutionJsonBean.ts create mode 100644 src/version2/schemas/pageBeanScreen.ts create mode 100644 src/version2/schemas/pageBeanScreenScheme.ts create mode 100644 src/version2/schemas/pageBeanScreenWithTab.ts create mode 100644 src/version2/schemas/pageBeanSecurityLevel.ts create mode 100644 src/version2/schemas/pageBeanSecurityLevelMember.ts create mode 100644 src/version2/schemas/pageBeanSecuritySchemeWithProjects.ts create mode 100644 src/version2/schemas/pageBeanString.ts create mode 100644 src/version2/schemas/pageBeanUiModificationDetails.ts create mode 100644 src/version2/schemas/pageBeanUser.ts create mode 100644 src/version2/schemas/pageBeanUserDetails.ts create mode 100644 src/version2/schemas/pageBeanUserKey.ts create mode 100644 src/version2/schemas/pageBeanVersion.ts create mode 100644 src/version2/schemas/pageBeanWebhook.ts create mode 100644 src/version2/schemas/pageBeanWorkflow.ts create mode 100644 src/version2/schemas/pageBeanWorkflowScheme.ts create mode 100644 src/version2/schemas/pageBeanWorkflowTransitionRules.ts create mode 100644 src/version2/schemas/pageOfChangelogs.ts create mode 100644 src/version2/schemas/pageOfComments.ts create mode 100644 src/version2/schemas/pageOfCreateMetaIssueTypeWithField.ts create mode 100644 src/version2/schemas/pageOfCreateMetaIssueTypes.ts create mode 100644 src/version2/schemas/pageOfDashboards.ts create mode 100644 src/version2/schemas/pageOfStatuses.ts create mode 100644 src/version2/schemas/pageOfWorklogs.ts create mode 100644 src/version2/schemas/pageWithCursorGetPlanResponseForPage.ts create mode 100644 src/version2/schemas/pageWithCursorGetTeamResponseForPage.ts create mode 100644 src/version2/schemas/pagedListUserDetailsApplicationUser.ts create mode 100644 src/version2/schemas/paginatedResponseComment.ts create mode 100644 src/version2/schemas/paginatedResponseFieldCreateMetadata.ts create mode 100644 src/version2/schemas/paginatedResponseIssueTypeIssueCreateMetadata.ts create mode 100644 src/version2/schemas/parsedJqlQueries.ts create mode 100644 src/version2/schemas/parsedJqlQuery.ts create mode 100644 src/version2/schemas/permissionDetails.ts create mode 100644 src/version2/schemas/permissionGrant.ts create mode 100644 src/version2/schemas/permissionGrantDTO.ts create mode 100644 src/version2/schemas/permissionGrants.ts create mode 100644 src/version2/schemas/permissionHolder.ts create mode 100644 src/version2/schemas/permissionPayloadDTO.ts create mode 100644 src/version2/schemas/permissionScheme.ts create mode 100644 src/version2/schemas/permissionSchemes.ts create mode 100644 src/version2/schemas/permissions.ts create mode 100644 src/version2/schemas/permissionsKeysBean.ts create mode 100644 src/version2/schemas/permittedProjects.ts create mode 100644 src/version2/schemas/priority.ts create mode 100644 src/version2/schemas/priorityId.ts create mode 100644 src/version2/schemas/priorityMapping.ts create mode 100644 src/version2/schemas/prioritySchemeChangesWithoutMappings.ts create mode 100644 src/version2/schemas/prioritySchemeId.ts create mode 100644 src/version2/schemas/prioritySchemeWithPaginatedPrioritiesAndProjects.ts create mode 100644 src/version2/schemas/priorityWithSequence.ts create mode 100644 src/version2/schemas/project.ts create mode 100644 src/version2/schemas/projectAndIssueTypePair.ts create mode 100644 src/version2/schemas/projectArchetype.ts create mode 100644 src/version2/schemas/projectAvatars.ts create mode 100644 src/version2/schemas/projectCategory.ts create mode 100644 src/version2/schemas/projectComponent.ts create mode 100644 src/version2/schemas/projectCreateResourceIdentifier.ts create mode 100644 src/version2/schemas/projectCustomTemplateCreateRequestDTO.ts create mode 100644 src/version2/schemas/projectDataPolicies.ts create mode 100644 src/version2/schemas/projectDataPolicy.ts create mode 100644 src/version2/schemas/projectDetails.ts create mode 100644 src/version2/schemas/projectEmailAddress.ts create mode 100644 src/version2/schemas/projectFeature.ts create mode 100644 src/version2/schemas/projectFeatureState.ts create mode 100644 src/version2/schemas/projectId.ts create mode 100644 src/version2/schemas/projectIdAssociationContext.ts create mode 100644 src/version2/schemas/projectIdentifierBean.ts create mode 100644 src/version2/schemas/projectIdentifiers.ts create mode 100644 src/version2/schemas/projectIds.ts create mode 100644 src/version2/schemas/projectInsight.ts create mode 100644 src/version2/schemas/projectIssueCreateMetadata.ts create mode 100644 src/version2/schemas/projectIssueSecurityLevels.ts create mode 100644 src/version2/schemas/projectIssueTypeHierarchy.ts create mode 100644 src/version2/schemas/projectIssueTypeMapping.ts create mode 100644 src/version2/schemas/projectIssueTypeMappings.ts create mode 100644 src/version2/schemas/projectIssueTypesHierarchyLevel.ts create mode 100644 src/version2/schemas/projectLandingPageInfo.ts create mode 100644 src/version2/schemas/projectPayload.ts create mode 100644 src/version2/schemas/projectPermissions.ts create mode 100644 src/version2/schemas/projectRole.ts create mode 100644 src/version2/schemas/projectRoleActorsUpdateBean.ts create mode 100644 src/version2/schemas/projectRoleDetails.ts create mode 100644 src/version2/schemas/projectRoleGroup.ts create mode 100644 src/version2/schemas/projectRoleUser.ts create mode 100644 src/version2/schemas/projectScopeBean.ts create mode 100644 src/version2/schemas/projectTemplateKey.ts create mode 100644 src/version2/schemas/projectTemplateModel.ts create mode 100644 src/version2/schemas/projectType.ts create mode 100644 src/version2/schemas/projectUsage.ts create mode 100644 src/version2/schemas/projectUsagePage.ts create mode 100644 src/version2/schemas/projectWithDataPolicy.ts create mode 100644 src/version2/schemas/propertyKey.ts create mode 100644 src/version2/schemas/propertyKeys.ts create mode 100644 src/version2/schemas/publishDraftWorkflowScheme.ts create mode 100644 src/version2/schemas/publishedWorkflowId.ts create mode 100644 src/version2/schemas/quickFilterPayload.ts create mode 100644 src/version2/schemas/redactionJobStatusResponse.ts create mode 100644 src/version2/schemas/redactionPosition.ts create mode 100644 src/version2/schemas/registeredWebhook.ts create mode 100644 src/version2/schemas/remoteIssueLink.ts create mode 100644 src/version2/schemas/remoteIssueLinkIdentifies.ts create mode 100644 src/version2/schemas/remoteIssueLinkRequest.ts create mode 100644 src/version2/schemas/remoteObject.ts create mode 100644 src/version2/schemas/removeOptionFromIssuesResult.ts create mode 100644 src/version2/schemas/reorderIssuePriorities.ts create mode 100644 src/version2/schemas/reorderIssueResolutionsRequest.ts create mode 100644 src/version2/schemas/requiredMappingByIssueType.ts create mode 100644 src/version2/schemas/requiredMappingByWorkflows.ts create mode 100644 src/version2/schemas/resolution.ts create mode 100644 src/version2/schemas/resolutionId.ts create mode 100644 src/version2/schemas/resolutionJsonBean.ts create mode 100644 src/version2/schemas/resource.ts create mode 100644 src/version2/schemas/restrictedPermission.ts create mode 100644 src/version2/schemas/richText.ts create mode 100644 src/version2/schemas/roleActor.ts create mode 100644 src/version2/schemas/rolePayload.ts create mode 100644 src/version2/schemas/rolesCapabilityPayload.ts create mode 100644 src/version2/schemas/ruleConfiguration.ts create mode 100644 src/version2/schemas/rulePayload.ts create mode 100644 src/version2/schemas/sanitizedJqlQueries.ts create mode 100644 src/version2/schemas/sanitizedJqlQuery.ts create mode 100644 src/version2/schemas/saveProjectTemplateRequest.ts create mode 100644 src/version2/schemas/saveTemplateRequest.ts create mode 100644 src/version2/schemas/saveTemplateResponse.ts create mode 100644 src/version2/schemas/scope.ts create mode 100644 src/version2/schemas/scopePayload.ts create mode 100644 src/version2/schemas/screen.ts create mode 100644 src/version2/schemas/screenDetails.ts create mode 100644 src/version2/schemas/screenPayload.ts create mode 100644 src/version2/schemas/screenScheme.ts create mode 100644 src/version2/schemas/screenSchemeDetails.ts create mode 100644 src/version2/schemas/screenSchemeId.ts create mode 100644 src/version2/schemas/screenSchemePayload.ts create mode 100644 src/version2/schemas/screenTypes.ts create mode 100644 src/version2/schemas/screenWithTab.ts create mode 100644 src/version2/schemas/screenableField.ts create mode 100644 src/version2/schemas/screenableTab.ts create mode 100644 src/version2/schemas/searchAndReconcileRequestBean.ts create mode 100644 src/version2/schemas/searchAndReconcileResults.ts create mode 100644 src/version2/schemas/searchAutoCompleteFilter.ts create mode 100644 src/version2/schemas/searchRequestBean.ts create mode 100644 src/version2/schemas/searchResults.ts create mode 100644 src/version2/schemas/securityLevel.ts create mode 100644 src/version2/schemas/securityLevelMember.ts create mode 100644 src/version2/schemas/securityLevelMemberPayload.ts create mode 100644 src/version2/schemas/securityLevelPayload.ts create mode 100644 src/version2/schemas/securityScheme.ts create mode 100644 src/version2/schemas/securitySchemeId.ts create mode 100644 src/version2/schemas/securitySchemeLevel.ts create mode 100644 src/version2/schemas/securitySchemeLevelMemberBean.ts create mode 100644 src/version2/schemas/securitySchemeMembersRequest.ts create mode 100644 src/version2/schemas/securitySchemePayload.ts create mode 100644 src/version2/schemas/securitySchemeWithProjects.ts create mode 100644 src/version2/schemas/securitySchemes.ts create mode 100644 src/version2/schemas/serverInformation.ts create mode 100644 src/version2/schemas/serviceManagementNavigationInfo.ts create mode 100644 src/version2/schemas/serviceRegistry.ts create mode 100644 src/version2/schemas/serviceRegistryTier.ts create mode 100644 src/version2/schemas/setDefaultLevelsRequest.ts create mode 100644 src/version2/schemas/setDefaultPriorityRequest.ts create mode 100644 src/version2/schemas/setDefaultResolutionRequest.ts create mode 100644 src/version2/schemas/sharePermission.ts create mode 100644 src/version2/schemas/sharePermissionInputBean.ts create mode 100644 src/version2/schemas/simpleApplicationPropertyBean.ts create mode 100644 src/version2/schemas/simpleErrorCollection.ts create mode 100644 src/version2/schemas/simpleLink.ts create mode 100644 src/version2/schemas/simpleListWrapperApplicationRole.ts create mode 100644 src/version2/schemas/simpleListWrapperGroupName.ts create mode 100644 src/version2/schemas/simplifiedHierarchyLevel.ts create mode 100644 src/version2/schemas/singleRedactionRequest.ts create mode 100644 src/version2/schemas/singleRedactionResponse.ts create mode 100644 src/version2/schemas/softwareNavigationInfo.ts create mode 100644 src/version2/schemas/status.ts create mode 100644 src/version2/schemas/statusCategory.ts create mode 100644 src/version2/schemas/statusCreate.ts create mode 100644 src/version2/schemas/statusCreateRequest.ts create mode 100644 src/version2/schemas/statusDetails.ts create mode 100644 src/version2/schemas/statusLayoutUpdate.ts create mode 100644 src/version2/schemas/statusMapping.ts create mode 100644 src/version2/schemas/statusMappingDTO.ts create mode 100644 src/version2/schemas/statusMetadata.ts create mode 100644 src/version2/schemas/statusMigration.ts create mode 100644 src/version2/schemas/statusPayload.ts create mode 100644 src/version2/schemas/statusProjectIssueTypeUsage.ts create mode 100644 src/version2/schemas/statusProjectIssueTypeUsageDTO.ts create mode 100644 src/version2/schemas/statusProjectIssueTypeUsagePage.ts create mode 100644 src/version2/schemas/statusProjectUsage.ts create mode 100644 src/version2/schemas/statusProjectUsageDTO.ts create mode 100644 src/version2/schemas/statusProjectUsagePage.ts create mode 100644 src/version2/schemas/statusScope.ts create mode 100644 src/version2/schemas/statusUpdate.ts create mode 100644 src/version2/schemas/statusUpdateRequest.ts create mode 100644 src/version2/schemas/statusWorkflowUsageDTO.ts create mode 100644 src/version2/schemas/statusWorkflowUsagePage.ts create mode 100644 src/version2/schemas/statusWorkflowUsageWorkflow.ts create mode 100644 src/version2/schemas/statusesPerWorkflow.ts create mode 100644 src/version2/schemas/streamingResponseBody.ts create mode 100644 src/version2/schemas/stringList.ts create mode 100644 src/version2/schemas/suggestedIssue.ts create mode 100644 src/version2/schemas/suggestedMappingsForPrioritiesRequestBean.ts create mode 100644 src/version2/schemas/suggestedMappingsForProjectsRequestBean.ts create mode 100644 src/version2/schemas/suggestedMappingsRequestBean.ts create mode 100644 src/version2/schemas/swimlanePayload.ts create mode 100644 src/version2/schemas/swimlanesPayload.ts create mode 100644 src/version2/schemas/systemAvatars.ts create mode 100644 src/version2/schemas/tabPayload.ts create mode 100644 src/version2/schemas/taskProgressBeanJsonNode.ts create mode 100644 src/version2/schemas/taskProgressBeanObject.ts create mode 100644 src/version2/schemas/taskProgressBeanRemoveOptionFromIssuesResult.ts create mode 100644 src/version2/schemas/timeTrackingConfiguration.ts create mode 100644 src/version2/schemas/timeTrackingDetails.ts create mode 100644 src/version2/schemas/timeTrackingProvider.ts create mode 100644 src/version2/schemas/toLayoutPayload.ts create mode 100644 src/version2/schemas/transition.ts create mode 100644 src/version2/schemas/transitionPayload.ts create mode 100644 src/version2/schemas/transitionScreenDetails.ts create mode 100644 src/version2/schemas/transitionUpdateDTO.ts create mode 100644 src/version2/schemas/transitions.ts create mode 100644 src/version2/schemas/uiModificationContextDetails.ts create mode 100644 src/version2/schemas/uiModificationDetails.ts create mode 100644 src/version2/schemas/uiModificationIdentifiers.ts create mode 100644 src/version2/schemas/unrestrictedUserEmail.ts create mode 100644 src/version2/schemas/updateCustomFieldDetails.ts create mode 100644 src/version2/schemas/updateDefaultProjectClassificationBean.ts create mode 100644 src/version2/schemas/updateDefaultScreenScheme.ts create mode 100644 src/version2/schemas/updateFieldConfigurationSchemeDetails.ts create mode 100644 src/version2/schemas/updateIssueSecurityLevelDetails.ts create mode 100644 src/version2/schemas/updateIssueSecuritySchemeRequestBean.ts create mode 100644 src/version2/schemas/updateNotificationSchemeDetails.ts create mode 100644 src/version2/schemas/updatePrioritiesInSchemeRequestBean.ts create mode 100644 src/version2/schemas/updatePriorityDetails.ts create mode 100644 src/version2/schemas/updatePrioritySchemeRequestBean.ts create mode 100644 src/version2/schemas/updatePrioritySchemeResponseBean.ts create mode 100644 src/version2/schemas/updateProjectDetails.ts create mode 100644 src/version2/schemas/updateProjectsInSchemeRequestBean.ts create mode 100644 src/version2/schemas/updateResolutionDetails.ts create mode 100644 src/version2/schemas/updateScreenDetails.ts create mode 100644 src/version2/schemas/updateScreenSchemeDetails.ts create mode 100644 src/version2/schemas/updateScreenTypes.ts create mode 100644 src/version2/schemas/updateUiModificationDetails.ts create mode 100644 src/version2/schemas/updateUserToGroupBean.ts create mode 100644 src/version2/schemas/updatedProjectCategory.ts create mode 100644 src/version2/schemas/user.ts create mode 100644 src/version2/schemas/userBean.ts create mode 100644 src/version2/schemas/userBeanAvatarUrls.ts create mode 100644 src/version2/schemas/userColumnRequestBody.ts create mode 100644 src/version2/schemas/userContextVariable.ts create mode 100644 src/version2/schemas/userDetails.ts create mode 100644 src/version2/schemas/userFilter.ts create mode 100644 src/version2/schemas/userKey.ts create mode 100644 src/version2/schemas/userList.ts create mode 100644 src/version2/schemas/userMigrationBean.ts create mode 100644 src/version2/schemas/userNavPropertyJsonBean.ts create mode 100644 src/version2/schemas/userPermission.ts create mode 100644 src/version2/schemas/userPickerUser.ts create mode 100644 src/version2/schemas/validationOptionsForCreate.ts create mode 100644 src/version2/schemas/validationOptionsForUpdate.ts create mode 100644 src/version2/schemas/valueOperand.ts create mode 100644 src/version2/schemas/version.ts create mode 100644 src/version2/schemas/versionApprover.ts create mode 100644 src/version2/schemas/versionIssueCounts.ts create mode 100644 src/version2/schemas/versionIssuesStatus.ts create mode 100644 src/version2/schemas/versionMoveBean.ts create mode 100644 src/version2/schemas/versionRelatedWork.ts create mode 100644 src/version2/schemas/versionUnresolvedIssuesCount.ts create mode 100644 src/version2/schemas/versionUsageInCustomField.ts create mode 100644 src/version2/schemas/visibility.ts create mode 100644 src/version2/schemas/votes.ts create mode 100644 src/version2/schemas/warningCollection.ts create mode 100644 src/version2/schemas/watchers.ts create mode 100644 src/version2/schemas/webhook.ts create mode 100644 src/version2/schemas/webhookDetails.ts create mode 100644 src/version2/schemas/webhookRegistrationDetails.ts create mode 100644 src/version2/schemas/webhooksExpirationDate.ts create mode 100644 src/version2/schemas/workManagementNavigationInfo.ts create mode 100644 src/version2/schemas/workflow.ts create mode 100644 src/version2/schemas/workflowAssociationStatusMapping.ts create mode 100644 src/version2/schemas/workflowCapabilities.ts create mode 100644 src/version2/schemas/workflowCapabilityPayload.ts create mode 100644 src/version2/schemas/workflowCompoundCondition.ts create mode 100644 src/version2/schemas/workflowCondition.ts create mode 100644 src/version2/schemas/workflowCreate.ts create mode 100644 src/version2/schemas/workflowCreateRequest.ts create mode 100644 src/version2/schemas/workflowCreateResponse.ts create mode 100644 src/version2/schemas/workflowCreateValidateRequest.ts create mode 100644 src/version2/schemas/workflowElementReference.ts create mode 100644 src/version2/schemas/workflowIDs.ts create mode 100644 src/version2/schemas/workflowId.ts create mode 100644 src/version2/schemas/workflowLayout.ts create mode 100644 src/version2/schemas/workflowMetadataAndIssueTypeRestModel.ts create mode 100644 src/version2/schemas/workflowMetadataRestModel.ts create mode 100644 src/version2/schemas/workflowOperations.ts create mode 100644 src/version2/schemas/workflowPayload.ts create mode 100644 src/version2/schemas/workflowProjectIssueTypeUsage.ts create mode 100644 src/version2/schemas/workflowProjectIssueTypeUsageDTO.ts create mode 100644 src/version2/schemas/workflowProjectIssueTypeUsagePage.ts create mode 100644 src/version2/schemas/workflowProjectUsageDTO.ts create mode 100644 src/version2/schemas/workflowReadRequest.ts create mode 100644 src/version2/schemas/workflowReadResponse.ts create mode 100644 src/version2/schemas/workflowReferenceStatus.ts create mode 100644 src/version2/schemas/workflowRuleConfiguration.ts create mode 100644 src/version2/schemas/workflowRules.ts create mode 100644 src/version2/schemas/workflowRulesSearch.ts create mode 100644 src/version2/schemas/workflowRulesSearchDetails.ts create mode 100644 src/version2/schemas/workflowScheme.ts create mode 100644 src/version2/schemas/workflowSchemeAssociation.ts create mode 100644 src/version2/schemas/workflowSchemeAssociations.ts create mode 100644 src/version2/schemas/workflowSchemeIdName.ts create mode 100644 src/version2/schemas/workflowSchemePayload.ts create mode 100644 src/version2/schemas/workflowSchemeProjectAssociation.ts create mode 100644 src/version2/schemas/workflowSchemeProjectUsageDTO.ts create mode 100644 src/version2/schemas/workflowSchemeReadRequest.ts create mode 100644 src/version2/schemas/workflowSchemeReadResponse.ts create mode 100644 src/version2/schemas/workflowSchemeUpdateRequest.ts create mode 100644 src/version2/schemas/workflowSchemeUpdateRequiredMappingsRequest.ts create mode 100644 src/version2/schemas/workflowSchemeUpdateRequiredMappingsResponse.ts create mode 100644 src/version2/schemas/workflowSchemeUsage.ts create mode 100644 src/version2/schemas/workflowSchemeUsageDTO.ts create mode 100644 src/version2/schemas/workflowSchemeUsagePage.ts create mode 100644 src/version2/schemas/workflowScope.ts create mode 100644 src/version2/schemas/workflowSearchResponse.ts create mode 100644 src/version2/schemas/workflowSimpleCondition.ts create mode 100644 src/version2/schemas/workflowStatus.ts create mode 100644 src/version2/schemas/workflowStatusLayout.ts create mode 100644 src/version2/schemas/workflowStatusLayoutPayload.ts create mode 100644 src/version2/schemas/workflowStatusPayload.ts create mode 100644 src/version2/schemas/workflowStatusUpdate.ts create mode 100644 src/version2/schemas/workflowTransition.ts create mode 100644 src/version2/schemas/workflowTransitionLinks.ts create mode 100644 src/version2/schemas/workflowTransitionProperty.ts create mode 100644 src/version2/schemas/workflowTransitionRule.ts create mode 100644 src/version2/schemas/workflowTransitionRules.ts create mode 100644 src/version2/schemas/workflowTransitionRulesDetails.ts create mode 100644 src/version2/schemas/workflowTransitionRulesUpdate.ts create mode 100644 src/version2/schemas/workflowTransitionRulesUpdateErrorDetails.ts create mode 100644 src/version2/schemas/workflowTransitionRulesUpdateErrors.ts create mode 100644 src/version2/schemas/workflowTransitions.ts create mode 100644 src/version2/schemas/workflowTrigger.ts create mode 100644 src/version2/schemas/workflowUpdate.ts create mode 100644 src/version2/schemas/workflowUpdateRequest.ts create mode 100644 src/version2/schemas/workflowUpdateResponse.ts create mode 100644 src/version2/schemas/workflowUpdateValidateRequestBean.ts create mode 100644 src/version2/schemas/workflowValidationError.ts create mode 100644 src/version2/schemas/workflowValidationErrorList.ts create mode 100644 src/version2/schemas/workflowsWithTransitionRulesDetails.ts create mode 100644 src/version2/schemas/workingDaysConfig.ts create mode 100644 src/version2/schemas/worklog.ts create mode 100644 src/version2/schemas/worklogIdsRequestBean.ts create mode 100644 src/version2/schemas/worklogsMoveRequestBean.ts create mode 100644 src/version2/schemas/workspaceDataPolicy.ts delete mode 100644 src/version2/workflowTransitionProperties.ts diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e4e776154c..5896179db1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,9 +9,6 @@ on: repository_dispatch: types: [ pr-approved ] -env: - PNPM_VERSION: '10' - jobs: build: name: 🏗️ Build diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index fb3dce89b2..a02833b237 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -5,7 +5,6 @@ on: env: NODE_VERSION: '20.x' - PNPM_VERSION: '10' permissions: contents: read diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 751d015852..7b7a8f4486 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,7 +7,6 @@ on: env: NODE_VERSION: '20.x' - PNPM_VERSION: '10' permissions: contents: read diff --git a/package.json b/package.json index edbd338189..32a68ea5c7 100644 --- a/package.json +++ b/package.json @@ -116,31 +116,32 @@ }, "dependencies": { "mime": "^4.0.7", - "zod": "^3.25.76" + "zod": "^4.1.0" }, "devDependencies": { - "@eslint/js": "^9.32.0", + "@eslint/js": "^9.34.0", "@rollup/plugin-alias": "^5.1.1", "@rollup/plugin-commonjs": "^28.0.6", "@rollup/plugin-node-resolve": "^16.0.1", "@rollup/plugin-typescript": "^12.1.4", - "@stylistic/eslint-plugin": "^5.2.2", - "@types/node": "^20.19.9", + "@stylistic/eslint-plugin": "^5.2.3", + "@types/node": "^20.19.11", "@types/sinon": "^17.0.4", "dotenv": "^17.2.1", - "eslint": "^9.32.0", + "eslint": "^9.34.0", "globals": "^16.3.0", "jiti": "^2.5.1", "prettier": "^3.6.2", "prettier-plugin-jsdoc": "^1.3.3", - "rollup": "^4.46.0", + "rollup": "^4.48.0", "rollup-plugin-esnext-to-nodenext": "^1.0.1", - "rollup-plugin-node-externals": "^8.0.1", + "rollup-plugin-node-externals": "^8.1.0", "sinon": "^21.0.0", "tslib": "^2.8.1", - "typedoc": "^0.28.7", - "typescript": "^5.8.3", - "typescript-eslint": "^8.38.0", + "typedoc": "^0.28.10", + "typescript": "^5.9.2", + "typescript-eslint": "^8.40.0", "vitest": "^3.2.4" - } + }, + "packageManager": "pnpm@10.15.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3adc1068a0..5137c539ce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,30 +12,30 @@ importers: specifier: ^4.0.7 version: 4.0.7 zod: - specifier: ^3.25.76 - version: 3.25.76 + specifier: ^4.1.0 + version: 4.1.0 devDependencies: '@eslint/js': - specifier: ^9.32.0 - version: 9.32.0 + specifier: ^9.34.0 + version: 9.34.0 '@rollup/plugin-alias': specifier: ^5.1.1 - version: 5.1.1(rollup@4.46.0) + version: 5.1.1(rollup@4.48.0) '@rollup/plugin-commonjs': specifier: ^28.0.6 - version: 28.0.6(rollup@4.46.0) + version: 28.0.6(rollup@4.48.0) '@rollup/plugin-node-resolve': specifier: ^16.0.1 - version: 16.0.1(rollup@4.46.0) + version: 16.0.1(rollup@4.48.0) '@rollup/plugin-typescript': specifier: ^12.1.4 - version: 12.1.4(rollup@4.46.0)(tslib@2.8.1)(typescript@5.8.3) + version: 12.1.4(rollup@4.48.0)(tslib@2.8.1)(typescript@5.9.2) '@stylistic/eslint-plugin': - specifier: ^5.2.2 - version: 5.2.2(eslint@9.32.0(jiti@2.5.1)) + specifier: ^5.2.3 + version: 5.2.3(eslint@9.34.0(jiti@2.5.1)) '@types/node': - specifier: ^20.19.9 - version: 20.19.9 + specifier: ^20.19.11 + version: 20.19.11 '@types/sinon': specifier: ^17.0.4 version: 17.0.4 @@ -43,8 +43,8 @@ importers: specifier: ^17.2.1 version: 17.2.1 eslint: - specifier: ^9.32.0 - version: 9.32.0(jiti@2.5.1) + specifier: ^9.34.0 + version: 9.34.0(jiti@2.5.1) globals: specifier: ^16.3.0 version: 16.3.0 @@ -58,14 +58,14 @@ importers: specifier: ^1.3.3 version: 1.3.3(prettier@3.6.2) rollup: - specifier: ^4.46.0 - version: 4.46.0 + specifier: ^4.48.0 + version: 4.48.0 rollup-plugin-esnext-to-nodenext: specifier: ^1.0.1 - version: 1.0.1(rollup@4.46.0) + version: 1.0.1(rollup@4.48.0) rollup-plugin-node-externals: - specifier: ^8.0.1 - version: 8.0.1(rollup@4.46.0) + specifier: ^8.1.0 + version: 8.1.0(rollup@4.48.0) sinon: specifier: ^21.0.0 version: 21.0.0 @@ -73,17 +73,17 @@ importers: specifier: ^2.8.1 version: 2.8.1 typedoc: - specifier: ^0.28.7 - version: 0.28.7(typescript@5.8.3) + specifier: ^0.28.10 + version: 0.28.10(typescript@5.9.2) typescript: - specifier: ^5.8.3 - version: 5.8.3 + specifier: ^5.9.2 + version: 5.9.2 typescript-eslint: - specifier: ^8.38.0 - version: 8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3) + specifier: ^8.40.0 + version: 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@20.19.9)(jiti@2.5.1)(yaml@2.8.0) + version: 3.2.4(@types/debug@4.1.12)(@types/node@20.19.11)(jiti@2.5.1)(yaml@2.8.0) packages: @@ -257,32 +257,32 @@ packages: resolution: {integrity: sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/config-helpers@0.3.0': - resolution: {integrity: sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw==} + '@eslint/config-helpers@0.3.1': + resolution: {integrity: sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.15.1': - resolution: {integrity: sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA==} + '@eslint/core@0.15.2': + resolution: {integrity: sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/eslintrc@3.3.1': resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.32.0': - resolution: {integrity: sha512-BBpRFZK3eX6uMLKz8WxFOBIFFcGFJ/g8XuwjTHCqHROSIsopI+ddn/d5Cfh36+7+e5edVS8dbSHnBNhrLEX0zg==} + '@eslint/js@9.34.0': + resolution: {integrity: sha512-EoyvqQnBNsV1CWaEJ559rxXL4c8V92gxirbawSmVUOWXlsRxxQXl6LmCpdUblgxgSkDIqKnhzba2SjRTI/A5Rw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.6': resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.3.4': - resolution: {integrity: sha512-Ul5l+lHEcw3L5+k8POx6r74mxEYKG5kOb6Xpy2gCRW6zweT6TEhAf8vhxGgjhqrd/VO/Dirhsb+1hNpD1ue9hw==} + '@eslint/plugin-kit@0.3.5': + resolution: {integrity: sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@gerrit0/mini-shiki@3.8.1': - resolution: {integrity: sha512-HVZW+8pxoOExr5ZMPK15U79jQAZTO/S6i5byQyyZGjtNj+qaYd82cizTncwFzTQgiLo8uUBym6vh+/1tfJklTw==} + '@gerrit0/mini-shiki@3.9.2': + resolution: {integrity: sha512-Tvsj+AOO4Z8xLRJK900WkyfxHsZQu+Zm1//oT1w443PO6RiYMoq/4NGOhaNuZoUMYsjKIAPVQ6eOFMddj6yphQ==} '@humanfs/core@0.19.1': resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} @@ -368,117 +368,117 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.46.0': - resolution: {integrity: sha512-9f3nSTFI2ivfxc7/tHBHcJ8pRnp8ROrELvsVprlQPVvcZ+j5zztYd+PTJGpyIOAdTvNwNrpCXswKSeoQcyGjMQ==} + '@rollup/rollup-android-arm-eabi@4.48.0': + resolution: {integrity: sha512-aVzKH922ogVAWkKiyKXorjYymz2084zrhrZRXtLrA5eEx5SO8Dj0c/4FpCHZyn7MKzhW2pW4tK28vVr+5oQ2xw==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.46.0': - resolution: {integrity: sha512-tFZSEhqJ8Yrpe50TzOdeoYi72gi/jsnT7y8Qrozf3cNu28WX+s6I3XzEPUAqoaT9SAS8Xz9AzGTFlxxCH/w20w==} + '@rollup/rollup-android-arm64@4.48.0': + resolution: {integrity: sha512-diOdQuw43xTa1RddAFbhIA8toirSzFMcnIg8kvlzRbK26xqEnKJ/vqQnghTAajy2Dcy42v+GMPMo6jq67od+Dw==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.46.0': - resolution: {integrity: sha512-+DikIIs+p6yU2hF51UaWG8BnHbq90X0QIOt5zqSKSZxY+G3qqdLih214e9InJal21af2PuuxkDectetGfbVPJw==} + '@rollup/rollup-darwin-arm64@4.48.0': + resolution: {integrity: sha512-QhR2KA18fPlJWFefySJPDYZELaVqIUVnYgAOdtJ+B/uH96CFg2l1TQpX19XpUMWUqMyIiyY45wje8K6F4w4/CA==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.46.0': - resolution: {integrity: sha512-5a+NofhdEB/WimSlFMskbFQn1vqz1FWryYpA99trmZGO6qEmiS0IsX6w4B3d91U878Q2ZQdiaFF1gxX4P147og==} + '@rollup/rollup-darwin-x64@4.48.0': + resolution: {integrity: sha512-Q9RMXnQVJ5S1SYpNSTwXDpoQLgJ/fbInWOyjbCnnqTElEyeNvLAB3QvG5xmMQMhFN74bB5ZZJYkKaFPcOG8sGg==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.46.0': - resolution: {integrity: sha512-igr/RlKPS3OCy4jD3XBmAmo3UAcNZkJSubRsw1JeM8bAbwf15k/3eMZXD91bnjheijJiOJcga3kfCLKjV8IXNg==} + '@rollup/rollup-freebsd-arm64@4.48.0': + resolution: {integrity: sha512-3jzOhHWM8O8PSfyft+ghXZfBkZawQA0PUGtadKYxFqpcYlOYjTi06WsnYBsbMHLawr+4uWirLlbhcYLHDXR16w==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.46.0': - resolution: {integrity: sha512-MdigWzPSHlQzB1xZ+MdFDWTAH+kcn7UxjEBoOKuaso7z1DRlnAnrknB1mTtNOQ+GdPI8xgExAGwHeqQjntR0Cg==} + '@rollup/rollup-freebsd-x64@4.48.0': + resolution: {integrity: sha512-NcD5uVUmE73C/TPJqf78hInZmiSBsDpz3iD5MF/BuB+qzm4ooF2S1HfeTChj5K4AV3y19FFPgxonsxiEpy8v/A==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.46.0': - resolution: {integrity: sha512-dmZseE0ZwA/4yy1+BwFrDqFTjjNg24GO9xSrb1weVbt6AFkhp5pz1gVS7IMtfIvoWy8yp6q/zN0bKnefRUImvQ==} + '@rollup/rollup-linux-arm-gnueabihf@4.48.0': + resolution: {integrity: sha512-JWnrj8qZgLWRNHr7NbpdnrQ8kcg09EBBq8jVOjmtlB3c8C6IrynAJSMhMVGME4YfTJzIkJqvSUSVJRqkDnu/aA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.46.0': - resolution: {integrity: sha512-fzhfn6p9Cfm3W8UrWKIa4l7Wfjs/KGdgaswMBBE3KY3Ta43jg2XsPrAtfezHpsRk0Nx+TFuS3hZk/To2N5kFPQ==} + '@rollup/rollup-linux-arm-musleabihf@4.48.0': + resolution: {integrity: sha512-9xu92F0TxuMH0tD6tG3+GtngwdgSf8Bnz+YcsPG91/r5Vgh5LNofO48jV55priA95p3c92FLmPM7CvsVlnSbGQ==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.46.0': - resolution: {integrity: sha512-vVDD+iPDPmJQ5nAQ5Tifq3ywdv60FartglFI8VOCK+hcU9aoG0qlQTsDJP97O5yiTaTqlneZWoARMcVC5nyUoQ==} + '@rollup/rollup-linux-arm64-gnu@4.48.0': + resolution: {integrity: sha512-NLtvJB5YpWn7jlp1rJiY0s+G1Z1IVmkDuiywiqUhh96MIraC0n7XQc2SZ1CZz14shqkM+XN2UrfIo7JB6UufOA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.46.0': - resolution: {integrity: sha512-0d0jx08fzDHCzXqrtCMEEyxKU0SvJrWmUjUDE2/KDQ2UDJql0tfiwYvEx1oHELClKO8CNdE+AGJj+RqXscZpdQ==} + '@rollup/rollup-linux-arm64-musl@4.48.0': + resolution: {integrity: sha512-QJ4hCOnz2SXgCh+HmpvZkM+0NSGcZACyYS8DGbWn2PbmA0e5xUk4bIP8eqJyNXLtyB4gZ3/XyvKtQ1IFH671vQ==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loongarch64-gnu@4.46.0': - resolution: {integrity: sha512-XBYu9oW9eKJadWn8M7hkTZsD4yG+RrsTrVEgyKwb4L72cpJjRbRboTG9Lg9fec8MxJp/cfTHAocg4mnismQR8A==} + '@rollup/rollup-linux-loongarch64-gnu@4.48.0': + resolution: {integrity: sha512-Pk0qlGJnhILdIC5zSKQnprFjrGmjfDM7TPZ0FKJxRkoo+kgMRAg4ps1VlTZf8u2vohSicLg7NP+cA5qE96PaFg==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-ppc64-gnu@4.46.0': - resolution: {integrity: sha512-wJaRvcT17PoOK6Ggcfo3nouFlybHvARBS4jzT0PC/lg17fIJHcDS2fZz3sD+iA4nRlho2zE6OGbU0HvwATdokQ==} + '@rollup/rollup-linux-ppc64-gnu@4.48.0': + resolution: {integrity: sha512-/dNFc6rTpoOzgp5GKoYjT6uLo8okR/Chi2ECOmCZiS4oqh3mc95pThWma7Bgyk6/WTEvjDINpiBCuecPLOgBLQ==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.46.0': - resolution: {integrity: sha512-GZ5bkMFteAGkcmh8x0Ok4LSa+L62Ez0tMsHPX6JtR0wl4Xc3bQcrFHDiR5DGLEDFtGrXih4Nd/UDaFqs968/wA==} + '@rollup/rollup-linux-riscv64-gnu@4.48.0': + resolution: {integrity: sha512-YBwXsvsFI8CVA4ej+bJF2d9uAeIiSkqKSPQNn0Wyh4eMDY4wxuSp71BauPjQNCKK2tD2/ksJ7uhJ8X/PVY9bHQ==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.46.0': - resolution: {integrity: sha512-7CjPw6FflFsVOUfWOrVrREiV3IYXG4RzZ1ZQUaT3BtSK8YXN6x286o+sruPZJESIaPebYuFowmg54ZdrkVBYog==} + '@rollup/rollup-linux-riscv64-musl@4.48.0': + resolution: {integrity: sha512-FI3Rr2aGAtl1aHzbkBIamsQyuauYtTF9SDUJ8n2wMXuuxwchC3QkumZa1TEXYIv/1AUp1a25Kwy6ONArvnyeVQ==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.46.0': - resolution: {integrity: sha512-nmvnl0ZiuysltcB/cKjUh40Rx4FbSyueERDsl2FLvLYr6pCgSsvGr3SocUT84svSpmloS7f1DRWqtRha74Gi1w==} + '@rollup/rollup-linux-s390x-gnu@4.48.0': + resolution: {integrity: sha512-Dx7qH0/rvNNFmCcIRe1pyQ9/H0XO4v/f0SDoafwRYwc2J7bJZ5N4CHL/cdjamISZ5Cgnon6iazAVRFlxSoHQnQ==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.46.0': - resolution: {integrity: sha512-Cv+moII5C8RM6gZbR3cb21o6rquVDZrN2o81maROg1LFzBz2dZUwIQSxFA8GtGZ/F2KtsqQ2z3eFPBb6akvQNg==} + '@rollup/rollup-linux-x64-gnu@4.48.0': + resolution: {integrity: sha512-GUdZKTeKBq9WmEBzvFYuC88yk26vT66lQV8D5+9TgkfbewhLaTHRNATyzpQwwbHIfJvDJ3N9WJ90wK/uR3cy3Q==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.46.0': - resolution: {integrity: sha512-PHcMG8DZTM9RCIjp8QIfN0VYtX0TtBPnWOTRurFhoCDoi9zptUZL2k7pCs+5rgut7JAiUsYy+huyhVKPcmxoog==} + '@rollup/rollup-linux-x64-musl@4.48.0': + resolution: {integrity: sha512-ao58Adz/v14MWpQgYAb4a4h3fdw73DrDGtaiF7Opds5wNyEQwtO6M9dBh89nke0yoZzzaegq6J/EXs7eBebG8A==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.46.0': - resolution: {integrity: sha512-1SI/Rd47e8aQJeFWMDg16ET+fjvCcD/CzeaRmIEPmb05hx+3cCcwIF4ebUag4yTt/D1peE+Mgp0+Po3M358cAA==} + '@rollup/rollup-win32-arm64-msvc@4.48.0': + resolution: {integrity: sha512-kpFno46bHtjZVdRIOxqaGeiABiToo2J+st7Yce+aiAoo1H0xPi2keyQIP04n2JjDVuxBN6bSz9R6RdTK5hIppw==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.46.0': - resolution: {integrity: sha512-JwOCYxmumFDfDhx4kNyz6kTVK3gWzBIvVdMNzQMRDubcoGRDniOOmo6DDNP42qwZx3Bp9/6vWJ+kNzNqXoHmeA==} + '@rollup/rollup-win32-ia32-msvc@4.48.0': + resolution: {integrity: sha512-rFYrk4lLk9YUTIeihnQMiwMr6gDhGGSbWThPEDfBoU/HdAtOzPXeexKi7yU8jO+LWRKnmqPN9NviHQf6GDwBcQ==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.46.0': - resolution: {integrity: sha512-IPMIfrfkG1GaEXi+JSsQEx8x9b4b+hRZXO7KYc2pKio3zO2/VDXDs6B9Ts/nnO+25Fk1tdAVtUn60HKKPPzDig==} + '@rollup/rollup-win32-x64-msvc@4.48.0': + resolution: {integrity: sha512-sq0hHLTgdtwOPDB5SJOuaoHyiP1qSwg+71TQWk8iDS04bW1wIE0oQ6otPiRj2ZvLYNASLMaTp8QRGUVZ+5OL5A==} cpu: [x64] os: [win32] - '@shikijs/engine-oniguruma@3.8.1': - resolution: {integrity: sha512-KGQJZHlNY7c656qPFEQpIoqOuC4LrxjyNndRdzk5WKB/Ie87+NJCF1xo9KkOUxwxylk7rT6nhlZyTGTC4fCe1g==} + '@shikijs/engine-oniguruma@3.9.2': + resolution: {integrity: sha512-Vn/w5oyQ6TUgTVDIC/BrpXwIlfK6V6kGWDVVz2eRkF2v13YoENUvaNwxMsQU/t6oCuZKzqp9vqtEtEzKl9VegA==} - '@shikijs/langs@3.8.1': - resolution: {integrity: sha512-TjOFg2Wp1w07oKnXjs0AUMb4kJvujML+fJ1C5cmEj45lhjbUXtziT1x2bPQb9Db6kmPhkG5NI2tgYW1/DzhUuQ==} + '@shikijs/langs@3.9.2': + resolution: {integrity: sha512-X1Q6wRRQXY7HqAuX3I8WjMscjeGjqXCg/Sve7J2GWFORXkSrXud23UECqTBIdCSNKJioFtmUGJQNKtlMMZMn0w==} - '@shikijs/themes@3.8.1': - resolution: {integrity: sha512-Vu3t3BBLifc0GB0UPg2Pox1naTemrrvyZv2lkiSw3QayVV60me1ujFQwPZGgUTmwXl1yhCPW8Lieesm0CYruLQ==} + '@shikijs/themes@3.9.2': + resolution: {integrity: sha512-6z5lBPBMRfLyyEsgf6uJDHPa6NAGVzFJqH4EAZ+03+7sedYir2yJBRu2uPZOKmj43GyhVHWHvyduLDAwJQfDjA==} - '@shikijs/types@3.8.1': - resolution: {integrity: sha512-5C39Q8/8r1I26suLh+5TPk1DTrbY/kn3IdWA5HdizR0FhlhD05zx5nKCqhzSfDHH3p4S0ZefxWd77DLV+8FhGg==} + '@shikijs/types@3.9.2': + resolution: {integrity: sha512-/M5L0Uc2ljyn2jKvj4Yiah7ow/W+DJSglVafvWAJ/b8AZDeeRAdMu3c2riDzB7N42VD+jSnWxeP9AKtd4TfYVw==} '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} @@ -492,8 +492,8 @@ packages: '@sinonjs/samsam@8.0.3': resolution: {integrity: sha512-hw6HbX+GyVZzmaYNh82Ecj1vdGZrqVIn/keDTg63IgAwiQPO+xCz99uG6Woqgb4tM0mUiFENKZ4cqd7IX94AXQ==} - '@stylistic/eslint-plugin@5.2.2': - resolution: {integrity: sha512-bE2DUjruqXlHYP3Q2Gpqiuj2bHq7/88FnuaS0FjeGGLCy+X6a07bGVuwtiOYnPSLHR6jmx5Bwdv+j7l8H+G97A==} + '@stylistic/eslint-plugin@5.2.3': + resolution: {integrity: sha512-oY7GVkJGVMI5benlBDCaRrSC1qPasafyv5dOBLLv5MTilMGnErKhO6ziEfodDDIZbo5QxPUNW360VudJOFODMw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: '>=9.0.0' @@ -522,8 +522,8 @@ packages: '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} - '@types/node@20.19.9': - resolution: {integrity: sha512-cuVNgarYWZqxRJDQHEB58GEONhOK79QVR/qYx4S7kcUObQvUwvFnYxJuuHUKm2aieN9X3yZB4LZsuYNU1Qphsw==} + '@types/node@20.19.11': + resolution: {integrity: sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow==} '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} @@ -537,63 +537,67 @@ packages: '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} - '@typescript-eslint/eslint-plugin@8.38.0': - resolution: {integrity: sha512-CPoznzpuAnIOl4nhj4tRr4gIPj5AfKgkiJmGQDaq+fQnRJTYlcBjbX3wbciGmpoPf8DREufuPRe1tNMZnGdanA==} + '@typescript-eslint/eslint-plugin@8.40.0': + resolution: {integrity: sha512-w/EboPlBwnmOBtRbiOvzjD+wdiZdgFeo17lkltrtn7X37vagKKWJABvyfsJXTlHe6XBzugmYgd4A4nW+k8Mixw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^8.38.0 + '@typescript-eslint/parser': ^8.40.0 eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/parser@8.38.0': - resolution: {integrity: sha512-Zhy8HCvBUEfBECzIl1PKqF4p11+d0aUJS1GeUiuqK9WmOug8YCmC4h4bjyBvMyAMI9sbRczmrYL5lKg/YMbrcQ==} + '@typescript-eslint/parser@8.40.0': + resolution: {integrity: sha512-jCNyAuXx8dr5KJMkecGmZ8KI61KBUhkCob+SD+C+I5+Y1FWI2Y3QmY4/cxMCC5WAsZqoEtEETVhUiUMIGCf6Bw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/project-service@8.38.0': - resolution: {integrity: sha512-dbK7Jvqcb8c9QfH01YB6pORpqX1mn5gDZc9n63Ak/+jD67oWXn3Gs0M6vddAN+eDXBCS5EmNWzbSxsn9SzFWWg==} + '@typescript-eslint/project-service@8.40.0': + resolution: {integrity: sha512-/A89vz7Wf5DEXsGVvcGdYKbVM9F7DyFXj52lNYUDS1L9yJfqjW/fIp5PgMuEJL/KeqVTe2QSbXAGUZljDUpArw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/scope-manager@8.38.0': - resolution: {integrity: sha512-WJw3AVlFFcdT9Ri1xs/lg8LwDqgekWXWhH3iAF+1ZM+QPd7oxQ6jvtW/JPwzAScxitILUIFs0/AnQ/UWHzbATQ==} + '@typescript-eslint/scope-manager@8.40.0': + resolution: {integrity: sha512-y9ObStCcdCiZKzwqsE8CcpyuVMwRouJbbSrNuThDpv16dFAj429IkM6LNb1dZ2m7hK5fHyzNcErZf7CEeKXR4w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/tsconfig-utils@8.38.0': - resolution: {integrity: sha512-Lum9RtSE3EroKk/bYns+sPOodqb2Fv50XOl/gMviMKNvanETUuUcC9ObRbzrJ4VSd2JalPqgSAavwrPiPvnAiQ==} + '@typescript-eslint/tsconfig-utils@8.40.0': + resolution: {integrity: sha512-jtMytmUaG9d/9kqSl/W3E3xaWESo4hFDxAIHGVW/WKKtQhesnRIJSAJO6XckluuJ6KDB5woD1EiqknriCtAmcw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/type-utils@8.38.0': - resolution: {integrity: sha512-c7jAvGEZVf0ao2z+nnz8BUaHZD09Agbh+DY7qvBQqLiz8uJzRgVPj5YvOh8I8uEiH8oIUGIfHzMwUcGVco/SJg==} + '@typescript-eslint/type-utils@8.40.0': + resolution: {integrity: sha512-eE60cK4KzAc6ZrzlJnflXdrMqOBaugeukWICO2rB0KNvwdIMaEaYiywwHMzA1qFpTxrLhN9Lp4E/00EgWcD3Ow==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' '@typescript-eslint/types@8.38.0': resolution: {integrity: sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.38.0': - resolution: {integrity: sha512-fooELKcAKzxux6fA6pxOflpNS0jc+nOQEEOipXFNjSlBS6fqrJOVY/whSn70SScHrcJ2LDsxWrneFoWYSVfqhQ==} + '@typescript-eslint/types@8.40.0': + resolution: {integrity: sha512-ETdbFlgbAmXHyFPwqUIYrfc12ArvpBhEVgGAxVYSwli26dn8Ko+lIo4Su9vI9ykTZdJn+vJprs/0eZU0YMAEQg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/typescript-estree@8.40.0': + resolution: {integrity: sha512-k1z9+GJReVVOkc1WfVKs1vBrR5MIKKbdAjDTPvIK3L8De6KbFfPFt6BKpdkdk7rZS2GtC/m6yI5MYX+UsuvVYQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/utils@8.38.0': - resolution: {integrity: sha512-hHcMA86Hgt+ijJlrD8fX0j1j8w4C92zue/8LOPAFioIno+W0+L7KqE8QZKCcPGc/92Vs9x36w/4MPTJhqXdyvg==} + '@typescript-eslint/utils@8.40.0': + resolution: {integrity: sha512-Cgzi2MXSZyAUOY+BFwGs17s7ad/7L+gKt6Y8rAVVWS+7o6wrjeFN4nVfTpbE25MNcxyJ+iYUXflbs2xR9h4UBg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/visitor-keys@8.38.0': - resolution: {integrity: sha512-pWrTcoFNWuwHlA9CvlfSsGWs14JxfN1TH25zM5L7o0pRLhsoZkDnTsXfQRJBEWJoV5DL0jf+Z+sxiud+K0mq1g==} + '@typescript-eslint/visitor-keys@8.40.0': + resolution: {integrity: sha512-8CZ47QwalyRjsypfwnbI3hKy5gJDPmrkLjkgMxhi0+DZZ2QNx2naS6/hWoVYUHU7LU2zleF68V9miaVZvhFfTA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@vitest/expect@3.2.4': @@ -775,8 +779,8 @@ packages: resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.32.0: - resolution: {integrity: sha512-LSehfdpgMeWcTZkWZVIJl+tkZ2nuSkyyB9C27MZqFWXuph7DvaowgcTvKqxvpLW1JZIk8PN7hFY3Rj9LQ7m7lg==} + eslint@9.34.0: + resolution: {integrity: sha512-RNCHRX5EwdrESy3Jc9o8ie8Bog+PeYvvSR8sDGoZxNFTvZ4dlxUB3WzQ3bQMztFrSRODGrLLj8g6OFuGY/aiQg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -1181,14 +1185,14 @@ packages: peerDependencies: rollup: ^4 - rollup-plugin-node-externals@8.0.1: - resolution: {integrity: sha512-j6uve/BPEyHCmQuXpu5/LT5qXw69QLIi6YnFrs6F7tmGFXjkFDT0zqZMt0KaMuWSvkcxJFBklsKfYYoKKEPwyw==} + rollup-plugin-node-externals@8.1.0: + resolution: {integrity: sha512-0D3S0E0Dl1V3Q6Cywnc7wt88VAfOB9AC5QHwVdgvP1vByRHW2wnEXoK0x3VYZzJ/EmGsR5Uix5HUmMJNG+hz2Q==} engines: {node: '>= 21 || ^20.6.0 || ^18.19.0'} peerDependencies: rollup: ^4.0.0 - rollup@4.46.0: - resolution: {integrity: sha512-ONmkT3Ud3IfW15nl7l4qAZko5/2iZ5ALVBDh02ZSZ5IGVLJSYkRcRa3iB58VyEIyoofs9m2xdVrm+lTi97+3pw==} + rollup@4.48.0: + resolution: {integrity: sha512-BXHRqK1vyt9XVSEHZ9y7xdYtuYbwVod2mLwOMFP7t/Eqoc1pHRlG/WdV2qNeNvZHRQdLedaFycljaYYM96RqJQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -1290,22 +1294,22 @@ packages: resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==} engines: {node: '>=4'} - typedoc@0.28.7: - resolution: {integrity: sha512-lpz0Oxl6aidFkmS90VQDQjk/Qf2iw0IUvFqirdONBdj7jPSN9mGXhy66BcGNDxx5ZMyKKiBVAREvPEzT6Uxipw==} + typedoc@0.28.10: + resolution: {integrity: sha512-zYvpjS2bNJ30SoNYfHSRaFpBMZAsL7uwKbWwqoCNFWjcPnI3e/mPLh2SneH9mX7SJxtDpvDgvd9/iZxGbo7daw==} engines: {node: '>= 18', pnpm: '>= 10'} hasBin: true 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 || 5.8.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 || 5.9.x - typescript-eslint@8.38.0: - resolution: {integrity: sha512-FsZlrYK6bPDGoLeZRuvx2v6qrM03I0U0SnfCLPs/XCCPCFD80xU9Pg09H/K+XFa68uJuZo7l/Xhs+eDRg2l3hg==} + typescript-eslint@8.40.0: + resolution: {integrity: sha512-Xvd2l+ZmFDPEt4oj1QEXzA4A2uUK6opvKu3eGN9aGjB8au02lIVcLyi375w94hHyejTOmzIU77L8ol2sRg9n7Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - typescript@5.8.3: - resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} + typescript@5.9.2: + resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} engines: {node: '>=14.17'} hasBin: true @@ -1417,8 +1421,8 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - zod@3.25.76: - resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==} + zod@4.1.0: + resolution: {integrity: sha512-UWxluYj2IDX9MHRXTMbB/2eeWrAMmmMSESM+MfT9MQw8U1qo9q5ASW08anoJh6AJ7pkt099fLdNFmfI+4aChHg==} snapshots: @@ -1500,9 +1504,9 @@ snapshots: '@esbuild/win32-x64@0.25.8': optional: true - '@eslint-community/eslint-utils@4.7.0(eslint@9.32.0(jiti@2.5.1))': + '@eslint-community/eslint-utils@4.7.0(eslint@9.34.0(jiti@2.5.1))': dependencies: - eslint: 9.32.0(jiti@2.5.1) + eslint: 9.34.0(jiti@2.5.1) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.1': {} @@ -1515,9 +1519,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/config-helpers@0.3.0': {} + '@eslint/config-helpers@0.3.1': {} - '@eslint/core@0.15.1': + '@eslint/core@0.15.2': dependencies: '@types/json-schema': 7.0.15 @@ -1535,21 +1539,21 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.32.0': {} + '@eslint/js@9.34.0': {} '@eslint/object-schema@2.1.6': {} - '@eslint/plugin-kit@0.3.4': + '@eslint/plugin-kit@0.3.5': dependencies: - '@eslint/core': 0.15.1 + '@eslint/core': 0.15.2 levn: 0.4.1 - '@gerrit0/mini-shiki@3.8.1': + '@gerrit0/mini-shiki@3.9.2': dependencies: - '@shikijs/engine-oniguruma': 3.8.1 - '@shikijs/langs': 3.8.1 - '@shikijs/themes': 3.8.1 - '@shikijs/types': 3.8.1 + '@shikijs/engine-oniguruma': 3.9.2 + '@shikijs/langs': 3.9.2 + '@shikijs/themes': 3.9.2 + '@shikijs/types': 3.9.2 '@shikijs/vscode-textmate': 10.0.2 '@humanfs/core@0.19.1': {} @@ -1579,13 +1583,13 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.19.1 - '@rollup/plugin-alias@5.1.1(rollup@4.46.0)': + '@rollup/plugin-alias@5.1.1(rollup@4.48.0)': optionalDependencies: - rollup: 4.46.0 + rollup: 4.48.0 - '@rollup/plugin-commonjs@28.0.6(rollup@4.46.0)': + '@rollup/plugin-commonjs@28.0.6(rollup@4.48.0)': dependencies: - '@rollup/pluginutils': 5.2.0(rollup@4.46.0) + '@rollup/pluginutils': 5.2.0(rollup@4.48.0) commondir: 1.0.1 estree-walker: 2.0.2 fdir: 6.4.6(picomatch@4.0.3) @@ -1593,109 +1597,109 @@ snapshots: magic-string: 0.30.17 picomatch: 4.0.3 optionalDependencies: - rollup: 4.46.0 + rollup: 4.48.0 - '@rollup/plugin-node-resolve@16.0.1(rollup@4.46.0)': + '@rollup/plugin-node-resolve@16.0.1(rollup@4.48.0)': dependencies: - '@rollup/pluginutils': 5.2.0(rollup@4.46.0) + '@rollup/pluginutils': 5.2.0(rollup@4.48.0) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-module: 1.0.0 resolve: 1.22.10 optionalDependencies: - rollup: 4.46.0 + rollup: 4.48.0 - '@rollup/plugin-typescript@12.1.4(rollup@4.46.0)(tslib@2.8.1)(typescript@5.8.3)': + '@rollup/plugin-typescript@12.1.4(rollup@4.48.0)(tslib@2.8.1)(typescript@5.9.2)': dependencies: - '@rollup/pluginutils': 5.2.0(rollup@4.46.0) + '@rollup/pluginutils': 5.2.0(rollup@4.48.0) resolve: 1.22.10 - typescript: 5.8.3 + typescript: 5.9.2 optionalDependencies: - rollup: 4.46.0 + rollup: 4.48.0 tslib: 2.8.1 - '@rollup/pluginutils@5.2.0(rollup@4.46.0)': + '@rollup/pluginutils@5.2.0(rollup@4.48.0)': dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 picomatch: 4.0.3 optionalDependencies: - rollup: 4.46.0 + rollup: 4.48.0 - '@rollup/rollup-android-arm-eabi@4.46.0': + '@rollup/rollup-android-arm-eabi@4.48.0': optional: true - '@rollup/rollup-android-arm64@4.46.0': + '@rollup/rollup-android-arm64@4.48.0': optional: true - '@rollup/rollup-darwin-arm64@4.46.0': + '@rollup/rollup-darwin-arm64@4.48.0': optional: true - '@rollup/rollup-darwin-x64@4.46.0': + '@rollup/rollup-darwin-x64@4.48.0': optional: true - '@rollup/rollup-freebsd-arm64@4.46.0': + '@rollup/rollup-freebsd-arm64@4.48.0': optional: true - '@rollup/rollup-freebsd-x64@4.46.0': + '@rollup/rollup-freebsd-x64@4.48.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.46.0': + '@rollup/rollup-linux-arm-gnueabihf@4.48.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.46.0': + '@rollup/rollup-linux-arm-musleabihf@4.48.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.46.0': + '@rollup/rollup-linux-arm64-gnu@4.48.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.46.0': + '@rollup/rollup-linux-arm64-musl@4.48.0': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.46.0': + '@rollup/rollup-linux-loongarch64-gnu@4.48.0': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.46.0': + '@rollup/rollup-linux-ppc64-gnu@4.48.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.46.0': + '@rollup/rollup-linux-riscv64-gnu@4.48.0': optional: true - '@rollup/rollup-linux-riscv64-musl@4.46.0': + '@rollup/rollup-linux-riscv64-musl@4.48.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.46.0': + '@rollup/rollup-linux-s390x-gnu@4.48.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.46.0': + '@rollup/rollup-linux-x64-gnu@4.48.0': optional: true - '@rollup/rollup-linux-x64-musl@4.46.0': + '@rollup/rollup-linux-x64-musl@4.48.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.46.0': + '@rollup/rollup-win32-arm64-msvc@4.48.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.46.0': + '@rollup/rollup-win32-ia32-msvc@4.48.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.46.0': + '@rollup/rollup-win32-x64-msvc@4.48.0': optional: true - '@shikijs/engine-oniguruma@3.8.1': + '@shikijs/engine-oniguruma@3.9.2': dependencies: - '@shikijs/types': 3.8.1 + '@shikijs/types': 3.9.2 '@shikijs/vscode-textmate': 10.0.2 - '@shikijs/langs@3.8.1': + '@shikijs/langs@3.9.2': dependencies: - '@shikijs/types': 3.8.1 + '@shikijs/types': 3.9.2 - '@shikijs/themes@3.8.1': + '@shikijs/themes@3.9.2': dependencies: - '@shikijs/types': 3.8.1 + '@shikijs/types': 3.9.2 - '@shikijs/types@3.8.1': + '@shikijs/types@3.9.2': dependencies: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 @@ -1715,11 +1719,11 @@ snapshots: '@sinonjs/commons': 3.0.1 type-detect: 4.1.0 - '@stylistic/eslint-plugin@5.2.2(eslint@9.32.0(jiti@2.5.1))': + '@stylistic/eslint-plugin@5.2.3(eslint@9.34.0(jiti@2.5.1))': dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.32.0(jiti@2.5.1)) + '@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1)) '@typescript-eslint/types': 8.38.0 - eslint: 9.32.0(jiti@2.5.1) + eslint: 9.34.0(jiti@2.5.1) eslint-visitor-keys: 4.2.1 espree: 10.4.0 estraverse: 5.3.0 @@ -1749,7 +1753,7 @@ snapshots: '@types/ms@2.1.0': {} - '@types/node@20.19.9': + '@types/node@20.19.11': dependencies: undici-types: 6.21.0 @@ -1763,97 +1767,99 @@ snapshots: '@types/unist@3.0.3': {} - '@typescript-eslint/eslint-plugin@8.38.0(@typescript-eslint/parser@8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3))(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3)': + '@typescript-eslint/eslint-plugin@8.40.0(@typescript-eslint/parser@8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3) - '@typescript-eslint/scope-manager': 8.38.0 - '@typescript-eslint/type-utils': 8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3) - '@typescript-eslint/utils': 8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3) - '@typescript-eslint/visitor-keys': 8.38.0 - eslint: 9.32.0(jiti@2.5.1) + '@typescript-eslint/parser': 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) + '@typescript-eslint/scope-manager': 8.40.0 + '@typescript-eslint/type-utils': 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) + '@typescript-eslint/utils': 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) + '@typescript-eslint/visitor-keys': 8.40.0 + eslint: 9.34.0(jiti@2.5.1) graphemer: 1.4.0 ignore: 7.0.5 natural-compare: 1.4.0 - ts-api-utils: 2.1.0(typescript@5.8.3) - typescript: 5.8.3 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3)': + '@typescript-eslint/parser@8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)': dependencies: - '@typescript-eslint/scope-manager': 8.38.0 - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3) - '@typescript-eslint/visitor-keys': 8.38.0 + '@typescript-eslint/scope-manager': 8.40.0 + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2) + '@typescript-eslint/visitor-keys': 8.40.0 debug: 4.4.1 - eslint: 9.32.0(jiti@2.5.1) - typescript: 5.8.3 + eslint: 9.34.0(jiti@2.5.1) + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.38.0(typescript@5.8.3)': + '@typescript-eslint/project-service@8.40.0(typescript@5.9.2)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.38.0(typescript@5.8.3) - '@typescript-eslint/types': 8.38.0 + '@typescript-eslint/tsconfig-utils': 8.40.0(typescript@5.9.2) + '@typescript-eslint/types': 8.40.0 debug: 4.4.1 - typescript: 5.8.3 + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.38.0': + '@typescript-eslint/scope-manager@8.40.0': dependencies: - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/visitor-keys': 8.38.0 + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/visitor-keys': 8.40.0 - '@typescript-eslint/tsconfig-utils@8.38.0(typescript@5.8.3)': + '@typescript-eslint/tsconfig-utils@8.40.0(typescript@5.9.2)': dependencies: - typescript: 5.8.3 + typescript: 5.9.2 - '@typescript-eslint/type-utils@8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3)': + '@typescript-eslint/type-utils@8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)': dependencies: - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3) - '@typescript-eslint/utils': 8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3) + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2) + '@typescript-eslint/utils': 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) debug: 4.4.1 - eslint: 9.32.0(jiti@2.5.1) - ts-api-utils: 2.1.0(typescript@5.8.3) - typescript: 5.8.3 + eslint: 9.34.0(jiti@2.5.1) + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - supports-color '@typescript-eslint/types@8.38.0': {} - '@typescript-eslint/typescript-estree@8.38.0(typescript@5.8.3)': + '@typescript-eslint/types@8.40.0': {} + + '@typescript-eslint/typescript-estree@8.40.0(typescript@5.9.2)': dependencies: - '@typescript-eslint/project-service': 8.38.0(typescript@5.8.3) - '@typescript-eslint/tsconfig-utils': 8.38.0(typescript@5.8.3) - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/visitor-keys': 8.38.0 + '@typescript-eslint/project-service': 8.40.0(typescript@5.9.2) + '@typescript-eslint/tsconfig-utils': 8.40.0(typescript@5.9.2) + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/visitor-keys': 8.40.0 debug: 4.4.1 fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.7.2 - ts-api-utils: 2.1.0(typescript@5.8.3) - typescript: 5.8.3 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3)': + '@typescript-eslint/utils@8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)': dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.32.0(jiti@2.5.1)) - '@typescript-eslint/scope-manager': 8.38.0 - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3) - eslint: 9.32.0(jiti@2.5.1) - typescript: 5.8.3 + '@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1)) + '@typescript-eslint/scope-manager': 8.40.0 + '@typescript-eslint/types': 8.40.0 + '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2) + eslint: 9.34.0(jiti@2.5.1) + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.38.0': + '@typescript-eslint/visitor-keys@8.40.0': dependencies: - '@typescript-eslint/types': 8.38.0 + '@typescript-eslint/types': 8.40.0 eslint-visitor-keys: 4.2.1 '@vitest/expect@3.2.4': @@ -1864,13 +1870,13 @@ snapshots: chai: 5.2.1 tinyrainbow: 2.0.0 - '@vitest/mocker@3.2.4(vite@7.0.6(@types/node@20.19.9)(jiti@2.5.1)(yaml@2.8.0))': + '@vitest/mocker@3.2.4(vite@7.0.6(@types/node@20.19.11)(jiti@2.5.1)(yaml@2.8.0))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 7.0.6(@types/node@20.19.9)(jiti@2.5.1)(yaml@2.8.0) + vite: 7.0.6(@types/node@20.19.11)(jiti@2.5.1)(yaml@2.8.0) '@vitest/pretty-format@3.2.4': dependencies: @@ -2043,16 +2049,16 @@ snapshots: eslint-visitor-keys@4.2.1: {} - eslint@9.32.0(jiti@2.5.1): + eslint@9.34.0(jiti@2.5.1): dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.32.0(jiti@2.5.1)) + '@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1)) '@eslint-community/regexpp': 4.12.1 '@eslint/config-array': 0.21.0 - '@eslint/config-helpers': 0.3.0 - '@eslint/core': 0.15.1 + '@eslint/config-helpers': 0.3.1 + '@eslint/core': 0.15.2 '@eslint/eslintrc': 3.3.1 - '@eslint/js': 9.32.0 - '@eslint/plugin-kit': 0.3.4 + '@eslint/js': 9.34.0 + '@eslint/plugin-kit': 0.3.5 '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.3 @@ -2510,39 +2516,39 @@ snapshots: reusify@1.1.0: {} - rollup-plugin-esnext-to-nodenext@1.0.1(rollup@4.46.0): + rollup-plugin-esnext-to-nodenext@1.0.1(rollup@4.48.0): dependencies: - rollup: 4.46.0 + rollup: 4.48.0 ts-add-js-extension: 1.6.6 - rollup-plugin-node-externals@8.0.1(rollup@4.46.0): + rollup-plugin-node-externals@8.1.0(rollup@4.48.0): dependencies: - rollup: 4.46.0 + rollup: 4.48.0 - rollup@4.46.0: + rollup@4.48.0: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.46.0 - '@rollup/rollup-android-arm64': 4.46.0 - '@rollup/rollup-darwin-arm64': 4.46.0 - '@rollup/rollup-darwin-x64': 4.46.0 - '@rollup/rollup-freebsd-arm64': 4.46.0 - '@rollup/rollup-freebsd-x64': 4.46.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.46.0 - '@rollup/rollup-linux-arm-musleabihf': 4.46.0 - '@rollup/rollup-linux-arm64-gnu': 4.46.0 - '@rollup/rollup-linux-arm64-musl': 4.46.0 - '@rollup/rollup-linux-loongarch64-gnu': 4.46.0 - '@rollup/rollup-linux-ppc64-gnu': 4.46.0 - '@rollup/rollup-linux-riscv64-gnu': 4.46.0 - '@rollup/rollup-linux-riscv64-musl': 4.46.0 - '@rollup/rollup-linux-s390x-gnu': 4.46.0 - '@rollup/rollup-linux-x64-gnu': 4.46.0 - '@rollup/rollup-linux-x64-musl': 4.46.0 - '@rollup/rollup-win32-arm64-msvc': 4.46.0 - '@rollup/rollup-win32-ia32-msvc': 4.46.0 - '@rollup/rollup-win32-x64-msvc': 4.46.0 + '@rollup/rollup-android-arm-eabi': 4.48.0 + '@rollup/rollup-android-arm64': 4.48.0 + '@rollup/rollup-darwin-arm64': 4.48.0 + '@rollup/rollup-darwin-x64': 4.48.0 + '@rollup/rollup-freebsd-arm64': 4.48.0 + '@rollup/rollup-freebsd-x64': 4.48.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.48.0 + '@rollup/rollup-linux-arm-musleabihf': 4.48.0 + '@rollup/rollup-linux-arm64-gnu': 4.48.0 + '@rollup/rollup-linux-arm64-musl': 4.48.0 + '@rollup/rollup-linux-loongarch64-gnu': 4.48.0 + '@rollup/rollup-linux-ppc64-gnu': 4.48.0 + '@rollup/rollup-linux-riscv64-gnu': 4.48.0 + '@rollup/rollup-linux-riscv64-musl': 4.48.0 + '@rollup/rollup-linux-s390x-gnu': 4.48.0 + '@rollup/rollup-linux-x64-gnu': 4.48.0 + '@rollup/rollup-linux-x64-musl': 4.48.0 + '@rollup/rollup-win32-arm64-msvc': 4.48.0 + '@rollup/rollup-win32-ia32-msvc': 4.48.0 + '@rollup/rollup-win32-x64-msvc': 4.48.0 fsevents: 2.3.3 run-parallel@1.2.0: @@ -2606,11 +2612,11 @@ snapshots: ts-add-js-extension@1.6.6: dependencies: - typescript: 5.8.3 + typescript: 5.9.2 - ts-api-utils@2.1.0(typescript@5.8.3): + ts-api-utils@2.1.0(typescript@5.9.2): dependencies: - typescript: 5.8.3 + typescript: 5.9.2 tslib@2.8.1: {} @@ -2622,27 +2628,27 @@ snapshots: type-detect@4.1.0: {} - typedoc@0.28.7(typescript@5.8.3): + typedoc@0.28.10(typescript@5.9.2): dependencies: - '@gerrit0/mini-shiki': 3.8.1 + '@gerrit0/mini-shiki': 3.9.2 lunr: 2.3.9 markdown-it: 14.1.0 minimatch: 9.0.5 - typescript: 5.8.3 + typescript: 5.9.2 yaml: 2.8.0 - typescript-eslint@8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3): + typescript-eslint@8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2): dependencies: - '@typescript-eslint/eslint-plugin': 8.38.0(@typescript-eslint/parser@8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3))(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3) - '@typescript-eslint/parser': 8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3) - '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3) - '@typescript-eslint/utils': 8.38.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.8.3) - eslint: 9.32.0(jiti@2.5.1) - typescript: 5.8.3 + '@typescript-eslint/eslint-plugin': 8.40.0(@typescript-eslint/parser@8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) + '@typescript-eslint/parser': 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) + '@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2) + '@typescript-eslint/utils': 8.40.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) + eslint: 9.34.0(jiti@2.5.1) + typescript: 5.9.2 transitivePeerDependencies: - supports-color - typescript@5.8.3: {} + typescript@5.9.2: {} uc.micro@2.1.0: {} @@ -2656,13 +2662,13 @@ snapshots: dependencies: punycode: 2.3.1 - vite-node@3.2.4(@types/node@20.19.9)(jiti@2.5.1)(yaml@2.8.0): + vite-node@3.2.4(@types/node@20.19.11)(jiti@2.5.1)(yaml@2.8.0): dependencies: cac: 6.7.14 debug: 4.4.1 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.0.6(@types/node@20.19.9)(jiti@2.5.1)(yaml@2.8.0) + vite: 7.0.6(@types/node@20.19.11)(jiti@2.5.1)(yaml@2.8.0) transitivePeerDependencies: - '@types/node' - jiti @@ -2677,25 +2683,25 @@ snapshots: - tsx - yaml - vite@7.0.6(@types/node@20.19.9)(jiti@2.5.1)(yaml@2.8.0): + vite@7.0.6(@types/node@20.19.11)(jiti@2.5.1)(yaml@2.8.0): dependencies: esbuild: 0.25.8 fdir: 6.4.6(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.46.0 + rollup: 4.48.0 tinyglobby: 0.2.14 optionalDependencies: - '@types/node': 20.19.9 + '@types/node': 20.19.11 fsevents: 2.3.3 jiti: 2.5.1 yaml: 2.8.0 - vitest@3.2.4(@types/debug@4.1.12)(@types/node@20.19.9)(jiti@2.5.1)(yaml@2.8.0): + vitest@3.2.4(@types/debug@4.1.12)(@types/node@20.19.11)(jiti@2.5.1)(yaml@2.8.0): dependencies: '@types/chai': 5.2.2 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(vite@7.0.6(@types/node@20.19.9)(jiti@2.5.1)(yaml@2.8.0)) + '@vitest/mocker': 3.2.4(vite@7.0.6(@types/node@20.19.11)(jiti@2.5.1)(yaml@2.8.0)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 @@ -2713,12 +2719,12 @@ snapshots: tinyglobby: 0.2.14 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 7.0.6(@types/node@20.19.9)(jiti@2.5.1)(yaml@2.8.0) - vite-node: 3.2.4(@types/node@20.19.9)(jiti@2.5.1)(yaml@2.8.0) + vite: 7.0.6(@types/node@20.19.11)(jiti@2.5.1)(yaml@2.8.0) + vite-node: 3.2.4(@types/node@20.19.11)(jiti@2.5.1)(yaml@2.8.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/debug': 4.1.12 - '@types/node': 20.19.9 + '@types/node': 20.19.11 transitivePeerDependencies: - jiti - less @@ -2748,4 +2754,4 @@ snapshots: yocto-queue@0.1.0: {} - zod@3.25.76: {} + zod@4.1.0: {} diff --git a/src/version2/announcementBanner.ts b/src/version2/announcementBanner.ts index 3e877e3372..454e335129 100644 --- a/src/version2/announcementBanner.ts +++ b/src/version2/announcementBanner.ts @@ -1,51 +1,32 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { SetBannerParameters } from './parameters/setBannerParameters'; export class AnnouncementBanner { constructor(private client: Client) {} - - /** - * Returns the current announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getBanner(callback: Callback): Promise; /** - * Returns the current announcement banner configuration. + * Returns the current announcement banner configuration. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getBanner(callback?: never): Promise; - async getBanner(): Promise { - const config: Request = { + async getBanner() { + const request: Request = { url: '/rest/api/2/announcementBanner', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates the announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setBanner(parameters: Parameters.SetBanner, callback: Callback): Promise; - /** - * Updates the announcement banner configuration. + * Updates the announcement banner configuration. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setBanner(parameters: Parameters.SetBanner, callback?: never): Promise; - async setBanner(parameters: Parameters.SetBanner): Promise { - const config: Request = { + async setBanner(parameters: SetBannerParameters) { + const request: Request = { url: '/rest/api/2/announcementBanner', method: 'PUT', body: { @@ -56,6 +37,6 @@ export class AnnouncementBanner { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/appDataPolicies.ts b/src/version2/appDataPolicies.ts index 9492ca28a8..d105f04acc 100644 --- a/src/version2/appDataPolicies.ts +++ b/src/version2/appDataPolicies.ts @@ -1,41 +1,29 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetPoliciesParameters } from './parameters/getPoliciesParameters'; 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(): Promise { - const config: Request = { + async getPolicy() { + const request: Request = { url: '/rest/api/2/data-policy', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** 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): Promise { - const config: Request = { + async getPolicies(parameters: GetPoliciesParameters) { + const request: Request = { url: '/rest/api/2/data-policy/project', method: 'GET', query: { - ids: parameters?.ids, + ids: parameters.ids, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/appMigration.ts b/src/version2/appMigration.ts index 307cc79a07..4d888e0f6f 100644 --- a/src/version2/appMigration.ts +++ b/src/version2/appMigration.ts @@ -1,102 +1,52 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { UpdateIssueFieldsParameters } from './parameters/updateIssueFieldsParameters'; +import type { UpdateEntityPropertiesValueParameters } from './parameters/updateEntityPropertiesValueParameters'; +import type { WorkflowRuleSearchParameters } from './parameters/workflowRuleSearchParameters'; export class AppMigration { constructor(private client: Client) {} - - /** - * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom - * fields can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request - */ - async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback: Callback): Promise; /** - * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom - * fields can be updated. + * Updates the value of a custom field added by Connect apps on one or more issues. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request + * - The values of up to 200 custom fields can be updated. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request */ - async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback?: never): Promise; - async updateIssueFields(parameters: Parameters.UpdateIssueFields): Promise { - const config: Request = { + async updateIssueFields(parameters: UpdateIssueFieldsParameters) { + const request: Request = { url: '/rest/atlassian-connect/1/migration/field', method: 'PUT', - headers: { - 'Atlassian-Account-Id': parameters.accountId, - 'Atlassian-Transfer-Id': parameters.transferId, - }, body: { updateValueList: parameters.updateValueList, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for * use by Connect apps during app migration. */ - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback: Callback, - ): Promise; - /** - * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for - * use by Connect apps during app migration. - */ - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback?: never, - ): Promise; - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - ): Promise { - const config: Request = { + async updateEntityPropertiesValue(parameters: UpdateEntityPropertiesValueParameters) { + const request: Request = { url: `/rest/atlassian-connect/1/migration/properties/${parameters.entityType}`, method: 'PUT', - headers: { - 'Atlassian-Account-Id': parameters.accountId, - 'Atlassian-Transfer-Id': parameters.transferId, - 'Content-Type': 'application/json', - }, - body: parameters.entities, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect * app. */ - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback: Callback, - ): Promise; - /** - * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect - * app. - */ - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback?: never, - ): Promise; - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - ): Promise { - const config: Request = { + async workflowRuleSearch(parameters: WorkflowRuleSearchParameters) { + const request: Request = { url: '/rest/atlassian-connect/1/migration/workflow/rule/search', method: 'POST', - headers: { - 'Atlassian-Transfer-Id': parameters.transferId, - }, body: { expand: parameters.expand, ruleIds: parameters.ruleIds, @@ -104,6 +54,6 @@ export class AppMigration { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/appProperties.ts b/src/version2/appProperties.ts index 87ca24ed62..6ef9b9ed80 100644 --- a/src/version2/appProperties.ts +++ b/src/version2/appProperties.ts @@ -1,223 +1,124 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAddonPropertiesParameters } from './parameters/getAddonPropertiesParameters'; +import type { DeleteAddonPropertyParameters } from './parameters/deleteAddonPropertyParameters'; +import type { GetAddonPropertyParameters } from './parameters/getAddonPropertyParameters'; +import type { PutAddonPropertyParameters } from './parameters/putAddonPropertyParameters'; +import type { DeleteForgeAppPropertyParameters } from './parameters/deleteForgeAppPropertyParameters'; +import type { PutForgeAppPropertyParameters } from './parameters/putForgeAppPropertyParameters'; export class AppProperties { constructor(private client: Client) {} - - /** - * Gets all the properties of an app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app - * properties (stored against the same `app.connect.key`). - */ - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback: Callback, - ): Promise; /** - * Gets all the properties of an app. + * 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 can access Connect app - * properties (stored against the same `app.connect.key`). + * - **[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 can access Connect app properties (stored against the same `app.connect.key`). */ - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback?: never, - ): Promise; - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - ): Promise { - const addonKey = typeof parameters === 'string' ? parameters : parameters.addonKey; - - const config: Request = { - url: `/rest/atlassian-connect/1/addons/${addonKey}/properties`, + async getAddonProperties(parameters: GetAddonPropertiesParameters) { + const request: Request = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the key and value of an app's property. + * 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. Additionally, Forge apps can access Connect app - * properties (stored against the same `app.connect.key`). + * - **[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 can access Connect app properties (stored against the same `app.connect.key`). */ - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of an app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app - * properties (stored against the same `app.connect.key`). - */ - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback?: never, - ): Promise; - async getAddonProperty(parameters: Parameters.GetAddonProperty): Promise { - const config: Request = { + async deleteAddonProperty(parameters: DeleteAddonPropertyParameters) { + const request: Request = { url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'GET', + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the value of an app's property. Use this resource to store custom data for your app. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. + * 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 can access Connect app - * properties (stored against the same `app.connect.key`). + * - **[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 can access Connect app properties (stored against the same `app.connect.key`). */ - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of an app's property. Use this resource to store custom data for your app. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app - * properties (stored against the same `app.connect.key`). - */ - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback?: never, - ): Promise; - async putAddonProperty(parameters: Parameters.PutAddonProperty): Promise { - const config: Request = { + async getAddonProperty(parameters: GetAddonPropertyParameters) { + const request: Request = { url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - body: parameters.propertyValue, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. 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. Additionally, Forge apps can access Connect app - * properties (stored against the same `app.connect.key`). + * Sets the value of an app's property. Use this resource to store custom data for your app. * + * + * - The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. + * - 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(parameters: Parameters.DeleteAddonProperty): Promise { - const config: Request = { + async putAddonProperty(parameters: PutAddonPropertyParameters) { + const request: Request = { url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', + method: 'PUT', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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). 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/). - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Forge apps can make this request. - * - * 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, - callback: Callback, - ): Promise; - /** - * Sets the value of a Forge app's property. These values can be retrieved in [Jira - * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context - * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). 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/). - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Forge apps can make this request. + * Deletes a Forge app's property. * * - * 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. + * - **[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, - callback?: never, - ): Promise; - async putAppProperty(parameters: Parameters.PutAppProperty): Promise { - const config: Request = { + async deleteForgeAppProperty(parameters: DeleteForgeAppPropertyParameters) { + const request: Request = { url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, - method: 'PUT', - body: parameters.propertyValue, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a Forge app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Forge apps can make this request. - * - * 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; - /** - * Deletes a Forge app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Forge apps can make this request. - * - * 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. + * Sets the value of a Forge app's property. + * + * - These values can be retrieved in [Jira expressions](/cloud/jira/platform/jira-expressions/) + * - Through the `app` [context variable](/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](/platform/forge/runtime-reference/storage-api/). + * - + * - The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Forge apps can make this request. + * - + * - 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(parameters: Parameters.DeleteAppProperty): Promise { - const config: Request = { + async putForgeAppProperty(parameters: PutForgeAppPropertyParameters) { + const request: Request = { url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, - method: 'DELETE', + method: 'PUT', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/applicationRoles.ts b/src/version2/applicationRoles.ts index 5893e94085..def574d581 100644 --- a/src/version2/applicationRoles.ts +++ b/src/version2/applicationRoles.ts @@ -1,67 +1,37 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetApplicationRoleParameters } from './parameters/getApplicationRoleParameters'; export class ApplicationRoles { constructor(private client: Client) {} - - /** - * Returns all application roles. In Jira, application roles are managed using the [Application access - * configuration](https://confluence.atlassian.com/x/3YxjL) page. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllApplicationRoles(callback: Callback): Promise; /** * Returns all application roles. In Jira, application roles are managed using the [Application access - * configuration](https://confluence.atlassian.com/x/3YxjL) page. + * configuration](https://confluence.atlassian.com/x/3YxjL) page. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAllApplicationRoles(callback?: never): Promise; - async getAllApplicationRoles(): Promise { - const config: Request = { + async getAllApplicationRoles() { + const request: Request = { url: '/rest/api/2/applicationrole', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns an application role. + * Returns an application role. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback: Callback, - ): Promise; - /** - * Returns an application role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback?: never, - ): Promise; - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters.key; - - const config: Request = { - url: `/rest/api/2/applicationrole/${key}`, + async getApplicationRole(parameters: GetApplicationRoleParameters) { + const request: Request = { + url: `/rest/api/2/applicationrole/${parameters.key}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/auditRecords.ts b/src/version2/auditRecords.ts index f72f3c9cbf..a90cf7a692 100644 --- a/src/version2/auditRecords.ts +++ b/src/version2/auditRecords.ts @@ -1,76 +1,45 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAuditRecordsParameters } from './parameters/getAuditRecordsParameters'; export class AuditRecords { constructor(private client: Client) {} - - /** - * Returns a list of audit records. The list can be filtered to include items: - * - * - Where each item in `filter` has at least one match in any of these fields: - * - * - `summary` - * - `category` - * - `eventSource` - * - `objectItem.name` If the object is a user, account ID is available to filter. - * - `objectItem.parentName` - * - `objectItem.typeName` - * - `changedValues.changedFrom` - * - `changedValues.changedTo` - * - `remoteAddress` - * - * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and - * `"category": "group management"` is returned. - * - Created on or after a date and time. - * - Created on or before a date and time. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAuditRecords( - parameters: Parameters.GetAuditRecords | undefined, - callback: Callback, - ): Promise; /** - * Returns a list of audit records. The list can be filtered to include items: - * - * - Where each item in `filter` has at least one match in any of these fields: - * - * - `summary` - * - `category` - * - `eventSource` - * - `objectItem.name` If the object is a user, account ID is available to filter. - * - `objectItem.parentName` - * - `objectItem.typeName` - * - `changedValues.changedFrom` - * - `changedValues.changedTo` - * - `remoteAddress` - * - * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and + * Returns a list of audit records. The list can be filtered to include items: * + * + * - - Where each item in `filter` has at least one match in any of these fields: + * - + * - - `summary` + * - - `category` + * - - `eventSource` + * - - `objectItem.name` If the object is a user, account ID is available to filter. + * - - `objectItem.parentName` + * - - `objectItem.typeName` + * - - `changedValues.changedFrom` + * - - `changedValues.changedTo` + * - - `remoteAddress` + * - + * - For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and * `"category": "group management"` is returned. - * - Created on or after a date and time. - * - Created on or before a date and time. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - - Created on or after a date and time. + * - - Created or or before a date and time. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAuditRecords(parameters?: Parameters.GetAuditRecords, callback?: never): Promise; - async getAuditRecords(parameters?: Parameters.GetAuditRecords): Promise { - const config: Request = { + async getAuditRecords(parameters: GetAuditRecordsParameters) { + const request: Request = { url: '/rest/api/2/auditing/record', method: 'GET', query: { - offset: parameters?.offset, - limit: parameters?.limit, - filter: parameters?.filter, - from: parameters?.from, - to: parameters?.to, + offset: parameters.offset, + limit: parameters.limit, + filter: parameters.filter, + from: parameters.from, + to: parameters.to, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/avatars.ts b/src/version2/avatars.ts index 11fa94f304..427950b9c3 100644 --- a/src/version2/avatars.ts +++ b/src/version2/avatars.ts @@ -1,187 +1,135 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAllSystemAvatarsParameters } from './parameters/getAllSystemAvatarsParameters'; +import type { GetAvatarsParameters } from './parameters/getAvatarsParameters'; +import type { StoreAvatarParameters } from './parameters/storeAvatarParameters'; +import type { DeleteAvatarParameters } from './parameters/deleteAvatarParameters'; +import type { GetAvatarImageByTypeParameters } from './parameters/getAvatarImageByTypeParameters'; +import type { GetAvatarImageByIDParameters } from './parameters/getAvatarImageByIDParameters'; +import type { GetAvatarImageByOwnerParameters } from './parameters/getAvatarImageByOwnerParameters'; 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, 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, - callback: Callback, - ): Promise; /** * Returns a list of system avatar details by owner type, where the owner types are issue type, project, user or - * priority. + * priority. * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback?: never, - ): Promise; - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - ): Promise { - const type = typeof parameters === 'string' ? parameters : parameters.type; - - const config: Request = { - url: `/rest/api/2/avatar/${type}/system`, + async getAllSystemAvatars(parameters: GetAllSystemAvatarsParameters) { + const request: Request = { + url: `/rest/api/2/avatar/${parameters.type}/system`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the system and custom avatars for a project, issue type or priority. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - * - For system avatars, none. - * - For priority avatars, none. + * Returns the system and custom avatars for a project, issue type or priority. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + * - - For system avatars, none. + * - - For priority avatars, none. */ - async getAvatars(parameters: Parameters.GetAvatars, callback: Callback): Promise; - /** - * Returns the system and custom avatars for a project, issue type or priority. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - * - For system avatars, none. - * - For priority avatars, none. - */ - async getAvatars(parameters: Parameters.GetAvatars, callback?: never): Promise; - async getAvatars(parameters: Parameters.GetAvatars): Promise { - const config: Request = { + async getAvatars(parameters: GetAvatarsParameters) { + const request: Request = { url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Loads a custom avatar for a project, issue type or priority. - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar use: - * - * - [Update issue - * type](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-types/#api-rest-api-2-issuetype-id-put) - * to set it as the issue type's displayed avatar. - * - [Set project - * avatar](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-avatars/#api-rest-api-2-project-projectidorkey-avatar-put) - * to set it as the project's displayed avatar. - * - [Update - * priority](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-priorities/#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, issue type or priority. - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar use: - * - * - [Update issue - * type](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-types/#api-rest-api-2-issuetype-id-put) - * to set it as the issue type's displayed avatar. - * - [Set project - * avatar](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-avatars/#api-rest-api-2-project-projectidorkey-avatar-put) - * to set it as the project's displayed avatar. - * - [Update - * priority](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-priorities/#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). + * 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. + * - + * - The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * - + * - After creating the avatar use: + * - + * - - [Update issue + * type](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-types/#api-rest-api-2-issuetype-id-put) + * to set it as the issue type's displayed avatar. + * - - [Set project + * avatar](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-avatars/#api-rest-api-2-project-projectidorkey-avatar-put) + * to set it as the project's displayed avatar. + * - - [Update + * priority](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-priorities/#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?: never): Promise; - async storeAvatar(parameters: Parameters.StoreAvatar): Promise { - const config: Request = { + async storeAvatar(parameters: StoreAvatarParameters) { + const request: Request = { url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, method: 'POST', - headers: { - 'X-Atlassian-Token': 'no-check', - 'Content-Type': parameters.mimeType, - }, query: { x: parameters.x, y: parameters.y, - size: parameters.size ?? 0, + size: parameters.size, }, - body: parameters.avatar, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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, issue type or priority. + * 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). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: never): Promise; - async deleteAvatar(parameters: Parameters.DeleteAvatar): Promise { - const config: Request = { + async deleteAvatar(parameters: DeleteAvatarParameters) { + const request: Request = { url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.owningObjectId}/avatar/${parameters.id}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the default project, issue type or priority 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. + * - 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): Promise { - const config: Request = { + async getAvatarImageByType(parameters: GetAvatarImageByTypeParameters) { + const request: Request = { url: `/rest/api/2/universal_avatar/view/type/${parameters.type}`, method: 'GET', query: { @@ -190,54 +138,25 @@ export class Avatars { }, }; - const response = await this.client.sendRequestWithRawResponse(config); - - const contentTypeWithEncoding = response.headers.get('content-type') ?? ''; - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - const avatar = await response.arrayBuffer(); - - return { contentType, avatar } as T; + return this.client.sendRequest(request); } /** - * Returns a project, issue type or priority avatar image by ID. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - * - For priority avatars, none. - */ - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback: Callback, - ): Promise; - /** - * Returns a project, issue type or priority avatar image by ID. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - * - For priority avatars, none. + * Returns a project, issue type or priority avatar image by ID. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - For system avatars, none. + * - - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + * - - For priority avatars, none. */ - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback?: never, - ): Promise; - async getAvatarImageByID(parameters: Parameters.GetAvatarImageByID): Promise { - const config: Request = { + async getAvatarImageByID(parameters: GetAvatarImageByIDParameters) { + const request: Request = { url: `/rest/api/2/universal_avatar/view/type/${parameters.type}/avatar/${parameters.id}`, method: 'GET', query: { @@ -246,54 +165,25 @@ export class Avatars { }, }; - const response = await this.client.sendRequestWithRawResponse(config); - - const contentType = response.headers.get('content-type'); - const avatar = await response.arrayBuffer(); - - return { contentType, avatar } as T; + return this.client.sendRequest(request); } /** - * Returns the avatar image for a project, issue type or priority. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - * - For priority avatars, none. - */ - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback: Callback, - ): Promise; - /** - * Returns the avatar image for a project, issue type or priority. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - * - For priority avatars, none. + * Returns the avatar image for a project, issue type or priority. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - For system avatars, none. + * - - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + * - - For priority avatars, none. */ - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback?: never, - ): Promise; - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - ): Promise { - const config: Request = { + async getAvatarImageByOwner(parameters: GetAvatarImageByOwnerParameters) { + const request: Request = { url: `/rest/api/2/universal_avatar/view/type/${parameters.type}/owner/${parameters.entityId}`, method: 'GET', query: { @@ -302,11 +192,6 @@ export class Avatars { }, }; - const response = await this.client.sendRequestWithRawResponse(config); - - const contentType = response.headers.get('content-type'); - const content = await response.arrayBuffer(); - - return { contentType, content } as T; + return this.client.sendRequest(request); } } diff --git a/src/version2/classificationLevels.ts b/src/version2/classificationLevels.ts index 6134d4b2e6..c691c75f2d 100644 --- a/src/version2/classificationLevels.ts +++ b/src/version2/classificationLevels.ts @@ -1,42 +1,24 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAllUserDataClassificationLevelsParameters } from './parameters/getAllUserDataClassificationLevelsParameters'; 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. + * Returns all classification levels. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - **[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, - ): Promise { - const config: Request = { + async getAllUserDataClassificationLevels(parameters: GetAllUserDataClassificationLevelsParameters) { + const request: Request = { url: '/rest/api/2/classification-levels', method: 'GET', query: { - status: parameters?.status, - orderBy: parameters?.orderBy, + status: parameters.status, + orderBy: parameters.orderBy, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/dashboards.ts b/src/version2/dashboards.ts index 169445fa1b..cfdb717a81 100644 --- a/src/version2/dashboards.ts +++ b/src/version2/dashboards.ts @@ -1,68 +1,53 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; -import { paramSerializer } from '../paramSerializer'; +import type { GetAllDashboardsParameters } from './parameters/getAllDashboardsParameters'; +import type { CreateDashboardParameters } from './parameters/createDashboardParameters'; +import type { BulkEditDashboardsParameters } from './parameters/bulkEditDashboardsParameters'; +import type { GetDashboardsPaginatedParameters } from './parameters/getDashboardsPaginatedParameters'; +import type { GetAllGadgetsParameters } from './parameters/getAllGadgetsParameters'; +import type { AddGadgetParameters } from './parameters/addGadgetParameters'; +import type { RemoveGadgetParameters } from './parameters/removeGadgetParameters'; +import type { UpdateGadgetParameters } from './parameters/updateGadgetParameters'; +import type { GetDashboardItemPropertyKeysParameters } from './parameters/getDashboardItemPropertyKeysParameters'; +import type { DeleteDashboardItemPropertyParameters } from './parameters/deleteDashboardItemPropertyParameters'; +import type { GetDashboardItemPropertyParameters } from './parameters/getDashboardItemPropertyParameters'; +import type { SetDashboardItemPropertyParameters } from './parameters/setDashboardItemPropertyParameters'; +import type { DeleteDashboardParameters } from './parameters/deleteDashboardParameters'; +import type { GetDashboardParameters } from './parameters/getDashboardParameters'; +import type { UpdateDashboardParameters } from './parameters/updateDashboardParameters'; +import type { CopyDashboardParameters } from './parameters/copyDashboardParameters'; export class Dashboards { constructor(private client: Client) {} - /** * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or - * owned dashboards. - * - * This operation can be accessed anonymously. + * owned dashboards. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAllDashboards( - parameters: Parameters.GetAllDashboards | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or - * owned dashboards. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllDashboards( - parameters?: Parameters.GetAllDashboards, - callback?: never, - ): Promise; - async getAllDashboards(parameters?: Parameters.GetAllDashboards): Promise { - const config: Request = { + async getAllDashboards(parameters: GetAllDashboardsParameters) { + const request: Request = { url: '/rest/api/2/dashboard', method: 'GET', query: { - filter: parameters?.filter, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, + filter: parameters.filter, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async createDashboard( - parameters: Parameters.CreateDashboard, - callback: Callback, - ): Promise; - /** - * Creates a dashboard. + * Creates a dashboard. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - **[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): Promise { - const config: Request = { + async createDashboard(parameters: CreateDashboardParameters) { + const request: Request = { url: '/rest/api/2/dashboard', method: 'POST', query: { @@ -76,35 +61,18 @@ export class Dashboards { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. * * - * The dashboards to be updated must be owned by the user, or the user must be an administrator. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * - + * - The dashboards to be updated must be owned by the user, or the user must be an administrator. */ - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback: Callback, - ): Promise; - /** - * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboards to be updated must be owned by the user, or the user must be an administrator. - */ - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback?: never, - ): Promise; - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - ): Promise { - const config: Request = { + async bulkEditDashboards(parameters: BulkEditDashboardsParameters) { + const request: Request = { url: '/rest/api/2/dashboard/bulk/edit', method: 'PUT', body: { @@ -116,165 +84,97 @@ export class Dashboards { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Gets a list of all available gadgets that can be added to all dashboards. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllAvailableDashboardGadgets( - callback: Callback, - ): Promise; - /** - * Gets a list of all available gadgets that can be added to all dashboards. + * Gets a list of all available gadgets that can be added to all dashboards. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAllAvailableDashboardGadgets(callback?: never): Promise; - async getAllAvailableDashboardGadgets(): Promise { - const config: Request = { + async getAllAvailableDashboardGadgets() { + const request: Request = { url: '/rest/api/2/dashboard/gadgets', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * dashboards. This operation is similar to [Get dashboards](#api-rest-api-2-dashboard-get) except that the results * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. - * When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * following dashboards that match the query parameters are returned: - * - * - Dashboards owned by the user. Not returned for anonymous users. - * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. - * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. - * - Dashboards shared with a public project. - * - Dashboards shared with the public. - */ - async getDashboardsPaginated( - parameters: Parameters.GetDashboardsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * dashboards. This operation is similar to [Get dashboards](#api-rest-api-2-dashboard-get) except that the results - * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. - * When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * following dashboards that match the query parameters are returned: - * - * - Dashboards owned by the user. Not returned for anonymous users. - * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. - * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. - * - Dashboards shared with a public project. - * - Dashboards shared with the public. - */ - async getDashboardsPaginated( - parameters?: Parameters.GetDashboardsPaginated, - callback?: never, - ): Promise; - async getDashboardsPaginated( - parameters?: Parameters.GetDashboardsPaginated, - ): Promise { - const config: Request = { + * When multiple attributes are specified only filters matching all attributes are returned. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * following dashboards that match the query parameters are returned: + * - + * - - Dashboards owned by the user. Not returned for anonymous users. + * - - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. + * - - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. + * - - Dashboards shared with a public project. + * - - Dashboards shared with the public. + */ + async getDashboardsPaginated(parameters: GetDashboardsPaginatedParameters) { + const request: Request = { url: '/rest/api/2/dashboard/search', method: 'GET', query: { - dashboardName: parameters?.dashboardName, - accountId: parameters?.accountId, - groupname: parameters?.groupname, - groupId: parameters?.groupId, - projectId: parameters?.projectId, - orderBy: parameters?.orderBy, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - status: parameters?.status, - expand: parameters?.expand, + dashboardName: parameters.dashboardName, + accountId: parameters.accountId, + owner: parameters.owner, + groupname: parameters.groupname, + groupId: parameters.groupId, + projectId: parameters.projectId, + orderBy: parameters.orderBy, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + status: parameters.status, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a list of dashboard gadgets on a dashboard. - * - * This operation returns: - * - * - Gadgets from a list of IDs, when `id` is set. - * - Gadgets with a module key, when `moduleKey` is set. - * - Gadgets from a list of URIs, when `uri` is set. - * - All gadgets, when no other parameters are set. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllGadgets( - parameters: Parameters.GetAllGadgets | string, - callback: Callback, - ): Promise; - /** - * Returns a list of dashboard gadgets on a dashboard. - * - * This operation returns: - * - * - Gadgets from a list of IDs, when `id` is set. - * - Gadgets with a module key, when `moduleKey` is set. - * - Gadgets from a list of URIs, when `uri` is set. - * - All gadgets, when no other parameters are set. + * Returns a list of dashboard gadgets on a dashboard. * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - This operation returns: + * - + * - - Gadgets from a list of IDs, when `id` is set. + * - - Gadgets with a module key, when `moduleKey` is set. + * - - Gadgets from a list of URIs, when `uri` is set. + * - - All gadgets, when no other parameters are set. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAllGadgets( - parameters: Parameters.GetAllGadgets | string, - callback?: never, - ): Promise; - async getAllGadgets( - parameters: Parameters.GetAllGadgets | string, - ): Promise { - const dashboardId = typeof parameters === 'string' ? parameters : parameters.dashboardId; - - const config: Request = { - url: `/rest/api/2/dashboard/${dashboardId}/gadget`, + async getAllGadgets(parameters: GetAllGadgetsParameters) { + const request: Request = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, method: 'GET', query: { - moduleKey: typeof parameters !== 'string' && paramSerializer('moduleKey', parameters.moduleKey), - uri: typeof parameters !== 'string' && parameters.uri, - gadgetId: typeof parameters !== 'string' && paramSerializer('gadgetId', parameters.gadgetId), + moduleKey: parameters.moduleKey, + uri: parameters.uri, + gadgetId: parameters.gadgetId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Adds a gadget to a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async addGadget(parameters: Parameters.AddGadget, callback: Callback): Promise; - /** - * Adds a gadget to a dashboard. + * Adds a gadget to a dashboard. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async addGadget(parameters: Parameters.AddGadget, callback?: never): Promise; - async addGadget(parameters: Parameters.AddGadget): Promise { - const config: Request = { + async addGadget(parameters: AddGadgetParameters) { + const request: Request = { url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, method: 'POST', body: { @@ -287,23 +187,33 @@ export class Dashboards { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Changes the title, position, and color of the gadget on a dashboard. + * Removes a dashboard gadget from a dashboard. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied + * position. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async updateGadget(parameters: Parameters.UpdateGadget, callback: Callback): Promise; + async removeGadget(parameters: RemoveGadgetParameters) { + const request: Request = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** - * Changes the title, position, and color of the gadget on a dashboard. + * Changes the title, position, and color of the gadget on a dashboard. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async updateGadget(parameters: Parameters.UpdateGadget, callback?: never): Promise; - async updateGadget(parameters: Parameters.UpdateGadget): Promise { - const config: Request = { + async updateGadget(parameters: UpdateGadgetParameters) { + const request: Request = { url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, method: 'PUT', body: { @@ -313,315 +223,162 @@ export class Dashboards { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Removes a dashboard gadget from a dashboard. + * Returns the keys of all properties for a dashboard item. * * - * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied - * position. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System + * dashboard. The System dashboard is considered to be shared with all other users, and is accessible to anonymous + * users when Jira\u2019s anonymous access is permitted. */ - async removeGadget(parameters: Parameters.RemoveGadget, callback: Callback): Promise; - /** - * Removes a dashboard gadget from a dashboard. - * - * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied - * position. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async removeGadget(parameters: Parameters.RemoveGadget, callback?: never): Promise; - async removeGadget(parameters: Parameters.RemoveGadget): Promise { - const config: Request = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, - method: 'DELETE', + async getDashboardItemPropertyKeys(parameters: GetDashboardItemPropertyKeysParameters) { + const request: Request = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties`, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the keys of all properties for a dashboard item. + * Deletes a dashboard item property. * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard 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. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. */ - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a dashboard item. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback?: never, - ): Promise; - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - ): Promise { - const config: Request = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties`, - method: 'GET', + async deleteDashboardItemProperty(parameters: DeleteDashboardItemPropertyParameters) { + const request: Request = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the key and value of a dashboard item property. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of a dashboard item property. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback?: never, - ): Promise; - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - ): Promise { - const config: Request = { + * Returns the key and value of a dashboard item property. * + * + * - A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see + * [Adding and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * - + * - When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * - + * - There is no resource to set or get dashboard items. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System + * dashboard. The System dashboard is considered to be shared with all other users, and is accessible to anonymous + * users when Jira\u2019s anonymous access is permitted. + */ + async getDashboardItemProperty(parameters: GetDashboardItemPropertyParameters) { + const request: Request = { url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard - * item. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard - * item. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback?: never, - ): Promise; - async setDashboardItemProperty(parameters: Parameters.SetDashboardItemProperty): Promise { - const config: Request = { + * item. * + * + * - A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see + * [Adding and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * - + * - When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * - + * - There is no resource to set or get dashboard items. + * - + * - The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async setDashboardItemProperty(parameters: SetDashboardItemPropertyParameters) { + const request: Request = { url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, method: 'PUT', - headers: { - 'Content-Type': 'application/json', - }, - body: parameters.propertyValue, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a dashboard item property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Deletes a dashboard item property. + * Deletes a dashboard. * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * - + * - The dashboard to be deleted must be owned by the user. */ - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback?: never, - ): Promise; - async deleteDashboardItemProperty(parameters: Parameters.DeleteDashboardItemProperty): Promise { - const config: Request = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + async deleteDashboard(parameters: DeleteDashboardParameters) { + const request: Request = { + url: `/rest/api/2/dashboard/${parameters.id}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a dashboard. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * Returns a dashboard. * * - * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the - * System dashboard. The System dashboard is considered to be shared with all other users. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - + * - However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the + * System dashboard. The System dashboard is considered to be shared with all other users. */ - async getDashboard( - parameters: Parameters.GetDashboard | string, - callback: Callback, - ): Promise; - /** - * Returns a dashboard. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - * - * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the - * System dashboard. The System dashboard is considered to be shared with all other users. - */ - async getDashboard(parameters: Parameters.GetDashboard | string, callback?: never): Promise; - async getDashboard(parameters: Parameters.GetDashboard | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/dashboard/${id}`, + async getDashboard(parameters: GetDashboardParameters) { + const request: Request = { + url: `/rest/api/2/dashboard/${parameters.id}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a dashboard, replacing all the dashboard details with those provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be updated must be owned by the user. - */ - async updateDashboard( - parameters: Parameters.UpdateDashboard, - callback: Callback, - ): Promise; - /** - * Updates a dashboard, replacing all the dashboard details with those provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * Updates a dashboard, replacing all the dashboard details with those provided. * * - * The dashboard to be updated must be owned by the user. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * - + * - The dashboard to be updated must be owned by the user. */ - async updateDashboard(parameters: Parameters.UpdateDashboard, callback?: never): Promise; - async updateDashboard(parameters: Parameters.UpdateDashboard): Promise { - const config: Request = { + async updateDashboard(parameters: UpdateDashboardParameters) { + const request: Request = { url: `/rest/api/2/dashboard/${parameters.id}`, method: 'PUT', query: { @@ -635,57 +392,18 @@ export class Dashboards { }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be deleted must be owned by the user. - */ - async deleteDashboard( - parameters: Parameters.DeleteDashboard | string, - callback: Callback, - ): Promise; - /** - * Deletes a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be deleted must be owned by the user. - */ - async deleteDashboard(parameters: Parameters.DeleteDashboard | string, callback?: never): Promise; - async deleteDashboard(parameters: Parameters.DeleteDashboard | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/dashboard/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be copied must be owned by or shared with the user. - */ - async copyDashboard(parameters: Parameters.CopyDashboard, callback: Callback): Promise; - /** - * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. * * - * The dashboard to be copied must be owned by or shared with the user. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * - + * - The dashboard to be copied must be owned by or shared with the user. */ - async copyDashboard(parameters: Parameters.CopyDashboard, callback?: never): Promise; - async copyDashboard(parameters: Parameters.CopyDashboard): Promise { - const config: Request = { + async copyDashboard(parameters: CopyDashboardParameters) { + const request: Request = { url: `/rest/api/2/dashboard/${parameters.id}/copy`, method: 'POST', query: { @@ -699,6 +417,6 @@ export class Dashboards { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/dynamicModules.ts b/src/version2/dynamicModules.ts index 54ecaa6aad..ab1739eee5 100644 --- a/src/version2/dynamicModules.ts +++ b/src/version2/dynamicModules.ts @@ -1,87 +1,58 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { RemoveModulesParameters } from './parameters/removeModulesParameters'; +import type { RegisterModulesParameters } from './parameters/registerModulesParameters'; export class DynamicModules { constructor(private client: Client) {} - - /** - * Returns all modules registered dynamically by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async getModules(callback: Callback): Promise; /** - * Returns all modules registered dynamically by the calling app. + * Remove all or a list of modules registered by the calling app. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. */ - async getModules(callback?: never): Promise; - async getModules(): Promise { - const config: Request = { + async removeModules(parameters: RemoveModulesParameters) { + const request: Request = { url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'GET', + method: 'DELETE', + query: { + moduleKey: parameters.moduleKey, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Registers a list of modules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async registerModules( - parameters: Parameters.RegisterModules | undefined, - callback: Callback, - ): Promise; - /** - * Registers a list of modules. + * Returns all modules registered dynamically by the calling app. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. */ - async registerModules(parameters?: Parameters.RegisterModules, callback?: never): Promise; - async registerModules(parameters?: Parameters.RegisterModules): Promise { - const config: Request = { + async getModules() { + const request: Request = { url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'POST', - body: { - modules: parameters?.modules, - }, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Remove all or a list of modules registered by the calling app. + * Registers a list of modules. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. */ - async removeModules(parameters: Parameters.RemoveModules | undefined, callback: Callback): Promise; - /** - * Remove all or a list of modules registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async removeModules(parameters?: Parameters.RemoveModules, callback?: never): Promise; - async removeModules(parameters?: Parameters.RemoveModules): Promise { - const config: Request = { + async registerModules(parameters: RegisterModulesParameters) { + const request: Request = { url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'DELETE', - query: { - moduleKey: parameters?.moduleKey, + method: 'POST', + body: { + modules: parameters.modules, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/filterSharing.ts b/src/version2/filterSharing.ts index 9727821945..17d90dcc96 100644 --- a/src/version2/filterSharing.ts +++ b/src/version2/filterSharing.ts @@ -1,244 +1,137 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { SetDefaultShareScopeParameters } from './parameters/setDefaultShareScopeParameters'; +import type { GetSharePermissionsParameters } from './parameters/getSharePermissionsParameters'; +import type { AddSharePermissionParameters } from './parameters/addSharePermissionParameters'; +import type { DeleteSharePermissionParameters } from './parameters/deleteSharePermissionParameters'; +import type { GetSharePermissionParameters } from './parameters/getSharePermissionParameters'; export class FilterSharing { constructor(private client: Client) {} - - /** - * Returns the default sharing settings for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getDefaultShareScope(callback: Callback): Promise; /** - * Returns the default sharing settings for new filters and dashboards for a user. + * Returns the default sharing settings for new filters and dashboards for a user. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async getDefaultShareScope(callback?: never): Promise; - async getDefaultShareScope(): Promise { - const config: Request = { + async getDefaultShareScope() { + const request: Request = { url: '/rest/api/2/filter/defaultShareScope', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the default sharing for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback: Callback, - ): Promise; - /** - * Sets the default sharing for new filters and dashboards for a user. + * Sets the default sharing for new filters and dashboards for a user. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback?: never, - ): Promise; - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - ): Promise { - const scope = typeof parameters === 'string' ? parameters : parameters.scope; - - const config: Request = { + async setDefaultShareScope(parameters: SetDefaultShareScopeParameters) { + const request: Request = { url: '/rest/api/2/filter/defaultShareScope', method: 'PUT', body: { - scope, + scope: parameters.scope, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or - * the public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, share permissions are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback: Callback, - ): Promise; - /** - * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or - * the public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, share permissions are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. + * the public. Sharing with all logged-in users or the public is known as a global share permission. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, share permissions are only returned for: + * - + * - - Filters owned by the user. + * - - Filters shared with a group that the user is a member of. + * - - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - - Filters shared with a public project. + * - - Filters shared with the public. */ - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback?: never, - ): Promise; - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/filter/${id}/permission`, + async getSharePermissions(parameters: GetSharePermissionsParameters) { + const request: Request = { + url: `/rest/api/2/filter/${parameters.id}/permission`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the - * public) it will overwrite all share permissions for the filter. - * - * Be aware that this operation uses different objects for updating share permissions compared to [Update - * filter](#api-rest-api-2-filter-id-put). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Share - * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the - * filter. - */ - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback: Callback, - ): Promise; - /** - * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the - * public) it will overwrite all share permissions for the filter. - * - * Be aware that this operation uses different objects for updating share permissions compared to [Update - * filter](#api-rest-api-2-filter-id-put). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Share - * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the - * filter. + * public) it will overwrite all share permissions for the filter. * + * + * - Be aware that this operation uses different objects for updating share permissions compared to [Update + * filter](#api-rest-api-2-filter-id-put). + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Share + * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the + * filter. */ - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback?: never, - ): Promise; - async addSharePermission(parameters: Parameters.AddSharePermission): Promise { - const config: Request = { + async addSharePermission(parameters: AddSharePermissionParameters) { + const request: Request = { url: `/rest/api/2/filter/${parameters.id}/permission`, method: 'POST', body: { - type: parameters.type, - projectId: parameters.projectId, + accountId: parameters.accountId, + groupId: parameters.groupId, groupname: parameters.groupname, + projectId: parameters.projectId, projectRoleId: parameters.projectRoleId, - accountId: parameters.accountId, rights: parameters.rights, - groupId: parameters.groupId, + type: parameters.type, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the - * public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, a share permission is only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback: Callback, - ): Promise; - /** - * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the - * public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, a share permission is only returned for: + * Deletes a share permission from a filter. * * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira and the user must own the filter. */ - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback?: never, - ): Promise; - async getSharePermission(parameters: Parameters.GetSharePermission): Promise { - const config: Request = { + async deleteSharePermission(parameters: DeleteSharePermissionParameters) { + const request: Request = { url: `/rest/api/2/filter/${parameters.id}/permission/${parameters.permissionId}`, - method: 'GET', + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a share permission from a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira and the user must own the filter. - */ - async deleteSharePermission( - parameters: Parameters.DeleteSharePermission, - callback: Callback, - ): Promise; - /** - * Deletes a share permission from a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira and the user must own the filter. + * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the + * public. Sharing with all logged-in users or the public is known as a global share permission. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, a share permission is only returned for: + * - + * - - Filters owned by the user. + * - - Filters shared with a group that the user is a member of. + * - - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - - Filters shared with a public project. + * - - Filters shared with the public. */ - async deleteSharePermission(parameters: Parameters.DeleteSharePermission, callback?: never): Promise; - async deleteSharePermission(parameters: Parameters.DeleteSharePermission): Promise { - const config: Request = { + async getSharePermission(parameters: GetSharePermissionParameters) { + const request: Request = { url: `/rest/api/2/filter/${parameters.id}/permission/${parameters.permissionId}`, - method: 'DELETE', + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/filters.ts b/src/version2/filters.ts index 6a0bc5420b..f0f7b4d227 100644 --- a/src/version2/filters.ts +++ b/src/version2/filters.ts @@ -1,30 +1,30 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { CreateFilterParameters } from './parameters/createFilterParameters'; +import type { GetFavouriteFiltersParameters } from './parameters/getFavouriteFiltersParameters'; +import type { GetMyFiltersParameters } from './parameters/getMyFiltersParameters'; +import type { GetFiltersPaginatedParameters } from './parameters/getFiltersPaginatedParameters'; +import type { DeleteFilterParameters } from './parameters/deleteFilterParameters'; +import type { GetFilterParameters } from './parameters/getFilterParameters'; +import type { UpdateFilterParameters } from './parameters/updateFilterParameters'; +import type { ResetColumnsParameters } from './parameters/resetColumnsParameters'; +import type { GetColumnsParameters } from './parameters/getColumnsParameters'; +import type { SetColumnsParameters } from './parameters/setColumnsParameters'; +import type { DeleteFavouriteForFilterParameters } from './parameters/deleteFavouriteForFilterParameters'; +import type { SetFavouriteForFilterParameters } from './parameters/setFavouriteForFilterParameters'; +import type { ChangeFilterOwnerParameters } from './parameters/changeFilterOwnerParameters'; export class Filters { constructor(private client: Client) {} - - /** - * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-2-filter-post). The - * filter is not selected as a favorite. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async createFilter(parameters: Parameters.CreateFilter, callback: Callback): Promise; /** * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-2-filter-post). The - * filter is not selected as a favorite. + * filter is not selected as a favorite. * * - * **[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:** + * Permission to access Jira. */ - async createFilter(parameters: Parameters.CreateFilter, callback?: never): Promise; - async createFilter(parameters: Parameters.CreateFilter): Promise { - const config: Request = { + async createFilter(parameters: CreateFilterParameters) { + const request: Request = { url: '/rest/api/2/filter', method: 'POST', query: { @@ -50,253 +50,165 @@ export class Filters { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the visible favorite filters of the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** A - * favorite filter is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getFavouriteFilters( - parameters: Parameters.GetFavouriteFilters | undefined, - callback: Callback, - ): Promise; - /** - * Returns the visible favorite filters of the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** A - * favorite filter is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. + * Returns the visible favorite filters of the user. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** A + * favorite filter is only visible to the user where the filter is: + * - + * - - Owned by the user. + * - - Shared with a group that the user is a member of. + * - - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - - Shared with a public project. + * - - Shared with the public. + * - + * - For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. */ - async getFavouriteFilters( - parameters?: Parameters.GetFavouriteFilters, - callback?: never, - ): Promise; - async getFavouriteFilters(parameters?: Parameters.GetFavouriteFilters): Promise { - const config: Request = { + async getFavouriteFilters(parameters: GetFavouriteFiltersParameters) { + const request: Request = { url: '/rest/api/2/filter/favourite', method: 'GET', query: { - expand: parameters?.expand, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are - * also returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getMyFilters( - parameters: Parameters.GetMyFilters | undefined, - callback: Callback, - ): Promise; - /** - * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are - * also returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. + * also returned. * + * + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: + * - + * - - Owned by the user. + * - - Shared with a group that the user is a member of. + * - - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - - Shared with a public project. + * - - Shared with the public. + * - + * - For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. */ - async getMyFilters(parameters?: Parameters.GetMyFilters, callback?: never): Promise; - async getMyFilters(parameters?: Parameters.GetMyFilters): Promise { - const config: Request = { + async getMyFilters(parameters: GetMyFiltersParameters) { + const request: Request = { url: '/rest/api/2/filter/my', method: 'GET', query: { - expand: parameters?.expand, - includeFavourites: parameters?.includeFavourites, + expand: parameters.expand, + includeFavourites: parameters.includeFavourites, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * filters. Use this operation to get: - * - * - Specific filters, by defining `id` only. - * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in - * their name. When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, only the following filters that match the query parameters are returned: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. + * filters. Use this operation to get: * + * + * - - Specific filters, by defining `id` only. + * - - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in + * their name. When multiple attributes are specified only filters matching all attributes are returned. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, only the following filters that match the query parameters are returned: + * - + * - - Filters owned by the user. + * - - Filters shared with a group that the user is a member of. + * - - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - - Filters shared with a public project. + * - - Filters shared with the public. */ - async getFiltersPaginated( - parameters: Parameters.GetFiltersPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * filters. Use this operation to get: - * - * - Specific filters, by defining `id` only. - * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in - * their name. When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, only the following filters that match the query parameters are returned: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getFiltersPaginated( - parameters?: Parameters.GetFiltersPaginated, - callback?: never, - ): Promise; - async getFiltersPaginated( - parameters?: Parameters.GetFiltersPaginated, - ): Promise { - const config: Request = { + async getFiltersPaginated(parameters: GetFiltersPaginatedParameters) { + const request: Request = { url: '/rest/api/2/filter/search', method: 'GET', query: { - filterName: parameters?.filterName, - accountId: parameters?.accountId, - groupname: parameters?.groupname, - groupId: parameters?.groupId, - projectId: parameters?.projectId, - id: parameters?.id, - orderBy: parameters?.orderBy, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - expand: parameters?.expand, - overrideSharePermissions: parameters?.overrideSharePermissions, - isSubstringMatch: parameters?.isSubstringMatch, + filterName: parameters.filterName, + accountId: parameters.accountId, + owner: parameters.owner, + groupname: parameters.groupname, + groupId: parameters.groupId, + projectId: parameters.projectId, + id: parameters.id, + orderBy: parameters.orderBy, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + expand: parameters.expand, + overrideSharePermissions: parameters.overrideSharePermissions, + isSubstringMatch: parameters.isSubstringMatch, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a filter. - * - * This operation can be accessed anonymously. + * Delete a filter. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, the filter is only returned where it is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getFilter(parameters: Parameters.GetFilter | string, callback: Callback): Promise; + async deleteFilter(parameters: DeleteFilterParameters) { + const request: Request = { + url: `/rest/api/2/filter/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** - * Returns a filter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, the filter is only returned where it is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. + * Returns a filter. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, the filter is only returned where it is: + * - + * - - Owned by the user. + * - - Shared with a group that the user is a member of. + * - - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - - Shared with a public project. + * - - Shared with the public. */ - async getFilter(parameters: Parameters.GetFilter | string, callback?: never): Promise; - async getFilter(parameters: Parameters.GetFilter | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/filter/${id}`, + async getFilter(parameters: GetFilterParameters) { + const request: Request = { + url: `/rest/api/2/filter/${parameters.id}`, method: 'GET', query: { - expand: typeof parameters !== 'string' && parameters.expand, - overrideSharePermissions: typeof parameters !== 'string' && parameters.overrideSharePermissions, + expand: parameters.expand, + overrideSharePermissions: parameters.overrideSharePermissions, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. + * Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however the user must own the filter. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however the user must own the filter. */ - async updateFilter(parameters: Parameters.UpdateFilter, callback: Callback): Promise; - /** - * Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however the user must own the filter. - */ - async updateFilter(parameters: Parameters.UpdateFilter, callback?: never): Promise; - async updateFilter(parameters: Parameters.UpdateFilter): Promise { - const config: Request = { + async updateFilter(parameters: UpdateFilterParameters) { + const request: Request = { url: `/rest/api/2/filter/${parameters.id}`, method: 'PUT', query: { @@ -304,291 +216,160 @@ export class Filters { overrideSharePermissions: parameters.overrideSharePermissions, }, body: { - name: parameters.name, + approximateLastUsed: parameters.approximateLastUsed, description: parameters.description, - jql: parameters.jql, + 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); + return this.client.sendRequest(request); } /** - * Delete a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Reset the user's column configuration for the filter to the default. * + * + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, columns are only reset for: + * - + * - - Filters owned by the user. + * - - Filters shared with a group that the user is a member of. + * - - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - - Filters shared with a public project. + * - - Filters shared with the public. */ - async deleteFilter(parameters: Parameters.DeleteFilter | string, callback: Callback): Promise; - /** - * Delete a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFilter(parameters: Parameters.DeleteFilter | string, callback?: never): Promise; - async deleteFilter(parameters: Parameters.DeleteFilter | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/filter/${id}`, + async resetColumns(parameters: ResetColumnsParameters) { + const request: Request = { + url: `/rest/api/2/filter/${parameters.id}/columns`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed - * in _List View_ with the _Columns_ set to _Filter_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, column details are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getColumns( - parameters: Parameters.GetColumns | string, - callback: Callback, - ): Promise; - /** - * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed - * in _List View_ with the _Columns_ set to _Filter_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, column details are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. + * in _List View_ with the _Columns_ set to _Filter_. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, column details are only returned for: + * - + * - - Filters owned by the user. + * - - Filters shared with a group that the user is a member of. + * - - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - - Filters shared with a public project. + * - - Filters shared with the public. */ - async getColumns(parameters: Parameters.GetColumns | string, callback?: never): Promise; - async getColumns(parameters: Parameters.GetColumns | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/filter/${id}/columns`, + async getColumns(parameters: GetColumnsParameters) { + const request: Request = { + url: `/rest/api/2/filter/${parameters.id}/columns`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get - * fields](#api-rest-api-2-field-get) to get the list fields in Jira. A navigable field has `navigable` set to - * `true`. - * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/filter/10000/columns` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, columns are only set for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setColumns(parameters: Parameters.SetColumns, callback: Callback): Promise; - /** - * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get - * fields](#api-rest-api-2-field-get) to get the list fields in Jira. A navigable field has `navigable` set to - * `true`. - * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/filter/10000/columns` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, columns are only set for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. + * fields](#api-rest-api-2-field-get) to get the list fields in Jira. A navigable field has `navigable` set to `true`. + * * + * + * - The parameters for this resource are expressed as HTML form data. For example, in curl: + * - + * - `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/2/filter/10000/columns` + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, columns are only set for: + * - + * - - Filters owned by the user. + * - - Filters shared with a group that the user is a member of. + * - - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - - Filters shared with a public project. + * - - Filters shared with the public. */ - async setColumns(parameters: Parameters.SetColumns, callback?: never): Promise; - async setColumns(parameters: Parameters.SetColumns): Promise { - const config: Request = { + async setColumns(parameters: SetColumnsParameters) { + const request: Request = { url: `/rest/api/2/filter/${parameters.id}/columns`, method: 'PUT', - body: parameters.columns, + body: { + columns: parameters.columns, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Reset the user's column configuration for the filter to the default. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, columns are only reset for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async resetColumns(parameters: Parameters.ResetColumns | string, callback: Callback): Promise; - /** - * Reset the user's column configuration for the filter to the default. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, columns are only reset for: + * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from + * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private + * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. * * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async resetColumns(parameters: Parameters.ResetColumns | string, callback?: never): Promise; - async resetColumns(parameters: Parameters.ResetColumns | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/filter/${id}/columns`, + async deleteFavouriteForFilter(parameters: DeleteFavouriteForFilterParameters) { + const request: Request = { + url: `/rest/api/2/filter/${parameters.id}/favourite`, method: 'DELETE', - }; - - return this.client.sendRequest(config); - } - - /** - * Add a filter as a favorite for the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user can only favorite: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback: Callback, - ): Promise; - /** - * Add a filter as a favorite for the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user can only favorite: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback?: never, - ): Promise; - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/filter/${id}/favourite`, - method: 'PUT', query: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from - * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private - * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * Add a filter as a favorite for the user. * + * + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user can only favorite: + * - + * - - Filters owned by the user. + * - - Filters shared with a group that the user is a member of. + * - - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - - Filters shared with a public project. + * - - Filters shared with the public. */ - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback: Callback, - ): Promise; - /** - * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from - * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private - * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback?: never, - ): Promise; - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/filter/${id}/favourite`, - method: 'DELETE', + async setFavouriteForFilter(parameters: SetFavouriteForFilterParameters) { + const request: Request = { + url: `/rest/api/2/filter/${parameters.id}/favourite`, + method: 'PUT', query: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Changes the owner of the filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback: Callback): Promise; - /** - * Changes the owner of the filter. + * Changes the owner of the filter. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg). */ - async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback?: never): Promise; - async changeFilterOwner(parameters: Parameters.ChangeFilterOwner): Promise { - const config: Request = { + async changeFilterOwner(parameters: ChangeFilterOwnerParameters) { + const request: Request = { url: `/rest/api/2/filter/${parameters.id}/owner`, method: 'PUT', body: { @@ -596,6 +377,6 @@ export class Filters { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/groupAndUserPicker.ts b/src/version2/groupAndUserPicker.ts index 71d26e9365..4f62717d39 100644 --- a/src/version2/groupAndUserPicker.ts +++ b/src/version2/groupAndUserPicker.ts @@ -1,94 +1,46 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { FindUsersAndGroupsParameters } from './parameters/findUsersAndGroupsParameters'; export class GroupAndUserPicker { constructor(private client: Client) {} - /** - * Returns a list of users and groups matching a string. The string is used: - * - * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden - * their email address in their user profile, partial matches of the email address will not find the user. An exact - * match is required. - * - For groups, to find a case-sensitive match with group name. - * - * For example, if the string _tin_ is used, records with the display name _Tina_, email address - * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. - * - * Optionally, the search can be refined to: - * - * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further - * refined to return only users and groups that have permission to view specific: - * - * - Projects. - * - Issue types. - * - * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or + * Returns a list of users and groups matching a string. The string is used: * + * + * - - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden + * their email address in their user profile, partial matches of the email address will not find the user. An + * exact match is required. + * - - For groups, to find a case-sensitive match with group name. + * - + * - For example, if the string _tin_ is used, records with the display name _Tina_, email address + * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. + * - + * - Optionally, the search can be refined to: + * - + * - - The projects and issue types associated with a custom field, such as a user picker. The search can then be further + * refined to return only users and groups that have permission to view specific: + * - + * - - Projects. + * - - Issue types. + * - + * - If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. - * - Not return Connect app users and groups. - * - Return groups that have a case-insensitive match with the query. - * - * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this - * end, the returned object includes an `html` field for each list. This field highlights the matched query term in - * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for - * use in a picker, specifically _Showing X of Y matching groups_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). - */ - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback: Callback, - ): Promise; - /** - * Returns a list of users and groups matching a string. The string is used: - * - * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden - * their email address in their user profile, partial matches of the email address will not find the user. An exact - * match is required. - * - For groups, to find a case-sensitive match with group name. - * - * For example, if the string _tin_ is used, records with the display name _Tina_, email address - * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. - * - * Optionally, the search can be refined to: - * - * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further - * refined to return only users and groups that have permission to view specific: - * - * - Projects. - * - Issue types. - * - * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or - * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be - * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. - * - Not return Connect app users and groups. - * - Return groups that have a case-insensitive match with the query. - * - * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this - * end, the returned object includes an `html` field for each list. This field highlights the matched query term in - * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for - * use in a picker, specifically _Showing X of Y matching groups_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). + * - - Not return Connect app users and groups. + * - - Return groups that have a case-insensitive match with the query. + * - + * - The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this + * end, the returned object includes an `html` field for each list. This field highlights the matched query term in + * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header + * for use in a picker, specifically _Showing X of Y matching groups_. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). */ - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback?: never, - ): Promise; - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - ): Promise { - const config: Request = { + async findUsersAndGroups(parameters: FindUsersAndGroupsParameters) { + const request: Request = { url: '/rest/api/2/groupuserpicker', method: 'GET', query: { @@ -104,6 +56,6 @@ export class GroupAndUserPicker { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/groups.ts b/src/version2/groups.ts index 5017c14caf..8442c5679c 100644 --- a/src/version2/groups.ts +++ b/src/version2/groups.ts @@ -1,52 +1,24 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { RemoveGroupParameters } from './parameters/removeGroupParameters'; +import type { CreateGroupParameters } from './parameters/createGroupParameters'; +import type { BulkGetGroupsParameters } from './parameters/bulkGetGroupsParameters'; +import type { GetUsersFromGroupParameters } from './parameters/getUsersFromGroupParameters'; +import type { RemoveUserFromGroupParameters } from './parameters/removeUserFromGroupParameters'; +import type { AddUserToGroupParameters } from './parameters/addUserToGroupParameters'; +import type { FindGroupsParameters } from './parameters/findGroupsParameters'; export class Groups { constructor(private client: Client) {} - - /** - * Creates a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async createGroup(parameters: Parameters.CreateGroup, callback: Callback): Promise; - /** - * Creates a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async createGroup(parameters: Parameters.CreateGroup, callback?: never): Promise; - async createGroup(parameters: Parameters.CreateGroup): Promise { - const config: Request = { - url: '/rest/api/2/group', - method: 'POST', - body: parameters, - }; - - return this.client.sendRequest(config); - } - /** - * Deletes a group. + * 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)). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ strategic + * [group](https://confluence.atlassian.com/x/24xjL)). */ - async removeGroup(parameters: Parameters.RemoveGroup, callback: Callback): Promise; - /** - * Deletes a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeGroup(parameters: Parameters.RemoveGroup, callback?: never): Promise; - async removeGroup(parameters: Parameters.RemoveGroup): Promise { - const config: Request = { + async removeGroup(parameters: RemoveGroupParameters) { + const request: Request = { url: '/rest/api/2/group', method: 'DELETE', query: { @@ -57,81 +29,66 @@ export class Groups { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * groups. + * Creates a group. * * - * **[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). + * - **[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 bulkGetGroups( - parameters: Parameters.BulkGetGroups | undefined, - callback: Callback, - ): Promise; + async createGroup(parameters: CreateGroupParameters) { + const request: Request = { + url: '/rest/api/2/group', + method: 'POST', + body: { + name: parameters.name, + }, + }; + + return this.client.sendRequest(request); + } + /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * groups. + * groups. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async bulkGetGroups(parameters?: Parameters.BulkGetGroups, callback?: never): Promise; - async bulkGetGroups(parameters?: Parameters.BulkGetGroups): Promise { - const config: Request = { + async bulkGetGroups(parameters: BulkGetGroupsParameters) { + const request: Request = { url: '/rest/api/2/group/bulk', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - groupId: parameters?.groupId, - groupName: parameters?.groupName, - accessType: parameters?.accessType, - applicationKey: parameters?.applicationKey, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + groupId: parameters.groupId, + groupName: parameters.groupName, + accessType: parameters.accessType, + applicationKey: parameters.applicationKey, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * users in a group. - * - * Note that users are ordered by username, however the username is not returned in the results due to privacy - * reasons. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** 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, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * users in a group. - * - * Note that users are ordered by username, however the username is not returned in the results due to privacy - * reasons. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * users in a group. * + * + * - Note that users are ordered by username, however the username is not returned in the results due to privacy + * reasons. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** 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, - callback?: never, - ): Promise; - async getUsersFromGroup(parameters: Parameters.GetUsersFromGroup): Promise { - const config: Request = { + async getUsersFromGroup(parameters: GetUsersFromGroupParameters) { + const request: Request = { url: '/rest/api/2/group/member', method: 'GET', query: { @@ -143,130 +100,89 @@ export class Groups { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Adds a user to a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async addUserToGroup(parameters: Parameters.AddUserToGroup, callback: Callback): Promise; - /** - * Adds a user to a group. + * Removes a user from a group. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + * - **[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): Promise { - const config: Request = { + async removeUserFromGroup(parameters: RemoveUserFromGroupParameters) { + const request: Request = { url: '/rest/api/2/group/user', - method: 'POST', + method: 'DELETE', query: { - groupname: parameters.groupName, + groupname: parameters.groupname, groupId: parameters.groupId, - }, - body: { + username: parameters.username, accountId: parameters.accountId, - name: parameters.name, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Removes a user from a group. + * 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)). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). */ - async removeUserFromGroup( - parameters: Parameters.RemoveUserFromGroup, - callback: Callback, - ): Promise; - /** - * Removes a user from a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUserFromGroup(parameters: Parameters.RemoveUserFromGroup, callback?: never): Promise; - async removeUserFromGroup(parameters: Parameters.RemoveUserFromGroup): Promise { - const config: Request = { + async addUserToGroup(parameters: AddUserToGroupParameters) { + const request: Request = { url: '/rest/api/2/group/user', - method: 'DELETE', + method: 'POST', query: { groupname: parameters.groupname, groupId: parameters.groupId, - username: parameters.username, + }, + body: { accountId: parameters.accountId, + name: parameters.name, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude - * groups from the results. - * - * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned - * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong - * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, - * specifically _Showing X of Y matching groups_. - * - * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and calls by users - * without the required permission return an empty list. - * - * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, - * calls where query is not an exact match to an existing group will return an empty list. - */ - async findGroups( - parameters: Parameters.FindGroups | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude - * groups from the results. - * - * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned - * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong - * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, - * specifically _Showing X of Y matching groups_. - * - * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and calls by users - * without the required permission return an empty list. - * - * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, - * calls where query is not an exact match to an existing group will return an empty list. + * groups from the results. * + * + * - The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned + * object includes the `html` field where the matched query term is highlighted in the group name with the HTML + * strong tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, + * specifically _Showing X of Y matching groups_. + * - + * - The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and calls by users + * without the required permission return an empty list. + * - + * - _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, + * calls where query is not an exact match to an existing group will return an empty list. */ - async findGroups(parameters?: Parameters.FindGroups, callback?: never): Promise; - async findGroups(parameters?: Parameters.FindGroups): Promise { - const config: Request = { + async findGroups(parameters: FindGroupsParameters) { + const request: Request = { url: '/rest/api/2/groups/picker', method: 'GET', query: { - query: parameters?.query, - exclude: parameters?.exclude, - excludeId: parameters?.excludeId, - maxResults: parameters?.maxResults, - caseInsensitive: parameters?.caseInsensitive, + accountId: parameters.accountId, + query: parameters.query, + exclude: parameters.exclude, + excludeId: parameters.excludeId, + maxResults: parameters.maxResults, + caseInsensitive: parameters.caseInsensitive, + userName: parameters.userName, + includeTeams: parameters.includeTeams, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/index.ts b/src/version2/index.ts deleted file mode 100644 index 82c283f799..0000000000 --- a/src/version2/index.ts +++ /dev/null @@ -1,99 +0,0 @@ -export * from './announcementBanner'; -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 './filterSharing'; -export * from './filters'; -export * from './groupAndUserPicker'; -export * from './groups'; -export * from './issueAttachments'; -export * from './issueCommentProperties'; -export * from './issueComments'; -export * from './issueCustomFieldAssociations'; -export * from './issueCustomFieldConfigurationApps'; -export * from './issueCustomFieldContexts'; -export * from './issueCustomFieldOptions'; -export * from './issueCustomFieldOptionsApps'; -export * from './issueCustomFieldValuesApps'; -export * from './issueFieldConfigurations'; -export * from './issueFields'; -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 './issueSearch'; -export * from './issueSecurityLevel'; -export * from './issueSecuritySchemes'; -export * from './issueTypeProperties'; -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'; -export * from './jqlFunctionsApps'; -export * from './labels'; -export * from './licenseMetrics'; -export * from './myself'; -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'; -export * from './projectKeyAndNameValidation'; -export * from './projectPermissionSchemes'; -export * from './projectProperties'; -export * from './projectRoleActors'; -export * from './projectRoles'; -export * from './projectTemplates'; -export * from './projectTypes'; -export * from './projectVersions'; -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 './userSearch'; -export * from './userNavProperties'; -export * from './users'; -export * from './webhooks'; -export * from './workflowSchemeDrafts'; -export * from './workflowSchemeProjectAssociations'; -export * from './workflowSchemes'; -export * from './workflowStatusCategories'; -export * from './workflowStatuses'; -export * from './workflowTransitionProperties'; -export * from './workflowTransitionRules'; -export * from './workflows'; - -export * from './client'; -export * as Version2Models from './models'; -export * as Version2Parameters from './parameters'; diff --git a/src/version2/issueAttachments.ts b/src/version2/issueAttachments.ts index dc728d6b49..19f663359d 100644 --- a/src/version2/issueAttachments.ts +++ b/src/version2/issueAttachments.ts @@ -1,36 +1,36 @@ -import type { Mime } from 'mime'; -import mime from 'mime'; -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAttachmentContentParameters } from './parameters/getAttachmentContentParameters'; +import type { GetAttachmentThumbnailParameters } from './parameters/getAttachmentThumbnailParameters'; +import type { RemoveAttachmentParameters } from './parameters/removeAttachmentParameters'; +import type { GetAttachmentParameters } from './parameters/getAttachmentParameters'; +import type { ExpandAttachmentForHumansParameters } from './parameters/expandAttachmentForHumansParameters'; +import type { ExpandAttachmentForMachinesParameters } from './parameters/expandAttachmentForMachinesParameters'; +import type { AddAttachmentParameters } from './parameters/addAttachmentParameters'; export class IssueAttachments { constructor(private client: Client) {} - /** * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) - * for details. - * - * To return a thumbnail of the attachment, use [Get attachment - * thumbnail](#api-rest-api-2-attachment-thumbnail-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. + * for details. * + * + * - To return a thumbnail of the attachment, use [Get attachment + * thumbnail](#api-rest-api-2-attachment-thumbnail-id-get). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If attachments are added in private comments, the comment-level restriction will be applied. */ - async getAttachmentContent(parameters: Parameters.GetAttachmentContent): Promise { - // todo #396 add Range header - https://github.com/MrRefactoring/jira.js/issues/396 - const config: Request = { + async getAttachmentContent(parameters: GetAttachmentContentParameters) { + const request: Request = { url: `/rest/api/2/attachment/content/${parameters.id}`, method: 'GET', query: { @@ -38,455 +38,329 @@ export class IssueAttachments { }, }; - const response = await this.client.sendRequestWithRawResponse(config); - - const contentTypeWithEncoding = response.headers.get('content-type') ?? ''; - const content = await response.arrayBuffer(); - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return { contentType, content } as T; + return this.client.sendRequest(request); } /** * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. - * - * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether - * users can create and delete attachments. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAttachmentMeta(callback: Callback): Promise; - /** - * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. - * - * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether - * users can create and delete attachments. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * * + * + * - Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether + * users can create and delete attachments. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAttachmentMeta(callback?: never): Promise; - async getAttachmentMeta(): Promise { - const config: Request = { + async getAttachmentMeta() { + const request: Request = { url: '/rest/api/2/attachment/meta', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use [Get attachment content](#api-rest-api-2-attachment-content-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. - */ - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback: Callback, - ): Promise; - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use [Get attachment content](#api-rest-api-2-attachment-content-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. + * Returns the thumbnail of an attachment. * + * + * - To return the attachment contents, use [Get attachment content](#api-rest-api-2-attachment-content-id-get). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If attachments are added in private comments, the comment-level restriction will be applied. */ - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback?: never, - ): Promise; - async getAttachmentThumbnail(parameters: Parameters.GetAttachmentThumbnail | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/attachment/thumbnail/${id}`, + async getAttachmentThumbnail(parameters: GetAttachmentThumbnailParameters) { + const request: Request = { + url: `/rest/api/2/attachment/thumbnail/${parameters.id}`, method: 'GET', query: { - 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', // todo }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the metadata for an attachment. Note that the attachment itself is not returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. - */ - async getAttachment( - parameters: Parameters.GetAttachment | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for an attachment. Note that the attachment itself is not returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. + * Deletes an attachment from an issue. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * project holding the issue containing the attachment: + * - + * - - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by the calling user. + * - - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by any user. */ - async getAttachment( - parameters: Parameters.GetAttachment | string, - callback?: never, - ): Promise; - async getAttachment(parameters: Parameters.GetAttachment | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/attachment/${id}`, - method: 'GET', + async removeAttachment(parameters: RemoveAttachmentParameters) { + const request: Request = { + url: `/rest/api/2/attachment/${parameters.id}`, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes an attachment from an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * project holding the issue containing the attachment: - * - * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by the calling user. - * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by any user. - */ - async removeAttachment( - parameters: Parameters.RemoveAttachment | string, - callback: Callback, - ): Promise; - /** - * Deletes an attachment from an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * project holding the issue containing the attachment: - * - * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by the calling user. - * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by any user. + * Returns the metadata for an attachment. Note that the attachment itself is not returned. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If attachments are added in private comments, the comment-level restriction will be applied. */ - async removeAttachment(parameters: Parameters.RemoveAttachment | string, callback?: never): Promise; - async removeAttachment(parameters: Parameters.RemoveAttachment | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/attachment/${id}`, - method: 'DELETE', + async getAttachment(parameters: GetAttachmentParameters) { + const request: Request = { + url: `/rest/api/2/attachment/${parameters.id}`, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is - * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. - * - * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the - * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded - * attachment](#api-rest-api-2-attachment-id-expand-raw-get), which only returns the metadata for the attachment's - * contents. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. - */ - async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment - * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is - * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. - * - * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the - * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded - * attachment](#api-rest-api-2-attachment-id-expand-raw-get), which only returns the metadata for the attachment's - * contents. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. + * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. * + * + * - Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the + * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded + * attachment](#api-rest-api-2-attachment-id-expand-raw-get), which only returns the metadata for the attachment's + * contents. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If attachments are added in private comments, the comment-level restriction will be applied. */ - async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback?: never, - ): Promise; - async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/attachment/${id}/expand/human`, + async expandAttachmentForHumans(parameters: ExpandAttachmentForHumansParameters) { + const request: Request = { + url: `/rest/api/2/attachment/${parameters.id}/expand/human`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is - * supported. - * - * Use this operation if you are processing the data without presenting it to the user, as this operation only returns - * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all - * metadata for an expanded attachment](#api-rest-api-2-attachment-id-expand-human-get) which also returns the - * metadata for the attachment itself, such as the attachment's ID and name. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. - */ - async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a - * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is - * supported. - * - * Use this operation if you are processing the data without presenting it to the user, as this operation only returns - * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all - * metadata for an expanded attachment](#api-rest-api-2-attachment-id-expand-human-get) which also returns the - * metadata for the attachment itself, such as the attachment's ID and name. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If attachments are added in private comments, the comment-level restriction will be applied. + * supported. * + * + * - Use this operation if you are processing the data without presenting it to the user, as this operation only returns + * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get + * all metadata for an expanded attachment](#api-rest-api-2-attachment-id-expand-human-get) which also returns the + * metadata for the attachment itself, such as the attachment's ID and name. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If attachments are added in private comments, the comment-level restriction will be applied. */ - async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback?: never, - ): Promise; - async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/attachment/${id}/expand/raw`, + async expandAttachmentForMachines(parameters: ExpandAttachmentForMachinesParameters) { + const request: Request = { + url: `/rest/api/2/attachment/${parameters.id}/expand/raw`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC - * 1867](https://www.ietf.org/rfc/rfc1867.txt)). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ and _Create attachments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addAttachment( - parameters: Parameters.AddAttachment, - callback: Callback, - ): Promise; - /** - * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC - * 1867](https://www.ietf.org/rfc/rfc1867.txt)). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ and _Create attachments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * 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:** + * - + * - - _Browse Projects_ and _Create attachments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async addAttachment(parameters: Parameters.AddAttachment, callback?: never): Promise; - async addAttachment(parameters: Parameters.AddAttachment): Promise { - const formData = new FormData(); - const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; - - // eslint-disable-next-line @typescript-eslint/consistent-type-imports - let Readable: typeof import('stream').Readable | undefined; - - if (typeof window === 'undefined') { - const { Readable: NodeReadable } = await import('stream'); - - Readable = NodeReadable; - } - - 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: Request = { + async addAttachment(parameters: AddAttachmentParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/attachments`, method: 'POST', - headers: { - 'X-Atlassian-Token': 'no-check', - // 'Content-Type': 'multipart/form-data', - }, - body: formData, - // maxBodyLength: Infinity, // todo - // maxContentLength: Infinity, // todo }; - return this.client.sendRequest(config); - } - - private async _convertToFile( - attachment: Parameters.Attachment, - mime: Mime, - // eslint-disable-next-line @typescript-eslint/consistent-type-imports - 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( - // eslint-disable-next-line @typescript-eslint/consistent-type-imports - 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) { - 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.'); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueCommentProperties.ts b/src/version2/issueCommentProperties.ts index d3ec6496b3..3e045d5a3c 100644 --- a/src/version2/issueCommentProperties.ts +++ b/src/version2/issueCommentProperties.ts @@ -1,186 +1,101 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetCommentPropertyKeysParameters } from './parameters/getCommentPropertyKeysParameters'; +import type { DeleteCommentPropertyParameters } from './parameters/deleteCommentPropertyParameters'; +import type { GetCommentPropertyParameters } from './parameters/getCommentPropertyParameters'; +import type { SetCommentPropertyParameters } from './parameters/setCommentPropertyParameters'; export class IssueCommentProperties { constructor(private client: Client) {} - - /** - * Returns the keys of all the properties of a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback: Callback, - ): Promise; /** - * Returns the keys of all the properties of a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * Returns the keys of all the properties of a comment. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback?: never, - ): Promise; - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - ): Promise { - const commentId = typeof parameters === 'string' ? parameters : parameters.commentId; - - const config: Request = { - url: `/rest/api/2/comment/${commentId}/properties`, + async getCommentPropertyKeys(parameters: GetCommentPropertyKeysParameters) { + const request: Request = { + url: `/rest/api/2/comment/${parameters.commentId}/properties`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the value of a comment property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a comment property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * Deletes a comment property. * + * + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * - + * - - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any + * comment. + * - - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a + * comment created by the user. + * - + * - Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. */ - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback?: never, - ): Promise; - async getCommentProperty(parameters: Parameters.GetCommentProperty): Promise { - const config: Request = { + async deleteCommentProperty(parameters: DeleteCommentPropertyParameters) { + const request: Request = { url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'GET', + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on any comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on a comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. + * Returns the value of a comment property. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async setCommentProperty( - parameters: Parameters.SetCommentProperty, - callback: Callback, - ): Promise; - /** - * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on any comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on a comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async setCommentProperty(parameters: Parameters.SetCommentProperty, callback?: never): Promise; - async setCommentProperty(parameters: Parameters.SetCommentProperty): Promise { - const config: Request = { + async getCommentProperty(parameters: GetCommentPropertyParameters) { + const request: Request = { url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'PUT', - body: parameters.property, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a comment property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any - * comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a - * comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async deleteCommentProperty( - parameters: Parameters.DeleteCommentProperty, - callback: Callback, - ): Promise; - /** - * Deletes a comment property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any - * comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a - * comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. + * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. + * * + * + * - The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * - + * - - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on any comment. + * - - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on a comment created by the user. + * - + * - Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. */ - async deleteCommentProperty(parameters: Parameters.DeleteCommentProperty, callback?: never): Promise; - async deleteCommentProperty(parameters: Parameters.DeleteCommentProperty): Promise { - const config: Request = { + async setCommentProperty(parameters: SetCommentPropertyParameters) { + const request: Request = { url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'DELETE', + method: 'PUT', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueComments.ts b/src/version2/issueComments.ts index 26ff6b5957..83a3c2856c 100644 --- a/src/version2/issueComments.ts +++ b/src/version2/issueComments.ts @@ -1,49 +1,31 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetCommentsByIdsParameters } from './parameters/getCommentsByIdsParameters'; +import type { GetCommentsParameters } from './parameters/getCommentsParameters'; +import type { AddCommentParameters } from './parameters/addCommentParameters'; +import type { DeleteCommentParameters } from './parameters/deleteCommentParameters'; +import type { GetCommentParameters } from './parameters/getCommentParameters'; +import type { UpdateCommentParameters } from './parameters/updateCommentParameters'; export class IssueComments { constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * comments specified by a list of comment IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Comments are returned where the user: - * - * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentsByIds( - parameters: Parameters.GetCommentsByIds, - callback: Callback, - ): Promise; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * comments specified by a list of comment IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Comments are returned where the user: - * - * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * comments specified by a list of comment IDs. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Comments are returned where the user: + * - + * - - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the comment. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async getCommentsByIds(parameters: Parameters.GetCommentsByIds, callback?: never): Promise; - async getCommentsByIds(parameters: Parameters.GetCommentsByIds): Promise { - const config: Request = { + async getCommentsByIds(parameters: GetCommentsByIdsParameters) { + const request: Request = { url: '/rest/api/2/comment/list', method: 'POST', query: { @@ -54,92 +36,53 @@ export class IssueComments { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns all comments for an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Comments are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is - * restricted to. - */ - async getComments( - parameters: Parameters.GetComments | string, - callback: Callback, - ): Promise; - /** - * Returns all comments for an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Comments are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is - * restricted to. + * Returns all comments for an issue. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Comments are included in the response where the user has: + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is + * restricted to. */ - async getComments( - parameters: Parameters.GetComments | string, - callback?: never, - ): Promise; - async getComments(parameters: Parameters.GetComments | string): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}/comment`, + async getComments(parameters: GetCommentsParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment`, method: 'GET', query: { - 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); + return this.client.sendRequest(request); } /** - * Adds a comment to an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addComment(parameters: Parameters.AddComment, callback: Callback): Promise; - /** - * Adds a comment to an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * Adds a comment to an issue. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue containing the comment is in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async addComment(parameters: Parameters.AddComment, callback?: never): Promise; - async addComment(parameters: Parameters.AddComment): Promise { - const config: Request = { + async addComment(parameters: AddCommentParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment`, method: 'POST', query: { @@ -147,7 +90,7 @@ export class IssueComments { }, body: { author: parameters.author, - body: parameters.comment, + body: parameters.body, created: parameters.created, id: parameters.id, jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, @@ -161,41 +104,48 @@ export class IssueComments { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. + * Deletes a comment. * + * + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue + * containing the comment is in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or + * _Delete own comments_ to delete comment created by the user, + * - - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. */ - async getComment(parameters: Parameters.GetComment, callback: Callback): Promise; + async deleteComment(parameters: DeleteCommentParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** - * Returns a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. + * Returns a comment. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. */ - async getComment(parameters: Parameters.GetComment, callback?: never): Promise; - async getComment(parameters: Parameters.GetComment): Promise { - const config: Request = { + async getComment(parameters: GetCommentParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, method: 'GET', query: { @@ -203,51 +153,30 @@ export class IssueComments { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit - * own comments_ to update comment created by the user. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - * - * **WARNING:** Child comments inherit visibility from their parent comment. Attempting to update a child comment's - * visibility will result in a 400 (Bad Request) error. - */ - async updateComment(parameters: Parameters.UpdateComment, callback: Callback): Promise; - /** - * Updates a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit - * own comments_ to update comment created by the user. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - * - * **WARNING:** Child comments inherit visibility from their parent comment. Attempting to update a child comment's - * visibility will result in a 400 (Bad Request) error. + * Updates a comment. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue + * containing the comment is in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit + * own comments_ to update comment created by the user. + * - - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + * - + * - **WARNING:** Child comments inherit visibility from their parent comment. Attempting to update a child comment's + * visibility will result in a 400 (Bad Request) error. */ - async updateComment(parameters: Parameters.UpdateComment, callback?: never): Promise; - async updateComment(parameters: Parameters.UpdateComment): Promise { - const config: Request = { + async updateComment(parameters: UpdateCommentParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, method: 'PUT', query: { @@ -256,54 +185,21 @@ export class IssueComments { expand: parameters.expand, }, body: { - body: parameters.comment, - visibility: parameters.visibility, + author: parameters.author, + 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, + updated: parameters.updated, + visibility: parameters.visibility, }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes a comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or - * _Delete own comments_ to delete comment created by the user, - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async deleteComment(parameters: Parameters.DeleteComment, callback: Callback): Promise; - /** - * Deletes a comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or - * _Delete own comments_ to delete comment created by the user, - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async deleteComment(parameters: Parameters.DeleteComment, callback?: never): Promise; - async deleteComment(parameters: Parameters.DeleteComment): Promise { - const config: Request = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'DELETE', - query: { - parentId: parameters.parentId, - }, - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueCustomFieldAssociations.ts b/src/version2/issueCustomFieldAssociations.ts index 3899c71a27..7ea0a23fc4 100644 --- a/src/version2/issueCustomFieldAssociations.ts +++ b/src/version2/issueCustomFieldAssociations.ts @@ -1,114 +1,68 @@ -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { RemoveAssociationsParameters } from './parameters/removeAssociationsParameters'; +import type { CreateAssociationsParameters } from './parameters/createAssociationsParameters'; export class IssueCustomFieldAssociations { constructor(private client: Client) {} - - /** - * Associates fields with projects. - * - * Fields will be associated with each issue type on the requested projects. - * - * Fields will be associated with all projects that share the same field configuration which the provided projects are - * using. This means that while the field will be associated with the requested projects, it will also be associated - * with any other projects that share the same field configuration. - * - * If a success response is returned it means that the field association has been created in any applicable contexts - * where it wasn't already present. - * - * Up to 50 fields and up to 100 projects can be associated in a single request. If more fields or projects are - * provided a 400 response will be returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createAssociations( - parameters: Parameters.CreateAssociations | undefined, - callback: Callback, - ): Promise; /** - * Associates fields with projects. - * - * Fields will be associated with each issue type on the requested projects. - * - * Fields will be associated with all projects that share the same field configuration which the provided projects are - * using. This means that while the field will be associated with the requested projects, it will also be associated - * with any other projects that share the same field configuration. - * - * If a success response is returned it means that the field association has been created in any applicable contexts - * where it wasn't already present. - * - * Up to 50 fields and up to 100 projects can be associated in a single request. If more fields or projects are - * provided a 400 response will be returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Unassociates a set of fields with a project and issue type context. * + * + * - Fields will be unassociated with all projects/issue types that share the same field configuration which the + * provided project and issue types are using. This means that while the field will be unassociated with the + * provided project and issue types, it will also be unassociated with any other projects and issue types that share + * the same field configuration. + * - + * - If a success response is returned it means that the field association has been removed in any applicable contexts + * where it was present. + * - + * - Up to 50 fields and up to 100 projects and issue types can be unassociated in a single request. If more fields or + * projects are provided a 400 response will be returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createAssociations(parameters?: Parameters.CreateAssociations, callback?: never): Promise; - async createAssociations(parameters?: Parameters.CreateAssociations): Promise { - const config: Request = { + async removeAssociations(parameters: RemoveAssociationsParameters) { + const request: Request = { url: '/rest/api/2/field/association', - method: 'PUT', + method: 'DELETE', body: { - associationContexts: parameters?.associationContexts, - fields: parameters?.fields, + associationContexts: parameters.associationContexts, + fields: parameters.fields, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Unassociates a set of fields with a project and issue type context. - * - * Fields will be unassociated with all projects/issue types that share the same field configuration which the - * provided project and issue types are using. This means that while the field will be unassociated with the provided - * project and issue types, it will also be unassociated with any other projects and issue types that share the same - * field configuration. - * - * If a success response is returned it means that the field association has been removed in any applicable contexts - * where it was present. - * - * Up to 50 fields and up to 100 projects and issue types can be unassociated in a single request. If more fields or - * projects are provided a 400 response will be returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Associates fields with projects. * + * + * - Fields will be associated with each issue type on the requested projects. + * - + * - Fields will be associated with all projects that share the same field configuration which the provided projects are + * using. This means that while the field will be associated with the requested projects, it will also be associated + * with any other projects that share the same field configuration. + * - + * - If a success response is returned it means that the field association has been created in any applicable contexts + * where it wasn't already present. + * - + * - Up to 50 fields and up to 100 projects can be associated in a single request. If more fields or projects are + * provided a 400 response will be returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async removeAssociations( - parameters: Parameters.RemoveAssociations | undefined, - callback: Callback, - ): Promise; - /** - * Unassociates a set of fields with a project and issue type context. - * - * Fields will be unassociated with all projects/issue types that share the same field configuration which the - * provided project and issue types are using. This means that while the field will be unassociated with the provided - * project and issue types, it will also be unassociated with any other projects and issue types that share the same - * field configuration. - * - * If a success response is returned it means that the field association has been removed in any applicable contexts - * where it was present. - * - * Up to 50 fields and up to 100 projects and issue types can be unassociated in a single request. If more fields or - * projects are provided a 400 response will be returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeAssociations(parameters?: Parameters.RemoveAssociations, callback?: never): Promise; - async removeAssociations(parameters?: Parameters.RemoveAssociations): Promise { - const config: Request = { + async createAssociations(parameters: CreateAssociationsParameters) { + const request: Request = { url: '/rest/api/2/field/association', - method: 'DELETE', + method: 'PUT', body: { - associationContexts: parameters?.associationContexts, - fields: parameters?.fields, + associationContexts: parameters.associationContexts, + fields: parameters.fields, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueCustomFieldConfigurationApps.ts b/src/version2/issueCustomFieldConfigurationApps.ts index c3e978781e..bf74b01965 100644 --- a/src/version2/issueCustomFieldConfigurationApps.ts +++ b/src/version2/issueCustomFieldConfigurationApps.ts @@ -1,131 +1,72 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetCustomFieldsConfigurationsParameters } from './parameters/getCustomFieldsConfigurationsParameters'; +import type { GetCustomFieldConfigurationParameters } from './parameters/getCustomFieldConfigurationParameters'; +import type { UpdateCustomFieldConfigurationParameters } from './parameters/updateCustomFieldConfigurationParameters'; 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. + * 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, - ): Promise { - const config: Request = { + async getCustomFieldsConfigurations(parameters: GetCustomFieldsConfigurationsParameters) { + const request: Request = { url: '/rest/api/2/app/field/context/configuration/list', method: 'POST', query: { - id: parameters?.id, - fieldContextId: parameters?.fieldContextId, - issueId: parameters?.issueId, - projectKeyOrId: parameters?.projectKeyOrId, - issueTypeId: parameters?.issueTypeId, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, + id: parameters.id, + fieldContextId: parameters.fieldContextId, + issueId: parameters.issueId, + projectKeyOrId: parameters.projectKeyOrId, + issueTypeId: parameters.issueTypeId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, body: { - fieldIdsOrKeys: parameters?.fieldIdsOrKeys, + fieldIdsOrKeys: parameters.fieldIdsOrKeys, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * configurations for a custom field of a * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created - * by a [Forge app](https://developer.atlassian.com/platform/forge/). - * - * The result can be filtered by one of these criteria: - * - * - `id`. - * - `fieldContextId`. - * - `issueId`. - * - `projectKeyOrId` and `issueTypeId`. - * - * Otherwise, all configurations are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that provided the custom field type. + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * + * + * - The result can be filtered by one of these criteria: + * - + * - - `id`. + * - - `fieldContextId`. + * - - `issueId`. + * - - `projectKeyOrId` and `issueTypeId`. + * - + * - Otherwise, all configurations are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not + * required for the Forge app that provided the custom field type. */ - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * configurations for a custom field 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 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 getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration, - callback?: never, - ): Promise; - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration, - ): Promise { - const config: Request = { + async getCustomFieldConfiguration(parameters: GetCustomFieldConfigurationParameters) { + const request: Request = { url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/context/configuration`, method: 'GET', query: { @@ -139,39 +80,20 @@ export class IssueCustomFieldConfigurationApps { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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 type. - */ - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - callback: Callback, - ): Promise; - /** - * 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/). + * 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 type. + * - **[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 type. */ - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - callback?: never, - ): Promise; - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - ): Promise { - const config: Request = { + async updateCustomFieldConfiguration(parameters: UpdateCustomFieldConfigurationParameters) { + const request: Request = { url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/context/configuration`, method: 'PUT', body: { @@ -179,6 +101,6 @@ export class IssueCustomFieldConfigurationApps { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueCustomFieldContexts.ts b/src/version2/issueCustomFieldContexts.ts index 5e4fcfc120..0cd6e10e32 100644 --- a/src/version2/issueCustomFieldContexts.ts +++ b/src/version2/issueCustomFieldContexts.ts @@ -1,102 +1,64 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetContextsForFieldParameters } from './parameters/getContextsForFieldParameters'; +import type { CreateCustomFieldContextParameters } from './parameters/createCustomFieldContextParameters'; +import type { GetDefaultValuesParameters } from './parameters/getDefaultValuesParameters'; +import type { SetDefaultValuesParameters } from './parameters/setDefaultValuesParameters'; +import type { GetIssueTypeMappingsForContextsParameters } from './parameters/getIssueTypeMappingsForContextsParameters'; +import type { GetCustomFieldContextsForProjectsAndIssueTypesParameters } from './parameters/getCustomFieldContextsForProjectsAndIssueTypesParameters'; +import type { GetProjectContextMappingParameters } from './parameters/getProjectContextMappingParameters'; +import type { DeleteCustomFieldContextParameters } from './parameters/deleteCustomFieldContextParameters'; +import type { UpdateCustomFieldContextParameters } from './parameters/updateCustomFieldContextParameters'; +import type { AddIssueTypesToContextParameters } from './parameters/addIssueTypesToContextParameters'; +import type { RemoveIssueTypesFromContextParameters } from './parameters/removeIssueTypesFromContextParameters'; +import type { AssignProjectsToCustomFieldContextParameters } from './parameters/assignProjectsToCustomFieldContextParameters'; +import type { RemoveCustomFieldContextFromProjectsParameters } from './parameters/removeCustomFieldContextFromProjectsParameters'; export class IssueCustomFieldContexts { constructor(private client: Client) {} - /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of [ * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a - * custom field. Contexts can be returned as follows: - * - * - With no other parameters set, all contexts. - * - By defining `id` only, all contexts from the list of IDs. - * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types - * (true) or those that apply to only a subset of issue types (false) - * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global - * contexts) (true) or those that apply to only a subset of projects (false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). _Edit Workflow_ [edit workflow - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Edit-Workflows) + * custom field. Contexts can be returned as follows: * + * + * - - With no other parameters set, all contexts. + * - - By defining `id` only, all contexts from the list of IDs. + * - - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types + * (true) or those that apply to only a subset of issue types (false) + * - - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global + * contexts) (true) or those that apply to only a subset of projects (false). + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). _Edit Workflow_ [edit workflow + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Edit-Workflows) */ - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of [ - * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a - * custom field. Contexts can be returned as follows: - * - * - With no other parameters set, all contexts. - * - By defining `id` only, all contexts from the list of IDs. - * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types - * (true) or those that apply to only a subset of issue types (false) - * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global - * contexts) (true) or those that apply to only a subset of projects (false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). _Edit Workflow_ [edit workflow - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Edit-Workflows) - */ - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback?: never, - ): Promise; - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: Request = { - url: `/rest/api/2/field/${fieldId}/context`, + async getContextsForField(parameters: GetContextsForFieldParameters) { + const request: Request = { + url: `/rest/api/2/field/${parameters.fieldId}/context`, method: 'GET', query: { - isAnyIssueType: typeof parameters !== 'string' && parameters.isAnyIssueType, - isGlobalContext: typeof parameters !== 'string' && parameters.isGlobalContext, - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, + isAnyIssueType: parameters.isAnyIssueType, + isGlobalContext: parameters.isGlobalContext, + contextId: parameters.contextId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a custom field context. - * - * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If - * `issueTypeIds` is empty, the context applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Creates a custom field context. + * Creates a custom field context. * * - * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If - * `issueTypeIds` is empty, the context applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If + * `issueTypeIds` is empty, the context applies to all issue types. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback?: never, - ): Promise; - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - ): Promise { - const config: Request = { + async createCustomFieldContext(parameters: CreateCustomFieldContextParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context`, method: 'POST', body: { @@ -108,227 +70,120 @@ export class IssueCustomFieldContexts { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no - * defaults are set for a context, nothing is returned.\ - * The returned object depends on type of the custom field: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no - * defaults are set for a context, nothing is returned.\ - * The returned object depends on type of the custom field: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * defaults are set for a context, nothing is returned. + * + * - The returned object depends on type of the custom field: + * - + * - - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * - + * - Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * - + * - - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback?: never, - ): Promise; - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: Request = { - url: `/rest/api/2/field/${fieldId}/context/defaultValue`, + async getDefaultValues(parameters: GetDefaultValuesParameters) { + const request: Request = { + url: `/rest/api/2/field/${parameters.fieldId}/context/defaultValue`, method: 'GET', query: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, + contextId: parameters.contextId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets default for contexts of a custom field. Default are defined using these objects: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * Only one type of default object can be included in a request. To remove a default for a context, set the default - * parameter to `null`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback: Callback): Promise; - /** - * Sets default for contexts of a custom field. Default are defined using these objects: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * Only one type of default object can be included in a request. To remove a default for a context, set the default - * parameter to `null`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Sets default for contexts of a custom field. Default are defined using these objects: * + * + * - - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * - + * - Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * - + * - - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * - + * - Only one type of default object can be included in a request. To remove a default for a context, set the default + * parameter to `null`. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: never): Promise; - async setDefaultValues(parameters: Parameters.SetDefaultValues): Promise { - const config: Request = { + async setDefaultValues(parameters: SetDefaultValuesParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/defaultValue`, method: 'PUT', body: { @@ -336,95 +191,51 @@ export class IssueCustomFieldContexts { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. - * Mappings are ordered first by context ID and then by issue type ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. - * Mappings are ordered first by context ID and then by issue type ID. + * Mappings are ordered first by context ID and then by issue type ID. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback?: never, - ): Promise; - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: Request = { - url: `/rest/api/2/field/${fieldId}/context/issuetypemapping`, + async getIssueTypeMappingsForContexts(parameters: GetIssueTypeMappingsForContextsParameters) { + const request: Request = { + url: `/rest/api/2/field/${parameters.fieldId}/context/issuetypemapping`, method: 'GET', query: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, + contextId: parameters.contextId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * project and issue type mappings and, for each mapping, the ID of a [custom field - * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. - * - * If there is no custom field context assigned to the project then, if present, the custom field context that applies - * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is - * not found, the returned custom field context ID is `null`. - * - * Duplicate project and issue type mappings cannot be provided in the request. - * - * The order of the returned values is the same as provided in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. * + * + * - If there is no custom field context assigned to the project then, if present, the custom field context that applies + * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is + * not found, the returned custom field context ID is `null`. + * - + * - Duplicate project and issue type mappings cannot be provided in the request. + * - + * - The order of the returned values is the same as provided in the request. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * project and issue type mappings and, for each mapping, the ID of a [custom field - * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. - * - * If there is no custom field context assigned to the project then, if present, the custom field context that applies - * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is - * not found, the returned custom field context ID is `null`. - * - * Duplicate project and issue type mappings cannot be provided in the request. - * - * The order of the returned values is the same as provided in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback?: never, - ): Promise; - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - ): Promise { - const config: Request = { + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: GetCustomFieldContextsForProjectsAndIssueTypesParameters, + ) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/mapping`, method: 'POST', query: { @@ -436,75 +247,56 @@ export class IssueCustomFieldContexts { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings - * are returned. Invalid IDs are ignored. + * are returned. Invalid IDs are ignored. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings - * are returned. Invalid IDs are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback?: never, - ): Promise; - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: Request = { - url: `/rest/api/2/field/${fieldId}/context/projectmapping`, + async getProjectContextMapping(parameters: GetProjectContextMappingParameters) { + const request: Request = { + url: `/rest/api/2/field/${parameters.fieldId}/context/projectmapping`, method: 'GET', query: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, + contextId: parameters.contextId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a [ custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * Deletes a [ custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback: Callback, - ): Promise; + async deleteCustomFieldContext(parameters: DeleteCustomFieldContextParameters) { + const request: Request = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** * Updates a [ custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback?: never, - ): Promise; - async updateCustomFieldContext(parameters: Parameters.UpdateCustomFieldContext): Promise { - const config: Request = { + async updateCustomFieldContext(parameters: UpdateCustomFieldContextParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}`, method: 'PUT', body: { @@ -513,69 +305,22 @@ export class IssueCustomFieldContexts { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Adds issue types to a custom field context, appending the issue types to the issue types list. * + * + * - A custom field context without any issue types applies to all issue types. Adding issue types to such a custom + * field context would result in it applying to only the listed issue types. + * - + * - If any of the issue types exists in the custom field context, the operation fails and no issue types are added. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Deletes a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback?: never, - ): Promise; - async deleteCustomFieldContext(parameters: Parameters.DeleteCustomFieldContext): Promise { - const config: Request = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config); - } - - /** - * Adds issue types to a custom field context, appending the issue types to the issue types list. - * - * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom - * field context would result in it applying to only the listed issue types. - * - * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToContext( - parameters: Parameters.AddIssueTypesToContext, - callback: Callback, - ): Promise; - /** - * Adds issue types to a custom field context, appending the issue types to the issue types list. - * - * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom - * field context would result in it applying to only the listed issue types. - * - * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToContext(parameters: Parameters.AddIssueTypesToContext, callback?: never): Promise; - async addIssueTypesToContext(parameters: Parameters.AddIssueTypesToContext): Promise { - const config: Request = { + async addIssueTypesToContext(parameters: AddIssueTypesToContextParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype`, method: 'PUT', body: { @@ -583,35 +328,19 @@ export class IssueCustomFieldContexts { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Removes issue types from a custom field context. - * - * A custom field context without any issue types applies to all issue types. + * Removes issue types from a custom field context. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - A custom field context without any issue types applies to all issue types. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback: Callback, - ): Promise; - /** - * Removes issue types from a custom field context. - * - * A custom field context without any issue types applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback?: never, - ): Promise; - async removeIssueTypesFromContext(parameters: Parameters.RemoveIssueTypesFromContext): Promise { - const config: Request = { + async removeIssueTypesFromContext(parameters: RemoveIssueTypesFromContextParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype/remove`, method: 'POST', body: { @@ -619,37 +348,19 @@ export class IssueCustomFieldContexts { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Assigns a custom field context to projects. - * - * If any project in the request is assigned to any context of the custom field, the operation fails. + * Assigns a custom field context to projects. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If any project in the request is assigned to any context of the custom field, the operation fails. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Assigns a custom field context to projects. - * - * If any project in the request is assigned to any context of the custom field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback?: never, - ): Promise; - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - ): Promise { - const config: Request = { + async assignProjectsToCustomFieldContext(parameters: AssignProjectsToCustomFieldContextParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/project`, method: 'PUT', body: { @@ -657,45 +368,23 @@ export class IssueCustomFieldContexts { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Removes a custom field context from projects. - * - * A custom field context without any projects applies to all projects. Removing all projects from a custom field - * context would result in it applying to all projects. - * - * If any project in the request is not assigned to the context, or the operation would result in two global contexts - * for the field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback: Callback, - ): Promise; - /** - * Removes a custom field context from projects. - * - * A custom field context without any projects applies to all projects. Removing all projects from a custom field - * context would result in it applying to all projects. - * - * If any project in the request is not assigned to the context, or the operation would result in two global contexts - * for the field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Removes a custom field context from projects. * + * + * - A custom field context without any projects applies to all projects. Removing all projects from a custom field + * context would result in it applying to all projects. + * - + * - If any project in the request is not assigned to the context, or the operation would result in two global contexts + * for the field, the operation fails. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback?: never, - ): Promise; - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - ): Promise { - const config: Request = { + async removeCustomFieldContextFromProjects(parameters: RemoveCustomFieldContextFromProjectsParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/project/remove`, method: 'POST', body: { @@ -703,6 +392,6 @@ export class IssueCustomFieldContexts { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueCustomFieldOptions.ts b/src/version2/issueCustomFieldOptions.ts index 1d2b277cdb..cf945aef37 100644 --- a/src/version2/issueCustomFieldOptions.ts +++ b/src/version2/issueCustomFieldOptions.ts @@ -1,105 +1,56 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetCustomFieldOptionParameters } from './parameters/getCustomFieldOptionParameters'; +import type { GetOptionsForContextParameters } from './parameters/getOptionsForContextParameters'; +import type { CreateCustomFieldOptionParameters } from './parameters/createCustomFieldOptionParameters'; +import type { UpdateCustomFieldOptionParameters } from './parameters/updateCustomFieldOptionParameters'; +import type { ReorderCustomFieldOptionsParameters } from './parameters/reorderCustomFieldOptionsParameters'; +import type { DeleteCustomFieldOptionParameters } from './parameters/deleteCustomFieldOptionParameters'; +import type { ReplaceCustomFieldOptionParameters } from './parameters/replaceCustomFieldOptionParameters'; export class IssueCustomFieldOptions { constructor(private client: Client) {} - /** - * Returns a custom field option. For example, an option in a select list. - * - * Note that this operation **only works for issue field select list options created in Jira or using operations from - * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue - * field select list options created by Connect apps. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * custom field option is returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least - * one project the custom field is used in, and the field is visible in at least one layout the user has permission - * to view. + * Returns a custom field option. For example, an option in a select list. * + * + * - Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect apps. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * custom field option is returned as follows: + * - + * - - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least + * one project the custom field is used in, and the field is visible in at least one layout the user has + * permission to view. */ - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback: Callback, - ): Promise; - /** - * Returns a custom field option. For example, an option in a select list. - * - * Note that this operation **only works for issue field select list options created in Jira or using operations from - * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue - * field select list options created by Connect apps. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * custom field option is returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least - * one project the custom field is used in, and the field is visible in at least one layout the user has permission - * to view. - */ - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback?: never, - ): Promise; - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/customFieldOption/${id}`, + async getCustomFieldOption(parameters: GetCustomFieldOptionParameters) { + const request: Request = { + url: `/rest/api/2/customFieldOption/${parameters.id}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all * custom field option for a context. Options are returned first then cascading options, in the order they display in - * Jira. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). _Edit Workflow_ [edit workflow - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Edit-Workflows) + * Jira. * + * + * - This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). _Edit Workflow_ [edit workflow + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Edit-Workflows) */ - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * custom field option for a context. Options are returned first then cascading options, in the order they display in - * Jira. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). _Edit Workflow_ [edit workflow - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Edit-Workflows) - */ - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback?: never, - ): Promise; - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - ): Promise { - const config: Request = { + async getOptionsForContext(parameters: GetOptionsForContextParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, method: 'GET', query: { @@ -110,49 +61,25 @@ export class IssueCustomFieldOptions { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a - * custom select field. The options are added to a context of the field. - * - * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 - * options. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a - * custom select field. The options are added to a context of the field. - * - * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 - * options. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * custom select field. The options are added to a context of the field. * + * + * - The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 + * options. + * - + * - This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback?: never, - ): Promise; - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - ): Promise { - const config: Request = { + async createCustomFieldOption(parameters: CreateCustomFieldOptionParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, method: 'POST', body: { @@ -160,47 +87,24 @@ export class IssueCustomFieldOptions { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates the options of a custom field. - * - * If any of the options are not found, no options are updated. Options where the values in the request match the - * current values aren't updated and aren't reported in the response. - * - * Note that this operation **only works for issue field select list options created in Jira or using operations from - * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue - * field select list options created by Connect apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Updates the options of a custom field. - * - * If any of the options are not found, no options are updated. Options where the values in the request match the - * current values aren't updated and aren't reported in the response. - * - * Note that this operation **only works for issue field select list options created in Jira or using operations from - * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue - * field select list options created by Connect apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Updates the options of a custom field. * + * + * - If any of the options are not found, no options are updated. Options where the values in the request match the + * current values aren't updated and aren't reported in the response. + * - + * - Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect apps. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback?: never, - ): Promise; - async updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - ): Promise { - const config: Request = { + async updateCustomFieldOption(parameters: UpdateCustomFieldOptionParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, method: 'PUT', body: { @@ -208,39 +112,21 @@ export class IssueCustomFieldOptions { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Changes the order of custom field options or cascading options in a context. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback: Callback, - ): Promise; - /** - * Changes the order of custom field options or cascading options in a context. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Changes the order of custom field options or cascading options in a context. * + * + * - This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback?: never, - ): Promise; - async reorderCustomFieldOptions(parameters: Parameters.ReorderCustomFieldOptions): Promise { - const config: Request = { + async reorderCustomFieldOptions(parameters: ReorderCustomFieldOptionsParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/move`, method: 'PUT', body: { @@ -250,77 +136,42 @@ export class IssueCustomFieldOptions { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a custom field option. - * - * Options with cascading options cannot be deleted without deleting the cascading options first. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldOption( - parameters: Parameters.DeleteCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Deletes a custom field option. - * - * Options with cascading options cannot be deleted without deleting the cascading options first. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Deletes a custom field option. * + * + * - Options with cascading options cannot be deleted without deleting the cascading options first. + * - + * - This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteCustomFieldOption(parameters: Parameters.DeleteCustomFieldOption, callback?: never): Promise; - async deleteCustomFieldOption(parameters: Parameters.DeleteCustomFieldOption): Promise { - const config: Request = { + async deleteCustomFieldOption(parameters: DeleteCustomFieldOptionParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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). + * 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): Promise { - const config: Request = { + async replaceCustomFieldOption(parameters: ReplaceCustomFieldOptionParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}/issue`, method: 'DELETE', query: { @@ -329,6 +180,6 @@ export class IssueCustomFieldOptions { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueCustomFieldOptionsApps.ts b/src/version2/issueCustomFieldOptionsApps.ts index 36ea2787dd..a8373439c7 100644 --- a/src/version2/issueCustomFieldOptionsApps.ts +++ b/src/version2/issueCustomFieldOptionsApps.ts @@ -1,103 +1,58 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAllIssueFieldOptionsParameters } from './parameters/getAllIssueFieldOptionsParameters'; +import type { CreateIssueFieldOptionParameters } from './parameters/createIssueFieldOptionParameters'; +import type { GetSelectableIssueFieldOptionsParameters } from './parameters/getSelectableIssueFieldOptionsParameters'; +import type { GetVisibleIssueFieldOptionsParameters } from './parameters/getVisibleIssueFieldOptionsParameters'; +import type { DeleteIssueFieldOptionParameters } from './parameters/deleteIssueFieldOptionParameters'; +import type { GetIssueFieldOptionParameters } from './parameters/getIssueFieldOptionParameters'; +import type { UpdateIssueFieldOptionParameters } from './parameters/updateIssueFieldOptionParameters'; +import type { ReplaceIssueFieldOptionParameters } from './parameters/replaceIssueFieldOptionParameters'; export class IssueCustomFieldOptionsApps { constructor(private client: Client) {} - /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all * the options of a select list issue field. A select list issue field is a type of [issue * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a - * value from a list of options. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * the options of a select list issue field. A select list issue field is a type of [issue - * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a - * value from a list of options. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback?: never, - ): Promise; - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: Request = { - url: `/rest/api/2/field/${fieldKey}/option`, + * value from a list of options. * + * + * - Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not + * required for the app providing the field. + */ + async getAllIssueFieldOptions(parameters: GetAllIssueFieldOptionsParameters) { + const request: Request = { + url: `/rest/api/2/field/${parameters.fieldKey}/option`, method: 'GET', query: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates an option for a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * 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. - */ - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Creates an option for a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. + * Creates an option for a select list issue field. * * - * 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. + * - Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * - + * - 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. */ - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback?: never, - ): Promise; - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - ): Promise { - const config: Request = { + async createIssueFieldOption(parameters: CreateIssueFieldOptionParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldKey}/option`, method: 'POST', body: { @@ -107,184 +62,114 @@ export class IssueCustomFieldOptionsApps { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * options for a select list issue field that can be viewed and selected by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * options for a select list issue field that can be viewed and selected by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback?: never, - ): Promise; - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: Request = { - url: `/rest/api/2/field/${fieldKey}/option/suggestions/edit`, + * options for a select list issue field that can be viewed and selected by the user. * + * + * - Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getSelectableIssueFieldOptions(parameters: GetSelectableIssueFieldOptionsParameters) { + const request: Request = { + url: `/rest/api/2/field/${parameters.fieldKey}/option/suggestions/edit`, method: 'GET', query: { - 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); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * options for a select list issue field that can be viewed by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * options for a select list issue field that can be viewed by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback?: never, - ): Promise; - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: Request = { - url: `/rest/api/2/field/${fieldKey}/option/suggestions/search`, + * options for a select list issue field that can be viewed by the user. * + * + * - Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getVisibleIssueFieldOptions(parameters: GetVisibleIssueFieldOptionsParameters) { + const request: Request = { + url: `/rest/api/2/field/${parameters.fieldKey}/option/suggestions/search`, method: 'GET', query: { - 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); + return this.client.sendRequest(request); } /** - * Returns an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. + * Deletes an option from a select list issue field. * * - * **[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. + * - Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not + * required for the app providing the field. */ - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback: Callback, - ): Promise; + async deleteIssueFieldOption(parameters: DeleteIssueFieldOptionParameters) { + const request: Request = { + url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** - * Returns an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. + * Returns an option from a select list issue field. * * - * **[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. + * - Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not + * required for the app providing the field. */ - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback?: never, - ): Promise; - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - ): Promise { - const config: Request = { + async getIssueFieldOption(parameters: GetIssueFieldOptionParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID - * provided in the path and body must be identical. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided - * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID - * provided in the path and body must be identical. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback?: never, - ): Promise; - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - ): Promise { - const config: Request = { + * provided in the path and body must be identical. * + * + * - Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not + * required for the app providing the field. + */ + async updateIssueFieldOption(parameters: UpdateIssueFieldOptionParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, method: 'PUT', body: { @@ -295,97 +180,31 @@ export class IssueCustomFieldOptionsApps { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } - /** - * Deletes an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async deleteIssueFieldOption( - parameters: Parameters.DeleteIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Deletes an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async deleteIssueFieldOption(parameters: Parameters.DeleteIssueFieldOption, callback?: never): Promise; - async deleteIssueFieldOption(parameters: Parameters.DeleteIssueFieldOption): Promise { - const config: Request = { - url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config); - } - - /** - * Deselects an issue-field select-list option from all issues where it is selected. A different option can be - * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a JQL - * query. - * - * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This is an [asynchronous - * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response - * object contains a link to the long-running task. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback: Callback, - ): Promise; /** * Deselects an issue-field select-list option from all issues where it is selected. A different option can be * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a JQL - * query. - * - * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This is an [asynchronous - * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response - * object contains a link to the long-running task. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback?: never, - ): Promise; - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - ): Promise { - const config: Request = { + * query. * + * + * - Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * - + * - This is an [asynchronous + * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response + * object contains a link to the long-running task. + * - + * - Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not + * required for the app providing the field. + */ + async replaceIssueFieldOption(parameters: ReplaceIssueFieldOptionParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}/issue`, method: 'DELETE', query: { @@ -396,6 +215,6 @@ export class IssueCustomFieldOptionsApps { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueCustomFieldValuesApps.ts b/src/version2/issueCustomFieldValuesApps.ts index 9195ee1d37..bbc0e074d9 100644 --- a/src/version2/issueCustomFieldValuesApps.ts +++ b/src/version2/issueCustomFieldValuesApps.ts @@ -1,53 +1,27 @@ -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { UpdateMultipleCustomFieldValuesParameters } from './parameters/updateMultipleCustomFieldValuesParameters'; +import type { UpdateCustomFieldValueParameters } from './parameters/updateCustomFieldValueParameters'; 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. - * - * 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 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, - 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. - * - * 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. + * be unique within the request. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * 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. + * - 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 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, - callback?: never, - ): Promise; - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - ): Promise { - const config: Request = { + async updateMultipleCustomFieldValues(parameters: UpdateMultipleCustomFieldValuesParameters) { + const request: Request = { url: '/rest/api/2/app/field/value', method: 'POST', query: { @@ -58,44 +32,25 @@ export class IssueCustomFieldValuesApps { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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 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. - * - * 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 owns the custom field or custom field type can update its values with this operation. + * Updates the value of a custom field on one or more issues. * * - * 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. + * - 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 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(parameters: Parameters.UpdateCustomFieldValue): Promise { - const config: Request = { + async updateCustomFieldValue(parameters: UpdateCustomFieldValueParameters) { + const request: Request = { url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/value`, method: 'PUT', query: { @@ -106,6 +61,6 @@ export class IssueCustomFieldValuesApps { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueFieldConfigurations.ts b/src/version2/issueFieldConfigurations.ts index dbfff09012..b284ea6832 100644 --- a/src/version2/issueFieldConfigurations.ts +++ b/src/version2/issueFieldConfigurations.ts @@ -1,262 +1,153 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAllFieldConfigurationsParameters } from './parameters/getAllFieldConfigurationsParameters'; +import type { CreateFieldConfigurationParameters } from './parameters/createFieldConfigurationParameters'; +import type { DeleteFieldConfigurationParameters } from './parameters/deleteFieldConfigurationParameters'; +import type { UpdateFieldConfigurationParameters } from './parameters/updateFieldConfigurationParameters'; +import type { GetFieldConfigurationItemsParameters } from './parameters/getFieldConfigurationItemsParameters'; +import type { UpdateFieldConfigurationItemsParameters } from './parameters/updateFieldConfigurationItemsParameters'; +import type { GetAllFieldConfigurationSchemesParameters } from './parameters/getAllFieldConfigurationSchemesParameters'; +import type { CreateFieldConfigurationSchemeParameters } from './parameters/createFieldConfigurationSchemeParameters'; +import type { GetFieldConfigurationSchemeMappingsParameters } from './parameters/getFieldConfigurationSchemeMappingsParameters'; +import type { GetFieldConfigurationSchemeProjectMappingParameters } from './parameters/getFieldConfigurationSchemeProjectMappingParameters'; +import type { AssignFieldConfigurationSchemeToProjectParameters } from './parameters/assignFieldConfigurationSchemeToProjectParameters'; +import type { DeleteFieldConfigurationSchemeParameters } from './parameters/deleteFieldConfigurationSchemeParameters'; +import type { UpdateFieldConfigurationSchemeParameters } from './parameters/updateFieldConfigurationSchemeParameters'; +import type { SetFieldConfigurationSchemeMappingParameters } from './parameters/setFieldConfigurationSchemeMappingParameters'; +import type { RemoveIssueTypesFromGlobalFieldConfigurationSchemeParameters } from './parameters/removeIssueTypesFromGlobalFieldConfigurationSchemeParameters'; export class IssueFieldConfigurations { constructor(private client: Client) {} - /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field * configurations. The list can be for all field configurations or a subset determined by any combination of these - * criteria: - * - * - A list of field configuration item IDs. - * - Whether the field configuration is a default. - * - Whether the field configuration name or description contains a query string. - * - * Only field configurations used in company-managed (classic) projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllFieldConfigurations( - parameters: Parameters.GetAllFieldConfigurations | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configurations. The list can be for all field configurations or a subset determined by any combination of these - * criteria: - * - * - A list of field configuration item IDs. - * - Whether the field configuration is a default. - * - Whether the field configuration name or description contains a query string. - * - * Only field configurations used in company-managed (classic) projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * criteria: * + * + * - - A list of field configuration item IDs. + * - - Whether the field configuration is a default. + * - - Whether the field configuration name or description contains a query string. + * - + * - Only field configurations used in company-managed (classic) projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAllFieldConfigurations( - parameters?: Parameters.GetAllFieldConfigurations, - callback?: never, - ): Promise; - async getAllFieldConfigurations( - parameters?: Parameters.GetAllFieldConfigurations, - ): Promise { - const config: Request = { + async getAllFieldConfigurations(parameters: GetAllFieldConfigurationsParameters) { + const request: Request = { url: '/rest/api/2/fieldconfiguration', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - isDefault: parameters?.isDefault, - query: parameters?.query, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + id: parameters.id, + isDefault: parameters.isDefault, + query: parameters.query, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Creates a field configuration. The field configuration is created with the same field properties as the default - * configuration, with all the fields being optional. - * - * This operation can only create configurations for use in company-managed (classic) projects. + * configuration, with all the fields being optional. * * - * **[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 only create configurations for use in company-managed (classic) projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createFieldConfiguration( - parameters: Parameters.CreateFieldConfiguration, - callback: Callback, - ): Promise; - /** - * Creates a field configuration. The field configuration is created with the same field properties as the default - * configuration, with all the fields being optional. - * - * This operation can only create configurations for use in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfiguration( - parameters: Parameters.CreateFieldConfiguration, - callback?: never, - ): Promise; - async createFieldConfiguration( - parameters: Parameters.CreateFieldConfiguration, - ): Promise { - const config: Request = { + async createFieldConfiguration(parameters: CreateFieldConfigurationParameters) { + const request: Request = { url: '/rest/api/2/fieldconfiguration', method: 'POST', body: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a field configuration. The name and the description provided in the request override the existing values. + * Deletes a field configuration. * * - * This operation can only update configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - This operation can only delete configurations used in company-managed (classic) projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback: Callback, - ): Promise; - /** - * Updates a field configuration. The name and the description provided in the request override the existing values. - * - * This operation can only update configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback?: never, - ): Promise; - async updateFieldConfiguration(parameters: Parameters.UpdateFieldConfiguration): Promise { - const config: Request = { + async deleteFieldConfiguration(parameters: DeleteFieldConfigurationParameters) { + const request: Request = { url: `/rest/api/2/fieldconfiguration/${parameters.id}`, - method: 'PUT', - body: { - name: parameters.name, - description: parameters.description, - }, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a field configuration. - * - * This operation can only delete configurations used in company-managed (classic) projects. + * Updates a field configuration. The name and the description provided in the request override the existing values. * * - * **[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 only update configurations used in company-managed (classic) projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration | string, - callback: Callback, - ): Promise; - /** - * Deletes a field configuration. - * - * This operation can only delete configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration | string, - callback?: never, - ): Promise; - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/fieldconfiguration/${id}`, - method: 'DELETE', + async updateFieldConfiguration(parameters: UpdateFieldConfigurationParameters) { + const request: Request = { + url: `/rest/api/2/fieldconfiguration/${parameters.id}`, + method: 'PUT', + body: { + description: parameters.description, + name: parameters.name, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * fields for a configuration. - * - * Only the fields from configurations used in company-managed (classic) projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * fields for a configuration. + * fields for a configuration. * * - * Only the fields from configurations used in company-managed (classic) projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only the fields from configurations used in company-managed (classic) projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems | string, - callback?: never, - ): Promise; - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/fieldconfiguration/${id}/fields`, + async getFieldConfigurationItems(parameters: GetFieldConfigurationItemsParameters) { + const request: Request = { + url: `/rest/api/2/fieldconfiguration/${parameters.id}/fields`, method: 'GET', query: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Updates fields in a field configuration. The properties of the field configuration fields provided override the - * existing values. - * - * This operation can only update field configurations used in company-managed (classic) projects. - * - * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style - * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer - * (`autocomplete-renderer`). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * existing values. * + * + * - This operation can only update field configurations used in company-managed (classic) projects. + * - + * - The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style + * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer + * (`autocomplete-renderer`). + * - + * - Hiding a field deletes it from the field configuration - deleting the required, description and renderer type + * values as well. As a result, hiding and unhiding will not restore the other values but use their default values. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback: Callback, - ): Promise; - /** - * Updates fields in a field configuration. The properties of the field configuration fields provided override the - * existing values. - * - * This operation can only update field configurations used in company-managed (classic) projects. - * - * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style - * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer - * (`autocomplete-renderer`). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback?: never, - ): Promise; - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - ): Promise { - const config: Request = { + async updateFieldConfigurationItems(parameters: UpdateFieldConfigurationItemsParameters) { + const request: Request = { url: `/rest/api/2/fieldconfiguration/${parameters.id}/fields`, method: 'PUT', body: { @@ -264,168 +155,90 @@ export class IssueFieldConfigurations { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration schemes. - * - * Only field configuration schemes used in classic projects are returned. + * configuration schemes. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only field configuration schemes used in classic projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAllFieldConfigurationSchemes( - parameters: Parameters.GetAllFieldConfigurationSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration schemes. - * - * Only field configuration schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllFieldConfigurationSchemes( - parameters?: Parameters.GetAllFieldConfigurationSchemes, - callback?: never, - ): Promise; - async getAllFieldConfigurationSchemes( - parameters?: Parameters.GetAllFieldConfigurationSchemes, - ): Promise { - const config: Request = { + async getAllFieldConfigurationSchemes(parameters: GetAllFieldConfigurationSchemesParameters) { + const request: Request = { url: '/rest/api/2/fieldconfigurationscheme', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + id: parameters.id, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a field configuration scheme. + * Creates a field configuration scheme. * * - * This operation can only create field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - This operation can only create field configuration schemes used in company-managed (classic) projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createFieldConfigurationScheme( - parameters: Parameters.CreateFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Creates a field configuration scheme. - * - * This operation can only create field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfigurationScheme( - parameters: Parameters.CreateFieldConfigurationScheme, - callback?: never, - ): Promise; - async createFieldConfigurationScheme( - parameters: Parameters.CreateFieldConfigurationScheme, - ): Promise { - const config: Request = { + async createFieldConfigurationScheme(parameters: CreateFieldConfigurationSchemeParameters) { + const request: Request = { url: '/rest/api/2/fieldconfigurationscheme', method: 'POST', body: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration issue type items. - * - * Only items used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationSchemeMappings( - parameters: Parameters.GetFieldConfigurationSchemeMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration issue type items. + * configuration issue type items. * * - * Only items used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only items used in classic projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getFieldConfigurationSchemeMappings( - parameters?: Parameters.GetFieldConfigurationSchemeMappings, - callback?: never, - ): Promise; - async getFieldConfigurationSchemeMappings( - parameters?: Parameters.GetFieldConfigurationSchemeMappings, - ): Promise { - const config: Request = { + async getFieldConfigurationSchemeMappings(parameters: GetFieldConfigurationSchemeMappingsParameters) { + const request: Request = { url: '/rest/api/2/fieldconfigurationscheme/mapping', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + fieldConfigurationSchemeId: parameters.fieldConfigurationSchemeId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration schemes and, for each scheme, a list of the projects that use it. - * - * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to - * the default field configuration scheme. - * - * Only field configuration schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * configuration schemes and, for each scheme, a list of the projects that use it. * + * + * - The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to + * the default field configuration scheme. + * - + * - Only field configuration schemes used in classic projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration schemes and, for each scheme, a list of the projects that use it. - * - * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to - * the default field configuration scheme. - * - * Only field configuration schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback?: never, - ): Promise; - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - ): Promise { - const config: Request = { + async getFieldConfigurationSchemeProjectMapping(parameters: GetFieldConfigurationSchemeProjectMappingParameters) { + const request: Request = { url: '/rest/api/2/fieldconfigurationscheme/project', method: 'GET', query: { @@ -435,39 +248,20 @@ export class IssueFieldConfigurations { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation - * assigns the default field configuration scheme. - * - * Field configuration schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignFieldConfigurationSchemeToProject( - parameters: Parameters.AssignFieldConfigurationSchemeToProject, - callback: Callback, - ): Promise; - /** - * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation - * assigns the default field configuration scheme. - * - * Field configuration schemes can only be assigned to classic projects. + * assigns the default field configuration scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Field configuration schemes can only be assigned to classic projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async assignFieldConfigurationSchemeToProject( - parameters: Parameters.AssignFieldConfigurationSchemeToProject, - callback?: never, - ): Promise; - async assignFieldConfigurationSchemeToProject( - parameters: Parameters.AssignFieldConfigurationSchemeToProject, - ): Promise { - const config: Request = { + async assignFieldConfigurationSchemeToProject(parameters: AssignFieldConfigurationSchemeToProjectParameters) { + const request: Request = { url: '/rest/api/2/fieldconfigurationscheme/project', method: 'PUT', body: { @@ -476,113 +270,57 @@ export class IssueFieldConfigurations { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a field configuration scheme. + * Deletes a field configuration scheme. * * - * This operation can only update field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Updates a field configuration scheme. - * - * This operation can only update field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - This operation can only delete field configuration schemes used in company-managed (classic) projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback?: never, - ): Promise; - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - ): Promise { - const config: Request = { + async deleteFieldConfigurationScheme(parameters: DeleteFieldConfigurationSchemeParameters) { + const request: Request = { url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}`, - method: 'PUT', - body: { - name: parameters.name, - description: parameters.description, - }, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a field configuration scheme. - * - * This operation can only delete field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a field configuration scheme. + * Updates a field configuration scheme. * * - * This operation can only delete field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - This operation can only update field configuration schemes used in company-managed (classic) projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme | string, - callback?: never, - ): Promise; - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/fieldconfigurationscheme/${id}`, - method: 'DELETE', + async updateFieldConfigurationScheme(parameters: UpdateFieldConfigurationSchemeParameters) { + const request: Request = { + url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}`, + method: 'PUT', + body: { + description: parameters.description, + name: parameters.name, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Assigns issue types to field configurations on field configuration scheme. + * Assigns issue types to field configurations on field configuration scheme. * * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - This operation can only modify field configuration schemes used in company-managed (classic) projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback: Callback, - ): Promise; - /** - * Assigns issue types to field configurations on field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback?: never, - ): Promise; - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - ): Promise { - const config: Request = { + async setFieldConfigurationSchemeMapping(parameters: SetFieldConfigurationSchemeMappingParameters) { + const request: Request = { url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}/mapping`, method: 'PUT', body: { @@ -590,37 +328,21 @@ export class IssueFieldConfigurations { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Removes issue types from the field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Removes issue types from the field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * Removes issue types from the field configuration scheme. * * - * **[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 only modify field configuration schemes used in company-managed (classic) projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback?: never, - ): Promise; - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - ): Promise { - const config: Request = { + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: RemoveIssueTypesFromGlobalFieldConfigurationSchemeParameters, + ) { + const request: Request = { url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}/mapping/delete`, method: 'POST', body: { @@ -628,6 +350,6 @@ export class IssueFieldConfigurations { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueFields.ts b/src/version2/issueFields.ts index d66238d8e7..54f0099365 100644 --- a/src/version2/issueFields.ts +++ b/src/version2/issueFields.ts @@ -1,204 +1,127 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { CreateCustomFieldParameters } from './parameters/createCustomFieldParameters'; +import type { GetFieldsPaginatedParameters } from './parameters/getFieldsPaginatedParameters'; +import type { GetTrashedFieldsPaginatedParameters } from './parameters/getTrashedFieldsPaginatedParameters'; +import type { UpdateCustomFieldParameters } from './parameters/updateCustomFieldParameters'; +import type { DeleteCustomFieldParameters } from './parameters/deleteCustomFieldParameters'; +import type { RestoreCustomFieldParameters } from './parameters/restoreCustomFieldParameters'; +import type { TrashCustomFieldParameters } from './parameters/trashCustomFieldParameters'; export class IssueFields { constructor(private client: Client) {} - /** - * Returns system and custom issue fields according to the following rules: - * - * - Fields that cannot be added to the issue navigator are always returned. - * - Fields that cannot be placed on an issue screen are always returned. - * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking - * fields, subtasks, votes, and watches. - * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the - * field is used in at least one project that the user has _Browse Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for.) - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getFields(callback: Callback): Promise; - /** - * Returns system and custom issue fields according to the following rules: - * - * - Fields that cannot be added to the issue navigator are always returned. - * - Fields that cannot be placed on an issue screen are always returned. - * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking - * fields, subtasks, votes, and watches. - * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the - * field is used in at least one project that the user has _Browse Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for.) - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getFields(callback?: never): Promise; - async getFields(): Promise { - const config: Request = { + * Returns system and custom issue fields according to the following rules: * + * + * - - Fields that cannot be added to the issue navigator are always returned. + * - - Fields that cannot be placed on an issue screen are always returned. + * - - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking + * fields, subtasks, votes, and watches. + * - - For all other fields, this operation only returns the fields that the user has permission to view (that is, the + * field is used in at least one project that the user has _Browse Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for.) + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getFields() { + const request: Request = { url: '/rest/api/2/field', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomField( - parameters: Parameters.CreateCustomField | undefined, - callback: Callback, - ): Promise; - /** - * Creates a custom field. + * Creates a custom field. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createCustomField( - parameters?: Parameters.CreateCustomField, - callback?: never, - ): Promise; - async createCustomField(parameters?: Parameters.CreateCustomField): Promise { - const config: Request = { + async createCustomField(parameters: CreateCustomFieldParameters) { + const request: Request = { url: '/rest/api/2/field', method: 'POST', body: { - description: parameters?.description, - name: parameters?.name, - searcherKey: parameters?.searcherKey, - type: parameters?.type, + description: parameters.description, + name: parameters.name, + searcherKey: parameters.searcherKey, + type: parameters.type, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields - * for Classic Jira projects. The list can include: - * - * - All fields - * - Specific fields, by defining `id` - * - Fields that contain a string in the field name or description, by defining `query` - * - Specific fields that contain a string in the field name or description, by defining `id` and `query` - * - * 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). - */ - async getFieldsPaginated( - parameters: Parameters.GetFieldsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields - * for Classic Jira projects. The list can include: - * - * - All fields - * - Specific fields, by defining `id` - * - Fields that contain a string in the field name or description, by defining `query` - * - Specific fields that contain a string in the field name or description, by defining `id` and `query` - * - * 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). - */ - async getFieldsPaginated( - parameters?: Parameters.GetFieldsPaginated, - callback?: never, - ): Promise; - async getFieldsPaginated(parameters?: Parameters.GetFieldsPaginated): Promise { - const config: Request = { + * for Classic Jira projects. The list can include: * + * + * - - All fields + * - - Specific fields, by defining `id` + * - - Fields that contain a string in the field name or description, by defining `query` + * - - Specific fields that contain a string in the field name or description, by defining `id` and `query` + * - + * - 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:** + * Permission to access Jira. + */ + async getFieldsPaginated(parameters: GetFieldsPaginatedParameters) { + const request: Request = { url: '/rest/api/2/field/search', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - type: parameters?.type, - id: parameters?.id, - query: parameters?.query, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - projectIds: parameters?.projectIds, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + type: parameters.type, + id: parameters.id, + query: parameters.query, + orderBy: parameters.orderBy, + expand: parameters.expand, + projectIds: parameters.projectIds, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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. + * in the trash. The list may be restricted to fields whose field name or description partially match a string. * * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only custom fields can be queried, `type` must be set to `custom`. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getTrashedFieldsPaginated( - parameters: Parameters.GetTrashedFieldsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields - * in the trash. The list may be restricted to fields whose field name or description partially match a string. - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getTrashedFieldsPaginated( - parameters?: Parameters.GetTrashedFieldsPaginated, - callback?: never, - ): Promise; - async getTrashedFieldsPaginated( - parameters?: Parameters.GetTrashedFieldsPaginated, - ): Promise { - const config: Request = { + async getTrashedFieldsPaginated(parameters: GetTrashedFieldsPaginatedParameters) { + const request: Request = { url: '/rest/api/2/field/search/trashed', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - query: parameters?.query, - expand: parameters?.expand, - orderBy: parameters?.orderBy, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + id: parameters.id, + query: parameters.query, + expand: parameters.expand, + orderBy: parameters.orderBy, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a custom field. + * Updates a custom field. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateCustomField(parameters: Parameters.UpdateCustomField, callback: Callback): Promise; - /** - * Updates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomField(parameters: Parameters.UpdateCustomField, callback?: never): Promise; - async updateCustomField(parameters: Parameters.UpdateCustomField): Promise { - const config: Request = { + async updateCustomField(parameters: UpdateCustomFieldParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.fieldId}`, method: 'PUT', body: { @@ -208,94 +131,59 @@ export class IssueFields { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom - * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomField(parameters: Parameters.DeleteCustomField, callback: Callback): Promise; - /** - * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom - * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomField(parameters: Parameters.DeleteCustomField, callback?: never): Promise; - async deleteCustomField(parameters: Parameters.DeleteCustomField): Promise { - const config: Request = { + * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. * + * + * - This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomField(parameters: DeleteCustomFieldParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.id}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) - * for more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async restoreCustomField( - parameters: Parameters.RestoreCustomField, - callback: Callback, - ): Promise; - /** - * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) - * for more information on trashing and deleting custom fields. + * for more information on trashing and deleting custom fields. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async restoreCustomField(parameters: Parameters.RestoreCustomField, callback?: never): Promise; - async restoreCustomField(parameters: Parameters.RestoreCustomField): Promise { - const config: Request = { + async restoreCustomField(parameters: RestoreCustomFieldParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.id}/restore`, method: 'POST', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for - * more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async trashCustomField(parameters: Parameters.TrashCustomField, callback: Callback): Promise; - /** - * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for - * more information on trashing and deleting custom fields. + * more information on trashing and deleting custom fields. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async trashCustomField(parameters: Parameters.TrashCustomField, callback?: never): Promise; - async trashCustomField(parameters: Parameters.TrashCustomField): Promise { - const config: Request = { + async trashCustomField(parameters: TrashCustomFieldParameters) { + const request: Request = { url: `/rest/api/2/field/${parameters.id}/trash`, method: 'POST', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueLinkTypes.ts b/src/version2/issueLinkTypes.ts index 7b0873388a..70e3249579 100644 --- a/src/version2/issueLinkTypes.ts +++ b/src/version2/issueLinkTypes.ts @@ -1,71 +1,42 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { CreateIssueLinkTypeParameters } from './parameters/createIssueLinkTypeParameters'; +import type { DeleteIssueLinkTypeParameters } from './parameters/deleteIssueLinkTypeParameters'; +import type { GetIssueLinkTypeParameters } from './parameters/getIssueLinkTypeParameters'; +import type { UpdateIssueLinkTypeParameters } from './parameters/updateIssueLinkTypeParameters'; export class IssueLinkTypes { constructor(private client: Client) {} - - /** - * Returns a list of all issue link types. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. - */ - async getIssueLinkTypes(callback: Callback): Promise; /** - * Returns a list of all issue link types. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + * Returns a list of all issue link types. * + * + * - To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. */ - async getIssueLinkTypes(callback?: never): Promise; - async getIssueLinkTypes(): Promise { - const config: Request = { + async getIssueLinkTypes() { + const request: Request = { url: '/rest/api/2/issueLinkType', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The - * issue link type consists of a name and descriptions for a link's inward and outward relationships. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback: Callback, - ): Promise; - /** - * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The - * issue link type consists of a name and descriptions for a link's inward and outward relationships. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * issue link type consists of a name and descriptions for a link's inward and outward relationships. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback?: never, - ): Promise; - async createIssueLinkType(parameters: Parameters.CreateIssueLinkType): Promise { - const config: Request = { + async createIssueLinkType(parameters: CreateIssueLinkTypeParameters) { + const request: Request = { url: '/rest/api/2/issueLinkType', method: 'POST', body: { @@ -77,76 +48,55 @@ export class IssueLinkTypes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns an issue link type. + * Deletes an issue link type. * * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + * - To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType | string, - callback: Callback, - ): Promise; + async deleteIssueLinkType(parameters: DeleteIssueLinkTypeParameters) { + const request: Request = { + url: `/rest/api/2/issueLinkType/${parameters.issueLinkTypeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** - * Returns an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + * Returns an issue link type. * + * + * - To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. */ - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType | string, - callback?: never, - ): Promise; - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType | string, - ): Promise { - const issueLinkTypeId = typeof parameters === 'string' ? parameters : parameters.issueLinkTypeId; - - const config: Request = { - url: `/rest/api/2/issueLinkType/${issueLinkTypeId}`, + async getIssueLinkType(parameters: GetIssueLinkTypeParameters) { + const request: Request = { + url: `/rest/api/2/issueLinkType/${parameters.issueLinkTypeId}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback: Callback, - ): Promise; - /** - * Updates an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * Updates an issue link type. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback?: never, - ): Promise; - async updateIssueLinkType(parameters: Parameters.UpdateIssueLinkType): Promise { - const config: Request = { + async updateIssueLinkType(parameters: UpdateIssueLinkTypeParameters) { + const request: Request = { url: `/rest/api/2/issueLinkType/${parameters.issueLinkTypeId}`, method: 'PUT', body: { @@ -158,41 +108,6 @@ export class IssueLinkTypes { }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueLinkType( - parameters: Parameters.DeleteIssueLinkType | string, - callback: Callback, - ): Promise; - /** - * Deletes an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueLinkType( - parameters: Parameters.DeleteIssueLinkType | string, - callback?: never, - ): Promise; - async deleteIssueLinkType(parameters: Parameters.DeleteIssueLinkType | string): Promise { - const issueLinkTypeId = typeof parameters === 'string' ? parameters : parameters.issueLinkTypeId; - - const config: Request = { - url: `/rest/api/2/issueLinkType/${issueLinkTypeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueLinks.ts b/src/version2/issueLinks.ts index fcbc7f20f3..6682aa7707 100644 --- a/src/version2/issueLinks.ts +++ b/src/version2/issueLinks.ts @@ -1,156 +1,90 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { LinkIssuesParameters } from './parameters/linkIssuesParameters'; +import type { DeleteIssueLinkParameters } from './parameters/deleteIssueLinkParameters'; +import type { GetIssueLinkParameters } from './parameters/getIssueLinkParameters'; export class IssueLinks { constructor(private client: Client) {} - /** * Creates a link between two issues. Use this operation to indicate a relationship between two issues and optionally * add a comment to the from (outward) issue. To use this resource the site must have [Issue - * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use - * `https://your-domain.atlassian.net/rest/api/2/issue/[linked issue key]?fields=issuelinks`. - * - * If the link request duplicates a link, the response indicates that the issue link was created. If the request - * included a comment, the comment is added. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the issues to be linked, - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from - * (outward) issue, - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. * + * + * - This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use + * `https://your-domain.atlassian.net/rest/api/2/issue/[linked issue key]?fields=issuelinks`. + * - + * - If the link request duplicates a link, the response indicates that the issue link was created. If the request + * included a comment, the comment is added. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the issues to be linked, + * - - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from + * (outward) issue, + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async linkIssues(parameters: Parameters.LinkIssues, callback: Callback): Promise; - /** - * Creates a link between two issues. Use this operation to indicate a relationship between two issues and optionally - * add a comment to the from (outward) issue. To use this resource the site must have [Issue - * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use - * `https://your-domain.atlassian.net/rest/api/2/issue/[linked issue key]?fields=issuelinks`. - * - * If the link request duplicates a link, the response indicates that the issue link was created. If the request - * included a comment, the comment is added. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the issues to be linked, - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from - * (outward) issue, - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async linkIssues(parameters: Parameters.LinkIssues, callback?: never): Promise; - async linkIssues(parameters: Parameters.LinkIssues): Promise { - const config: Request = { + async linkIssues(parameters: LinkIssuesParameters) { + const request: Request = { url: '/rest/api/2/issueLink', method: 'POST', body: { - type: parameters.type, + comment: parameters.comment, inwardIssue: parameters.inwardIssue, outwardIssue: parameters.outwardIssue, - comment: parameters.comment, + type: parameters.type, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the linked issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async getIssueLink( - parameters: Parameters.GetIssueLink | string, - callback: Callback, - ): Promise; - /** - * Returns an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the linked issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. + * Deletes an issue link. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the + * issues in the link. + * - - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects + * containing issues in the link. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. */ - async getIssueLink(parameters: Parameters.GetIssueLink | string, callback?: never): Promise; - async getIssueLink(parameters: Parameters.GetIssueLink | string): Promise { - const linkId = typeof parameters === 'string' ? parameters : parameters.linkId; - - const config: Request = { - url: `/rest/api/2/issueLink/${linkId}`, - method: 'GET', + async deleteIssueLink(parameters: DeleteIssueLinkParameters) { + const request: Request = { + url: `/rest/api/2/issueLink/${parameters.linkId}`, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the - * issues in the link. - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects - * containing issues in the link. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async deleteIssueLink( - parameters: Parameters.DeleteIssueLink | string, - callback: Callback, - ): Promise; - /** - * Deletes an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the - * issues in the link. - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects - * containing issues in the link. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. + * Returns an issue link. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the linked issues. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. */ - async deleteIssueLink(parameters: Parameters.DeleteIssueLink | string, callback?: never): Promise; - async deleteIssueLink(parameters: Parameters.DeleteIssueLink | string): Promise { - const linkId = typeof parameters === 'string' ? parameters : parameters.linkId; - - const config: Request = { - url: `/rest/api/2/issueLink/${linkId}`, - method: 'DELETE', + async getIssueLink(parameters: GetIssueLinkParameters) { + const request: Request = { + url: `/rest/api/2/issueLink/${parameters.linkId}`, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueNavigatorSettings.ts b/src/version2/issueNavigatorSettings.ts index 72d4a7242d..2cbcc956a7 100644 --- a/src/version2/issueNavigatorSettings.ts +++ b/src/version2/issueNavigatorSettings.ts @@ -1,76 +1,46 @@ -import type * as Models from './models'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; export class IssueNavigatorSettings { constructor(private client: Client) {} - - /** - * Returns the default issue navigator columns. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueNavigatorDefaultColumns(callback: Callback): Promise; /** - * Returns the default issue navigator columns. + * Returns the default issue navigator columns. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueNavigatorDefaultColumns(callback?: never): Promise; - async getIssueNavigatorDefaultColumns(): Promise { - const config: Request = { + async getIssueNavigatorDefaultColumns() { + const request: Request = { url: '/rest/api/2/settings/columns', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the default issue navigator columns. - * - * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple - * columns, pass multiple `columns` parameters. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/settings/columns` - * - * If no column details are sent, then all default columns are removed. - * - * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue - * columns using [Get fields](#api-rest-api-2-field-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueNavigatorDefaultColumns(callback: Callback): Promise; - /** - * Sets the default issue navigator columns. - * - * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple - * columns, pass multiple `columns` parameters. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/settings/columns` - * - * If no column details are sent, then all default columns are removed. - * - * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue - * columns using [Get fields](#api-rest-api-2-field-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Sets the default issue navigator columns. * + * + * - The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple + * columns, pass multiple `columns` parameters. For example, in curl: + * - + * - `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/2/settings/columns` + * - + * - If no column details are sent, then all default columns are removed. + * - + * - A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue + * columns using [Get fields](#api-rest-api-2-field-get). + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setIssueNavigatorDefaultColumns(callback?: never): Promise; - async setIssueNavigatorDefaultColumns(): Promise { - const config: Request = { + async setIssueNavigatorDefaultColumns() { + const request: Request = { url: '/rest/api/2/settings/columns', method: 'PUT', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueNotificationSchemes.ts b/src/version2/issueNotificationSchemes.ts index 495815add3..c5a0f400ca 100644 --- a/src/version2/issueNotificationSchemes.ts +++ b/src/version2/issueNotificationSchemes.ts @@ -1,83 +1,51 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetNotificationSchemesParameters } from './parameters/getNotificationSchemesParameters'; +import type { CreateNotificationSchemeParameters } from './parameters/createNotificationSchemeParameters'; +import type { GetNotificationSchemeToProjectMappingsParameters } from './parameters/getNotificationSchemeToProjectMappingsParameters'; +import type { GetNotificationSchemeParameters } from './parameters/getNotificationSchemeParameters'; +import type { UpdateNotificationSchemeParameters } from './parameters/updateNotificationSchemeParameters'; +import type { AddNotificationsParameters } from './parameters/addNotificationsParameters'; +import type { DeleteNotificationSchemeParameters } from './parameters/deleteNotificationSchemeParameters'; +import type { RemoveNotificationFromNotificationSchemeParameters } from './parameters/removeNotificationFromNotificationSchemeParameters'; export class IssueNotificationSchemes { constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. - * - * _Note that you should allow for events without recipients to appear in responses._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with a notification scheme for it to be returned. - */ - async getNotificationSchemes( - parameters: Parameters.GetNotificationSchemes | undefined, - callback: Callback, - ): Promise; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. - * - * _Note that you should allow for events without recipients to appear in responses._ + * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with a notification scheme for it to be returned. + * - _Note that you should allow for events without recipients to appear in responses._ + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with a notification scheme for it to be returned. */ - async getNotificationSchemes( - parameters?: Parameters.GetNotificationSchemes, - callback?: never, - ): Promise; - async getNotificationSchemes( - parameters?: Parameters.GetNotificationSchemes, - ): Promise { - const config: Request = { + async getNotificationSchemes(parameters: GetNotificationSchemesParameters) { + const request: Request = { url: '/rest/api/2/notificationscheme', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - projectId: parameters?.projectId, - onlyDefault: parameters?.onlyDefault, - expand: parameters?.expand, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + id: parameters.id, + projectId: parameters.projectId, + onlyDefault: parameters.onlyDefault, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback: Callback, - ): Promise; - /** - * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. + * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback?: never, - ): Promise; - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - ): Promise { - const config: Request = { + async createNotificationScheme(parameters: CreateNotificationSchemeParameters) { + const request: Request = { url: '/rest/api/2/notificationscheme', method: 'POST', body: { @@ -87,7 +55,7 @@ export class IssueNotificationSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** @@ -95,108 +63,54 @@ export class IssueNotificationSchemes { * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a - * default notification scheme. The mappings are ordered by projectId. + * default notification scheme. The mappings are ordered by projectId. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async getNotificationSchemeToProjectMappings( - parameters: Parameters.GetNotificationSchemeToProjectMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of - * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or - * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only - * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a - * default notification scheme. The mappings are ordered by projectId. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getNotificationSchemeToProjectMappings( - parameters?: Parameters.GetNotificationSchemeToProjectMappings, - callback?: never, - ): Promise; - async getNotificationSchemeToProjectMappings( - parameters?: Parameters.GetNotificationSchemeToProjectMappings, - ): Promise { - const config: Request = { + async getNotificationSchemeToProjectMappings(parameters: GetNotificationSchemeToProjectMappingsParameters) { + const request: Request = { url: '/rest/api/2/notificationscheme/project', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - notificationSchemeId: parameters?.notificationSchemeId, - projectId: parameters?.projectId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + notificationSchemeId: parameters.notificationSchemeId, + projectId: parameters.projectId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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. + * recipients who will receive notifications for those events. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with the notification scheme. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with the notification scheme. */ - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the - * recipients who will receive notifications for those events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with the notification scheme. - */ - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback?: never, - ): Promise; - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/notificationscheme/${id}`, + async getNotificationScheme(parameters: GetNotificationSchemeParameters) { + const request: Request = { + url: `/rest/api/2/notificationscheme/${parameters.id}`, method: 'GET', query: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a notification scheme. + * Updates a notification scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback: Callback, - ): Promise; - /** - * Updates a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback?: never, - ): Promise; - async updateNotificationScheme(parameters: Parameters.UpdateNotificationScheme): Promise { - const config: Request = { + async updateNotificationScheme(parameters: UpdateNotificationSchemeParameters) { + const request: Request = { url: `/rest/api/2/notificationscheme/${parameters.id}`, method: 'PUT', body: { @@ -205,31 +119,20 @@ export class IssueNotificationSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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._ + * Adds notifications to a notification scheme. You can add up to 1000 notifications per request. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _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): Promise { - const config: Request = { + async addNotifications(parameters: AddNotificationsParameters) { + const request: Request = { url: `/rest/api/2/notificationscheme/${parameters.id}/notification`, method: 'PUT', body: { @@ -237,66 +140,36 @@ export class IssueNotificationSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a notification scheme. + * Deletes a notification scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback: Callback, - ): Promise; - /** - * Deletes a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback?: never, - ): Promise; - async deleteNotificationScheme(parameters: Parameters.DeleteNotificationScheme): Promise { - const config: Request = { + async deleteNotificationScheme(parameters: DeleteNotificationSchemeParameters) { + const request: Request = { url: `/rest/api/2/notificationscheme/${parameters.notificationSchemeId}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Removes a notification from a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback: Callback, - ): Promise; - /** - * Removes a notification from a notification scheme. + * Removes a notification from a notification scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback?: never, - ): Promise; - async removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - ): Promise { - const config: Request = { + async removeNotificationFromNotificationScheme(parameters: RemoveNotificationFromNotificationSchemeParameters) { + const request: Request = { url: `/rest/api/2/notificationscheme/${parameters.notificationSchemeId}/notification/${parameters.notificationId}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issuePriorities.ts b/src/version2/issuePriorities.ts index 8b047324f3..4ab594bcbe 100644 --- a/src/version2/issuePriorities.ts +++ b/src/version2/issuePriorities.ts @@ -1,120 +1,38 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; -import { paramSerializer } from '../paramSerializer'; +import type { SetDefaultPriorityParameters } from './parameters/setDefaultPriorityParameters'; +import type { MovePrioritiesParameters } from './parameters/movePrioritiesParameters'; +import type { DeletePriorityParameters } from './parameters/deletePriorityParameters'; +import type { GetPriorityParameters } from './parameters/getPriorityParameters'; export class IssuePriorities { constructor(private client: Client) {} - - /** - * Returns the list of all issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriorities(callback: Callback): Promise; - /** - * Returns the list of all issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriorities(callback?: never): Promise; - async getPriorities(): Promise { - const config: Request = { - url: '/rest/api/2/priority', - method: 'GET', - }; - - return this.client.sendRequest(config); - } - - /** - * 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: 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): Promise { - const config: Request = { - url: '/rest/api/2/priority', - method: 'POST', - body: { - avatarId: parameters.avatarId, - description: parameters.description, - iconUrl: parameters.iconUrl, - name: parameters.name, - statusColor: parameters.statusColor, - }, - }; - - return this.client.sendRequest(config); - } - - /** - * Sets default issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultPriority( - parameters: Parameters.SetDefaultPriority | undefined, - callback: Callback, - ): Promise; /** - * Sets default issue priority. + * Sets default issue priority. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setDefaultPriority(parameters?: Parameters.SetDefaultPriority, callback?: never): Promise; - async setDefaultPriority(parameters?: Parameters.SetDefaultPriority): Promise { - const config: Request = { + async setDefaultPriority(parameters: SetDefaultPriorityParameters) { + const request: Request = { url: '/rest/api/2/priority/default', method: 'PUT', body: { - id: parameters?.id, + id: parameters.id, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Changes the order of issue priorities. + * 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). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async movePriorities(parameters: Parameters.MovePriorities, callback: Callback): Promise; - /** - * Changes the order of issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async movePriorities(parameters: Parameters.MovePriorities, callback?: never): Promise; - async movePriorities(parameters: Parameters.MovePriorities): Promise { - const config: Request = { + async movePriorities(parameters: MovePrioritiesParameters) { + const request: Request = { url: '/rest/api/2/priority/move', method: 'PUT', body: { @@ -124,159 +42,41 @@ export class IssuePriorities { }, }; - return this.client.sendRequest(config); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: - * - * - A list of priority IDs. Any invalid priority IDs are ignored. - * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project - * IDs are ignored. - * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, - * as there is no concept of default priorities in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchPriorities( - parameters: Parameters.SearchPriorities | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: - * - * - A list of priority IDs. Any invalid priority IDs are ignored. - * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project - * IDs are ignored. - * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, - * as there is no concept of default priorities in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchPriorities( - parameters?: Parameters.SearchPriorities, - callback?: never, - ): Promise; - async searchPriorities(parameters?: Parameters.SearchPriorities): Promise { - const config: Request = { - url: '/rest/api/2/priority/search', - method: 'GET', - query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - projectId: paramSerializer('projectId', parameters?.projectId), - priorityName: parameters?.priorityName, - onlyDefault: parameters?.onlyDefault, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config); - } - - /** - * Returns an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriority( - parameters: Parameters.GetPriority | string, - callback: Callback, - ): Promise; - /** - * Returns an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriority(parameters: Parameters.GetPriority | string, callback?: never): Promise; - async getPriority(parameters: Parameters.GetPriority | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/priority/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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). - */ - async updatePriority(parameters: Parameters.UpdatePriority, callback: Callback): Promise; - /** - * 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). + * Deletes an issue priority. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - 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 updatePriority(parameters: Parameters.UpdatePriority, callback?: never): Promise; - async updatePriority(parameters: Parameters.UpdatePriority): Promise { - const config: Request = { + async deletePriority(parameters: DeletePriorityParameters) { + const request: Request = { url: `/rest/api/2/priority/${parameters.id}`, - method: 'PUT', - body: { - avatarId: parameters.avatarId, - description: parameters.description, - iconUrl: parameters.iconUrl, - name: parameters.name, - statusColor: parameters.statusColor, - }, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * Returns an issue priority. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - 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): Promise { - const config: Request = { + async getPriority(parameters: GetPriorityParameters) { + const request: Request = { url: `/rest/api/2/priority/${parameters.id}`, - method: 'DELETE', + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueProperties.ts b/src/version2/issueProperties.ts index f3dfeb54e8..93894a08d0 100644 --- a/src/version2/issueProperties.ts +++ b/src/version2/issueProperties.ts @@ -1,491 +1,270 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { BulkSetIssuesPropertiesListParameters } from './parameters/bulkSetIssuesPropertiesListParameters'; +import type { BulkSetIssuePropertiesByIssueParameters } from './parameters/bulkSetIssuePropertiesByIssueParameters'; +import type { BulkDeleteIssuePropertyParameters } from './parameters/bulkDeleteIssuePropertyParameters'; +import type { BulkSetIssuePropertyParameters } from './parameters/bulkSetIssuePropertyParameters'; +import type { GetIssuePropertyKeysParameters } from './parameters/getIssuePropertyKeysParameters'; +import type { DeleteIssuePropertyParameters } from './parameters/deleteIssuePropertyParameters'; +import type { GetIssuePropertyParameters } from './parameters/getIssuePropertyParameters'; +import type { SetIssuePropertyParameters } from './parameters/setIssuePropertyParameters'; export class IssueProperties { constructor(private client: Client) {} - - /** - * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified - * along with up to 10,000 issues on which to set or update that list of entity properties. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum - * length of single issue property value is 32768 characters. This operation can be accessed anonymously. - * - * This operation is: - * - * - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are - * updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async bulkSetIssuesProperties( - parameters: Parameters.BulkSetIssuesProperties | undefined, - callback: Callback, - ): Promise; /** * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified - * along with up to 10,000 issues on which to set or update that list of entity properties. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum - * length of single issue property value is 32768 characters. This operation can be accessed anonymously. - * - * This operation is: - * - * - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are - * updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * along with up to 10,000 issues on which to set or update that list of entity properties. * + * + * - The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum + * length of single issue property value is 32768 characters. This operation can be accessed anonymously. + * - + * - This operation is: + * - + * - - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are + * updated. + * - - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async bulkSetIssuesProperties( - parameters?: Parameters.BulkSetIssuesProperties, - callback?: never, - ): Promise; - async bulkSetIssuesProperties(parameters?: Parameters.BulkSetIssuesProperties): Promise { - const config: Request = { + async bulkSetIssuesPropertiesList(parameters: BulkSetIssuesPropertiesListParameters) { + const request: Request = { url: '/rest/api/2/issue/properties', method: 'POST', body: { - entitiesIds: parameters?.entitiesIds, - properties: parameters?.properties, + entitiesIds: parameters.entitiesIds, + properties: parameters.properties, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up - * to 100 issues included in the request. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. - * - * This operation is: - * - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - Non-transactional. Updating some entities may fail. Such information will available in the task result. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async bulkSetIssuePropertiesByIssue( - parameters: Parameters.BulkSetIssuePropertiesByIssue | undefined, - callback: Callback, - ): Promise; - /** - * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up - * to 100 issues included in the request. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. - * - * This operation is: - * - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - Non-transactional. Updating some entities may fail. Such information will available in the task result. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * to 100 issues included in the request. * + * + * - The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. + * - + * - This operation is: + * - + * - - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * - - Non-transactional. Updating some entities may fail. Such information will available in the task result. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async bulkSetIssuePropertiesByIssue( - parameters?: Parameters.BulkSetIssuePropertiesByIssue, - callback?: never, - ): Promise; - async bulkSetIssuePropertiesByIssue( - parameters?: Parameters.BulkSetIssuePropertiesByIssue, - ): Promise { - const config: Request = { + async bulkSetIssuePropertiesByIssue(parameters: BulkSetIssuePropertiesByIssueParameters) { + const request: Request = { url: '/rest/api/2/issue/properties/multi', method: 'POST', body: { - issues: parameters?.issues, + issues: parameters.issues, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets a property value on multiple issues. - * - * The value set can be a constant or determined by a [Jira - * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable - * with constant complexity when applied to a set of issues. Expressions must also comply with the - * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to - * all Jira expressions. - * - * The issues to be updated can be specified by a filter. - * - * The filter identifies issues eligible for update using these criteria: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - `hasProperty`: - * - * - If _true_, only issues with the property are eligible. - * - If _false_, only issues without the property are eligible. - * - * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all - * criteria are eligible. - * - * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` - * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a - * value). - * - * The filter is optional. Without the filter all the issues visible to the user and where the user has the - * EDIT_ISSUES permission for the issue are considered eligible. - * - * This operation is: - * - * - Transactional, either all eligible issues are updated or, when errors occur, none are updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. * + * + * - The criteria the filter used to identify eligible issues are: + * - + * - - `entityIds` Only issues from this list are eligible. + * - - `currentValue` Only issues with the property set to this value are eligible. + * - + * - If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are + * considered eligible. + * - + * - If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES + * permission for the issue are considered eligible. + * - + * - This operation is: + * - + * - - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are + * deleted. + * - - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. */ - async bulkSetIssueProperty( - parameters: Parameters.BulkSetIssueProperty, - callback: Callback, - ): Promise; - /** - * Sets a property value on multiple issues. - * - * The value set can be a constant or determined by a [Jira - * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable - * with constant complexity when applied to a set of issues. Expressions must also comply with the - * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to - * all Jira expressions. - * - * The issues to be updated can be specified by a filter. - * - * The filter identifies issues eligible for update using these criteria: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - `hasProperty`: - * - * - If _true_, only issues with the property are eligible. - * - If _false_, only issues without the property are eligible. - * - * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all - * criteria are eligible. - * - * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` - * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a - * value). - * - * The filter is optional. Without the filter all the issues visible to the user and where the user has the - * EDIT_ISSUES permission for the issue are considered eligible. - * - * This operation is: - * - * - Transactional, either all eligible issues are updated or, when errors occur, none are updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkSetIssueProperty(parameters: Parameters.BulkSetIssueProperty, callback?: never): Promise; - async bulkSetIssueProperty(parameters: Parameters.BulkSetIssueProperty): Promise { - const config: Request = { + async bulkDeleteIssueProperty(parameters: BulkDeleteIssuePropertyParameters) { + const request: Request = { url: `/rest/api/2/issue/properties/${parameters.propertyKey}`, - method: 'PUT', + method: 'DELETE', body: { - value: parameters.value, - expression: parameters.expression, - filter: parameters.filter, + currentValue: parameters.currentValue, + entityIds: parameters.entityIds, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. - * - * The criteria the filter used to identify eligible issues are: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are - * considered eligible. - * - * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES - * permission for the issue are considered eligible. - * - * This operation is: - * - * - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are - * deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback: Callback, - ): Promise; - /** - * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. - * - * The criteria the filter used to identify eligible issues are: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are - * considered eligible. - * - * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES - * permission for the issue are considered eligible. - * - * This operation is: - * - * - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are - * deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + * Sets a property value on multiple issues. * + * + * - The value set can be a constant or determined by a [Jira + * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be + * computable with constant complexity when applied to a set of issues. Expressions must also comply with the + * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to + * all Jira expressions. + * - + * - The issues to be updated can be specified by a filter. + * - + * - The filter identifies issues eligible for update using these criteria: + * - + * - - `entityIds` Only issues from this list are eligible. + * - - `currentValue` Only issues with the property set to this value are eligible. + * - - `hasProperty`: + * - + * - - If _true_, only issues with the property are eligible. + * - - If _false_, only issues without the property are eligible. + * - + * - If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all + * criteria are eligible. + * - + * - If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` + * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a + * value). + * - + * - The filter is optional. Without the filter all the issues visible to the user and where the user has the + * EDIT_ISSUES permission for the issue are considered eligible. + * - + * - This operation is: + * - + * - - Transactional, either all eligible issues are updated or, when errors occur, none are updated. + * - - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. */ - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback?: never, - ): Promise; - async bulkDeleteIssueProperty(parameters: Parameters.BulkDeleteIssueProperty): Promise { - const config: Request = { + async bulkSetIssueProperty(parameters: BulkSetIssuePropertyParameters) { + const request: Request = { url: `/rest/api/2/issue/properties/${parameters.propertyKey}`, - method: 'DELETE', + method: 'PUT', body: { - entityIds: parameters.entityIds, - currentValue: parameters.currentValue, + expression: parameters.expression, + filter: parameters.filter, + value: parameters.value, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the URLs and keys of an issue's properties. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Property details are only returned where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns the URLs and keys of an issue's properties. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Property details are only returned where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * Returns the URLs and keys of an issue's properties. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Property details are only returned where the user has: + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys | string, - callback?: never, - ): Promise; - async getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys | string, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}/properties`, + async getIssuePropertyKeys(parameters: GetIssuePropertyKeysParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the key and value of an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * Deletes an issue's property. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback?: never, - ): Promise; - async getIssueProperty(parameters: Parameters.GetIssueProperty): Promise { - const config: Request = { + async deleteIssueProperty(parameters: DeleteIssuePropertyParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'GET', + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the value of an issue's property. Use this resource to store custom data against an issue. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * Returns the key and value of an issue's property. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async setIssueProperty(parameters: Parameters.SetIssueProperty, callback: Callback): Promise; - /** - * Sets the value of an issue's property. Use this resource to store custom data against an issue. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async setIssueProperty(parameters: Parameters.SetIssueProperty, callback?: never): Promise; - async setIssueProperty(parameters: Parameters.SetIssueProperty): Promise { - const config: Request = { + async getIssueProperty(parameters: GetIssuePropertyParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - body: parameters.propertyValue, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * Sets the value of an issue's property. Use this resource to store custom data against an issue. * + * + * - The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback: Callback): Promise; - /** - * Deletes an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback?: never): Promise; - async deleteIssueProperty(parameters: Parameters.DeleteIssueProperty): Promise { - const config: Request = { + async setIssueProperty(parameters: SetIssuePropertyParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', + method: 'PUT', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueRedaction.ts b/src/version2/issueRedaction.ts new file mode 100644 index 0000000000..066626d3da --- /dev/null +++ b/src/version2/issueRedaction.ts @@ -0,0 +1,43 @@ +import type { Client } from '../client'; +import type { Request } from '../request'; +import type { RedactParameters } from './parameters/redactParameters'; +import type { GetRedactionStatusParameters } from './parameters/getRedactionStatusParameters'; + +export class IssueRedaction { + constructor(private client: Client) {} + /** + * Submit a job to redact issue field data. This will trigger the redaction of the data in the specified fields + * asynchronously. * + * + * - The redaction status can be polled using the job id. + */ + async redact(parameters: RedactParameters) { + const request: Request = { + url: '/rest/api/2/redact', + method: 'POST', + body: { + redactions: parameters.redactions, + }, + }; + + return this.client.sendRequest(request); + } + + /** + * Retrieves the current status of a redaction job ID. * + * + * - The jobStatus will be one of the following: + * - + * - - IN_PROGRESS - The redaction job is currently in progress + * - - COMPLETED - The redaction job has completed successfully. + * - - PENDING - The redaction job has not started yet + */ + async getRedactionStatus(parameters: GetRedactionStatusParameters) { + const request: Request = { + url: `/rest/api/2/redact/status/${parameters.jobId}`, + method: 'GET', + }; + + return this.client.sendRequest(request); + } +} diff --git a/src/version2/issueRemoteLinks.ts b/src/version2/issueRemoteLinks.ts index 21ca0f1d6c..7cbfc04564 100644 --- a/src/version2/issueRemoteLinks.ts +++ b/src/version2/issueRemoteLinks.ts @@ -1,326 +1,177 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { DeleteRemoteIssueLinkByGlobalIdParameters } from './parameters/deleteRemoteIssueLinkByGlobalIdParameters'; +import type { GetRemoteIssueLinksParameters } from './parameters/getRemoteIssueLinksParameters'; +import type { CreateOrUpdateRemoteIssueLinkParameters } from './parameters/createOrUpdateRemoteIssueLinkParameters'; +import type { DeleteRemoteIssueLinkByIdParameters } from './parameters/deleteRemoteIssueLinkByIdParameters'; +import type { GetRemoteIssueLinkByIdParameters } from './parameters/getRemoteIssueLinkByIdParameters'; +import type { UpdateRemoteIssueLinkParameters } from './parameters/updateRemoteIssueLinkParameters'; export class IssueRemoteLinks { constructor(private client: Client) {} - /** - * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that - * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL + * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. * + * + * - This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is implemented, issue-level security + * permission to view the issue. */ - async getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks | string, - callback: Callback, - ): Promise; + async deleteRemoteIssueLinkByGlobalId(parameters: DeleteRemoteIssueLinkByGlobalIdParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink`, + method: 'DELETE', + query: { + globalId: parameters.globalId, + }, + }; + + return this.client.sendRequest(request); + } + /** * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. * + * + * - This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks | string, - callback?: never, - ): Promise; - async getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks | string, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}/remotelink`, + async getRemoteIssueLinks(parameters: GetRemoteIssueLinksParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink`, method: 'GET', query: { - globalId: typeof parameters !== 'string' && parameters.globalId, + globalId: parameters.globalId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates or updates a remote issue link for an issue. - * - * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without - * values in the request are set to null. Otherwise, the remote issue link is created. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * Creates or updates a remote issue link for an issue. * + * + * - If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without + * values in the request are set to null. Otherwise, the remote issue link is created. + * - + * - This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback: Callback, - ): Promise; - /** - * Creates or updates a remote issue link for an issue. - * - * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without - * values in the request are set to null. Otherwise, the remote issue link is created. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback?: never, - ): Promise; - async createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - ): Promise { - const config: Request = { + async createOrUpdateRemoteIssueLink(parameters: CreateOrUpdateRemoteIssueLinkParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink`, method: 'POST', body: { - globalId: parameters.globalId, application: parameters.application, - relationship: parameters.relationship, + globalId: parameters.globalId, object: parameters.object, + relationship: parameters.relationship, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is implemented, issue-level security - * permission to view the issue. - */ - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, - callback: Callback, - ): Promise; - /** - * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is implemented, issue-level security - * permission to view the issue. + * Deletes a remote issue link from an issue. * + * + * - This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_, _Edit issues_, and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for the project that the issue is in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, - callback?: never, - ): Promise; - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}/remotelink`, + async deleteRemoteIssueLinkById(parameters: DeleteRemoteIssueLinkByIdParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, method: 'DELETE', - query: { - globalId: typeof parameters !== 'string' && parameters.globalId, - }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a remote issue link for an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback: Callback, - ): Promise; - /** - * Returns a remote issue link for an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * Returns a remote issue link for an issue. * + * + * - This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback?: never, - ): Promise; - async getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - ): Promise { - const config: Request = { + async getRemoteIssueLinkById(parameters: GetRemoteIssueLinkByIdParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a remote issue link for an issue. - * - * Note: Fields without values in the request are set to null. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * Updates a remote issue link for an issue. * + * + * - Note: Fields without values in the request are set to null. + * - + * - This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async updateRemoteIssueLink( - parameters: Parameters.UpdateRemoteIssueLink, - callback: Callback, - ): Promise; - /** - * Updates a remote issue link for an issue. - * - * Note: Fields without values in the request are set to null. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async updateRemoteIssueLink(parameters: Parameters.UpdateRemoteIssueLink, callback?: never): Promise; - async updateRemoteIssueLink(parameters: Parameters.UpdateRemoteIssueLink): Promise { - const config: Request = { + async updateRemoteIssueLink(parameters: UpdateRemoteIssueLinkParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, method: 'PUT', body: { - globalId: parameters.globalId, application: parameters.application, - relationship: parameters.relationship, + globalId: parameters.globalId, object: parameters.object, + relationship: parameters.relationship, }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes a remote issue link from an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_, _Edit issues_, and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for the project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback: Callback, - ): Promise; - /** - * Deletes a remote issue link from an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_, _Edit issues_, and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for the project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback?: never, - ): Promise; - async deleteRemoteIssueLinkById(parameters: Parameters.DeleteRemoteIssueLinkById): Promise { - const config: Request = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueResolutions.ts b/src/version2/issueResolutions.ts index 3efc00c796..df0c7d5e79 100644 --- a/src/version2/issueResolutions.ts +++ b/src/version2/issueResolutions.ts @@ -1,84 +1,42 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { CreateResolutionParameters } from './parameters/createResolutionParameters'; +import type { SetDefaultResolutionParameters } from './parameters/setDefaultResolutionParameters'; +import type { MoveResolutionsParameters } from './parameters/moveResolutionsParameters'; +import type { SearchResolutionsParameters } from './parameters/searchResolutionsParameters'; +import type { DeleteResolutionParameters } from './parameters/deleteResolutionParameters'; +import type { GetResolutionParameters } from './parameters/getResolutionParameters'; +import type { UpdateResolutionParameters } from './parameters/updateResolutionParameters'; 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(): Promise { - const config: Request = { - url: '/rest/api/2/resolution', - method: 'GET', - }; - - return this.client.sendRequest(config); - } - - /** - * Creates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createResolution( - parameters: Parameters.CreateResolution, - callback: Callback, - ): Promise; /** - * Creates an issue resolution. + * Creates an issue resolution. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createResolution( - parameters: Parameters.CreateResolution, - callback?: never, - ): Promise; - async createResolution(parameters: Parameters.CreateResolution): Promise { - const config: Request = { + async createResolution(parameters: CreateResolutionParameters) { + const request: Request = { url: '/rest/api/2/resolution', method: 'POST', - body: parameters, + body: { + description: parameters.description, + name: parameters.name, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets default issue resolution. + * Sets default issue resolution. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setDefaultResolution( - parameters: Parameters.SetDefaultResolution, - callback: Callback, - ): Promise; - /** - * Sets default issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultResolution(parameters: Parameters.SetDefaultResolution, callback?: never): Promise; - async setDefaultResolution(parameters: Parameters.SetDefaultResolution): Promise { - const config: Request = { + async setDefaultResolution(parameters: SetDefaultResolutionParameters) { + const request: Request = { url: '/rest/api/2/resolution/default', method: 'PUT', body: { @@ -86,25 +44,17 @@ export class IssueResolutions { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Changes the order of issue resolutions. + * 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). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async moveResolutions(parameters: Parameters.MoveResolutions, callback: Callback): Promise; - /** - * Changes the order of issue resolutions. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveResolutions(parameters: Parameters.MoveResolutions, callback?: never): Promise; - async moveResolutions(parameters: Parameters.MoveResolutions): Promise { - const config: Request = { + async moveResolutions(parameters: MoveResolutionsParameters) { + const request: Request = { url: '/rest/api/2/resolution/move', method: 'PUT', body: { @@ -114,141 +64,89 @@ export class IssueResolutions { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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: + * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: * * - * - A list of resolutions IDs. - * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects - * only, as there is no concept of default resolutions in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * - - A list of resolutions IDs. + * - - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects + * only, as there is no concept of default resolutions in team-managed projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async searchResolutions( - parameters: Parameters.SearchResolutions | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: - * - * - A list of resolutions IDs. - * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects - * only, as there is no concept of default resolutions in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchResolutions( - parameters?: Parameters.SearchResolutions, - callback?: never, - ): Promise; - async searchResolutions(parameters?: Parameters.SearchResolutions): Promise { - const config: Request = { + async searchResolutions(parameters: SearchResolutionsParameters) { + const request: Request = { url: '/rest/api/2/resolution/search', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - onlyDefault: parameters?.onlyDefault, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + id: parameters.id, + onlyDefault: parameters.onlyDefault, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * Deletes an issue resolution. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * - 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 getResolution(parameters: Parameters.GetResolution, callback?: never): Promise; - async getResolution(parameters: Parameters.GetResolution): Promise { - const config: Request = { + async deleteResolution(parameters: DeleteResolutionParameters) { + const request: Request = { url: `/rest/api/2/resolution/${parameters.id}`, - method: 'GET', + method: 'DELETE', + query: { + replaceWith: parameters.replaceWith, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates an issue resolution. + * Returns an issue resolution value. * * - * **[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:** + * Permission to access Jira. */ - async updateResolution(parameters: Parameters.UpdateResolution, callback: Callback): Promise; - /** - * Updates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateResolution(parameters: Parameters.UpdateResolution, callback?: never): Promise; - async updateResolution(parameters: Parameters.UpdateResolution): Promise { - const config: Request = { + async getResolution(parameters: GetResolutionParameters) { + const request: Request = { url: `/rest/api/2/resolution/${parameters.id}`, - method: 'PUT', - body: { - ...parameters, - name: parameters.name, - id: undefined, - }, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes an issue resolution. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteResolution(parameters: Parameters.DeleteResolution, callback: Callback): Promise; - /** - * Deletes an issue resolution. + * Updates an issue resolution. * * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteResolution(parameters: Parameters.DeleteResolution, callback?: never): Promise; - async deleteResolution(parameters: Parameters.DeleteResolution): Promise { - const config: Request = { + async updateResolution(parameters: UpdateResolutionParameters) { + const request: Request = { url: `/rest/api/2/resolution/${parameters.id}`, - method: 'DELETE', - query: { - replaceWith: parameters.replaceWith, + method: 'PUT', + body: { + description: parameters.description, + name: parameters.name, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueSearch.ts b/src/version2/issueSearch.ts index c957577657..00ba70147e 100644 --- a/src/version2/issueSearch.ts +++ b/src/version2/issueSearch.ts @@ -1,95 +1,58 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetIssuePickerResourceParameters } from './parameters/getIssuePickerResourceParameters'; +import type { MatchIssuesParameters } from './parameters/matchIssuesParameters'; +import type { CountIssuesParameters } from './parameters/countIssuesParameters'; +import type { SearchAndReconsileIssuesUsingJqlParameters } from './parameters/searchAndReconsileIssuesUsingJqlParameters'; +import type { SearchAndReconsileIssuesUsingJqlPostParameters } from './parameters/searchAndReconsileIssuesUsingJqlPostParameters'; export class IssueSearch { constructor(private client: Client) {} - - /** - * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the - * user is looking for an issue using a word or string. - * - * This operation returns two lists: - * - * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain - * the string in the `query` parameter. - * - `Current Search` which includes issues that match the JQL expression in `currentJQL` and contain the string in the - * `query` parameter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getIssuePickerResource( - parameters: Parameters.GetIssuePickerResource | undefined, - callback: Callback, - ): Promise; /** * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the - * user is looking for an issue using a word or string. - * - * This operation returns two lists: - * - * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain - * the string in the `query` parameter. - * - `Current Search` which includes issues that match the JQL expression in `currentJQL` and contain the string in the - * `query` parameter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getIssuePickerResource( - parameters?: Parameters.GetIssuePickerResource, - callback?: never, - ): Promise; - async getIssuePickerResource( - parameters?: Parameters.GetIssuePickerResource, - ): Promise { - const config: Request = { + * user is looking for an issue using a word or string. * + * + * - This operation returns two lists: + * - + * - - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain + * the string in the `query` parameter. + * - - `Current Search` which includes issues that match the JQL expression in `currentJQL` and contain the string in the + * `query` parameter. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getIssuePickerResource(parameters: GetIssuePickerResourceParameters) { + const request: Request = { url: '/rest/api/2/issue/picker', method: 'GET', query: { - query: parameters?.query, - currentJQL: parameters?.currentJQL, - currentIssueKey: parameters?.currentIssueKey, - currentProjectId: parameters?.currentProjectId, - showSubTasks: parameters?.showSubTasks, - showSubTaskParent: parameters?.showSubTaskParent, + query: parameters.query, + currentJQL: parameters.currentJQL, + currentIssueKey: parameters.currentIssueKey, + currentProjectId: parameters.currentProjectId, + showSubTasks: parameters.showSubTasks, + showSubTaskParent: parameters.showSubTaskParent, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Checks whether one or more issues would be returned by one or more JQL queries. + * Checks whether one or more issues would be returned by one or more JQL queries. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, issues are only matched against JQL queries where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async matchIssues(parameters: Parameters.MatchIssues, callback: Callback): Promise; - /** - * Checks whether one or more issues would be returned by one or more JQL queries. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, issues are only matched against JQL queries where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, issues are only matched against JQL queries where the user has: + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async matchIssues(parameters: Parameters.MatchIssues, callback?: never): Promise; - async matchIssues(parameters: Parameters.MatchIssues): Promise { - const config: Request = { + async matchIssues(parameters: MatchIssuesParameters) { + const request: Request = { url: '/rest/api/2/jql/match', method: 'POST', body: { @@ -98,246 +61,33 @@ export class IssueSearch { }, }; - return this.client.sendRequest(config); - } - - /** - * @deprecated Use {@link searchForIssuesUsingJqlEnhancedSearch} instead. This endpoint doesn't support newer features - * like read-after-write consistency. - * - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * If the JQL query expression is too large to be encoded as a query parameter, use the - * [POST](#api-rest-api-2-search-post) version of this resource. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJql( - parameters: Parameters.SearchForIssuesUsingJql, - callback: Callback, - ): Promise; - /** - * @deprecated Use {@link searchForIssuesUsingJqlEnhancedSearch} instead. This endpoint doesn't support newer features - * like read-after-write consistency. - * - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * If the JQL query expression is too large to be encoded as a query parameter, use the - * [POST](#api-rest-api-2-search-post) version of this resource. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJql( - parameters: Parameters.SearchForIssuesUsingJql, - callback?: never, - ): Promise; - async searchForIssuesUsingJql( - parameters: Parameters.SearchForIssuesUsingJql, - ): Promise { - const config: Request = { - url: '/rest/api/2/search', - method: 'GET', - query: { - 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, - }, - }; - - return this.client.sendRequest(config); - } - - /** - * @deprecated Use {@link searchForIssuesUsingJqlEnhancedSearchPost} instead. This endpoint doesn't support newer - * features like read-after-write consistency. - * - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * There is a [GET](#api-rest-api-2-search-get) version of this resource that can be used for smaller JQL query - * expressions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJqlPost( - parameters: Parameters.SearchForIssuesUsingJqlPost | undefined, - callback: Callback, - ): Promise; - /** - * @deprecated Use {@link searchForIssuesUsingJqlEnhancedSearchPost} instead. This endpoint doesn't support newer - * features like read-after-write consistency. - * - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * There is a [GET](#api-rest-api-2-search-get) version of this resource that can be used for smaller JQL query - * expressions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJqlPost( - parameters?: Parameters.SearchForIssuesUsingJqlPost, - callback?: never, - ): Promise; - async searchForIssuesUsingJqlPost( - parameters?: Parameters.SearchForIssuesUsingJqlPost, - ): Promise { - const config: Request = { - url: '/rest/api/2/search', - method: 'POST', - body: { - expand: parameters?.expand, - fields: parameters?.fields, - fieldsByKeys: parameters?.fieldsByKeys, - jql: parameters?.jql, - maxResults: parameters?.maxResults, - properties: parameters?.properties, - startAt: parameters?.startAt, - validateQuery: parameters?.validateQuery, - }, - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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. + * updates might not be immediately visible in the returned output. This endpoint requires JQL to be bounded. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async countIssues(parameters: Parameters.CountIssues, callback: Callback): Promise; - /** - * Provide an estimated count of the issues that match the [JQL](https://confluence.atlassian.com/x/egORLQ). Recent - * updates might not be immediately visible in the returned output. This endpoint requires JQL to be bounded. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async countIssues(parameters: Parameters.CountIssues, callback?: never): Promise; - async countIssues(parameters: Parameters.CountIssues): Promise { - const config: Request = { - url: '/rest/api/2/search/approximate-count', - method: 'POST', - body: { - jql: parameters.jql, - }, - }; - - return this.client.sendRequest(config); - } - - /** - * @deprecated This endpoint is no longer supported and may be removed in a future version. - * - * 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 + * - 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 + * - + * - - _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 + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async searchForIssuesIds( - parameters: Parameters.SearchForIssuesIds, - callback: Callback, - ): Promise; - /** - * @deprecated This endpoint is no longer supported and may be removed in a future version. - * - * Searches for IDs of issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * Use the [Search](#api-rest-api-2-search-post) endpoint if you need to fetch more than just issue IDs. The Search - * endpoint returns more information, but may take much longer to respond to requests. This is because it uses a - * different mechanism for ordering results than this endpoint and doesn't provide the total number of results for - * your query. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesIds( - parameters: Parameters.SearchForIssuesIds, - callback?: never, - ): Promise; - async searchForIssuesIds(parameters: Parameters.SearchForIssuesIds): Promise { - const config: Request = { - url: '/rest/api/2/search/id', + async countIssues(parameters: CountIssuesParameters) { + const request: Request = { + url: '/rest/api/2/search/approximate-count', method: 'POST', body: { jql: parameters.jql, - maxResults: parameters.maxResults, - nextPageToken: parameters.nextPageToken, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** @@ -345,49 +95,21 @@ export class IssueSearch { * visible in the returned search results. If you need * [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) consistency, you can * utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. This operation can be accessed - * anonymously. - * - * If the JQL query expression is too large to be encoded as a query parameter, use the - * [POST](#api-rest-api-2-search-post) version of this resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJqlEnhancedSearch( - parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch, - callback: Callback, - ): Promise; - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately - * visible in the returned search results. If you need - * [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) consistency, you can - * utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. This operation can be accessed - * anonymously. + * anonymously. * * - * If the JQL query expression is too large to be encoded as a query parameter, use the - * [POST](#api-rest-api-2-search-post) version of this resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * - If the JQL query expression is too large to be encoded as a query parameter, use the + * [POST](#api-rest-api-2-search-post) version of this resource. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async searchForIssuesUsingJqlEnhancedSearch( - parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch, - callback?: never, - ): Promise; - async searchForIssuesUsingJqlEnhancedSearch( - parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch, - ): Promise { - const config: Request = { + async searchAndReconsileIssuesUsingJql(parameters: SearchAndReconsileIssuesUsingJqlParameters) { + const request: Request = { url: '/rest/api/2/search/jql', method: 'GET', query: { @@ -403,7 +125,7 @@ export class IssueSearch { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** @@ -411,43 +133,18 @@ export class IssueSearch { * visible in the returned search results. If you need * [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) consistency, you can * utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. This operation can be accessed - * anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJqlEnhancedSearchPost( - parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, - callback: Callback, - ): Promise; - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately - * visible in the returned search results. If you need - * [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) consistency, you can - * utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. This operation can be accessed - * anonymously. + * 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. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async searchForIssuesUsingJqlEnhancedSearchPost( - parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, - callback?: never, - ): Promise; - async searchForIssuesUsingJqlEnhancedSearchPost( - parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, - ): Promise { - const config: Request = { + async searchAndReconsileIssuesUsingJqlPost(parameters: SearchAndReconsileIssuesUsingJqlPostParameters) { + const request: Request = { url: '/rest/api/2/search/jql', method: 'POST', body: { @@ -462,6 +159,6 @@ export class IssueSearch { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueSecurityLevel.ts b/src/version2/issueSecurityLevel.ts index 4472e8d738..602cceb258 100644 --- a/src/version2/issueSecurityLevel.ts +++ b/src/version2/issueSecurityLevel.ts @@ -1,93 +1,49 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetIssueSecurityLevelMembersParameters } from './parameters/getIssueSecurityLevelMembersParameters'; +import type { GetIssueSecurityLevelParameters } from './parameters/getIssueSecurityLevelParameters'; export class IssueSecurityLevel { constructor(private client: Client) {} - - /** - * Returns issue security level members. - * - * Only issue security level members in context of classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers | string, - callback: Callback, - ): Promise; /** - * Returns issue security level members. - * - * Only issue security level members in context of classic projects are returned. + * Returns issue security level members. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only issue security level members in context of classic projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers | string, - callback?: never, - ): Promise; - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers | string, - ): Promise { - const issueSecuritySchemeId = typeof parameters === 'string' ? parameters : parameters.issueSecuritySchemeId; - - const config: Request = { - url: `/rest/api/2/issuesecurityschemes/${issueSecuritySchemeId}/members`, + async getIssueSecurityLevelMembers(parameters: GetIssueSecurityLevelMembersParameters) { + const request: Request = { + url: `/rest/api/2/issuesecurityschemes/${parameters.issueSecuritySchemeId}/members`, method: 'GET', query: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - issueSecurityLevelId: typeof parameters !== 'string' && parameters.issueSecurityLevelId, - expand: typeof parameters !== 'string' && parameters.expand, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + issueSecurityLevelId: parameters.issueSecurityLevelId, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns details of an issue security level. - * - * Use [Get issue security scheme](#api-rest-api-2-issuesecurityschemes-id-get) to obtain the IDs of issue security - * levels associated with the issue security scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel | string, - callback: Callback, - ): Promise; - /** - * Returns details of an issue security level. - * - * Use [Get issue security scheme](#api-rest-api-2-issuesecurityschemes-id-get) to obtain the IDs of issue security - * levels associated with the issue security scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * Returns details of an issue security level. * + * + * - Use [Get issue security scheme](#api-rest-api-2-issuesecurityschemes-id-get) to obtain the IDs of issue security + * levels associated with the issue security scheme. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel | string, - callback?: never, - ): Promise; - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/securitylevel/${id}`, + async getIssueSecurityLevel(parameters: GetIssueSecurityLevelParameters) { + const request: Request = { + url: `/rest/api/2/securitylevel/${parameters.id}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueSecuritySchemes.ts b/src/version2/issueSecuritySchemes.ts index d9976b35fe..d6930cd40b 100644 --- a/src/version2/issueSecuritySchemes.ts +++ b/src/version2/issueSecuritySchemes.ts @@ -1,62 +1,47 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; -import { paramSerializer } from '../paramSerializer'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { CreateIssueSecuritySchemeParameters } from './parameters/createIssueSecuritySchemeParameters'; +import type { GetSecurityLevelsParameters } from './parameters/getSecurityLevelsParameters'; +import type { SetDefaultLevelsParameters } from './parameters/setDefaultLevelsParameters'; +import type { GetSecurityLevelMembersParameters } from './parameters/getSecurityLevelMembersParameters'; +import type { SearchProjectsUsingSecuritySchemesParameters } from './parameters/searchProjectsUsingSecuritySchemesParameters'; +import type { AssociateSchemesToProjectsParameters } from './parameters/associateSchemesToProjectsParameters'; +import type { SearchSecuritySchemesParameters } from './parameters/searchSecuritySchemesParameters'; +import type { GetIssueSecuritySchemeParameters } from './parameters/getIssueSecuritySchemeParameters'; +import type { UpdateIssueSecuritySchemeParameters } from './parameters/updateIssueSecuritySchemeParameters'; +import type { DeleteSecuritySchemeParameters } from './parameters/deleteSecuritySchemeParameters'; +import type { AddSecurityLevelParameters } from './parameters/addSecurityLevelParameters'; +import type { RemoveLevelParameters } from './parameters/removeLevelParameters'; +import type { UpdateSecurityLevelParameters } from './parameters/updateSecurityLevelParameters'; +import type { AddSecurityLevelMembersParameters } from './parameters/addSecurityLevelMembersParameters'; +import type { RemoveMemberFromSecurityLevelParameters } from './parameters/removeMemberFromSecurityLevelParameters'; export class IssueSecuritySchemes { constructor(private client: Client) {} - - /** - * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecuritySchemes(callback: Callback): Promise; /** - * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). + * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueSecuritySchemes(callback?: never): Promise; - async getIssueSecuritySchemes(): Promise { - const config: Request = { + async getIssueSecuritySchemes() { + const request: Request = { url: '/rest/api/2/issuesecurityschemes', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme - * levels and security scheme levels' members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback: Callback, - ): Promise; - /** - * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme - * levels and security scheme levels' members per request. + * levels and security scheme levels' members per request. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback?: never, - ): Promise; - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - ): Promise { - const config: Request = { + async createIssueSecurityScheme(parameters: CreateIssueSecuritySchemeParameters) { + const request: Request = { url: '/rest/api/2/issuesecurityschemes', method: 'POST', body: { @@ -66,135 +51,82 @@ export class IssueSecuritySchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security levels. - * - * Only issue security levels in the context of classic projects are returned. - * - * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include - * both specified issue security levels and all issue security levels from the specified schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevels( - parameters: Parameters.GetSecurityLevels | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security levels. - * - * Only issue security levels in the context of classic projects are returned. - * - * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include - * both specified issue security levels and all issue security levels from the specified schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevels( - parameters?: Parameters.GetSecurityLevels, - callback?: never, - ): Promise; - async getSecurityLevels(parameters?: Parameters.GetSecurityLevels): Promise { - const config: Request = { + * security levels. * + * + * - Only issue security levels in the context of classic projects are returned. + * - + * - Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include + * both specified issue security levels and all issue security levels from the specified schemes. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevels(parameters: GetSecurityLevelsParameters) { + const request: Request = { url: '/rest/api/2/issuesecurityschemes/level', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: paramSerializer('id', parameters?.id), - schemeId: paramSerializer('schemeId', parameters?.schemeId), - onlyDefault: parameters?.onlyDefault, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + id: parameters.id, + schemeId: parameters.schemeId, + onlyDefault: parameters.onlyDefault, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets default issue security levels for schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultLevels( - parameters: Parameters.SetDefaultLevels | undefined, - callback: Callback, - ): Promise; - /** - * Sets default issue security levels for schemes. + * Sets default issue security levels for schemes. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setDefaultLevels(parameters?: Parameters.SetDefaultLevels, callback?: never): Promise; - async setDefaultLevels(parameters?: Parameters.SetDefaultLevels): Promise { - const config: Request = { + async setDefaultLevels(parameters: SetDefaultLevelsParameters) { + const request: Request = { url: '/rest/api/2/issuesecurityschemes/level/default', method: 'PUT', body: { - defaultValues: parameters?.defaultValues, + defaultValues: parameters.defaultValues, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security level members. - * - * Only issue security level members in the context of classic projects are returned. - * - * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will - * include all issue security level members from the specified schemes and levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevelMembers( - parameters: Parameters.GetSecurityLevelMembers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security level members. - * - * Only issue security level members in the context of classic projects are returned. - * - * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will - * include all issue security level members from the specified schemes and levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevelMembers( - parameters?: Parameters.GetSecurityLevelMembers, - callback?: never, - ): Promise; - async getSecurityLevelMembers( - parameters?: Parameters.GetSecurityLevelMembers, - ): Promise { - const config: Request = { + * security level members. * + * + * - Only issue security level members in the context of classic projects are returned. + * - + * - Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will + * include all issue security level members from the specified schemes and levels. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevelMembers(parameters: GetSecurityLevelMembersParameters) { + const request: Request = { url: '/rest/api/2/issuesecurityschemes/level/member', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: paramSerializer('id', parameters?.id), - schemeId: paramSerializer('schemeId', parameters?.schemeId), - levelId: paramSerializer('levelId', parameters?.levelId), - expand: parameters?.expand, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + id: parameters.id, + schemeId: parameters.schemeId, + levelId: parameters.levelId, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** @@ -205,75 +137,35 @@ export class IssueSecuritySchemes { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async searchProjectsUsingSecuritySchemes( - parameters: Parameters.SearchProjectsUsingSecuritySchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of - * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs - * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the - * context of classic projects are supported. - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjectsUsingSecuritySchemes( - parameters?: Parameters.SearchProjectsUsingSecuritySchemes, - callback?: never, - ): Promise; - async searchProjectsUsingSecuritySchemes( - parameters?: Parameters.SearchProjectsUsingSecuritySchemes, - ): Promise { - const config: Request = { + async searchProjectsUsingSecuritySchemes(parameters: SearchProjectsUsingSecuritySchemesParameters) { + const request: Request = { url: '/rest/api/2/issuesecurityschemes/project', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueSecuritySchemeId: parameters?.issueSecuritySchemeId, - projectId: parameters?.projectId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + issueSecuritySchemeId: parameters.issueSecuritySchemeId, + projectId: parameters.projectId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if - * provided. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback: Callback, - ): Promise; - /** - * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if - * provided. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback?: never, - ): Promise; - async associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - ): Promise { - const config: Request = { + * provided. * + * + * - This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async associateSchemesToProjects(parameters: AssociateSchemesToProjectsParameters) { + const request: Request = { url: '/rest/api/2/issuesecurityschemes/project', method: 'PUT', body: { @@ -283,119 +175,63 @@ export class IssueSecuritySchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security schemes.\ - * If you specify the project ID parameter, the result will contain issue security schemes and related project IDs you - * filter by. Use {@link IssueSecuritySchemeResource#searchProjectsUsingSecuritySchemes(String, String, Set, Set)} to - * obtain all projects related to scheme. - * - * Only issue security schemes in the context of classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchSecuritySchemes( - parameters: Parameters.SearchSecuritySchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security schemes.\ - * If you specify the project ID parameter, the result will contain issue security schemes and related project IDs you - * filter by. Use {@link IssueSecuritySchemeResource#searchProjectsUsingSecuritySchemes(String, String, Set, Set)} to - * obtain all projects related to scheme. - * - * Only issue security schemes in the context of classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchSecuritySchemes( - parameters?: Parameters.SearchSecuritySchemes, - callback?: never, - ): Promise; - async searchSecuritySchemes( - parameters?: Parameters.SearchSecuritySchemes, - ): Promise { - const config: Request = { + * security schemes. + * + * - If you specify the project ID parameter, the result will contain issue security schemes and related project IDs you + * filter by. Use {@link IssueSecuritySchemeResource#searchProjectsUsingSecuritySchemes(String, String, Set, Set)} to + * obtain all projects related to scheme. + * - + * - Only issue security schemes in the context of classic projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchSecuritySchemes(parameters: SearchSecuritySchemesParameters) { + const request: Request = { url: '/rest/api/2/issuesecurityschemes/search', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: paramSerializer('id', parameters?.id), - projectId: paramSerializer('projectId', parameters?.projectId), + startAt: parameters.startAt, + maxResults: parameters.maxResults, + id: parameters.id, + projectId: parameters.projectId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns an issue security scheme along with its security levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the - * requested issue security scheme. - */ - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme | string, - callback: Callback, - ): Promise; - /** - * Returns an issue security scheme along with its security levels. + * Returns an issue security scheme along with its security levels. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the - * requested issue security scheme. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the + * requested issue security scheme. */ - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme | string, - callback?: never, - ): Promise; - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/issuesecurityschemes/${id}`, + async getIssueSecurityScheme(parameters: GetIssueSecuritySchemeParameters) { + const request: Request = { + url: `/rest/api/2/issuesecurityschemes/${parameters.id}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates the issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback: Callback, - ): Promise; - /** - * Updates the issue security scheme. + * Updates the issue security scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback?: never, - ): Promise; - async updateIssueSecurityScheme(parameters: Parameters.UpdateIssueSecurityScheme): Promise { - const config: Request = { + async updateIssueSecurityScheme(parameters: UpdateIssueSecuritySchemeParameters) { + const request: Request = { url: `/rest/api/2/issuesecurityschemes/${parameters.id}`, method: 'PUT', body: { @@ -404,51 +240,32 @@ export class IssueSecuritySchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes an issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteSecurityScheme( - parameters: Parameters.DeleteSecurityScheme, - callback: Callback, - ): Promise; - /** - * Deletes an issue security scheme. + * Deletes an issue security scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteSecurityScheme(parameters: Parameters.DeleteSecurityScheme, callback?: never): Promise; - async deleteSecurityScheme(parameters: Parameters.DeleteSecurityScheme): Promise { - const config: Request = { + async deleteSecurityScheme(parameters: DeleteSecuritySchemeParameters) { + const request: Request = { url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback: Callback): Promise; - /** - * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. + * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: never): Promise; - async addSecurityLevel(parameters: Parameters.AddSecurityLevel): Promise { - const config: Request = { + async addSecurityLevel(parameters: AddSecurityLevelParameters) { + const request: Request = { url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level`, method: 'PUT', body: { @@ -456,91 +273,59 @@ export class IssueSecuritySchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates the issue security level. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback: Callback): Promise; - /** - * Updates the issue security level. + * Deletes an issue security level. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - 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 updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback?: never): Promise; - async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel): Promise { - const config: Request = { + async removeLevel(parameters: RemoveLevelParameters) { + const request: Request = { url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, - method: 'PUT', - body: { - description: parameters.description, - name: parameters.name, + method: 'DELETE', + query: { + replaceWith: parameters.replaceWith, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes an issue security level. + * Updates the issue security level. * * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeLevel(parameters: Parameters.RemoveLevel, callback: Callback): Promise; - /** - * Deletes an issue security level. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async removeLevel(parameters: Parameters.RemoveLevel, callback?: never): Promise; - async removeLevel(parameters: Parameters.RemoveLevel): Promise { - const config: Request = { + async updateSecurityLevel(parameters: UpdateSecurityLevelParameters) { + const request: Request = { url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, - method: 'DELETE', - query: { - replaceWith: parameters.replaceWith, + method: 'PUT', + body: { + description: parameters.description, + name: parameters.name, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Adds members to the issue security level. You can add up to 100 members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevelMembers( - parameters: Parameters.AddSecurityLevelMembers, - callback: Callback, - ): Promise; - /** - * Adds members to the issue security level. You can add up to 100 members per request. + * Adds members to the issue security level. You can add up to 100 members per request. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async addSecurityLevelMembers(parameters: Parameters.AddSecurityLevelMembers, callback?: never): Promise; - async addSecurityLevelMembers(parameters: Parameters.AddSecurityLevelMembers): Promise { - const config: Request = { + async addSecurityLevelMembers(parameters: AddSecurityLevelMembersParameters) { + const request: Request = { url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member`, method: 'PUT', body: { @@ -548,37 +333,21 @@ export class IssueSecuritySchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Removes an issue security level member from an issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback: Callback, - ): Promise; - /** - * Removes an issue security level member from an issue security scheme. + * Removes an issue security level member from an issue security scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback?: never, - ): Promise; - async removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - ): Promise { - const config: Request = { + async removeMemberFromSecurityLevel(parameters: RemoveMemberFromSecurityLevelParameters) { + const request: Request = { url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member/${parameters.memberId}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueTypeProperties.ts b/src/version2/issueTypeProperties.ts index f711087030..d0bd07b509 100644 --- a/src/version2/issueTypeProperties.ts +++ b/src/version2/issueTypeProperties.ts @@ -1,168 +1,92 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetIssueTypePropertyKeysParameters } from './parameters/getIssueTypePropertyKeysParameters'; +import type { DeleteIssueTypePropertyParameters } from './parameters/deleteIssueTypePropertyParameters'; +import type { GetIssueTypePropertyParameters } from './parameters/getIssueTypePropertyParameters'; +import type { SetIssueTypePropertyParameters } from './parameters/setIssueTypePropertyParameters'; export class IssueTypeProperties { constructor(private client: Client) {} - - /** - * Returns all the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys of the issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any - * issue type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any - * issue types associated with the projects the user has permission to browse. - */ - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys | string, - callback: Callback, - ): Promise; /** * Returns all the [issue type * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys of the issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any - * issue type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any - * issue types associated with the projects the user has permission to browse. + * keys of the issue type. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any + * issue type. + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any + * issue types associated with the projects the user has permission to browse. */ - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys | string, - callback?: never, - ): Promise; - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys | string, - ): Promise { - const issueTypeId = typeof parameters === 'string' ? parameters : parameters.issueTypeId; - - const config: Request = { - url: `/rest/api/2/issuetype/${issueTypeId}/properties`, + async getIssueTypePropertyKeys(parameters: GetIssueTypePropertyKeysParameters) { + const request: Request = { + url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the key and value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue - * type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue - * types associated with the projects the user has permission to browse. - */ - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of the [issue type + * Deletes the [issue type * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue - * type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue - * types associated with the projects the user has permission to browse. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback?: never, - ): Promise; - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - ): Promise { - const config: Request = { + async deleteIssueTypeProperty(parameters: DeleteIssueTypePropertyParameters) { + const request: Request = { url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'GET', + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates or updates the value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * Use this resource to store and update data against an issue type. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueTypeProperty( - parameters: Parameters.SetIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Creates or updates the value of the [issue type + * Returns the key and value of the [issue type * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * Use this resource to store and update data against an issue type. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue + * type. + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue + * types associated with the projects the user has permission to browse. */ - async setIssueTypeProperty(parameters: Parameters.SetIssueTypeProperty, callback?: never): Promise; - async setIssueTypeProperty(parameters: Parameters.SetIssueTypeProperty): Promise { - const config: Request = { + async getIssueTypeProperty(parameters: GetIssueTypePropertyParameters) { + const request: Request = { url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'PUT', - body: parameters.propertyValue, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeProperty( - parameters: Parameters.DeleteIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Deletes the [issue type + * Creates or updates the value of the [issue type * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * Use this resource to store and update data against an issue type. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteIssueTypeProperty(parameters: Parameters.DeleteIssueTypeProperty, callback?: never): Promise; - async deleteIssueTypeProperty(parameters: Parameters.DeleteIssueTypeProperty): Promise { - const config: Request = { + async setIssueTypeProperty(parameters: SetIssueTypePropertyParameters) { + const request: Request = { url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'DELETE', + method: 'PUT', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueTypeSchemes.ts b/src/version2/issueTypeSchemes.ts index 47653c65d5..96de1a4108 100644 --- a/src/version2/issueTypeSchemes.ts +++ b/src/version2/issueTypeSchemes.ts @@ -1,166 +1,99 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAllIssueTypeSchemesParameters } from './parameters/getAllIssueTypeSchemesParameters'; +import type { CreateIssueTypeSchemeParameters } from './parameters/createIssueTypeSchemeParameters'; +import type { GetIssueTypeSchemesMappingParameters } from './parameters/getIssueTypeSchemesMappingParameters'; +import type { GetIssueTypeSchemeForProjectsParameters } from './parameters/getIssueTypeSchemeForProjectsParameters'; +import type { AssignIssueTypeSchemeToProjectParameters } from './parameters/assignIssueTypeSchemeToProjectParameters'; +import type { DeleteIssueTypeSchemeParameters } from './parameters/deleteIssueTypeSchemeParameters'; +import type { UpdateIssueTypeSchemeParameters } from './parameters/updateIssueTypeSchemeParameters'; +import type { AddIssueTypesToIssueTypeSchemeParameters } from './parameters/addIssueTypesToIssueTypeSchemeParameters'; +import type { ReorderIssueTypesInIssueTypeSchemeParameters } from './parameters/reorderIssueTypesInIssueTypeSchemeParameters'; +import type { RemoveIssueTypeFromIssueTypeSchemeParameters } from './parameters/removeIssueTypeFromIssueTypeSchemeParameters'; export class IssueTypeSchemes { constructor(private client: Client) {} - /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type schemes. - * - * Only issue type schemes used in classic projects are returned. + * type schemes. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only issue type schemes used in classic projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAllIssueTypeSchemes( - parameters: Parameters.GetAllIssueTypeSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type schemes. - * - * Only issue type schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllIssueTypeSchemes( - parameters?: Parameters.GetAllIssueTypeSchemes, - callback?: never, - ): Promise; - async getAllIssueTypeSchemes( - parameters?: Parameters.GetAllIssueTypeSchemes, - ): Promise { - const config: Request = { + async getAllIssueTypeSchemes(parameters: GetAllIssueTypeSchemesParameters) { + const request: Request = { url: '/rest/api/2/issuetypescheme', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - queryString: parameters?.queryString, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + id: parameters.id, + orderBy: parameters.orderBy, + expand: parameters.expand, + queryString: parameters.queryString, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeScheme( - parameters: Parameters.CreateIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Creates an issue type scheme. + * Creates an issue type scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createIssueTypeScheme( - parameters: Parameters.CreateIssueTypeScheme, - callback?: never, - ): Promise; - async createIssueTypeScheme( - parameters: Parameters.CreateIssueTypeScheme, - ): Promise { - const config: Request = { + async createIssueTypeScheme(parameters: CreateIssueTypeSchemeParameters) { + const request: Request = { url: '/rest/api/2/issuetypescheme', method: 'POST', body: { - name: parameters.name, - description: parameters.description, defaultIssueTypeId: parameters.defaultIssueTypeId, + description: parameters.description, issueTypeIds: parameters.issueTypeIds, + name: parameters.name, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type scheme items. - * - * Only issue type scheme items used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeSchemesMapping( - parameters: Parameters.GetIssueTypeSchemesMapping | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type scheme items. - * - * Only issue type scheme items used in classic projects are returned. + * type scheme items. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only issue type scheme items used in classic projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueTypeSchemesMapping( - parameters?: Parameters.GetIssueTypeSchemesMapping, - callback?: never, - ): Promise; - async getIssueTypeSchemesMapping( - parameters?: Parameters.GetIssueTypeSchemesMapping, - ): Promise { - const config: Request = { + async getIssueTypeSchemesMapping(parameters: GetIssueTypeSchemesMappingParameters) { + const request: Request = { url: '/rest/api/2/issuetypescheme/mapping', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueTypeSchemeId: parameters?.issueTypeSchemeId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + issueTypeSchemeId: parameters.issueTypeSchemeId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type schemes and, for each issue type scheme, a list of the projects that use it. + * type schemes and, for each issue type scheme, a list of the projects that use it. * * - * Only issue type schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only issue type schemes used in classic projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type schemes and, for each issue type scheme, a list of the projects that use it. - * - * Only issue type schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback?: never, - ): Promise; - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - ): Promise { - const config: Request = { + async getIssueTypeSchemeForProjects(parameters: GetIssueTypeSchemeForProjectsParameters) { + const request: Request = { url: '/rest/api/2/issuetypescheme/project', method: 'GET', query: { @@ -170,43 +103,22 @@ export class IssueTypeSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Assigns an issue type scheme to a project. - * - * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To - * complete the assignment those issues must be updated to use issue types in the new scheme. - * - * Issue type schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeSchemeToProject( - parameters: Parameters.AssignIssueTypeSchemeToProject, - callback: Callback, - ): Promise; - /** - * Assigns an issue type scheme to a project. + * Assigns an issue type scheme to a project. * * - * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To - * complete the assignment those issues must be updated to use issue types in the new scheme. - * - * Issue type schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To + * complete the assignment those issues must be updated to use issue types in the new scheme. + * - + * - Issue type schemes can only be assigned to classic projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async assignIssueTypeSchemeToProject( - parameters: Parameters.AssignIssueTypeSchemeToProject, - callback?: never, - ): Promise; - async assignIssueTypeSchemeToProject( - parameters: Parameters.AssignIssueTypeSchemeToProject, - ): Promise { - const config: Request = { + async assignIssueTypeSchemeToProject(parameters: AssignIssueTypeSchemeToProjectParameters) { + const request: Request = { url: '/rest/api/2/issuetypescheme/project', method: 'PUT', body: { @@ -215,111 +127,60 @@ export class IssueTypeSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates an issue type scheme. + * Deletes an issue type scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only issue type schemes used in classic projects can be deleted. + * - + * - Any projects assigned to the scheme are reassigned to the default issue type scheme. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateIssueTypeScheme( - parameters: Parameters.UpdateIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Updates an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueTypeScheme(parameters: Parameters.UpdateIssueTypeScheme, callback?: never): Promise; - async updateIssueTypeScheme(parameters: Parameters.UpdateIssueTypeScheme): Promise { - const config: Request = { + async deleteIssueTypeScheme(parameters: DeleteIssueTypeSchemeParameters) { + const request: Request = { url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}`, - method: 'PUT', - body: { - name: parameters.name, - description: parameters.description, - defaultIssueTypeId: parameters.defaultIssueTypeId, - }, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes an issue type scheme. - * - * Only issue type schemes used in classic projects can be deleted. - * - * Any projects assigned to the scheme are reassigned to the default issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeScheme( - parameters: Parameters.DeleteIssueTypeScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes an issue type scheme. - * - * Only issue type schemes used in classic projects can be deleted. - * - * Any projects assigned to the scheme are reassigned to the default issue type scheme. + * Updates an issue type scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteIssueTypeScheme( - parameters: Parameters.DeleteIssueTypeScheme | string, - callback?: never, - ): Promise; - async deleteIssueTypeScheme(parameters: Parameters.DeleteIssueTypeScheme | string): Promise { - const issueTypeSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeSchemeId; - - const config: Request = { - url: `/rest/api/2/issuetypescheme/${issueTypeSchemeId}`, - method: 'DELETE', + async updateIssueTypeScheme(parameters: UpdateIssueTypeSchemeParameters) { + const request: Request = { + url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}`, + method: 'PUT', + body: { + defaultIssueTypeId: parameters.defaultIssueTypeId, + description: parameters.description, + name: parameters.name, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Adds issue types to an issue type scheme. - * - * The added issue types are appended to the issue types list. - * - * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. + * Adds issue types to an issue type scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - The added issue types are appended to the issue types list. + * - + * - If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Adds issue types to an issue type scheme. - * - * The added issue types are appended to the issue types list. - * - * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback?: never, - ): Promise; - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - ): Promise { - const config: Request = { + async addIssueTypesToIssueTypeScheme(parameters: AddIssueTypesToIssueTypeSchemeParameters) { + const request: Request = { url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype`, method: 'PUT', body: { @@ -327,97 +188,53 @@ export class IssueTypeSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Changes the order of issue types in an issue type scheme. - * - * The request body parameters must meet the following requirements: + * Changes the order of issue types in an issue type scheme. * * - * - All of the issue types must belong to the issue type scheme. - * - Either `after` or `position` must be provided. - * - The issue type in `after` must not be in the issue type list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - The request body parameters must meet the following requirements: + * - + * - - All of the issue types must belong to the issue type scheme. + * - - Either `after` or `position` must be provided. + * - - The issue type in `after` must not be in the issue type list. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Changes the order of issue types in an issue type scheme. - * - * The request body parameters must meet the following requirements: - * - * - All of the issue types must belong to the issue type scheme. - * - Either `after` or `position` must be provided. - * - The issue type in `after` must not be in the issue type list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback?: never, - ): Promise; - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - ): Promise { - const config: Request = { + async reorderIssueTypesInIssueTypeScheme(parameters: ReorderIssueTypesInIssueTypeSchemeParameters) { + const request: Request = { url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/move`, method: 'PUT', body: { - issueTypeIds: parameters.issueTypeIds, after: parameters.after, + issueTypeIds: parameters.issueTypeIds, position: parameters.position, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Removes an issue type from an issue type scheme. - * - * This operation cannot remove: - * - * - Any issue type used by issues. - * - Any issue types from the default issue type scheme. - * - The last standard issue type from an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Removes an issue type from an issue type scheme. - * - * This operation cannot remove: - * - * - Any issue type used by issues. - * - Any issue types from the default issue type scheme. - * - The last standard issue type from an issue type scheme. + * Removes an issue type from an issue type scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - This operation cannot remove: + * - + * - - Any issue type used by issues. + * - - Any issue types from the default issue type scheme. + * - - The last standard issue type from an issue type scheme. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback?: never, - ): Promise; - async removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - ): Promise { - const config: Request = { + async removeIssueTypeFromIssueTypeScheme(parameters: RemoveIssueTypeFromIssueTypeSchemeParameters) { + const request: Request = { url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/${parameters.issueTypeId}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueTypeScreenSchemes.ts b/src/version2/issueTypeScreenSchemes.ts index ee400d27f7..ca25fa9642 100644 --- a/src/version2/issueTypeScreenSchemes.ts +++ b/src/version2/issueTypeScreenSchemes.ts @@ -1,165 +1,99 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetIssueTypeScreenSchemesParameters } from './parameters/getIssueTypeScreenSchemesParameters'; +import type { CreateIssueTypeScreenSchemeParameters } from './parameters/createIssueTypeScreenSchemeParameters'; +import type { GetIssueTypeScreenSchemeMappingsParameters } from './parameters/getIssueTypeScreenSchemeMappingsParameters'; +import type { GetIssueTypeScreenSchemeProjectAssociationsParameters } from './parameters/getIssueTypeScreenSchemeProjectAssociationsParameters'; +import type { AssignIssueTypeScreenSchemeToProjectParameters } from './parameters/assignIssueTypeScreenSchemeToProjectParameters'; +import type { DeleteIssueTypeScreenSchemeParameters } from './parameters/deleteIssueTypeScreenSchemeParameters'; +import type { UpdateIssueTypeScreenSchemeParameters } from './parameters/updateIssueTypeScreenSchemeParameters'; +import type { AppendMappingsForIssueTypeScreenSchemeParameters } from './parameters/appendMappingsForIssueTypeScreenSchemeParameters'; +import type { UpdateDefaultScreenSchemeParameters } from './parameters/updateDefaultScreenSchemeParameters'; +import type { RemoveMappingsFromIssueTypeScreenSchemeParameters } from './parameters/removeMappingsFromIssueTypeScreenSchemeParameters'; +import type { GetProjectsForIssueTypeScreenSchemeParameters } from './parameters/getProjectsForIssueTypeScreenSchemeParameters'; export class IssueTypeScreenSchemes { constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen schemes. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemes( - parameters: Parameters.GetIssueTypeScreenSchemes | undefined, - callback: Callback, - ): Promise; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen schemes. - * - * Only issue type screen schemes used in classic projects are returned. + * type screen schemes. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only issue type screen schemes used in classic projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueTypeScreenSchemes( - parameters?: Parameters.GetIssueTypeScreenSchemes, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemes( - parameters?: Parameters.GetIssueTypeScreenSchemes, - ): Promise { - const config: Request = { + async getIssueTypeScreenSchemes(parameters: GetIssueTypeScreenSchemesParameters) { + const request: Request = { url: '/rest/api/2/issuetypescreenscheme', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - expand: parameters?.expand, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + id: parameters.id, + queryString: parameters.queryString, + orderBy: parameters.orderBy, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates an issue type screen scheme. + * Creates an issue type screen scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createIssueTypeScreenScheme( - parameters: Parameters.CreateIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Creates an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeScreenScheme( - parameters: Parameters.CreateIssueTypeScreenScheme, - callback?: never, - ): Promise; - async createIssueTypeScreenScheme( - parameters: Parameters.CreateIssueTypeScreenScheme, - ): Promise { - const config: Request = { + async createIssueTypeScreenScheme(parameters: CreateIssueTypeScreenSchemeParameters) { + const request: Request = { url: '/rest/api/2/issuetypescreenscheme', method: 'POST', body: { - name: parameters.name, description: parameters.description, issueTypeMappings: parameters.issueTypeMappings, + name: parameters.name, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen scheme items. - * - * Only issue type screen schemes used in classic projects are returned. + * type screen scheme items. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only issue type screen schemes used in classic projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueTypeScreenSchemeMappings( - parameters: Parameters.GetIssueTypeScreenSchemeMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen scheme items. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemeMappings( - parameters?: Parameters.GetIssueTypeScreenSchemeMappings, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemeMappings( - parameters?: Parameters.GetIssueTypeScreenSchemeMappings, - ): Promise { - const config: Request = { + async getIssueTypeScreenSchemeMappings(parameters: GetIssueTypeScreenSchemeMappingsParameters) { + const request: Request = { url: '/rest/api/2/issuetypescreenscheme/mapping', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + issueTypeScreenSchemeId: parameters.issueTypeScreenSchemeId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. - * - * Only issue type screen schemes used in classic projects are returned. + * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only issue type screen schemes used in classic projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - ): Promise { - const config: Request = { + async getIssueTypeScreenSchemeProjectAssociations(parameters: GetIssueTypeScreenSchemeProjectAssociationsParameters) { + const request: Request = { url: '/rest/api/2/issuetypescreenscheme/project', method: 'GET', query: { @@ -169,138 +103,72 @@ export class IssueTypeScreenSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Assigns an issue type screen scheme to a project. + * Assigns an issue type screen scheme to a project. * * - * Issue type screen schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeScreenSchemeToProject( - parameters: Parameters.AssignIssueTypeScreenSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns an issue type screen scheme to a project. - * - * Issue type screen schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Issue type screen schemes can only be assigned to classic projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async assignIssueTypeScreenSchemeToProject( - parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, - callback?: never, - ): Promise; - async assignIssueTypeScreenSchemeToProject( - parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, - ): Promise { - const config: Request = { + async assignIssueTypeScreenSchemeToProject(parameters: AssignIssueTypeScreenSchemeToProjectParameters) { + const request: Request = { url: '/rest/api/2/issuetypescreenscheme/project', method: 'PUT', body: { - issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, - projectId: parameters?.projectId, + issueTypeScreenSchemeId: parameters.issueTypeScreenSchemeId, + projectId: parameters.projectId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Updates an issue type screen scheme. + * Deletes an issue type screen scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback?: never, - ): Promise; - async updateIssueTypeScreenScheme(parameters: Parameters.UpdateIssueTypeScreenScheme): Promise { - const config: Request = { + async deleteIssueTypeScreenScheme(parameters: DeleteIssueTypeScreenSchemeParameters) { + const request: Request = { url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, - method: 'PUT', - body: { - name: parameters.name, - description: parameters.description, - }, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes an issue type screen scheme. + * Updates an issue type screen scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme | string, - callback?: never, - ): Promise; - async deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme | string, - ): Promise { - const issueTypeScreenSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeScreenSchemeId; - - const config: Request = { - url: `/rest/api/2/issuetypescreenscheme/${issueTypeScreenSchemeId}`, - method: 'DELETE', + async updateIssueTypeScreenScheme(parameters: UpdateIssueTypeScreenSchemeParameters) { + const request: Request = { + url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, + method: 'PUT', + body: { + description: parameters.description, + name: parameters.name, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Appends issue type to screen scheme mappings to an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Appends issue type to screen scheme mappings to an issue type screen scheme. + * Appends issue type to screen scheme mappings to an issue type screen scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback?: never, - ): Promise; - async appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - ): Promise { - const config: Request = { + async appendMappingsForIssueTypeScreenScheme(parameters: AppendMappingsForIssueTypeScreenSchemeParameters) { + const request: Request = { url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping`, method: 'PUT', body: { @@ -308,33 +176,18 @@ export class IssueTypeScreenSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all - * unmapped issue types. + * unmapped issue types. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback: Callback, - ): Promise; - /** - * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all - * unmapped issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback?: never, - ): Promise; - async updateDefaultScreenScheme(parameters: Parameters.UpdateDefaultScreenScheme): Promise { - const config: Request = { + async updateDefaultScreenScheme(parameters: UpdateDefaultScreenSchemeParameters) { + const request: Request = { url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/default`, method: 'PUT', body: { @@ -342,33 +195,17 @@ export class IssueTypeScreenSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Removes issue type to screen scheme mappings from an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Removes issue type to screen scheme mappings from an issue type screen scheme. + * Removes issue type to screen scheme mappings from an issue type screen scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback?: never, - ): Promise; - async removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - ): Promise { - const config: Request = { + async removeMappingsFromIssueTypeScreenScheme(parameters: RemoveMappingsFromIssueTypeScreenSchemeParameters) { + const request: Request = { url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/remove`, method: 'POST', body: { @@ -376,50 +213,29 @@ export class IssueTypeScreenSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * projects associated with an issue type screen scheme. + * projects associated with an issue type screen scheme. * * - * Only company-managed projects associated with an issue type screen scheme are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only company-managed projects associated with an issue type screen scheme are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * projects associated with an issue type screen scheme. - * - * Only company-managed projects associated with an issue type screen scheme are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, - callback?: never, - ): Promise; - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, - ): Promise { - const issueTypeScreenSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeScreenSchemeId; - - const config: Request = { - url: `/rest/api/2/issuetypescreenscheme/${issueTypeScreenSchemeId}/project`, + async getProjectsForIssueTypeScreenScheme(parameters: GetProjectsForIssueTypeScreenSchemeParameters) { + const request: Request = { + url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/project`, method: 'GET', query: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - query: typeof parameters !== 'string' && parameters.query, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + query: parameters.query, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueTypes.ts b/src/version2/issueTypes.ts index e6a278278e..e9a89f0c93 100644 --- a/src/version2/issueTypes.ts +++ b/src/version2/issueTypes.ts @@ -1,117 +1,71 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { CreateIssueTypeParameters } from './parameters/createIssueTypeParameters'; +import type { GetIssueTypesForProjectParameters } from './parameters/getIssueTypesForProjectParameters'; +import type { DeleteIssueTypeParameters } from './parameters/deleteIssueTypeParameters'; +import type { GetIssueTypeParameters } from './parameters/getIssueTypeParameters'; +import type { UpdateIssueTypeParameters } from './parameters/updateIssueTypeParameters'; +import type { GetAlternativeIssueTypesParameters } from './parameters/getAlternativeIssueTypesParameters'; +import type { CreateIssueTypeAvatarParameters } from './parameters/createIssueTypeAvatarParameters'; export class IssueTypes { constructor(private client: Client) {} - /** - * Returns all issue types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issue - * types are only returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue - * types are returned. - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or - * more projects, the issue types associated with the projects the user has permission to browse are returned. - * - If the user is anonymous then they will be able to access projects with the _Browse projects_ for anonymous users - * - If the user authentication is incorrect they will fall back to anonymous - */ - async getIssueAllTypes(callback: Callback): Promise; - /** - * Returns all issue types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issue - * types are only returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue - * types are returned. - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or - * more projects, the issue types associated with the projects the user has permission to browse are returned. - * - If the user is anonymous then they will be able to access projects with the _Browse projects_ for anonymous users - * - If the user authentication is incorrect they will fall back to anonymous - */ - async getIssueAllTypes(callback?: never): Promise; - async getIssueAllTypes(): Promise { - const config: Request = { + * Returns all issue types. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issue + * types are only returned as follows: + * - + * - - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue + * types are returned. + * - - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or + * more projects, the issue types associated with the projects the user has permission to browse are returned. + * - - If the user is anonymous then they will be able to access projects with the _Browse projects_ for anonymous users + * - - If the user authentication is incorrect they will fall back to anonymous + */ + async getIssueAllTypes() { + const request: Request = { url: '/rest/api/2/issuetype', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates an issue type and adds it to the default issue type scheme. + * Creates an issue type and adds it to the default issue type scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createIssueType( - parameters: Parameters.CreateIssueType, - callback: Callback, - ): Promise; - /** - * Creates an issue type and adds it to the default issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueType( - parameters: Parameters.CreateIssueType, - callback?: never, - ): Promise; - async createIssueType(parameters: Parameters.CreateIssueType): Promise { - const config: Request = { + async createIssueType(parameters: CreateIssueTypeParameters) { + const request: Request = { url: '/rest/api/2/issuetype', method: 'POST', body: { description: parameters.description, hierarchyLevel: parameters.hierarchyLevel, name: parameters.name, + type: parameters.type, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns issue types for a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the relevant project or _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback: Callback, - ): Promise; - /** - * Returns issue types for a project. - * - * This operation can be accessed anonymously. + * Returns issue types 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) in the relevant project or _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:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the relevant project or _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback?: never, - ): Promise; - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - ): Promise { - const config: Request = { + async getIssueTypesForProject(parameters: GetIssueTypesForProjectParameters) { + const request: Request = { url: '/rest/api/2/issuetype/project', method: 'GET', query: { @@ -120,68 +74,55 @@ export class IssueTypes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns an issue type. - * - * This operation can be accessed anonymously. + * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type + * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue + * types](#api-rest-api-2-issuetype-id-alternatives-get) resource. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue type is associated - * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueType( - parameters: Parameters.GetIssueType | string, - callback: Callback, - ): Promise; + async deleteIssueType(parameters: DeleteIssueTypeParameters) { + const request: Request = { + url: `/rest/api/2/issuetype/${parameters.id}`, + method: 'DELETE', + query: { + alternativeIssueTypeId: parameters.alternativeIssueTypeId, + }, + }; + + return this.client.sendRequest(request); + } + /** - * Returns an issue type. - * - * This operation can be accessed anonymously. + * Returns an issue type. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue type is associated - * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue type is + * associated with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getIssueType( - parameters: Parameters.GetIssueType | string, - callback?: never, - ): Promise; - async getIssueType(parameters: Parameters.GetIssueType | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/issuetype/${id}`, + async getIssueType(parameters: GetIssueTypeParameters) { + const request: Request = { + url: `/rest/api/2/issuetype/${parameters.id}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates the issue type. + * Updates the issue type. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback: Callback, - ): Promise; - /** - * Updates the issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback?: never, - ): Promise; - async updateIssueType(parameters: Parameters.UpdateIssueType): Promise { - const config: Request = { + async updateIssueType(parameters: UpdateIssueTypeParameters) { + const request: Request = { url: `/rest/api/2/issuetype/${parameters.id}`, method: 'PUT', body: { @@ -191,135 +132,63 @@ export class IssueTypes { }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type - * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue - * types](#api-rest-api-2-issuetype-id-alternatives-get) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueType( - parameters: Parameters.DeleteIssueType | string, - callback: Callback, - ): Promise; - /** - * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type - * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue - * types](#api-rest-api-2-issuetype-id-alternatives-get) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueType(parameters: Parameters.DeleteIssueType | string, callback?: never): Promise; - async deleteIssueType(parameters: Parameters.DeleteIssueType | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/issuetype/${id}`, - method: 'DELETE', - query: { - alternativeIssueTypeId: typeof parameters !== 'string' ? parameters.alternativeIssueTypeId : undefined, - }, - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those - * assigned to the same workflow scheme, field configuration scheme, and screen scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes | string, - callback: Callback, - ): Promise; - /** - * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those - * assigned to the same workflow scheme, field configuration scheme, and screen scheme. - * - * This operation can be accessed anonymously. + * assigned to the same workflow scheme, field configuration scheme, and screen scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes | string, - callback?: never, - ): Promise; - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/issuetype/${id}/alternatives`, + async getAlternativeIssueTypes(parameters: GetAlternativeIssueTypesParameters) { + const request: Request = { + url: `/rest/api/2/issuetype/${parameters.id}/alternatives`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Loads an avatar for the issue type. - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar, use [ Update issue - * type](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-types/#api-rest-api-2-issuetype-id-put) - * to set it as the issue type's displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback: Callback, - ): Promise; - /** - * Loads an avatar for the issue type. - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar, use [ Update issue - * type](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-types/#api-rest-api-2-issuetype-id-put) - * to set it as the issue type's displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback?: never, - ): Promise; - async createIssueTypeAvatar(parameters: Parameters.CreateIssueTypeAvatar): Promise { - const config: Request = { + * Loads an avatar for the issue type. * + * + * - Specify the avatar's local file location in the body of the request. Also, include the following headers: + * - + * - - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * - + * - For example: + * - `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check' \ --header + * 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url + * 'https://your-domain.atlassian.net/rest/api/2/issuetype/{issueTypeId}'This` + * - + * - The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * - + * - The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * - + * - After creating the avatar, use [ Update issue + * type](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-types/#api-rest-api-2-issuetype-id-put) + * to set it as the issue type's displayed avatar. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeAvatar(parameters: CreateIssueTypeAvatarParameters) { + const request: Request = { url: `/rest/api/2/issuetype/${parameters.id}/avatar2`, method: 'POST', - headers: { - 'X-Atlassian-Token': 'no-check', - 'Content-Type': parameters.mimeType, - }, query: { x: parameters.x, y: parameters.y, - size: parameters.size ?? 0, + size: parameters.size, }, - body: parameters.avatar, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueVotes.ts b/src/version2/issueVotes.ts index d5b317ecfa..18b8b7ff65 100644 --- a/src/version2/issueVotes.ts +++ b/src/version2/issueVotes.ts @@ -1,145 +1,82 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { RemoveVoteParameters } from './parameters/removeVoteParameters'; +import type { GetVotesParameters } from './parameters/getVotesParameters'; +import type { AddVoteParameters } from './parameters/addVoteParameters'; export class IssueVotes { constructor(private client: Client) {} - /** - * Returns details about the votes on an issue. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ - * project permissions are not returned details in the `voters` field. + * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. * + * + * - This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async getVotes(parameters: Parameters.GetVotes | string, callback: Callback): Promise; - /** - * Returns details about the votes on an issue. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ - * project permissions are not returned details in the `voters` field. - */ - async getVotes(parameters: Parameters.GetVotes | string, callback?: never): Promise; - async getVotes(parameters: Parameters.GetVotes | string): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}/votes`, - method: 'GET', + async removeVote(parameters: RemoveVoteParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/votes`, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addVote(parameters: Parameters.AddVote | string, callback: Callback): Promise; - /** - * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * Returns details about the votes on an issue. * + * + * - This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * ini + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - + * - Note that users with the necessary permissions for this operation but without the _View voters and watchers_ + * project permissions are not returned details in the `voters` field. */ - async addVote(parameters: Parameters.AddVote | string, callback?: never): Promise; - async addVote(parameters: Parameters.AddVote | string): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}/votes`, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + async getVotes(parameters: GetVotesParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/votes`, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. * + * + * - This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async removeVote(parameters: Parameters.RemoveVote | string, callback: Callback): Promise; - /** - * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async removeVote(parameters: Parameters.RemoveVote | string, callback?: never): Promise; - async removeVote(parameters: Parameters.RemoveVote | string): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}/votes`, - method: 'DELETE', + async addVote(parameters: AddVoteParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/votes`, + method: 'POST', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueWatchers.ts b/src/version2/issueWatchers.ts index 413497d7a7..64efdd1a5c 100644 --- a/src/version2/issueWatchers.ts +++ b/src/version2/issueWatchers.ts @@ -1,211 +1,118 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetIsWatchingIssueBulkParameters } from './parameters/getIsWatchingIssueBulkParameters'; +import type { RemoveWatcherParameters } from './parameters/removeWatcherParameters'; +import type { GetIssueWatchersParameters } from './parameters/getIssueWatchersParameters'; +import type { AddWatcherParameters } from './parameters/addWatcherParameters'; export class IssueWatchers { constructor(private client: Client) {} - - /** - * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned - * watched status is `false`. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIsWatchingIssueBulk( - parameters: Parameters.GetIsWatchingIssueBulk | undefined, - callback: Callback, - ): Promise; /** * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned - * watched status is `false`. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * watched status is `false`. * + * + * - This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async getIsWatchingIssueBulk( - parameters?: Parameters.GetIsWatchingIssueBulk, - callback?: never, - ): Promise; - async getIsWatchingIssueBulk( - parameters?: Parameters.GetIsWatchingIssueBulk, - ): Promise { - const config: Request = { + async getIsWatchingIssueBulk(parameters: GetIsWatchingIssueBulkParameters) { + const request: Request = { url: '/rest/api/2/issue/watching', method: 'POST', body: { - issueIds: parameters?.issueIds, + issueIds: parameters.issueIds, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the watchers for an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + * Deletes a user as a watcher of an issue. * + * + * - This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - To remove users other than themselves from the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. */ - async getIssueWatchers( - parameters: Parameters.GetIssueWatchers | string, - callback: Callback, - ): Promise; - /** - * Returns the watchers for an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async getIssueWatchers( - parameters: Parameters.GetIssueWatchers | string, - callback?: never, - ): Promise; - async getIssueWatchers(parameters: Parameters.GetIssueWatchers | string): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}/watchers`, - method: 'GET', + async removeWatcher(parameters: RemoveWatcherParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/watchers`, + method: 'DELETE', + query: { + username: parameters.username, + accountId: parameters.accountId, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Adds a user as a watcher of an issue by passing the account ID of the user. For example, - * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To add users other than themselves to the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async addWatcher(parameters: Parameters.AddWatcher, callback: Callback): Promise; - /** - * Adds a user as a watcher of an issue by passing the account ID of the user. For example, - * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To add users other than themselves to the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + * Returns the watchers for an issue. * + * + * - This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * ini + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. */ - async addWatcher(parameters: Parameters.AddWatcher, callback?: never): Promise; - async addWatcher(parameters: Parameters.AddWatcher): Promise { - const config: Request = { + async getIssueWatchers(parameters: GetIssueWatchersParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/watchers`, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: parameters.accountId, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a user as a watcher of an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async removeWatcher(parameters: Parameters.RemoveWatcher, callback: Callback): Promise; - /** - * Deletes a user as a watcher of an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + * Adds a user as a watcher of an issue by passing the account ID of the user. For example, + * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. * + * + * - This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - To add users other than themselves to the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. */ - async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: never): Promise; - async removeWatcher(parameters: Parameters.RemoveWatcher): Promise { - const config: Request = { + async addWatcher(parameters: AddWatcherParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/watchers`, - method: 'DELETE', - query: { - accountId: parameters.accountId, - }, + method: 'POST', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueWorklogProperties.ts b/src/version2/issueWorklogProperties.ts index 5fee396c58..ee9f3fea0a 100644 --- a/src/version2/issueWorklogProperties.ts +++ b/src/version2/issueWorklogProperties.ts @@ -1,187 +1,102 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetWorklogPropertyKeysParameters } from './parameters/getWorklogPropertyKeysParameters'; +import type { DeleteWorklogPropertyParameters } from './parameters/deleteWorklogPropertyParameters'; +import type { GetWorklogPropertyParameters } from './parameters/getWorklogPropertyParameters'; +import type { SetWorklogPropertyParameters } from './parameters/setWorklogPropertyParameters'; export class IssueWorklogProperties { constructor(private client: Client) {} - /** - * Returns the keys of all properties for a worklog. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * Returns the keys of all properties for a worklog. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a worklog. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback?: never, - ): Promise; - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - ): Promise { - const config: Request = { + async getWorklogPropertyKeys(parameters: GetWorklogPropertyKeysParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the value of a worklog property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a worklog property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * Deletes a worklog property. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback?: never, - ): Promise; - async getWorklogProperty(parameters: Parameters.GetWorklogProperty): Promise { - const config: Request = { + async deleteWorklogProperty(parameters: DeleteWorklogPropertyParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'GET', + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the value of a worklog property. Use this operation to store custom data against the worklog. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async setWorklogProperty( - parameters: Parameters.SetWorklogProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a worklog property. Use this operation to store custom data against the worklog. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * Returns the value of a worklog property. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async setWorklogProperty(parameters: Parameters.SetWorklogProperty, callback?: never): Promise; - async setWorklogProperty(parameters: Parameters.SetWorklogProperty): Promise { - const config: Request = { + async getWorklogProperty(parameters: GetWorklogPropertyParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'PUT', + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a worklog property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklogProperty( - parameters: Parameters.DeleteWorklogProperty, - callback: Callback, - ): Promise; - /** - * Deletes a worklog property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * Sets the value of a worklog property. Use this operation to store custom data against the worklog. * + * + * - The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async deleteWorklogProperty(parameters: Parameters.DeleteWorklogProperty, callback?: never): Promise; - async deleteWorklogProperty(parameters: Parameters.DeleteWorklogProperty): Promise { - const config: Request = { + async setWorklogProperty(parameters: SetWorklogPropertyParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'DELETE', + method: 'PUT', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issueWorklogs.ts b/src/version2/issueWorklogs.ts index 2aacd0c334..9cd9d4817b 100644 --- a/src/version2/issueWorklogs.ts +++ b/src/version2/issueWorklogs.ts @@ -1,108 +1,103 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { BulkDeleteWorklogsParameters } from './parameters/bulkDeleteWorklogsParameters'; +import type { GetIssueWorklogParameters } from './parameters/getIssueWorklogParameters'; +import type { AddWorklogParameters } from './parameters/addWorklogParameters'; +import type { BulkMoveWorklogsParameters } from './parameters/bulkMoveWorklogsParameters'; +import type { DeleteWorklogParameters } from './parameters/deleteWorklogParameters'; +import type { GetWorklogParameters } from './parameters/getWorklogParameters'; +import type { UpdateWorklogParameters } from './parameters/updateWorklogParameters'; +import type { GetIdsOfWorklogsDeletedSinceParameters } from './parameters/getIdsOfWorklogsDeletedSinceParameters'; +import type { GetWorklogsForIdsParameters } from './parameters/getWorklogsForIdsParameters'; +import type { GetIdsOfWorklogsModifiedSinceParameters } from './parameters/getIdsOfWorklogsModifiedSinceParameters'; 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. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Workloads are only returned where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * 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 getIssueWorklog( - parameters: Parameters.GetIssueWorklog | string, - callback: Callback, - ): Promise; + async bulkDeleteWorklogs(parameters: BulkDeleteWorklogsParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog`, + method: 'DELETE', + query: { + adjustEstimate: parameters.adjustEstimate, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + body: { + ids: parameters.ids, + }, + }; + + return this.client.sendRequest(request); + } + /** * 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). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Workloads are only returned where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * started on or after a date and time. * + * + * - Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Workloads are only returned where the user has: + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog | string, - callback?: never, - ): Promise; - async getIssueWorklog(parameters: Parameters.GetIssueWorklog | string): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}/worklog`, + async getIssueWorklog(parameters: GetIssueWorklogParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog`, method: 'GET', query: { - 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, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + startedAfter: parameters.startedAfter, + startedBefore: parameters.startedBefore, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Adds a worklog to an issue. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Work on issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * Adds a worklog to an issue. * + * + * - Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ and _Work on issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async addWorklog(parameters: Parameters.AddWorklog, callback: Callback): Promise; - /** - * Adds a worklog to an issue. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Work on issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addWorklog(parameters: Parameters.AddWorklog, callback?: never): Promise; - async addWorklog(parameters: Parameters.AddWorklog): Promise { - const config: Request = { + async addWorklog(parameters: AddWorklogParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog`, method: 'POST', query: { @@ -130,161 +125,101 @@ export class IssueWorklogs { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * 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 bulkDeleteWorklogs(parameters: Parameters.BulkDeleteWorklogs, callback?: never): Promise; - async bulkDeleteWorklogs(parameters: Parameters.BulkDeleteWorklogs): Promise { - const config: Request = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog`, - method: 'DELETE', + async bulkMoveWorklogs(parameters: BulkMoveWorklogsParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/move`, + method: 'POST', query: { adjustEstimate: parameters.adjustEstimate, overrideEditableFlag: parameters.overrideEditableFlag, }, body: { ids: parameters.ids, + issueIdOrKey: parameters.issueIdOrKey, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * Deletes a worklog from an issue. * + * + * - Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or + * _Delete own worklogs_ to delete worklogs created by the user, + * - - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async bulkMoveWorklogs(parameters: Parameters.BulkMoveWorklogs, callback?: never): Promise; - async bulkMoveWorklogs(parameters: Parameters.BulkMoveWorklogs): Promise { - const config: Request = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/move`, - method: 'POST', + async deleteWorklog(parameters: DeleteWorklogParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'DELETE', query: { + notifyUsers: parameters.notifyUsers, adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + increaseBy: parameters.increaseBy, overrideEditableFlag: parameters.overrideEditableFlag, }, - body: parameters.worklogs, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a worklog. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklog(parameters: Parameters.GetWorklog, callback: Callback): Promise; - /** - * Returns a worklog. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * Returns a worklog. * + * + * - Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async getWorklog(parameters: Parameters.GetWorklog, callback?: never): Promise; - async getWorklog(parameters: Parameters.GetWorklog): Promise { - const config: Request = { + async getWorklog(parameters: GetWorklogParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, method: 'GET', query: { @@ -292,49 +227,29 @@ export class IssueWorklogs { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a worklog. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * Updates a worklog. * + * + * - Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async updateWorklog(parameters: Parameters.UpdateWorklog, callback: Callback): Promise; - /** - * Updates a worklog. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async updateWorklog(parameters: Parameters.UpdateWorklog, callback?: never): Promise; - async updateWorklog(parameters: Parameters.UpdateWorklog): Promise { - const config: Request = { + async updateWorklog(parameters: UpdateWorklogParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, method: 'PUT', query: { @@ -345,217 +260,102 @@ export class IssueWorklogs { overrideEditableFlag: parameters.overrideEditableFlag, }, body: { + author: parameters.author, comment: parameters.comment, - visibility: parameters.visibility, + created: parameters.created, + id: parameters.id, + issueId: parameters.issueId, + properties: parameters.properties, + self: parameters.self, started: parameters.started, timeSpent: parameters.timeSpent, timeSpentSeconds: parameters.timeSpentSeconds, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config); - } - - /** - * Deletes a worklog from an issue. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or - * _Delete own worklogs_ to delete worklogs created by the user, - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback: Callback): Promise; - /** - * Deletes a worklog from an issue. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or - * _Delete own worklogs_ to delete worklogs created by the user, - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: never): Promise; - async deleteWorklog(parameters: Parameters.DeleteWorklog): Promise { - const config: Request = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'DELETE', - query: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - increaseBy: parameters.increaseBy, - overrideEditableFlag: parameters.overrideEditableFlag, + updateAuthor: parameters.updateAuthor, + updated: parameters.updated, + visibility: parameters.visibility, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs deleted during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. * + * + * - This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is + * set to true on the last page of worklogs. + * - + * - This resource does not return worklogs deleted during the minute preceding the request. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async getIdsOfWorklogsDeletedSince( - parameters: Parameters.GetIdsOfWorklogsDeletedSince | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs deleted during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getIdsOfWorklogsDeletedSince( - parameters?: Parameters.GetIdsOfWorklogsDeletedSince, - callback?: never, - ): Promise; - async getIdsOfWorklogsDeletedSince( - parameters?: Parameters.GetIdsOfWorklogsDeletedSince, - ): Promise { - const config: Request = { + async getIdsOfWorklogsDeletedSince(parameters: GetIdsOfWorklogsDeletedSinceParameters) { + const request: Request = { url: '/rest/api/2/worklog/deleted', method: 'GET', query: { - since: parameters?.since, + since: parameters.since, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns worklog details for a list of worklog IDs. - * - * The returned list of worklogs is limited to 1000 items. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getWorklogsForIds( - parameters: Parameters.GetWorklogsForIds | undefined, - callback: Callback, - ): Promise; - /** - * Returns worklog details for a list of worklog IDs. - * - * The returned list of worklogs is limited to 1000 items. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. + * Returns worklog details for a list of worklog IDs. * + * + * - The returned list of worklogs is limited to 1000 items. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * - + * - - The worklog is set as _Viewable by All Users_. + * - - The user is a member of a project role or group with permission to view the worklog. */ - async getWorklogsForIds( - parameters?: Parameters.GetWorklogsForIds, - callback?: never, - ): Promise; - async getWorklogsForIds(parameters?: Parameters.GetWorklogsForIds): Promise { - const config: Request = { + async getWorklogsForIds(parameters: GetWorklogsForIdsParameters) { + const request: Request = { url: '/rest/api/2/worklog/list', method: 'POST', query: { - expand: parameters?.expand, + expand: parameters.expand, }, body: { - ids: parameters?.ids, + ids: parameters.ids, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a list of IDs and update timestamps for worklogs updated after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs updated during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. + * Returns a list of IDs and update timestamps for worklogs updated after a date and time. * + * + * - This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is + * set to true on the last page of worklogs. + * - + * - This resource does not return worklogs updated during the minute preceding the request. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * - + * - - The worklog is set as _Viewable by All Users_. + * - - The user is a member of a project role or group with permission to view the worklog. */ - async getIdsOfWorklogsModifiedSince( - parameters: Parameters.GetIdsOfWorklogsModifiedSince | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of IDs and update timestamps for worklogs updated after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs updated during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getIdsOfWorklogsModifiedSince( - parameters?: Parameters.GetIdsOfWorklogsModifiedSince, - callback?: never, - ): Promise; - async getIdsOfWorklogsModifiedSince( - parameters?: Parameters.GetIdsOfWorklogsModifiedSince, - ): Promise { - const config: Request = { + async getIdsOfWorklogsModifiedSince(parameters: GetIdsOfWorklogsModifiedSinceParameters) { + const request: Request = { url: '/rest/api/2/worklog/updated', method: 'GET', query: { - since: parameters?.since, - expand: parameters?.expand, + since: parameters.since, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/issues.ts b/src/version2/issues.ts index 04a6cf9db5..f4c7cc8c15 100644 --- a/src/version2/issues.ts +++ b/src/version2/issues.ts @@ -1,54 +1,47 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetBulkChangelogsParameters } from './parameters/getBulkChangelogsParameters'; +import type { CreateIssueParameters } from './parameters/createIssueParameters'; +import type { ArchiveIssuesAsyncParameters } from './parameters/archiveIssuesAsyncParameters'; +import type { ArchiveIssuesParameters } from './parameters/archiveIssuesParameters'; +import type { CreateIssuesParameters } from './parameters/createIssuesParameters'; +import type { BulkFetchIssuesParameters } from './parameters/bulkFetchIssuesParameters'; +import type { GetCreateIssueMetaIssueTypesParameters } from './parameters/getCreateIssueMetaIssueTypesParameters'; +import type { GetCreateIssueMetaIssueTypeIdParameters } from './parameters/getCreateIssueMetaIssueTypeIdParameters'; +import type { GetIssueLimitReportParameters } from './parameters/getIssueLimitReportParameters'; +import type { UnarchiveIssuesParameters } from './parameters/unarchiveIssuesParameters'; +import type { DeleteIssueParameters } from './parameters/deleteIssueParameters'; +import type { GetIssueParameters } from './parameters/getIssueParameters'; +import type { EditIssueParameters } from './parameters/editIssueParameters'; +import type { AssignIssueParameters } from './parameters/assignIssueParameters'; +import type { GetChangeLogsParameters } from './parameters/getChangeLogsParameters'; +import type { GetChangeLogsByIdsParameters } from './parameters/getChangeLogsByIdsParameters'; +import type { GetEditIssueMetaParameters } from './parameters/getEditIssueMetaParameters'; +import type { NotifyParameters } from './parameters/notifyParameters'; +import type { GetTransitionsParameters } from './parameters/getTransitionsParameters'; +import type { DoTransitionParameters } from './parameters/doTransitionParameters'; +import type { ExportArchivedIssuesParameters } from './parameters/exportArchivedIssuesParameters'; export class Issues { constructor(private client: Client) {} - - /** - * Bulk fetch changelogs for multiple issues and filter by fields - * - * Returns a paginated list of all changelogs for given issues sorted by changelog date and issue IDs, starting from - * the oldest changelog and smallest issue ID. - * - * Issues are identified by their ID or key, and optionally changelogs can be filtered by their field IDs. You can - * request the changelogs of up to 1000 issues and can filter them by up to 10 field IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects that the issues - * are in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issues. - */ - async getBulkChangelogs( - parameters: Parameters.GetBulkChangelogs, - callback: Callback, - ): Promise; /** - * Bulk fetch changelogs for multiple issues and filter by fields - * - * Returns a paginated list of all changelogs for given issues sorted by changelog date and issue IDs, starting from - * the oldest changelog and smallest issue ID. - * - * Issues are identified by their ID or key, and optionally changelogs can be filtered by their field IDs. You can - * request the changelogs of up to 1000 issues and can filter them by up to 10 field IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects that the issues - * are in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issues. - */ - async getBulkChangelogs( - parameters: Parameters.GetBulkChangelogs, - callback?: never, - ): Promise; - async getBulkChangelogs(parameters: Parameters.GetBulkChangelogs): Promise { - const config: Request = { + * 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: GetBulkChangelogsParameters) { + const request: Request = { url: '/rest/api/2/changelog/bulkfetch', method: 'POST', body: { @@ -59,74 +52,45 @@ export class Issues { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns all issue events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getEvents(callback: Callback): Promise; - /** - * Returns all issue events. + * Returns all issue events. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getEvents(callback?: never): Promise; - async getEvents(): Promise { - const config: Request = { + async getEvents() { + const request: Request = { url: '/rest/api/2/events', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties - * set. - * - * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue - * or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These are - * the same fields that appear on the issue's create screen. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). - * - `parent` must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which the issue or subtask is created. - */ - async createIssue(parameters: Parameters.CreateIssue, callback: Callback): Promise; - /** - * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be - * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties - * set. - * - * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue - * or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These are - * the same fields that appear on the issue's create screen. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). - * - `parent` must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which the issue or subtask is created. - */ - async createIssue(parameters: Parameters.CreateIssue, callback?: never): Promise; - async createIssue(parameters: Parameters.CreateIssue): Promise { - const config: Request = { + * set. * + * + * - The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue + * or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These are + * the same fields that appear on the issue's create screen. + * - + * - Creating a subtask differs from creating an issue as follows: + * - + * - - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). + * - - `parent` must contain the ID or key of the parent issue. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which the issue or subtask is created. + */ + async createIssue(parameters: CreateIssueParameters) { + const request: Request = { url: '/rest/api/2/issue', method: 'POST', query: { @@ -141,61 +105,38 @@ export class Issues { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Enables admins to archive up to 100,000 issues in a single request using JQL, returning the URL to check the status - * of the submitted request. - * - * You can use the [get - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-rest-api-2-task-taskid-get) - * and [cancel - * 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:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request per jira instance can be active at any given time. - */ - async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback: Callback): Promise; - /** - * Enables admins to archive up to 100,000 issues in a single request using JQL, returning the URL to check the status - * of the submitted request. - * - * You can use the [get - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-rest-api-2-task-taskid-get) - * and [cancel - * 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:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request per jira instance can be active at any given time. - */ - async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; - async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync): Promise { - const config: Request = { + * of the submitted request. * + * + * - You can use the [get + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) + * and [cancel + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * APIs to manage the request. + * - + * - **Note that:** + * - + * - - You can't archive subtasks directly, only through their parent issues + * - - You can only archive issues from software, service management, and business projects + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * - + * - **License required:** Premium or Enterprise + * - + * - **Signed-in users only:** This API can't be accessed anonymously. + * - + * - **Rate limiting:** Only a single request per jira instance can be active at any given time. + * - + * - + * - + */ + async archiveIssuesAsync(parameters: ArchiveIssuesAsyncParameters) { + const request: Request = { url: '/rest/api/2/issue/archive', method: 'POST', body: { @@ -203,48 +144,30 @@ export class Issues { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) archived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async archiveIssues( - parameters: Parameters.ArchiveIssues, - callback: Callback, - ): Promise; - /** - * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) archived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async archiveIssues(parameters: Parameters.ArchiveIssues, callback?: never): Promise; - async archiveIssues(parameters: Parameters.ArchiveIssues): Promise { - const config: Request = { + * issue(s) archived in the process and the errors encountered, if any. * + * + * - **Note that:** + * - + * - - You can't archive subtasks directly, only through their parent issues + * - - You can only archive issues from software, service management, and business projects + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * - + * - **License required:** Premium or Enterprise + * - + * - **Signed-in users only:** This API can't be accessed anonymously. + * - + * - + * - + */ + async archiveIssues(parameters: ArchiveIssuesParameters) { + const request: Request = { url: '/rest/api/2/issue/archive', method: 'PUT', body: { @@ -252,111 +175,62 @@ export class Issues { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue - * properties set. - * - * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the - * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These - * are the same fields that appear on the issues' create screens. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). - * - `parent` the must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which each issue or subtask is created. - */ - async createIssues( - parameters: Parameters.CreateIssues | undefined, - callback: Callback, - ): Promise; - /** - * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may - * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue - * properties set. - * - * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the - * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These - * are the same fields that appear on the issues' create screens. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). - * - `parent` the must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which each issue or subtask is created. - */ - async createIssues(parameters?: Parameters.CreateIssues, callback?: never): Promise; - async createIssues(parameters?: Parameters.CreateIssues): Promise { - const config: Request = { + * properties set. * + * + * - The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the + * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). + * These are the same fields that appear on the issues' create screens. + * - + * - Creating a subtask differs from creating an issue as follows: + * - + * - - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). + * - - `parent` the must contain the ID or key of the parent issue. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which each issue or subtask is created. + */ + async createIssues(parameters: CreateIssuesParameters) { + const request: Request = { url: '/rest/api/2/issue/bulk', method: 'POST', body: { - issueUpdates: parameters?.issueUpdates, + issueUpdates: parameters.issueUpdates, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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: 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): Promise { - const config: Request = { + * 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: BulkFetchIssuesParameters) { + const request: Request = { url: '/rest/api/2/issue/bulkfetch', method: 'POST', body: { @@ -368,99 +242,20 @@ export class Issues { }, }; - return this.client.sendRequest(config); - } - - /** - * @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, 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, - callback?: never, - ): Promise; - async getCreateIssueMeta( - parameters?: Parameters.GetCreateIssueMeta, - ): Promise { - const config: Request = { - url: '/rest/api/2/issue/createmeta', - method: 'GET', - query: { - projectIds: parameters?.projectIds, - projectKeys: parameters?.projectKeys, - issuetypeIds: parameters?.issuetypeIds, - issuetypeNames: parameters?.issuetypeNames, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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. + * Create issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). * * - * **[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. + * - 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, - ): Promise { - const config: Request = { + async getCreateIssueMetaIssueTypes(parameters: GetCreateIssueMetaIssueTypesParameters) { + const request: Request = { url: `/rest/api/2/issue/createmeta/${parameters.projectIdOrKey}/issuetypes`, method: 'GET', query: { @@ -469,39 +264,20 @@ export class Issues { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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). + * 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. + * - 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, - ): Promise { - const config: Request = { + async getCreateIssueMetaIssueTypeId(parameters: GetCreateIssueMetaIssueTypeIdParameters) { + const request: Request = { url: `/rest/api/2/issue/createmeta/${parameters.projectIdOrKey}/issuetypes/${parameters.issueTypeId}`, method: 'GET', query: { @@ -510,94 +286,51 @@ export class Issues { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns all issues breaching and approaching per-issue limits. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Returns all issues breaching and approaching per-issue limits. * * - * - _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). + * - **[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, - ): Promise { - const config: Request = { + async getIssueLimitReport(parameters: GetIssueLimitReportParameters) { + const request: Request = { url: '/rest/api/2/issue/limit/report', method: 'GET', query: { - isReturningKeys: parameters?.isReturningKeys, - }, - body: { - issuesApproachingLimitParams: parameters?.issuesApproachingLimitParams, + isReturningKeys: parameters.isReturningKeys, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) unarchived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't unarchive subtasks directly, only through their parent issues - * - You can only unarchive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback: Callback, - ): Promise; - /** - * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) unarchived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't unarchive subtasks directly, only through their parent issues - * - You can only unarchive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback?: never, - ): Promise; - async unarchiveIssues(parameters: Parameters.UnarchiveIssues): Promise { - const config: Request = { + * issue(s) unarchived in the process and the errors encountered, if any. * + * + * - **Note that:** + * - + * - - You can't unarchive subtasks directly, only through their parent issues + * - - You can only unarchive issues from software, service management, and business projects + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * - + * - **License required:** Premium or Enterprise + * - + * - **Signed-in users only:** This API can't be accessed anonymously. + * - + * - + * - + */ + async unarchiveIssues(parameters: UnarchiveIssuesParameters) { + const request: Request = { url: '/rest/api/2/issue/unarchive', method: 'PUT', body: { @@ -605,115 +338,96 @@ export class Issues { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the details for an issue. - * - * The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive - * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or - * other redirect is **not** returned. The issue key returned in the response is the key of the issue found. + * Deletes an issue. * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * - An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. + * This causes the issue's subtasks to be deleted with the issue. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ and _Delete issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async getIssue(parameters: Parameters.GetIssue | string, callback: Callback): Promise; + async deleteIssue(parameters: DeleteIssueParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}`, + method: 'DELETE', + query: { + deleteSubtasks: parameters.deleteSubtasks, + }, + }; + + return this.client.sendRequest(request); + } + /** - * Returns the details for an issue. - * - * The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive - * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or - * other redirect is **not** returned. The issue key returned in the response is the key of the issue found. - * - * This operation can be accessed anonymously. + * Returns the details for an issue. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * - The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. The issue key returned in the response is the key of the issue found. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async getIssue(parameters: Parameters.GetIssue | string, callback?: never): Promise; - async getIssue(parameters: Parameters.GetIssue | string): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}`, + async getIssue(parameters: GetIssueParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}`, method: 'GET', query: { - 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, + fields: parameters.fields, + fieldsByKeys: parameters.fieldsByKeys, + expand: parameters.expand, + properties: parameters.properties, + updateHistory: parameters.updateHistory, + failFast: parameters.failFast, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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). - * - * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting - * `update.parent.set.none` to _true_. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security - * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async editIssue(parameters: Parameters.EditIssue, callback: Callback): Promise; - /** - * Edits an issue. 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). - * - * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting - * `update.parent.set.none` to _true_. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security - * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async editIssue(parameters: Parameters.EditIssue, callback?: never): Promise; - async editIssue(parameters: Parameters.EditIssue): Promise { - const config: Request = { + * 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). + * - + * - The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting + * `update.parent.set.none` to _true_. + * - + * - Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security + * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ and _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async editIssue(parameters: EditIssueParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}`, method: 'PUT', query: { @@ -732,95 +446,29 @@ export class Issues { }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes an issue. - * - * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. - * This causes the issue's subtasks to be deleted with the issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Delete issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteIssue(parameters: Parameters.DeleteIssue | string, callback: Callback): Promise; - /** - * Deletes an issue. - * - * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. - * This causes the issue's subtasks to be deleted with the issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Delete issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteIssue(parameters: Parameters.DeleteIssue | string, callback?: never): Promise; - async deleteIssue(parameters: Parameters.DeleteIssue | string): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}`, - method: 'DELETE', - query: { - deleteSubtasks: typeof parameters !== 'string' ? parameters.deleteSubtasks : undefined, - }, - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but - * has the _Assign issue_ permission for the project that the issue is in. - * - * If `name` or `accountId` is set to: - * - * - `"-1"`, the issue is assigned to the default assignee for the project. - * - `null`, the issue is set to unassigned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ and _Assign Issues_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async assignIssue(parameters: Parameters.AssignIssue, callback: Callback): Promise; - /** - * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but - * has the _Assign issue_ permission for the project that the issue is in. - * - * If `name` or `accountId` is set to: - * - * - `"-1"`, the issue is assigned to the default assignee for the project. - * - `null`, the issue is set to unassigned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ and _Assign Issues_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async assignIssue(parameters: Parameters.AssignIssue, callback?: never): Promise; - async assignIssue(parameters: Parameters.AssignIssue): Promise { - const config: Request = { + * has the _Assign issue_ permission for the project that the issue is in. * + * + * - If `name` or `accountId` is set to: + * - + * - - `"-1"`, the issue is assigned to the default assignee for the project. + * - - `null`, the issue is set to unassigned. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse Projects_ and _Assign Issues_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async assignIssue(parameters: AssignIssueParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/assignee`, method: 'PUT', body: { @@ -841,92 +489,49 @@ export class Issues { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * changelogs for an issue sorted by date, starting from the oldest. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getChangeLogs( - parameters: Parameters.GetChangeLogs | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * changelogs for an issue sorted by date, starting from the oldest. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getChangeLogs( - parameters: Parameters.GetChangeLogs | string, - callback?: never, - ): Promise; - async getChangeLogs(parameters: Parameters.GetChangeLogs | string): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}/changelog`, + * changelogs for an issue sorted by date, starting from the oldest. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getChangeLogs(parameters: GetChangeLogsParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/changelog`, method: 'GET', query: { - startAt: typeof parameters !== 'string' ? parameters.startAt : undefined, - maxResults: typeof parameters !== 'string' ? parameters.maxResults : undefined, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns changelogs for an issue specified by a list of changelog IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback: Callback, - ): Promise; - /** - * Returns changelogs for an issue specified by a list of changelog IDs. - * - * This operation can be accessed anonymously. + * Returns changelogs for an issue specified by a list of changelog 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 project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback?: never, - ): Promise; - async getChangeLogsByIds(parameters: Parameters.GetChangeLogsByIds): Promise { - const config: Request = { + async getChangeLogsByIds(parameters: GetChangeLogsByIdsParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/changelog/list`, method: 'POST', body: { @@ -934,162 +539,86 @@ export class Issues { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to - * populate the requests in [Edit issue](#api-rest-api-2-issue-issueIdOrKey-put). - * - * This endpoint will check for these conditions: - * - * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type - * scheme configuration. `overrideScreenSecurity=true` skips this condition. - * 2. Field is visible in the [field - * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). - * `overrideScreenSecurity=true` skips this condition. - * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if - * attachments are enabled. Assignee only shows if user has permissions to assign the issue. - * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All - * system fields are assumed to have context in all projects and all issue types. - * 5. Issue has a project, issue type, and status defined. - * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. - * `overrideEditableFlag=true` skips this condition. - * 7. The current workflow step is editable. This is true by default, but [can be disabled by - * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the - * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. - * 8. User has [Edit issues - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). - * 9. Workflow permissions allow editing a field. This is true by default but [can be - * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using - * `jira.permission.*` workflow properties. - * - * Fields hidden using [Issue layout settings - * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain - * editable. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: - * - * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available - * through screens, and field configuration (conditions 1. and 2. from the list above). - * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if - * the current step is editable (conditions 6. and 7. from the list above). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note: For any fields to be editable the user must have the _Edit issues_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. - */ - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta | string, - callback: Callback, - ): Promise; - /** - * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to - * populate the requests in [Edit issue](#api-rest-api-2-issue-issueIdOrKey-put). - * - * This endpoint will check for these conditions: - * - * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type - * scheme configuration. `overrideScreenSecurity=true` skips this condition. - * 2. Field is visible in the [field - * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). - * `overrideScreenSecurity=true` skips this condition. - * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if - * attachments are enabled. Assignee only shows if user has permissions to assign the issue. - * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All - * system fields are assumed to have context in all projects and all issue types. - * 5. Issue has a project, issue type, and status defined. - * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. - * `overrideEditableFlag=true` skips this condition. - * 7. The current workflow step is editable. This is true by default, but [can be disabled by - * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the - * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. - * 8. User has [Edit issues - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). - * 9. Workflow permissions allow editing a field. This is true by default but [can be - * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using - * `jira.permission.*` workflow properties. - * - * Fields hidden using [Issue layout settings - * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain - * editable. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: - * - * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available - * through screens, and field configuration (conditions 1. and 2. from the list above). - * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if - * the current step is editable (conditions 6. and 7. from the list above). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note: For any fields to be editable the user must have the _Edit issues_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. - */ - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta | string, - callback?: never, - ): Promise; - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta | string, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}/editmeta`, + * populate the requests in [Edit issue](#api-rest-api-2-issue-issueIdOrKey-put). * + * + * - This endpoint will check for these conditions: + * - + * - 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type + * scheme configuration. `overrideScreenSecurity=true` skips this condition. + * - 2. Field is visible in the [field + * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). + * `overrideScreenSecurity=true` skips this condition. + * - 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if + * attachments are enabled. Assignee only shows if user has permissions to assign the issue. + * - 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All + * system fields are assumed to have context in all projects and all issue types. + * - 5. Issue has a project, issue type, and status defined. + * - 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. + * `overrideEditableFlag=true` skips this condition. + * - 7. The current workflow step is editable. This is true by default, but [can be disabled by + * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the + * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. + * - 8. User has [Edit issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). + * - 9. Workflow permissions allow editing a field. This is true by default but [can be + * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using + * `jira.permission.*` workflow properties. + * - + * - Fields hidden using [Issue layout settings + * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain + * editable. + * - + * - Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: + * - + * - - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available + * through screens, and field configuration (conditions 1. and 2. from the list above). + * - - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if + * the current step is editable (conditions 6. and 7. from the list above). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - + * - Note: For any fields to be editable the user must have the _Edit issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. + */ + async getEditIssueMeta(parameters: GetEditIssueMetaParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/editmeta`, method: 'GET', query: { - overrideScreenSecurity: typeof parameters !== 'string' ? parameters.overrideScreenSecurity : undefined, - overrideEditableFlag: typeof parameters !== 'string' ? parameters.overrideEditableFlag : undefined, + overrideScreenSecurity: parameters.overrideScreenSecurity, + overrideEditableFlag: parameters.overrideEditableFlag, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates an email notification for an issue and adds it to the mail queue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Creates an email notification for an issue and adds it to the mail queue. * * - * - _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. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async notify(parameters: Parameters.Notify, callback: Callback): Promise; - /** - * Creates an email notification for an issue and adds it to the mail queue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async notify(parameters: Parameters.Notify, callback?: never): Promise; - async notify(parameters: Parameters.Notify): Promise { - const config: Request = { + async notify(parameters: NotifyParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/notify`, method: 'POST', body: { @@ -1101,112 +630,63 @@ export class Issues { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's - * status. - * - * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its - * status, the response will return any empty transitions list. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: A list or - * transition is returned only when the user has:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * However, if the user does not have the _Transition issues_ [ project - * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. - */ - async getTransitions( - parameters: Parameters.GetTransitions | string, - callback: Callback, - ): Promise; - /** - * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's - * status. - * - * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its - * status, the response will return any empty transitions list. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: A list or - * transition is returned only when the user has:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * However, if the user does not have the _Transition issues_ [ project - * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. - */ - async getTransitions( - parameters: Parameters.GetTransitions | string, - callback?: never, - ): Promise; - async getTransitions(parameters: Parameters.GetTransitions | string): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: Request = { - url: `/rest/api/2/issue/${issueIdOrKey}/transitions`, + * status. * + * + * - Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its + * status, the response will return any empty transitions list. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: A list or + * transition is returned only when the user has:** + * - + * - - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - + * - However, if the user does not have the _Transition issues_ [ project + * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. + */ + async getTransitions(parameters: GetTransitionsParameters) { + const request: Request = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/transitions`, method: 'GET', query: { - 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, + expand: parameters.expand, + transitionId: parameters.transitionId, + skipRemoteOnlyCondition: parameters.skipRemoteOnlyCondition, + includeUnavailableTransitions: parameters.includeUnavailableTransitions, + sortByOpsBarAndStatus: parameters.sortByOpsBarAndStatus, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. - * - * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` - * parameters in the request body. Get details about the fields using [ Get - * transitions](#api-rest-api-2-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Transition issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async doTransition(parameters: Parameters.DoTransition, callback: Callback): Promise; - /** - * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. - * - * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` - * parameters in the request body. Get details about the fields using [ Get - * transitions](#api-rest-api-2-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. * * - * - _Browse projects_ and _Transition issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. + * - SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` + * parameters in the request body. Get details about the fields using [ Get + * transitions](#api-rest-api-2-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Browse projects_ and _Transition issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. */ - async doTransition(parameters: Parameters.DoTransition, callback?: never): Promise; - async doTransition(parameters: Parameters.DoTransition): Promise { - const config: Request = { + async doTransition(parameters: DoTransitionParameters) { + const request: Request = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/transitions`, method: 'POST', body: { @@ -1218,53 +698,30 @@ export class Issues { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it - * will receive an email with a link to download a CSV file with the issue details. - * - * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and - * `ArchivedDate`). Custom fields aren't supported. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request can be active at any given time. - */ - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues, - callback: Callback, - ): Promise; - /** - * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it - * will receive an email with a link to download a CSV file with the issue details. - * - * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and - * `ArchivedDate`). Custom fields aren't supported. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request can be active at any given time. - */ - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues, - callback?: never, - ): Promise; - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues, - ): Promise { - const config: Request = { + * will receive an email with a link to download a CSV file with the issue details. * + * + * - Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and + * `ArchivedDate`). Custom fields aren't supported. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * - + * - **License required:** Premium or Enterprise + * - + * - **Signed-in users only:** This API can't be accessed anonymously. + * - + * - **Rate limiting:** Only a single request can be active at any given time. + * - + * - + * - + */ + async exportArchivedIssues(parameters: ExportArchivedIssuesParameters) { + const request: Request = { url: '/rest/api/2/issues/archive/export', method: 'PUT', body: { @@ -1276,6 +733,6 @@ export class Issues { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/jQL.ts b/src/version2/jQL.ts index b2fb6a55a0..df5b4c0ca3 100644 --- a/src/version2/jQL.ts +++ b/src/version2/jQL.ts @@ -1,49 +1,34 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAutoCompletePostParameters } from './parameters/getAutoCompletePostParameters'; +import type { GetFieldAutoCompleteForQueryStringParameters } from './parameters/getFieldAutoCompleteForQueryStringParameters'; +import type { ParseJqlQueriesParameters } from './parameters/parseJqlQueriesParameters'; +import type { MigrateQueriesParameters } from './parameters/migrateQueriesParameters'; +import type { SanitiseJqlQueriesParameters } from './parameters/sanitiseJqlQueriesParameters'; export class JQL { constructor(private client: Client) {} - - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference - * data (POST)](#api-rest-api-2-jql-autocompletedata-post) can be used. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAutoComplete(callback: Callback): Promise; /** * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference - * data (POST)](#api-rest-api-2-jql-autocompletedata-post) can be used. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * query builder. * + * + * - To filter visible field details by project or collapse non-unique fields by field type then [Get field reference + * data (POST)](#api-rest-api-2-jql-autocompletedata-post) can be used. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAutoComplete(callback?: never): Promise; - async getAutoComplete(): Promise { - const config: Request = { + async getAutoComplete() { + const request: Request = { url: '/rest/api/2/jql/autocompletedata', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** @@ -51,141 +36,72 @@ export class JQL { * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. - * System fields are always returned. - * - * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across - * all fields with the same name and of the same field type. For example, the collapsed field `Component - - * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched - * simultaneously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * query builder. * + * + * - This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. + * System fields are always returned. + * - + * - It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across + * all fields with the same name and of the same field type. For example, the collapsed field `Component - + * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched + * simultaneously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAutoCompletePost( - parameters: Parameters.GetAutoCompletePost | undefined, - callback: Callback, - ): Promise; - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. - * System fields are always returned. - * - * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across - * all fields with the same name and of the same field type. For example, the collapsed field `Component - - * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched - * simultaneously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAutoCompletePost( - parameters?: Parameters.GetAutoCompletePost, - callback?: never, - ): Promise; - async getAutoCompletePost( - parameters?: Parameters.GetAutoCompletePost, - ): Promise { - const config: Request = { + async getAutoCompletePost(parameters: GetAutoCompletePostParameters) { + const request: Request = { url: '/rest/api/2/jql/autocompletedata', method: 'POST', body: { - includeCollapsedFields: parameters?.includeCollapsedFields, - projectIds: parameters?.projectIds, + includeCollapsedFields: parameters.includeCollapsedFields, + projectIds: parameters.projectIds, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the JQL search auto complete suggestions for a field. - * - * Suggestions can be obtained by providing: - * - * - `fieldName` to get a list of all values for the field. - * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. - * - `fieldName` and `predicateName` to get a list of all predicate values for the field. - * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in - * `predicateValue`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * Returns the JQL search auto complete suggestions for a field. * + * + * - Suggestions can be obtained by providing: + * - + * - - `fieldName` to get a list of all values for the field. + * - - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. + * - - `fieldName` and `predicateName` to get a list of all predicate values for the field. + * - - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in + * `predicateValue`. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getFieldAutoCompleteForQueryString( - parameters: Parameters.GetFieldAutoCompleteForQueryString | undefined, - callback: Callback, - ): Promise; - /** - * Returns the JQL search auto complete suggestions for a field. - * - * Suggestions can be obtained by providing: - * - * - `fieldName` to get a list of all values for the field. - * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. - * - `fieldName` and `predicateName` to get a list of all predicate values for the field. - * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in - * `predicateValue`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getFieldAutoCompleteForQueryString( - parameters?: Parameters.GetFieldAutoCompleteForQueryString, - callback?: never, - ): Promise; - async getFieldAutoCompleteForQueryString( - parameters?: Parameters.GetFieldAutoCompleteForQueryString, - ): Promise { - const config: Request = { + async getFieldAutoCompleteForQueryString(parameters: GetFieldAutoCompleteForQueryStringParameters) { + const request: Request = { url: '/rest/api/2/jql/autocompletedata/suggestions', method: 'GET', query: { - fieldName: parameters?.fieldName, - fieldValue: parameters?.fieldValue, - predicateName: parameters?.predicateName, - predicateValue: parameters?.predicateValue, + fieldName: parameters.fieldName, + fieldValue: parameters.fieldValue, + predicateName: parameters.predicateName, + predicateValue: parameters.predicateValue, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Parses and validates JQL queries. + * Parses and validates JQL queries. * * - * Validation is performed in context of the current user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - Validation is performed in context of the current user. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async parseJqlQueries( - parameters: Parameters.ParseJqlQueries, - callback: Callback, - ): Promise; - /** - * Parses and validates JQL queries. - * - * Validation is performed in context of the current user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async parseJqlQueries( - parameters: Parameters.ParseJqlQueries, - callback?: never, - ): Promise; - async parseJqlQueries(parameters: Parameters.ParseJqlQueries): Promise { - const config: Request = { + async parseJqlQueries(parameters: ParseJqlQueriesParameters) { + const request: Request = { url: '/rest/api/2/jql/parse', method: 'POST', query: { @@ -196,108 +112,60 @@ export class JQL { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Converts one or more JQL queries with user identifiers (username or user key) to equivalent JQL queries with - * account IDs. - * - * You may wish to use this operation if your system stores JQL queries and you want to make them GDPR-compliant. For - * more information about GDPR-related changes, see the [migration - * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async migrateQueries( - parameters: Parameters.MigrateQueries | undefined, - callback: Callback, - ): Promise; - /** - * Converts one or more JQL queries with user identifiers (username or user key) to equivalent JQL queries with - * account IDs. - * - * You may wish to use this operation if your system stores JQL queries and you want to make them GDPR-compliant. For - * more information about GDPR-related changes, see the [migration - * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * account IDs. * + * + * - You may wish to use this operation if your system stores JQL queries and you want to make them GDPR-compliant. For + * more information about GDPR-related changes, see the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async migrateQueries( - parameters?: Parameters.MigrateQueries, - callback?: never, - ): Promise; - async migrateQueries(parameters?: Parameters.MigrateQueries): Promise { - const config: Request = { + async migrateQueries(parameters: MigrateQueriesParameters) { + const request: Request = { url: '/rest/api/2/jql/pdcleaner', method: 'POST', body: { - queryStrings: parameters?.queryStrings, + queryStrings: parameters.queryStrings, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Sanitizes one or more JQL queries by converting readable details into IDs where a user doesn't have permission to - * view the entity. - * - * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse - * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where - * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account - * ID is null, sanitizing is performed for an anonymous user. - * - * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers - * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in - * JQL - * queries](https://developer.atlassian.com/cloud/jira/platform/rest/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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * view the entity. * + * + * - For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse + * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ + * (where 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If + * the account ID is null, sanitizing is performed for an anonymous user. + * - + * - Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers + * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs + * in JQL + * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). + * - + * - Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async sanitiseJqlQueries( - parameters: Parameters.SanitiseJqlQueries | undefined, - callback: Callback, - ): Promise; - /** - * Sanitizes one or more JQL queries by converting readable details into IDs where a user doesn't have permission to - * view the entity. - * - * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse - * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where - * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account - * ID is null, sanitizing is performed for an anonymous user. - * - * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers - * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in - * JQL - * queries](https://developer.atlassian.com/cloud/jira/platform/rest/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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async sanitiseJqlQueries( - parameters?: Parameters.SanitiseJqlQueries, - callback?: never, - ): Promise; - async sanitiseJqlQueries( - parameters?: Parameters.SanitiseJqlQueries, - ): Promise { - const config: Request = { + async sanitiseJqlQueries(parameters: SanitiseJqlQueriesParameters) { + const request: Request = { url: '/rest/api/2/jql/sanitize', method: 'POST', body: { - queries: parameters?.queries, + queries: parameters.queries, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/jiraExpressions.ts b/src/version2/jiraExpressions.ts index 0cd79c8a71..ac1fca96c4 100644 --- a/src/version2/jiraExpressions.ts +++ b/src/version2/jiraExpressions.ts @@ -1,339 +1,110 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { AnalyseExpressionParameters } from './parameters/analyseExpressionParameters'; +import type { EvaluateJSISJiraExpressionParameters } from './parameters/evaluateJSISJiraExpressionParameters'; export class JiraExpressions { constructor(private client: Client) {} - /** - * Analyses and validates Jira expressions. - * - * As an experimental feature, this operation can also attempt to type-check the expressions. - * - * Learn more about Jira expressions in the - * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. - */ - async analyseExpression( - parameters: Parameters.AnalyseExpression | undefined, - callback: Callback, - ): Promise; - /** - * Analyses and validates Jira expressions. - * - * As an experimental feature, this operation can also attempt to type-check the expressions. - * - * Learn more about Jira expressions in the - * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. + * Analyses and validates Jira expressions. * + * + * - As an experimental feature, this operation can also attempt to type-check the expressions. + * - + * - Learn more about Jira expressions in the + * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. */ - async analyseExpression( - parameters?: Parameters.AnalyseExpression, - callback?: never, - ): Promise; - async analyseExpression( - parameters?: Parameters.AnalyseExpression, - ): Promise { - const config: Request = { + async analyseExpression(parameters: AnalyseExpressionParameters) { + const request: Request = { url: '/rest/api/2/expression/analyse', method: 'POST', query: { - check: parameters?.check, + check: parameters.check, }, body: { - contextVariables: parameters?.contextVariables, - expressions: parameters?.expressions, + contextVariables: parameters.contextVariables, + expressions: parameters.expressions, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } - /** - * Evaluates a Jira expression and returns its value. - * - * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible - * way. Consult the [Jira expressions - * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. - * - * #### Context variables - * - * The following context variables are available to Jira expressions evaluated by this resource. Their presence - * depends on various factors; usually you need to manually request them in the context object sent in the payload, - * but some of them are added automatically under certain conditions. - * - * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The - * current user. Always available and equal to `null` if the request is anonymous. - * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The - * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. - * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect - * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). - * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The - * current issue. Available only when the issue is provided in the request context object. - * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of - * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A - * collection of issues matching a JQL query. Available only when JQL is provided in the request context object. - * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): - * The current project. Available only when the project is provided in the request context object. - * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): - * The current sprint. Available only when the sprint is provided in the request context object. - * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The - * current board. Available only when the board is provided in the request context object. - * - `serviceDesk` - * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): - * The current service desk. Available only when the service desk is provided in the request context object. - * - `customerRequest` - * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): - * The current customer request. Available only when the customer request is provided in the request context - * object. - * - * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by - * key in the Jira expression. These variable types are available for use in a custom context: - * - * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) - * specified as an Atlassian account ID. - * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) - * specified by ID or key. All the fields of the issue object are available in the Jira expression. - * - `json`: A JSON object containing custom content. - * - `list`: A JSON list of `user`, `issue`, or `json` variable types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. - * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue.\ - * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or - * fields (for example, `issue.sprint`). - */ - async evaluateJiraExpression( - parameters: Parameters.EvaluateJiraExpression, - callback: Callback, - ): Promise; - /** - * Evaluates a Jira expression and returns its value. - * - * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible - * way. Consult the [Jira expressions - * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. - * - * #### Context variables - * - * The following context variables are available to Jira expressions evaluated by this resource. Their presence - * depends on various factors; usually you need to manually request them in the context object sent in the payload, - * but some of them are added automatically under certain conditions. - * - * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The - * current user. Always available and equal to `null` if the request is anonymous. - * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The - * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. - * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect - * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). - * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The - * current issue. Available only when the issue is provided in the request context object. - * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of - * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A - * collection of issues matching a JQL query. Available only when JQL is provided in the request context object. - * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): - * The current project. Available only when the project is provided in the request context object. - * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): - * The current sprint. Available only when the sprint is provided in the request context object. - * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The - * current board. Available only when the board is provided in the request context object. - * - `serviceDesk` - * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): - * The current service desk. Available only when the service desk is provided in the request context object. - * - `customerRequest` - * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): - * The current customer request. Available only when the customer request is provided in the request context - * object. - * - * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by - * key in the Jira expression. These variable types are available for use in a custom context: - * - * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) - * specified as an Atlassian account ID. - * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) - * specified by ID or key. All the fields of the issue object are available in the Jira expression. - * - `json`: A JSON object containing custom content. - * - `list`: A JSON list of `user`, `issue`, or `json` variable types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. - * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue.\ - * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or - * fields (for example, `issue.sprint`). - */ - async evaluateJiraExpression( - parameters: Parameters.EvaluateJiraExpression, - callback?: never, - ): Promise; - async evaluateJiraExpression( - parameters: Parameters.EvaluateJiraExpression, - ): Promise { - const config: Request = { - url: '/rest/api/2/expression/eval', - method: 'POST', - query: { - expand: parameters.expand, - }, - body: { - context: parameters.context, - expression: parameters.expression, - }, - }; - - return this.client.sendRequest(config); - } - - /** - * Evaluates a Jira expression and returns its value. The difference between this and `eval` is that this endpoint - * uses the enhanced search API when evaluating JQL queries. This API is eventually consistent, unlike the strongly - * consistent `eval` API. This allows for better performance and scalability. In addition, this API's response for JQL - * evaluation is based on a scrolling view (backed by a `nextPageToken`) instead of a paginated view (backed by - * `startAt` and `totalCount`). - * - * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible - * way. Consult the [Jira expressions - * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. - * - * #### Context variables - * - * The following context variables are available to Jira expressions evaluated by this resource. Their presence - * depends on various factors; usually you need to manually request them in the context object sent in the payload, - * but some of them are added automatically under certain conditions. - * - * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The - * current user. Always available and equal to `null` if the request is anonymous. - * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The - * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. - * Available only for authenticated requests made by Connect apps (read more here: [Authentication for Connect - * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). - * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The - * current issue. Available only when the issue is provided in the request context object. - * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of - * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A - * collection of issues matching a JQL query. Available only when JQL is provided in the request context object. - * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): - * The current project. Available only when the project is provided in the request context object. - * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): - * The current sprint. Available only when the sprint is provided in the request context object. - * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The - * current board. Available only when the board is provided in the request context object. - * - `serviceDesk` - * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): - * The current service desk. Available only when the service desk is provided in the request context object. - * - `customerRequest` - * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): - * The current customer request. Available only when the customer request is provided in the request context - * object. - * - * In addition, you can pass custom context variables along with their types. You can then access them from the Jira - * expression by key. You can use the following variables in a custom context: - * - * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) - * specified as an Atlassian account ID. - * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) - * specified by ID or key. All the fields of the issue object are available in the Jira expression. - * - `json`: A JSON object containing custom content. - * - `list`: A JSON list of `user`, `issue`, or `json` variable types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. - * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue.\ - * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or - * fields (for example, `issue.sprint`). - */ - async evaluateJiraExpressionUsingEnhancedSearch( - parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, - callback: Callback, - ): Promise; /** * Evaluates a Jira expression and returns its value. The difference between this and `eval` is that this endpoint * uses the enhanced search API when evaluating JQL queries. This API is eventually consistent, unlike the strongly * consistent `eval` API. This allows for better performance and scalability. In addition, this API's response for JQL * evaluation is based on a scrolling view (backed by a `nextPageToken`) instead of a paginated view (backed by - * `startAt` and `totalCount`). - * - * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible - * way. Consult the [Jira expressions - * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. - * - * #### Context variables - * - * The following context variables are available to Jira expressions evaluated by this resource. Their presence - * depends on various factors; usually you need to manually request them in the context object sent in the payload, - * but some of them are added automatically under certain conditions. - * - * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The - * current user. Always available and equal to `null` if the request is anonymous. - * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The - * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. - * Available only for authenticated requests made by Connect apps (read more here: [Authentication for Connect - * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). - * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The - * current issue. Available only when the issue is provided in the request context object. - * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of - * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A - * collection of issues matching a JQL query. Available only when JQL is provided in the request context object. - * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): - * The current project. Available only when the project is provided in the request context object. - * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): - * The current sprint. Available only when the sprint is provided in the request context object. - * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The - * current board. Available only when the board is provided in the request context object. - * - `serviceDesk` - * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): - * The current service desk. Available only when the service desk is provided in the request context object. - * - `customerRequest` - * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): - * The current customer request. Available only when the customer request is provided in the request context - * object. - * - * In addition, you can pass custom context variables along with their types. You can then access them from the Jira - * expression by key. You can use the following variables in a custom context: - * - * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) - * specified as an Atlassian account ID. - * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) - * specified by ID or key. All the fields of the issue object are available in the Jira expression. - * - `json`: A JSON object containing custom content. - * - `list`: A JSON list of `user`, `issue`, or `json` variable types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. - * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue.\ - * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or - * fields (for example, `issue.sprint`). + * `startAt` and `totalCount`). * + * + * - This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible + * way. Consult the [Jira expressions + * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. + * - + * - #### Context variables + * - + * - The following context variables are available to Jira expressions evaluated by this resource. Their presence + * depends on various factors; usually you need to manually request them in the context object sent in the payload, + * but some of them are added automatically under certain conditions. + * - + * - - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The + * current user. Always available and equal to `null` if the request is anonymous. + * - - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The + * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. + * Available only for authenticated requests made by Connect apps (read more here: [Authentication for Connect + * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). + * - - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The + * current issue. Available only when the issue is provided in the request context object. + * - - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of + * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A + * collection of issues matching a JQL query. Available only when JQL is provided in the request context + * object. + * - - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): + * The current project. Available only when the project is provided in the request context object. + * - - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): + * The current sprint. Available only when the sprint is provided in the request context object. + * - - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The + * current board. Available only when the board is provided in the request context object. + * - - `serviceDesk` + * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): + * The current service desk. Available only when the service desk is provided in the request context object. + * - - `customerRequest` + * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): + * The current customer request. Available only when the customer request is provided in the request context + * object. + * - + * - In addition, you can pass custom context variables along with their types. You can then access them from the Jira + * expression by key. You can use the following variables in a custom context: + * - + * - - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - - `json`: A JSON object containing custom content. + * - - `list`: A JSON list of `user`, `issue`, or `json` variable types. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. + * However, an expression may return different results for different users depending on their permissions. For + * example, different users may see different comments on the same issue. + * - Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or + * fields (for example, `issue.sprint`). */ - async evaluateJiraExpressionUsingEnhancedSearch( - parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, - callback?: never, - ): Promise; - async evaluateJiraExpressionUsingEnhancedSearch( - parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, - ): Promise { - const config: Request = { + async evaluateJSISJiraExpression(parameters: EvaluateJSISJiraExpressionParameters) { + const request: Request = { url: '/rest/api/2/expression/evaluate', method: 'POST', query: { expand: parameters.expand, }, body: { - expression: parameters.expression, context: parameters.context, + expression: parameters.expression, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/jiraSettings.ts b/src/version2/jiraSettings.ts index e2fae064ac..3c71fee047 100644 --- a/src/version2/jiraSettings.ts +++ b/src/version2/jiraSettings.ts @@ -1,237 +1,154 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetApplicationPropertyParameters } from './parameters/getApplicationPropertyParameters'; +import type { SetApplicationPropertyParameters } from './parameters/setApplicationPropertyParameters'; export class JiraSettings { constructor(private client: Client) {} - /** - * Returns all application properties or an application property. - * - * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an - * array). Otherwise, an array of all editable application properties is returned. See [Set application - * property](#api-rest-api-2-application-properties-id-put) for descriptions of editable properties. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Returns all application properties or an application property. * + * + * - If you specify a value for the `key` parameter, then an application property is returned as an object (not in an + * array). Otherwise, an array of all editable application properties is returned. See [Set application + * property](#api-rest-api-2-application-properties-id-put) for descriptions of editable properties. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getApplicationProperty( - parameters: Parameters.GetApplicationProperty | undefined, - callback: Callback, - ): Promise; - /** - * Returns all application properties or an application property. - * - * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an - * array). Otherwise, an array of all editable application properties is returned. See [Set application - * property](#api-rest-api-2-application-properties-id-put) for descriptions of editable properties. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationProperty( - parameters?: Parameters.GetApplicationProperty, - callback?: never, - ): Promise; - async getApplicationProperty( - parameters?: Parameters.GetApplicationProperty, - ): Promise { - const config: Request = { + async getApplicationProperty(parameters: GetApplicationPropertyParameters) { + const request: Request = { url: '/rest/api/2/application-properties', method: 'GET', query: { - key: parameters?.key, - permissionLevel: parameters?.permissionLevel, - keyFilter: parameters?.keyFilter, + key: parameters.key, + permissionLevel: parameters.permissionLevel, + keyFilter: parameters.keyFilter, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** - * and then click **Advanced Settings** (in the upper right). + * and then click **Advanced Settings** (in the upper right). * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAdvancedSettings(callback: Callback): Promise; - /** - * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the - * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** - * and then click **Advanced Settings** (in the upper right). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAdvancedSettings(callback?: never): Promise; - async getAdvancedSettings(): Promise { - const config: Request = { + async getAdvancedSettings() { + const request: Request = { url: '/rest/api/2/application-properties/advanced-settings', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are - * described below along with their default values. - * - * #### Advanced settings - * - * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). - * - * | Key | Description | Default value | - * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | - * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | - * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | - * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | - * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | - * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | - * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | - * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | - * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | - * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | - * - * #### Look and feel - * - * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). - * - * | Key | Description | Default value | - * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | - * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | - * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | - * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | - * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | - * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | - * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | - * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | - * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | - * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | - * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | - * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | - * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | - * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | - * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | - * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | - * - * #### Other settings - * - * | Key | Description | Default value | - * | ----------------------------------- | ----------------------------------------------------- | ------------- | - * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | - * - * _Note: Be careful when changing [application properties and advanced - * settings](https://confluence.atlassian.com/x/vYXKM)._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback: Callback, - ): Promise; - /** - * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from - * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are - * described below along with their default values. - * - * #### Advanced settings - * - * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). - * - * | Key | Description | Default value | - * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | - * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | - * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | - * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | - * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | - * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | - * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | - * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | - * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | - * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | - * - * #### Look and feel - * - * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). - * - * | Key | Description | Default value | - * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | - * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | - * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | - * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | - * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | - * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | - * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | - * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | - * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | - * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | - * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | - * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | - * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | - * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | - * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | - * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | - * - * #### Other settings - * - * | Key | Description | Default value | - * | ----------------------------------- | ----------------------------------------------------- | ------------- | - * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | - * - * _Note: Be careful when changing [application properties and advanced - * settings](https://confluence.atlassian.com/x/vYXKM)._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * described below along with their default values. * + * + * - #### Advanced settings + * - + * - The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). + * - + * - | Key | Description | Default value | + * - | -- | -- | -- | + * - | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | + * - | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the + * same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | + * - | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This + * must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | + * - | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must + * be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | + * - | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date + * times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | + * - | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on + * the issue view. | `asc` | + * - | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, + * status, priority` | + * - | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to + * occur. A value of `0` disables comment collapsing. | `4` | + * - | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter + * is shown. A value of `-1` disables this feature. | `7` | + * - + * - + * - #### Look and feel + * - + * - The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). + * - + * - | Key | Description | Default value | + * - | -- | -- | -- | + * - | `jira.lf.date.time` | The [ time + * format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | + * - | `jira.lf.date.day` | The [ day + * format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | + * - | `jira.lf.date.complete` | The [ date and time + * format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm + * a` | + * - | `jira.lf.date.dmy` | The [ date + * format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | + * - | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, + * as specified by the ISO8601 standard. | `false` | + * - | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | + * - | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | + * `false` | + * - | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | + * - | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | + * - | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | + * - | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | + * - | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | + * - | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | + * `Jira` | + * - | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` + * | + * - | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within + * Jira. | `true` | + * - + * - + * - #### Other settings + * - + * - | Key | Description | Default value | + * - | -- | -- | -- | + * - | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | + * - + * - + * - _Note: Be careful when changing [application properties and advanced + * settings](https://confluence.atlassian.com/x/vYXKM)._ + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback?: never, - ): Promise; - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - ): Promise { - const config: Request = { + async setApplicationProperty(parameters: SetApplicationPropertyParameters) { + const request: Request = { url: `/rest/api/2/application-properties/${parameters.id}`, method: 'PUT', - body: parameters.body, + body: { + id: parameters.id, + value: parameters.value, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this - * operation also returns the time tracking configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getConfiguration(callback: Callback): Promise; - /** - * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether - * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this - * operation also returns the time tracking configuration. + * operation also returns the time tracking configuration. * * - * **[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:** + * Permission to access Jira. */ - async getConfiguration(callback?: never): Promise; - async getConfiguration(): Promise { - const config: Request = { + async getConfiguration() { + const request: Request = { url: '/rest/api/2/configuration', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/jqlFunctionsApps.ts b/src/version2/jqlFunctionsApps.ts index 047c1538cf..4d73aaf296 100644 --- a/src/version2/jqlFunctionsApps.ts +++ b/src/version2/jqlFunctionsApps.ts @@ -1,83 +1,47 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetPrecomputationsParameters } from './parameters/getPrecomputationsParameters'; +import type { UpdatePrecomputationsParameters } from './parameters/updatePrecomputationsParameters'; +import type { GetPrecomputationsByIDParameters } from './parameters/getPrecomputationsByIDParameters'; -export class JqlFunctionsApps { +export class JQLFunctionsApps { constructor(private client: Client) {} - - /** - * Returns the list of a function's precomputations along with information about when they were created, updated, and - * last used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This - * API is only accessible to apps and apps can only inspect their own functions. - * - * 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, - callback: Callback, - ): Promise; /** * Returns the list of a function's precomputations along with information about when they were created, updated, and - * last used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This - * API is only accessible to apps and apps can only inspect their own functions. + * last used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. * * - * 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. + * - **[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, - callback?: never, - ): Promise; - async getPrecomputations( - parameters?: Parameters.GetPrecomputations, - ): Promise { - const config: Request = { + async getPrecomputations(parameters: GetPrecomputationsParameters) { + const request: Request = { url: '/rest/api/2/jql/function/computation', method: 'GET', query: { - functionKey: parameters?.functionKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - orderBy: parameters?.orderBy, - filter: parameters?.filter, + functionKey: parameters.functionKey, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + orderBy: parameters.orderBy, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Update the precomputation value of a function created by a Forge/Connect app. + * 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. + * - **[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: Callback, - ): Promise; - /** - * Update the precomputation value of a function created by a Forge/Connect app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** An API - * for apps to update their own precomputations. - * - * 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): Promise { - const config: Request = { + async updatePrecomputations(parameters: UpdatePrecomputationsParameters) { + const request: Request = { url: '/rest/api/2/jql/function/computation', method: 'POST', query: { @@ -88,41 +52,21 @@ export class JqlFunctionsApps { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns function precomputations by IDs, along with information about when they were created, updated, and last - * used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This - * API is only accessible to apps and apps can only inspect their own functions. - * - * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we - * recommend adding it to your app's scope list because we will eventually make it mandatory. - */ - async getPrecomputationsByID( - parameters: Parameters.GetPrecomputationsByID, - callback: Callback, - ): Promise; - /** - * Returns function precomputations by IDs, along with information about when they were created, updated, and last - * used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This - * API is only accessible to apps and apps can only inspect their own functions. + * used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. * * - * 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. + * - **[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, - ): Promise { - const config: Request = { + async getPrecomputationsByID(parameters: GetPrecomputationsByIDParameters) { + const request: Request = { url: '/rest/api/2/jql/function/computation/search', method: 'POST', query: { @@ -133,6 +77,6 @@ export class JqlFunctionsApps { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/labels.ts b/src/version2/labels.ts index 140eebcc03..aba80b5cf1 100644 --- a/src/version2/labels.ts +++ b/src/version2/labels.ts @@ -1,35 +1,23 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAllLabelsParameters } from './parameters/getAllLabelsParameters'; export class Labels { constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * labels. - */ - async getAllLabels( - parameters: Parameters.GetAllLabels | undefined, - callback: Callback, - ): Promise; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * labels. */ - async getAllLabels(parameters?: Parameters.GetAllLabels, callback?: never): Promise; - async getAllLabels(parameters?: Parameters.GetAllLabels): Promise { - const config: Request = { + async getAllLabels(parameters: GetAllLabelsParameters) { + const request: Request = { url: '/rest/api/2/label', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/licenseMetrics.ts b/src/version2/licenseMetrics.ts index 51ad61af8d..59a61c8b74 100644 --- a/src/version2/licenseMetrics.ts +++ b/src/version2/licenseMetrics.ts @@ -1,85 +1,52 @@ -import type * as Models from './models'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetApproximateApplicationLicenseCountParameters } from './parameters/getApproximateApplicationLicenseCountParameters'; export class LicenseMetrics { constructor(private client: Client) {} - - /** - * Returns licensing information about the Jira instance. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getLicense(callback: Callback): Promise; /** - * Returns licensing information about the Jira instance. + * Returns licensing information about the Jira instance. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getLicense(callback?: never): Promise; - async getLicense(): Promise { - const config: Request = { + async getLicense() { + const request: Request = { url: '/rest/api/2/instance/license', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with - * a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateLicenseCount(callback: Callback): Promise; - /** - * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with - * a 7-day lifecycle and could be stale at the time of call. + * a 7-day lifecycle and could be stale at the time of call. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getApproximateLicenseCount(callback?: never): Promise; - async getApproximateLicenseCount(): Promise { - const config: Request = { + async getApproximateLicenseCount() { + const request: Request = { url: '/rest/api/2/license/approximateLicenseCount', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the total approximate number of user accounts for a single Jira license. Note that this information is - * cached with a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback: Callback, - ): Promise; - /** - * Returns the total approximate number of user accounts for a single Jira license. Note that this information is - * cached with a 7-day lifecycle and could be stale at the time of call. + * cached with a 7-day lifecycle and could be stale at the time of call. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback?: never, - ): Promise; - async getApproximateApplicationLicenseCount(applicationKey: string): Promise { - const config: Request = { - url: `/rest/api/2/license/approximateLicenseCount/product/${applicationKey}`, + async getApproximateApplicationLicenseCount(parameters: GetApproximateApplicationLicenseCountParameters) { + const request: Request = { + url: `/rest/api/2/license/approximateLicenseCount/product/${parameters.applicationKey}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/models/actorsMap.ts b/src/version2/models/actorsMap.ts deleted file mode 100644 index 01c3b88e96..0000000000 --- a/src/version2/models/actorsMap.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface ActorsMap { - /** - * The name of the group to add. This parameter cannot be used with the `groupId` parameter. As a group's name can - * change, use of `groupId` is recommended. - */ - group?: string[]; - /** The ID of the group to add. This parameter cannot be used with the `group` parameter. */ - groupId?: string[]; - /** The user account ID of the user to add. */ - user?: string[]; -} diff --git a/src/version2/models/addAtlassianTeamRequest.ts b/src/version2/models/addAtlassianTeamRequest.ts deleted file mode 100644 index 61b43a6018..0000000000 --- a/src/version2/models/addAtlassianTeamRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -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/addField.ts b/src/version2/models/addField.ts deleted file mode 100644 index 09d70ed44f..0000000000 --- a/src/version2/models/addField.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface AddField { - /** The ID of the field to add. */ - fieldId: string; -} diff --git a/src/version2/models/addGroup.ts b/src/version2/models/addGroup.ts deleted file mode 100644 index 261837d95e..0000000000 --- a/src/version2/models/addGroup.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface AddGroup { - /** The name of the group. */ - name: string; -} diff --git a/src/version2/models/addNotificationsDetails.ts b/src/version2/models/addNotificationsDetails.ts deleted file mode 100644 index 03c29ad2aa..0000000000 --- a/src/version2/models/addNotificationsDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { 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/addSecuritySchemeLevelsRequest.ts b/src/version2/models/addSecuritySchemeLevelsRequest.ts deleted file mode 100644 index b3ec284675..0000000000 --- a/src/version2/models/addSecuritySchemeLevelsRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SecuritySchemeLevel } from './securitySchemeLevel'; - -export interface AddSecuritySchemeLevelsRequest { - /** The list of scheme levels which should be added to the security scheme. */ - levels: SecuritySchemeLevel[]; -} diff --git a/src/version2/models/announcementBannerConfiguration.ts b/src/version2/models/announcementBannerConfiguration.ts deleted file mode 100644 index cc7773706f..0000000000 --- a/src/version2/models/announcementBannerConfiguration.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** Announcement banner configuration. */ -export interface AnnouncementBannerConfiguration { - /** Hash of the banner data. The client detects updates by comparing hash IDs. */ - hashId?: string; - /** Flag indicating if the announcement banner can be dismissed by the user. */ - isDismissible?: boolean; - /** Flag indicating if the announcement banner is enabled or not. */ - isEnabled?: boolean; - /** The text on the announcement banner. */ - message?: string; - /** Visibility of the announcement banner. */ - visibility?: string; -} diff --git a/src/version2/models/announcementBannerConfigurationUpdate.ts b/src/version2/models/announcementBannerConfigurationUpdate.ts deleted file mode 100644 index df42d4dd49..0000000000 --- a/src/version2/models/announcementBannerConfigurationUpdate.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** Configuration of the announcement banner. */ -export interface AnnouncementBannerConfigurationUpdate { - /** Flag indicating if the announcement banner can be dismissed by the user. */ - isDismissible?: boolean; - /** Flag indicating if the announcement banner is enabled or not. */ - isEnabled?: boolean; - /** The text on the announcement banner. */ - message?: string; - /** Visibility of the announcement banner. Can be public or private. */ - visibility?: string; -} diff --git a/src/version2/models/application.ts b/src/version2/models/application.ts deleted file mode 100644 index 8f7f9105ab..0000000000 --- a/src/version2/models/application.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** The application the linked item is in. */ -export interface Application { - /** - * The name of the application. Used in conjunction with the (remote) object icon title to display a tooltip for the - * link's icon. The tooltip takes the format "[application name] icon title". Blank items are excluded from the - * tooltip title. If both items are blank, the icon tooltop displays as "Web Link". Grouping and sorting of links may - * place links without an application name last. - */ - name?: string; - /** The name-spaced type of the application, used by registered rendering apps. */ - type?: string; -} diff --git a/src/version2/models/applicationProperty.ts b/src/version2/models/applicationProperty.ts deleted file mode 100644 index 6745dc0954..0000000000 --- a/src/version2/models/applicationProperty.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** Details of an application property. */ -export interface ApplicationProperty { - /** The allowed values, if applicable. */ - allowedValues?: string[]; - /** The default value of the application property. */ - defaultValue?: string; - /** The description of the application property. */ - desc?: string; - example?: string; - /** The ID of the application property. The ID and key are the same. */ - id?: string; - /** The key of the application property. The ID and key are the same. */ - key?: string; - /** The name of the application property. */ - name?: string; - /** The data type of the application property. */ - type?: string; - /** The new value. */ - value?: string; -} diff --git a/src/version2/models/applicationRole.ts b/src/version2/models/applicationRole.ts deleted file mode 100644 index ca76bebac7..0000000000 --- a/src/version2/models/applicationRole.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { GroupName } from './groupName'; - -/** Details of an application role. */ -export interface ApplicationRole { - /** - * The groups that are granted default access for this application role. As a group's name can change, use of - * `defaultGroupsDetails` is recommended to identify a groups. - */ - defaultGroups?: string[]; - /** The groups that are granted default access for this application role. */ - defaultGroupsDetails?: GroupName[]; - /** The groups associated with the application role. */ - groupDetails?: GroupName[]; - /** - * The groups associated with the application role. As a group's name can change, use of `groupDetails` is recommended - * to identify a groups. - */ - groups?: string[]; - hasUnlimitedSeats?: boolean; - /** The key of the application role. */ - key?: string; - /** The display name of the application role. */ - name?: string; - /** The maximum count of users on your license. */ - numberOfSeats?: number; - /** Indicates if the application role belongs to Jira platform (`jira-core`). */ - platform?: boolean; - /** The count of users remaining on your license. */ - remainingSeats?: number; - /** Determines whether this application role should be selected by default on user creation. */ - selectedByDefault?: boolean; - /** The number of users counting against your license. */ - userCount?: number; - /** The [type of users](https://confluence.atlassian.com/x/lRW3Ng) being counted against your license. */ - userCountDescription?: string; -} diff --git a/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.ts b/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.ts deleted file mode 100644 index a52c286cbc..0000000000 --- a/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { FieldConfigurationToIssueTypeMapping } from './fieldConfigurationToIssueTypeMapping'; - -/** Details of a field configuration to issue type mappings. */ -export interface AssociateFieldConfigurationsWithIssueTypesRequest { - /** Field configuration to issue type mappings. */ - mappings: FieldConfigurationToIssueTypeMapping[]; -} diff --git a/src/version2/models/associatedItem.ts b/src/version2/models/associatedItem.ts deleted file mode 100644 index 99eb05db78..0000000000 --- a/src/version2/models/associatedItem.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** Details of an item associated with the changed record. */ -export interface AssociatedItem { - /** The ID of the associated record. */ - id?: string; - /** The name of the associated record. */ - name?: string; - /** The ID of the associated parent record. */ - parentId?: string; - /** The name of the associated parent record. */ - parentName?: string; - /** The type of the associated record. */ - typeName?: string; -} diff --git a/src/version2/models/associationContextObject.ts b/src/version2/models/associationContextObject.ts deleted file mode 100644 index c734d465ac..0000000000 --- a/src/version2/models/associationContextObject.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Field association for example PROJECT_ID. */ -export interface AssociationContextObject { - identifier?: {}; - type: string; -} diff --git a/src/version2/models/attachment.ts b/src/version2/models/attachment.ts deleted file mode 100644 index bcdb362bd2..0000000000 --- a/src/version2/models/attachment.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { UserDetails } from './userDetails'; - -/** Details about an attachment. */ -export interface Attachment { - author?: UserDetails; - /** The content of the attachment. */ - content?: string; - /** The datetime the attachment was created. */ - created?: string; - /** The file name of the attachment. */ - filename?: string; - /** The ID of the attachment. */ - id: string; - /** The MIME type of the attachment. */ - mimeType?: string; - /** The URL of the attachment details response. */ - self?: string; - /** The size of the attachment. */ - size?: number; - /** The URL of a thumbnail representing the attachment. */ - thumbnail?: string; -} diff --git a/src/version2/models/attachmentArchiveEntry.ts b/src/version2/models/attachmentArchiveEntry.ts deleted file mode 100644 index 6686d6ab03..0000000000 --- a/src/version2/models/attachmentArchiveEntry.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface AttachmentArchiveEntry { - abbreviatedName?: string; - entryIndex?: number; - mediaType?: string; - name?: string; - size?: number; -} diff --git a/src/version2/models/attachmentArchiveImpl.ts b/src/version2/models/attachmentArchiveImpl.ts deleted file mode 100644 index dfdc00fac7..0000000000 --- a/src/version2/models/attachmentArchiveImpl.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AttachmentArchiveEntry } from './attachmentArchiveEntry'; - -export interface AttachmentArchiveImpl { - /** The list of the items included in the archive. */ - entries?: AttachmentArchiveEntry[]; - /** The number of items in the archive. */ - totalEntryCount?: number; -} diff --git a/src/version2/models/attachmentArchiveItemReadable.ts b/src/version2/models/attachmentArchiveItemReadable.ts deleted file mode 100644 index 191e9577f1..0000000000 --- a/src/version2/models/attachmentArchiveItemReadable.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** Metadata for an item in an attachment archive. */ -export interface AttachmentArchiveItemReadable { - /** The position of the item within the archive. */ - index?: number; - /** The label for the archive item. */ - label?: string; - /** The MIME type of the archive item. */ - mediaType?: string; - /** The path of the archive item. */ - path?: string; - /** The size of the archive item. */ - size?: string; -} diff --git a/src/version2/models/attachmentArchiveMetadataReadable.ts b/src/version2/models/attachmentArchiveMetadataReadable.ts deleted file mode 100644 index a4d46be740..0000000000 --- a/src/version2/models/attachmentArchiveMetadataReadable.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { AttachmentArchiveItemReadable } from './attachmentArchiveItemReadable'; - -/** Metadata for an archive (for example a zip) and its contents. */ -export interface AttachmentArchiveMetadataReadable { - /** The list of the items included in the archive. */ - entries?: AttachmentArchiveItemReadable[]; - /** The ID of the attachment. */ - id?: number; - /** The MIME type of the attachment. */ - mediaType?: string; - /** The name of the archive file. */ - name?: string; - /** The number of items included in the archive. */ - totalEntryCount?: number; -} diff --git a/src/version2/models/attachmentContent.ts b/src/version2/models/attachmentContent.ts deleted file mode 100644 index 3e5b6fdfce..0000000000 --- a/src/version2/models/attachmentContent.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface AttachmentContent { - contentType: string; - content: ArrayBuffer; -} diff --git a/src/version2/models/attachmentMetadata.ts b/src/version2/models/attachmentMetadata.ts deleted file mode 100644 index 60a6d1aa75..0000000000 --- a/src/version2/models/attachmentMetadata.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { User } from './user'; - -/** Metadata for an issue attachment. */ -export interface AttachmentMetadata { - /** The ID of the attachment. */ - id?: number; - /** The URL of the attachment metadata details. */ - self?: string; - /** The name of the attachment file. */ - filename?: string; - author?: User; - /** The datetime the attachment was created. */ - created?: string; - /** The size of the attachment. */ - size?: number; - /** The MIME type of the attachment. */ - mimeType?: string; - /** Additional properties of the attachment. */ - properties?: unknown; - /** The URL of the attachment. */ - content?: string; - /** The URL of a thumbnail representing the attachment. */ - thumbnail?: string; - /** - * The file ID of the attachment in the media store. See the [Media - * API](https://developer.atlassian.com/platform/media/) documentation for more details. - */ - mediaApiFileId?: string; -} diff --git a/src/version2/models/attachmentSettings.ts b/src/version2/models/attachmentSettings.ts deleted file mode 100644 index 2700d941d2..0000000000 --- a/src/version2/models/attachmentSettings.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of the instance's attachment settings. */ -export interface AttachmentSettings { - /** Whether the ability to add attachments is enabled. */ - enabled?: boolean; - /** The maximum size of attachments permitted, in bytes. */ - uploadLimit?: number; -} diff --git a/src/version2/models/auditRecord.ts b/src/version2/models/auditRecord.ts deleted file mode 100644 index 023dfb636f..0000000000 --- a/src/version2/models/auditRecord.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { AssociatedItem } from './associatedItem'; -import type { ChangedValue } from './changedValue'; - -/** An audit record. */ -export interface AuditRecord { - /** The ID of the audit record. */ - id?: number; - /** The summary of the audit record. */ - summary?: string; - /** The URL of the computer where the creation of the audit record was initiated. */ - remoteAddress?: string; - /** The date and time on which the audit record was created. */ - created?: string; - /** - * The category of the audit record. For a list of these categories, see the help article [Auditing in Jira - * applications](https://confluence.atlassian.com/x/noXKM). - */ - category?: string; - /** The event the audit record originated from. */ - eventSource?: string; - /** The description of the audit record. */ - description?: string; - objectItem?: AssociatedItem; - /** The list of values changed in the record event. */ - changedValues?: ChangedValue[]; - /** The list of items associated with the changed record. */ - associatedItems?: AssociatedItem[]; -} diff --git a/src/version2/models/auditRecords.ts b/src/version2/models/auditRecords.ts deleted file mode 100644 index fe2c3e0e95..0000000000 --- a/src/version2/models/auditRecords.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { AuditRecord } from './auditRecord'; - -/** Container for a list of audit records. */ -export interface AuditRecords { - /** The requested or default limit on the number of audit items to be returned. */ - limit?: number; - /** The number of audit items skipped before the first item in this list. */ - offset?: number; - /** The list of audit items. */ - records?: AuditRecord[]; - /** The total number of audit items returned. */ - total?: number; -} diff --git a/src/version2/models/autoCompleteSuggestion.ts b/src/version2/models/autoCompleteSuggestion.ts deleted file mode 100644 index 3f0e8014c9..0000000000 --- a/src/version2/models/autoCompleteSuggestion.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** A field auto-complete suggestion. */ -export interface AutoCompleteSuggestion { - /** - * The display name of a suggested item. If `fieldValue` or `predicateValue` are provided, the matching text is - * highlighted with the HTML bold tag. - */ - displayName?: string; - /** The value of a suggested item. */ - value?: string; -} diff --git a/src/version2/models/autoCompleteSuggestions.ts b/src/version2/models/autoCompleteSuggestions.ts deleted file mode 100644 index ccc36c7830..0000000000 --- a/src/version2/models/autoCompleteSuggestions.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { AutoCompleteSuggestion } from './autoCompleteSuggestion'; - -/** The results from a JQL query. */ -export interface AutoCompleteSuggestions { - /** The list of suggested item. */ - results?: AutoCompleteSuggestion[]; -} diff --git a/src/version2/models/availableDashboardGadget.ts b/src/version2/models/availableDashboardGadget.ts deleted file mode 100644 index 0373695c49..0000000000 --- a/src/version2/models/availableDashboardGadget.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** The details of the available dashboard gadget. */ -export interface AvailableDashboardGadget { - /** The module key of the gadget type. */ - moduleKey?: string; - /** The title of the gadget. */ - title: string; - /** The URI of the gadget type. */ - uri?: string; -} diff --git a/src/version2/models/availableDashboardGadgetsResponse.ts b/src/version2/models/availableDashboardGadgetsResponse.ts deleted file mode 100644 index 13f5ccecaf..0000000000 --- a/src/version2/models/availableDashboardGadgetsResponse.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { AvailableDashboardGadget } from './availableDashboardGadget'; - -/** The list of available gadgets. */ -export interface AvailableDashboardGadgetsResponse { - /** The list of available gadgets. */ - gadgets: AvailableDashboardGadget[]; -} diff --git a/src/version2/models/availableWorkflowConnectRule.ts b/src/version2/models/availableWorkflowConnectRule.ts deleted file mode 100644 index 23db909126..0000000000 --- a/src/version2/models/availableWorkflowConnectRule.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** The Connect provided ecosystem rules available. */ -export interface AvailableWorkflowConnectRule { - /** The add-on providing the rule. */ - addonKey?: string; - /** The URL creation path segment defined in the Connect module. */ - createUrl?: string; - /** The rule description. */ - description?: string; - /** The URL edit path segment defined in the Connect module. */ - editUrl?: string; - /** The module providing the rule. */ - moduleKey?: string; - /** The rule name. */ - name?: string; - /** The rule key. */ - ruleKey?: string; - /** The rule type. */ - ruleType?: string; - /** The URL view path segment defined in the Connect module. */ - viewUrl?: string; -} diff --git a/src/version2/models/availableWorkflowForgeRule.ts b/src/version2/models/availableWorkflowForgeRule.ts deleted file mode 100644 index aff833ac19..0000000000 --- a/src/version2/models/availableWorkflowForgeRule.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** The Forge provided ecosystem rules available. */ -export interface AvailableWorkflowForgeRule { - /** The rule description. */ - description?: string; - /** The unique ARI of the forge rule type. */ - id?: string; - /** The rule name. */ - name?: string; - /** The rule key. */ - ruleKey?: string; - /** The rule type. */ - ruleType?: string; -} diff --git a/src/version2/models/availableWorkflowSystemRule.ts b/src/version2/models/availableWorkflowSystemRule.ts deleted file mode 100644 index 30ff1a459b..0000000000 --- a/src/version2/models/availableWorkflowSystemRule.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** The Atlassian provided system rules available. */ -export interface AvailableWorkflowSystemRule { - /** The rule description. */ - description: string; - /** List of rules that conflict with this one. */ - incompatibleRuleKeys: string[]; - /** Whether the rule can be added to an initial transition. */ - isAvailableForInitialTransition: boolean; - /** Whether the rule is visible. */ - isVisible: boolean; - /** The rule name. */ - name: string; - /** The rule key. */ - ruleKey: string; - /** The rule type. */ - ruleType: string; -} diff --git a/src/version2/models/availableWorkflowTriggerTypes.ts b/src/version2/models/availableWorkflowTriggerTypes.ts deleted file mode 100644 index c6d05575d0..0000000000 --- a/src/version2/models/availableWorkflowTriggerTypes.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** The list of available trigger types. */ -export interface AvailableWorkflowTriggerTypes { - /** The description of the trigger rule. */ - description?: string; - /** The name of the trigger rule. */ - name?: string; - /** The type identifier of trigger rule. */ - type?: string; -} diff --git a/src/version2/models/availableWorkflowTriggers.ts b/src/version2/models/availableWorkflowTriggers.ts deleted file mode 100644 index c4700c8c71..0000000000 --- a/src/version2/models/availableWorkflowTriggers.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { AvailableWorkflowTriggerTypes } from './availableWorkflowTriggerTypes'; - -/** The trigger rules available. */ -export interface AvailableWorkflowTriggers { - /** The list of available trigger types. */ - availableTypes: AvailableWorkflowTriggerTypes[]; - /** The rule key of the rule. */ - ruleKey: string; -} diff --git a/src/version2/models/avatar.ts b/src/version2/models/avatar.ts deleted file mode 100644 index 80484a38e3..0000000000 --- a/src/version2/models/avatar.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { AvatarUrls } from './avatarUrls'; - -/** Details of an avatar. */ -export interface Avatar { - /** The file name of the avatar icon. Returned for system avatars. */ - fileName?: string; - /** The ID of the avatar. */ - id: string; - /** Whether the avatar can be deleted. */ - isDeletable: boolean; - /** Whether the avatar is used in Jira. For example, shown as a project's avatar. */ - isSelected: boolean; - /** Whether the avatar is a system avatar. */ - isSystemAvatar: boolean; - /** - * The owner of the avatar. For a system avatar the owner is null (and nothing is returned). For non-system avatars - * this is the appropriate identifier, such as the ID for a project or the account ID for a user. - */ - owner?: string; - /** The list of avatar icon URLs. */ - urls: AvatarUrls; -} diff --git a/src/version2/models/avatarUrls.ts b/src/version2/models/avatarUrls.ts deleted file mode 100644 index cda993d7f3..0000000000 --- a/src/version2/models/avatarUrls.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface AvatarUrls { - /** The URL of the item's 16x16 pixel avatar. */ - '16x16'?: string; - /** The URL of the item's 24x24 pixel avatar. */ - '24x24'?: string; - /** The URL of the item's 32x32 pixel avatar. */ - '32x32'?: string; - /** The URL of the item's 48x48 pixel avatar. */ - '48x48'?: string; -} diff --git a/src/version2/models/avatarWithDetails.ts b/src/version2/models/avatarWithDetails.ts deleted file mode 100644 index 15f5f99071..0000000000 --- a/src/version2/models/avatarWithDetails.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface AvatarWithDetails { - /** The content type of the avatar. Expected values include 'image/png', 'image/svg+xml', or any other valid MIME type. */ - contentType: 'image/png' | 'image/svg+xml' | string; - /** The binary representation of the avatar image. */ - avatar: ArrayBuffer; -} diff --git a/src/version2/models/avatars.ts b/src/version2/models/avatars.ts deleted file mode 100644 index 84341dd69a..0000000000 --- a/src/version2/models/avatars.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Avatar } from './avatar'; - -/** Details about system and custom avatars. */ -export interface Avatars { - /** Custom avatars list. */ - custom: Avatar[]; - /** System avatars list. */ - system: Avatar[]; -} diff --git a/src/version2/models/boardColumnPayload.ts b/src/version2/models/boardColumnPayload.ts deleted file mode 100644 index 5459babd1e..0000000000 --- a/src/version2/models/boardColumnPayload.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** The payload for creating a board column */ -export interface BoardColumnPayload { - /** The maximum issue constraint for the column */ - maximumIssueConstraint?: number; - /** The minimum issue constraint for the column */ - minimumIssueConstraint?: number; - /** The name of the column */ - name?: string; - /** The status IDs for the column */ - statusIds?: ProjectCreateResourceIdentifier[]; -} diff --git a/src/version2/models/boardFeaturePayload.ts b/src/version2/models/boardFeaturePayload.ts deleted file mode 100644 index 126e703c04..0000000000 --- a/src/version2/models/boardFeaturePayload.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The payload for setting a board feature */ -export interface BoardFeaturePayload { - /** The key of the feature */ - featureKey?: 'ESTIMATION' | 'SPRINT' | string; - /** Whether the feature should be turned on or off */ - state?: boolean; -} diff --git a/src/version2/models/boardPayload.ts b/src/version2/models/boardPayload.ts deleted file mode 100644 index 80368a5b17..0000000000 --- a/src/version2/models/boardPayload.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { CardLayout } from './cardLayout'; -import type { CardLayoutField } from './cardLayoutField'; -import type { BoardColumnPayload } from './boardColumnPayload'; -import type { BoardFeaturePayload } from './boardFeaturePayload'; -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; -import type { QuickFilterPayload } from './quickFilterPayload'; -import type { SwimlanesPayload } from './swimlanesPayload'; -import type { WorkingDaysConfig } from './workingDaysConfig'; - -/** The payload for creating a board */ -export interface BoardPayload { - /** - * Takes in a JQL string to create a new filter. If no value is provided, it'll default to a JQL filter for the - * project creating - */ - boardFilterJQL?: string; - /** Card color settings of the board */ - cardColorStrategy?: 'ISSUE_TYPE' | 'REQUEST_TYPE' | 'ASSIGNEE' | 'PRIORITY' | 'NONE' | 'CUSTOM' | string; - cardLayout?: CardLayout; - /** Card layout settings of the board */ - cardLayouts?: CardLayoutField[]; - /** The columns of the board */ - columns?: BoardColumnPayload[]; - /** Feature settings for the board */ - features?: BoardFeaturePayload[]; - /** The name of the board */ - name?: string; - pcri?: ProjectCreateResourceIdentifier; - /** The quick filters for the board. */ - quickFilters?: QuickFilterPayload[]; - /** Whether sprints are supported on the board */ - supportsSprint?: boolean; - swimlanes?: SwimlanesPayload; - workingDaysConfig?: WorkingDaysConfig; -} diff --git a/src/version2/models/boardsPayload.ts b/src/version2/models/boardsPayload.ts deleted file mode 100644 index 47d2e08bcf..0000000000 --- a/src/version2/models/boardsPayload.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { BoardPayload } from './boardPayload'; - -export interface BoardsPayload { - /** The boards to be associated with the project. */ - boards?: BoardPayload[]; -} diff --git a/src/version2/models/bulkChangeOwnerDetails.ts b/src/version2/models/bulkChangeOwnerDetails.ts deleted file mode 100644 index c64ce952eb..0000000000 --- a/src/version2/models/bulkChangeOwnerDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details for changing owners of shareable entities */ -export interface BulkChangeOwnerDetails { - /** Whether the name is fixed automatically if it's duplicated after changing owner. */ - autofixName: boolean; - /** The account id of the new owner. */ - newOwner: string; -} diff --git a/src/version2/models/bulkChangelog.ts b/src/version2/models/bulkChangelog.ts deleted file mode 100644 index fab06c8dbe..0000000000 --- a/src/version2/models/bulkChangelog.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { 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 deleted file mode 100644 index b6162735ac..0000000000 --- a/src/version2/models/bulkChangelogRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** 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 deleted file mode 100644 index db48337038..0000000000 --- a/src/version2/models/bulkContextualConfiguration.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** Details of the contextual configuration for a custom field. */ -export interface BulkContextualConfiguration { - /** The field configuration. */ - configuration?: unknown; - /** 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?: unknown; -} diff --git a/src/version2/models/bulkCustomFieldOptionCreateRequest.ts b/src/version2/models/bulkCustomFieldOptionCreateRequest.ts deleted file mode 100644 index e991aaaa8d..0000000000 --- a/src/version2/models/bulkCustomFieldOptionCreateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldOptionCreate } from './customFieldOptionCreate'; - -/** Details of the options to create for a custom field. */ -export interface BulkCustomFieldOptionCreateRequest { - /** Details of options to create. */ - options?: CustomFieldOptionCreate[]; -} diff --git a/src/version2/models/bulkCustomFieldOptionUpdateRequest.ts b/src/version2/models/bulkCustomFieldOptionUpdateRequest.ts deleted file mode 100644 index f0c3ad0fcc..0000000000 --- a/src/version2/models/bulkCustomFieldOptionUpdateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldOptionUpdate } from './customFieldOptionUpdate'; - -/** Details of the options to update for a custom field. */ -export interface BulkCustomFieldOptionUpdateRequest { - /** Details of the options to update. */ - options?: CustomFieldOptionUpdate[]; -} diff --git a/src/version2/models/bulkEditShareableEntity.ts b/src/version2/models/bulkEditShareableEntity.ts deleted file mode 100644 index 787b6c3d82..0000000000 --- a/src/version2/models/bulkEditShareableEntity.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of a request to bulk edit shareable entity. */ -export interface BulkEditShareableEntity { - /** Allowed action for bulk edit shareable entity */ - action: string; - /** The mapping dashboard id to errors if any. */ - entityErrors?: unknown; -} diff --git a/src/version2/models/bulkIssue.ts b/src/version2/models/bulkIssue.ts deleted file mode 100644 index 0361d026c4..0000000000 --- a/src/version2/models/bulkIssue.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { IssueError } from './issueError'; -import type { 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/bulkIssueIsWatching.ts b/src/version2/models/bulkIssueIsWatching.ts deleted file mode 100644 index 8f44798854..0000000000 --- a/src/version2/models/bulkIssueIsWatching.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** A container for the watch status of a list of issues. */ -export interface BulkIssueIsWatching { - /** The map of issue ID to boolean watch status. */ - issuesIsWatching?: unknown; -} diff --git a/src/version2/models/bulkIssuePropertyUpdateRequest.ts b/src/version2/models/bulkIssuePropertyUpdateRequest.ts deleted file mode 100644 index 5665dfbbd0..0000000000 --- a/src/version2/models/bulkIssuePropertyUpdateRequest.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueFilterForBulkPropertySet } from './issueFilterForBulkPropertySet'; - -/** Bulk issue property update request details. */ -export interface BulkIssuePropertyUpdateRequest { - /** - * EXPERIMENTAL. The Jira expression to calculate the value of the property. The value of the expression must be an - * object that can be converted to JSON, such as a number, boolean, string, list, or map. The context variables - * available to the expression are `issue` and `user`. Issues for which the expression returns a value whose JSON - * representation is longer than 32768 characters are ignored. - */ - expression?: string; - filter?: IssueFilterForBulkPropertySet; - /** - * The value of the property. The value must be a [valid](https://tools.ietf.org/html/rfc4627), non-empty JSON blob. - * The maximum length is 32768 characters. - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - value?: any; -} diff --git a/src/version2/models/bulkOperationErrorResult.ts b/src/version2/models/bulkOperationErrorResult.ts deleted file mode 100644 index 36f89d9326..0000000000 --- a/src/version2/models/bulkOperationErrorResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ErrorCollection } from './errorCollection'; - -export interface BulkOperationErrorResult { - elementErrors?: ErrorCollection; - failedElementNumber?: number; - status?: number; -} diff --git a/src/version2/models/bulkPermissionGrants.ts b/src/version2/models/bulkPermissionGrants.ts deleted file mode 100644 index 30590bbc0a..0000000000 --- a/src/version2/models/bulkPermissionGrants.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { BulkProjectPermissionGrants } from './bulkProjectPermissionGrants'; - -/** Details of global and project permissions granted to the user. */ -export interface BulkPermissionGrants { - /** List of permissions granted to the user. */ - globalPermissions: string[]; - /** List of project permissions and the projects and issues those permissions provide access to. */ - projectPermissions: BulkProjectPermissionGrants[]; -} diff --git a/src/version2/models/bulkPermissionsRequest.ts b/src/version2/models/bulkPermissionsRequest.ts deleted file mode 100644 index c1e89424b7..0000000000 --- a/src/version2/models/bulkPermissionsRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { BulkProjectPermissions } from './bulkProjectPermissions'; - -/** Details of global permissions to look up and project permissions with associated projects and issues to look up. */ -export interface BulkPermissionsRequest { - /** The account ID of a user. */ - accountId?: string; - /** Global permissions to look up. */ - globalPermissions?: string[]; - /** Project permissions with associated projects and issues to look up. */ - projectPermissions?: BulkProjectPermissions[]; -} diff --git a/src/version2/models/bulkProjectPermissionGrants.ts b/src/version2/models/bulkProjectPermissionGrants.ts deleted file mode 100644 index dfc38188e7..0000000000 --- a/src/version2/models/bulkProjectPermissionGrants.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** List of project permissions and the projects and issues those permissions grant access to. */ -export interface BulkProjectPermissionGrants { - /** IDs of the issues the user has the permission for. */ - issues: number[]; - /** A project permission, */ - permission: string; - /** IDs of the projects the user has the permission for. */ - projects: number[]; -} diff --git a/src/version2/models/bulkProjectPermissions.ts b/src/version2/models/bulkProjectPermissions.ts deleted file mode 100644 index ed9623563d..0000000000 --- a/src/version2/models/bulkProjectPermissions.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of project permissions and associated issues and projects to look up. */ -export interface BulkProjectPermissions { - /** List of issue IDs. */ - issues?: number[]; - /** List of project permissions. */ - permissions: string[]; - /** List of project IDs. */ - projects?: number[]; -} diff --git a/src/version2/models/cardLayout.ts b/src/version2/models/cardLayout.ts deleted file mode 100644 index b6541b0bde..0000000000 --- a/src/version2/models/cardLayout.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Card layout configuration. */ -export interface CardLayout { - /** Whether to show days in column */ - showDaysInColumn?: boolean; -} diff --git a/src/version2/models/cardLayoutField.ts b/src/version2/models/cardLayoutField.ts deleted file mode 100644 index b08a9339aa..0000000000 --- a/src/version2/models/cardLayoutField.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Card layout settings of the board */ -export interface CardLayoutField { - fieldId?: string; - id?: number; - mode?: 'PLAN' | 'WORK' | string; - position?: number; -} diff --git a/src/version2/models/changeDetails.ts b/src/version2/models/changeDetails.ts deleted file mode 100644 index 58743158a9..0000000000 --- a/src/version2/models/changeDetails.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** A change item. */ -export interface ChangeDetails { - /** The name of the field changed. */ - field?: string; - /** The ID of the field changed. */ - fieldId?: string; - /** The type of the field changed. */ - fieldtype?: string; - /** The details of the original value. */ - from?: string; - /** The details of the original value as a string. */ - fromString?: string; - /** The details of the new value. */ - to?: string; - /** The details of the new value as a string. */ - toString?: string; -} diff --git a/src/version2/models/changedValue.ts b/src/version2/models/changedValue.ts deleted file mode 100644 index 54733bdf6d..0000000000 --- a/src/version2/models/changedValue.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of names changed in the record event. */ -export interface ChangedValue { - /** The value of the field before the change. */ - changedFrom?: string; - /** The value of the field after the change. */ - changedTo?: string; - /** The name of the field changed. */ - fieldName?: string; -} diff --git a/src/version2/models/changedWorklog.ts b/src/version2/models/changedWorklog.ts deleted file mode 100644 index 47fe7b0a2a..0000000000 --- a/src/version2/models/changedWorklog.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { EntityProperty } from './entityProperty'; - -/** Details of a changed worklog. */ -export interface ChangedWorklog { - /** Details of properties associated with the change. */ - properties?: EntityProperty[]; - /** The datetime of the change. */ - updatedTime?: number; - /** The ID of the worklog. */ - worklogId?: number; -} diff --git a/src/version2/models/changedWorklogs.ts b/src/version2/models/changedWorklogs.ts deleted file mode 100644 index a3d11dbd90..0000000000 --- a/src/version2/models/changedWorklogs.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ChangedWorklog } from './changedWorklog'; - -/** List of changed worklogs. */ -export interface ChangedWorklogs { - lastPage?: boolean; - /** The URL of the next list of changed worklogs. */ - nextPage?: string; - /** The URL of this changed worklogs list. */ - self?: string; - /** The datetime of the first worklog item in the list. */ - since?: number; - /** The datetime of the last worklog item in the list. */ - until?: number; - /** Changed worklog list. */ - values?: ChangedWorklog[]; -} diff --git a/src/version2/models/changelog.ts b/src/version2/models/changelog.ts deleted file mode 100644 index 1d2ac584d4..0000000000 --- a/src/version2/models/changelog.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ChangeDetails } from './changeDetails'; -import type { HistoryMetadata } from './historyMetadata'; -import type { UserDetails } from './userDetails'; - -/** A log of changes made to issue fields. Changelogs related to workflow associations are currently being deprecated. */ -export interface Changelog { - author?: UserDetails; - /** The date on which the change took place. */ - created?: string; - historyMetadata?: HistoryMetadata; - /** The ID of the changelog. */ - id?: string; - /** The list of items changed. */ - items?: ChangeDetails[]; -} diff --git a/src/version2/models/columnItem.ts b/src/version2/models/columnItem.ts deleted file mode 100644 index 71ae6dc4fb..0000000000 --- a/src/version2/models/columnItem.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of an issue navigator column item. */ -export interface ColumnItem { - /** The issue navigator column label. */ - label?: string; - /** The issue navigator column value. */ - value?: string; -} diff --git a/src/version2/models/comment.ts b/src/version2/models/comment.ts deleted file mode 100644 index 04363a671a..0000000000 --- a/src/version2/models/comment.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { EntityProperty } from './entityProperty'; -import type { UserDetails } from './userDetails'; -import type { Visibility } from './visibility'; - -/** A comment. */ -export interface Comment { - author?: UserDetails; - /** The comment text. */ - comment?: string; - /** The date and time at which the comment was created. */ - created?: string; - /** The ID of the comment. */ - id?: string; - /** - * Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external - * emails to be added as comments on - * issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for - * information on setting up this feature. - */ - jsdAuthorCanSeeRequest?: boolean; - /** - * Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud - * Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk - * project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its - * visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request - * comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) - * operation. - */ - jsdPublic?: boolean; - /** A list of comment properties. Optional on create and update. */ - properties?: EntityProperty[]; - /** The rendered version of the comment. */ - renderedBody?: string; - /** The URL of the comment. */ - self?: string; - updateAuthor?: UserDetails; - /** The date and time at which the comment was updated last. */ - updated?: string; - visibility?: Visibility; -} diff --git a/src/version2/models/component.ts b/src/version2/models/component.ts deleted file mode 100644 index 9caaab2d89..0000000000 --- a/src/version2/models/component.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface Component { - ari?: string; - description?: string; - id?: string; - metadata?: unknown; - name?: string; - self?: string; -} diff --git a/src/version2/models/componentIssuesCount.ts b/src/version2/models/componentIssuesCount.ts deleted file mode 100644 index 48d5a1694d..0000000000 --- a/src/version2/models/componentIssuesCount.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Count of issues assigned to a component. */ -export interface ComponentIssuesCount { - /** The count of issues assigned to a component. */ - issueCount?: number; - /** The URL for this count of issues for a component. */ - self?: string; -} diff --git a/src/version2/models/componentWithIssueCount.ts b/src/version2/models/componentWithIssueCount.ts deleted file mode 100644 index bf4f0c92d4..0000000000 --- a/src/version2/models/componentWithIssueCount.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { User } from './user'; - -/** Details about a component with a count of the issues it contains. */ -export interface ComponentWithIssueCount { - assignee?: User; - /** - * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` - * for details on how the type of the user, and hence the user, assigned to issues is determined. Takes the following - * values: - * - * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the - * component is in. `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for - * the component. `UNASSIGNED` an assignee is not set for issues created with this component. `PROJECT_DEFAULT` the - * assignee to any issues created with this component is nominally the default assignee for the project that the - * component is in. - */ - assigneeType?: string; - /** The description for the component. */ - description?: string; - /** The unique identifier for the component. */ - id?: string; - /** - * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but - * the component lead is not set, then `false` is returned. - */ - isAssigneeTypeValid?: boolean; - /** Count of issues for the component. */ - issueCount?: number; - lead?: User; - /** The name for the component. */ - name?: string; - /** The key of the project to which the component is assigned. */ - project?: string; - /** Not used. */ - projectId?: number; - realAssignee?: User; - /** - * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set - * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This - * property is set to one of the following values: - * - * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in - * the project that the component is in. `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component - * lead has permission to be assigned issues in the project that the component is in. `UNASSIGNED` when `assigneeType` - * is `UNASSIGNED` and Jira is configured to allow unassigned issues. `PROJECT_DEFAULT` when none of the preceding - * cases are true. - */ - realAssigneeType?: string; - /** The URL for this count of the issues contained in the component. */ - self?: string; -} diff --git a/src/version2/models/conditionGroupConfiguration.ts b/src/version2/models/conditionGroupConfiguration.ts deleted file mode 100644 index 2e5b87ffc4..0000000000 --- a/src/version2/models/conditionGroupConfiguration.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { WorkflowRuleConfiguration } from './workflowRuleConfiguration'; - -/** The conditions group associated with the transition. */ -export interface ConditionGroupConfiguration { - /** The nested conditions of the condition group. */ - conditionGroups?: ConditionGroupConfiguration[]; - /** The rules for this condition. */ - conditions?: WorkflowRuleConfiguration[]; - /** - * Determines how the conditions in the group are evaluated. Accepts either `ANY` or `ALL`. If `ANY` is used, at least - * one condition in the group must be true for the group to evaluate to true. If `ALL` is used, all conditions in the - * group must be true for the group to evaluate to true. - */ - operation?: string; -} diff --git a/src/version2/models/conditionGroupPayload.ts b/src/version2/models/conditionGroupPayload.ts deleted file mode 100644 index 43c6f89f72..0000000000 --- a/src/version2/models/conditionGroupPayload.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { RulePayload } from './rulePayload'; - -/** The payload for creating a condition group in a workflow */ -export interface ConditionGroupPayload { - /** The nested conditions of the condition group. */ - conditionGroup?: ConditionGroupPayload[]; - /** The rules for this condition. */ - conditions?: RulePayload[]; - /** - * Determines how the conditions in the group are evaluated. Accepts either `ANY` or `ALL`. If `ANY` is used, at least - * one condition in the group must be true for the group to evaluate to true. If `ALL` is used, all conditions in the - * group must be true for the group to evaluate to true. - */ - operation?: 'ANY' | 'ALL' | string; -} diff --git a/src/version2/models/conditionGroupUpdate.ts b/src/version2/models/conditionGroupUpdate.ts deleted file mode 100644 index 89354435d0..0000000000 --- a/src/version2/models/conditionGroupUpdate.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { WorkflowRuleConfiguration } from './workflowRuleConfiguration'; - -/** The conditions group associated with the transition. */ -export interface ConditionGroupUpdate { - /** The nested conditions of the condition group. */ - conditionGroups?: ConditionGroupUpdate[]; - /** The rules for this condition. */ - conditions?: WorkflowRuleConfiguration[]; - /** - * Determines how the conditions in the group are evaluated. Accepts either `ANY` or `ALL`. If `ANY` is used, at least - * one condition in the group must be true for the group to evaluate to true. If `ALL` is used, all conditions in the - * group must be true for the group to evaluate to true. - */ - operation: string; -} diff --git a/src/version2/models/configuration.ts b/src/version2/models/configuration.ts deleted file mode 100644 index 8cb481435e..0000000000 --- a/src/version2/models/configuration.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { TimeTrackingConfiguration } from './timeTrackingConfiguration'; - -/** Details about the configuration of Jira. */ -export interface Configuration { - /** Whether the ability to add attachments to issues is enabled. */ - attachmentsEnabled?: boolean; - /** Whether the ability to link issues is enabled. */ - issueLinkingEnabled?: boolean; - /** Whether the ability to create subtasks for issues is enabled. */ - subTasksEnabled?: boolean; - timeTrackingConfiguration?: TimeTrackingConfiguration; - /** - * Whether the ability to create unassigned issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - unassignedIssuesAllowed?: boolean; - /** - * Whether the ability for users to vote on issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - votingEnabled?: boolean; - /** - * Whether the ability for users to watch issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - watchingEnabled?: boolean; -} diff --git a/src/version2/models/configurationsListParameters.ts b/src/version2/models/configurationsListParameters.ts deleted file mode 100644 index 0ded35d16e..0000000000 --- a/src/version2/models/configurationsListParameters.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** 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/connectCustomFieldValue.ts b/src/version2/models/connectCustomFieldValue.ts deleted file mode 100644 index a9c9d6f953..0000000000 --- a/src/version2/models/connectCustomFieldValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** A list of custom field details. */ -export interface ConnectCustomFieldValue { - /** The type of custom field. */ - Type: string; - /** The custom field ID. */ - fieldID: number; - /** The issue ID. */ - issueID: number; - /** The value of number type custom field when `_type` is `NumberIssueField`. */ - number?: number; - /** - * The value of single select and multiselect custom field type when `_type` is `SingleSelectIssueField` or - * `MultiSelectIssueField`. - */ - optionID?: string; - /** The value of richText type custom field when `_type` is `RichTextIssueField`. */ - richText?: string; - /** The value of string type custom field when `_type` is `StringIssueField`. */ - string?: string; - /** The value of text custom field type when `_type` is `TextIssueField`. */ - text?: string; -} diff --git a/src/version2/models/connectCustomFieldValues.ts b/src/version2/models/connectCustomFieldValues.ts deleted file mode 100644 index 206b99d7c1..0000000000 --- a/src/version2/models/connectCustomFieldValues.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ConnectCustomFieldValue } from './connectCustomFieldValue'; - -/** Details of updates for a custom field. */ -export interface ConnectCustomFieldValues { - /** The list of custom field update details. */ - updateValueList?: ConnectCustomFieldValue[]; -} diff --git a/src/version2/models/connectModule.ts b/src/version2/models/connectModule.ts deleted file mode 100644 index b92cbf3ccd..0000000000 --- a/src/version2/models/connectModule.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * A [Connect module](https://developer.atlassian.com/cloud/jira/platform/about-jira-modules/) in the same format as in - * the* [app descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). - */ -export interface ConnectModule {} diff --git a/src/version2/models/connectModules.ts b/src/version2/models/connectModules.ts deleted file mode 100644 index 5bc92b42cc..0000000000 --- a/src/version2/models/connectModules.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ConnectModule } from './connectModule'; - -export interface ConnectModules { - /** - * A list of app modules in the same format as the `modules` property in the [app - * descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). - */ - modules: ConnectModule[]; -} diff --git a/src/version2/models/connectWorkflowTransitionRule.ts b/src/version2/models/connectWorkflowTransitionRule.ts deleted file mode 100644 index 92019de03f..0000000000 --- a/src/version2/models/connectWorkflowTransitionRule.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { RuleConfiguration } from './ruleConfiguration'; -import type { WorkflowTransition } from './workflowTransition'; - -/** A workflow transition rule. */ -export interface ConnectWorkflowTransitionRule { - configuration: RuleConfiguration; - /** The ID of the transition rule. */ - id: string; - /** The key of the rule, as defined in the Connect app descriptor. */ - key: string; - transition?: WorkflowTransition; -} diff --git a/src/version2/models/containerForProjectFeatures.ts b/src/version2/models/containerForProjectFeatures.ts deleted file mode 100644 index b176d15644..0000000000 --- a/src/version2/models/containerForProjectFeatures.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ProjectFeature } from './projectFeature'; - -/** The list of features on a project. */ -export interface ContainerForProjectFeatures { - /** The project features. */ - features?: ProjectFeature[]; -} diff --git a/src/version2/models/containerForRegisteredWebhooks.ts b/src/version2/models/containerForRegisteredWebhooks.ts deleted file mode 100644 index 38c19c66b2..0000000000 --- a/src/version2/models/containerForRegisteredWebhooks.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { RegisteredWebhook } from './registeredWebhook'; - -/** Container for a list of registered webhooks. Webhook details are returned in the same order as the request. */ -export interface ContainerForRegisteredWebhooks { - /** A list of registered webhooks. */ - webhookRegistrationResult?: RegisteredWebhook[]; -} diff --git a/src/version2/models/containerForWebhookIDs.ts b/src/version2/models/containerForWebhookIDs.ts deleted file mode 100644 index 63be84248b..0000000000 --- a/src/version2/models/containerForWebhookIDs.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Container for a list of webhook IDs. */ -export interface ContainerForWebhookIDs { - /** A list of webhook IDs. */ - webhookIds: number[]; -} diff --git a/src/version2/models/containerOfWorkflowSchemeAssociations.ts b/src/version2/models/containerOfWorkflowSchemeAssociations.ts deleted file mode 100644 index 61c9bfc4f5..0000000000 --- a/src/version2/models/containerOfWorkflowSchemeAssociations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkflowSchemeAssociations } from './workflowSchemeAssociations'; - -/** A container for a list of workflow schemes together with the projects they are associated with. */ -export interface ContainerOfWorkflowSchemeAssociations { - /** A list of workflow schemes together with projects they are associated with. */ - values: WorkflowSchemeAssociations[]; -} diff --git a/src/version2/models/contextForProjectAndIssueType.ts b/src/version2/models/contextForProjectAndIssueType.ts deleted file mode 100644 index c576764e11..0000000000 --- a/src/version2/models/contextForProjectAndIssueType.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** The project and issue type mapping with a matching custom field context. */ -export interface ContextForProjectAndIssueType { - /** The ID of the custom field context. */ - contextId: string; - /** The ID of the issue type. */ - issueTypeId: string; - /** The ID of the project. */ - projectId: string; -} diff --git a/src/version2/models/contextualConfiguration.ts b/src/version2/models/contextualConfiguration.ts deleted file mode 100644 index 1a1aa79f84..0000000000 --- a/src/version2/models/contextualConfiguration.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** Details of the contextual configuration for a custom field. */ -export interface ContextualConfiguration { - /** The ID of the configuration. */ - id: string; - /** The ID of the field context the configuration is associated with. */ - fieldContextId: string; - /** The field configuration. */ - configuration?: unknown; - /** The field value schema. */ - schema?: unknown; -} diff --git a/src/version2/models/convertedJQLQueries.ts b/src/version2/models/convertedJQLQueries.ts deleted file mode 100644 index 6e3db745f0..0000000000 --- a/src/version2/models/convertedJQLQueries.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { JQLQueryWithUnknownUsers } from './jQLQueryWithUnknownUsers'; - -/** The converted JQL queries. */ -export interface ConvertedJQLQueries { - /** List of queries containing user information that could not be mapped to an existing user */ - queriesWithUnknownUsers?: JQLQueryWithUnknownUsers[]; - /** The list of converted query strings with account IDs in place of user identifiers. */ - queryStrings?: string[]; -} diff --git a/src/version2/models/createCrossProjectReleaseRequest.ts b/src/version2/models/createCrossProjectReleaseRequest.ts deleted file mode 100644 index ad86f7182f..0000000000 --- a/src/version2/models/createCrossProjectReleaseRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/createCustomFieldContext.ts b/src/version2/models/createCustomFieldContext.ts deleted file mode 100644 index bcf3d24b35..0000000000 --- a/src/version2/models/createCustomFieldContext.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** The details of a created custom field context. */ -export interface CreateCustomFieldContext { - /** The description of the context. */ - description?: string; - /** The ID of the context. */ - id?: string; - /** The list of issue types IDs for the context. If the list is empty, the context refers to all issue types. */ - issueTypeIds?: string[]; - /** The name of the context. */ - name: string; - /** The list of project IDs associated with the context. If the list is empty, the context is global. */ - projectIds?: string[]; -} diff --git a/src/version2/models/createCustomFieldRequest.ts b/src/version2/models/createCustomFieldRequest.ts deleted file mode 100644 index 08f438709f..0000000000 --- a/src/version2/models/createCustomFieldRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index 8c70d94eb2..0000000000 --- a/src/version2/models/createDateFieldRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index 88a7aca6eb..0000000000 --- a/src/version2/models/createExclusionRulesRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -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/createIssueSecuritySchemeDetails.ts b/src/version2/models/createIssueSecuritySchemeDetails.ts deleted file mode 100644 index 4dd9c8b5d5..0000000000 --- a/src/version2/models/createIssueSecuritySchemeDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { SecuritySchemeLevel } from './securitySchemeLevel'; - -/** Issue security scheme and it's details */ -export interface CreateIssueSecuritySchemeDetails { - /** The description of the issue security scheme. */ - description?: string; - /** The list of scheme levels which should be added to the security scheme. */ - levels?: SecuritySchemeLevel[]; - /** The name of the issue security scheme. Must be unique (case-insensitive). */ - name: string; -} diff --git a/src/version2/models/createIssueSourceRequest.ts b/src/version2/models/createIssueSourceRequest.ts deleted file mode 100644 index 87f7d3c1f3..0000000000 --- a/src/version2/models/createIssueSourceRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -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/createNotificationSchemeDetails.ts b/src/version2/models/createNotificationSchemeDetails.ts deleted file mode 100644 index fe8418e94b..0000000000 --- a/src/version2/models/createNotificationSchemeDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { NotificationSchemeEventDetails } from './notificationSchemeEventDetails'; - -/** Details of a notification scheme. */ -export interface CreateNotificationSchemeDetails { - /** The description of the notification scheme. */ - description?: string; - /** The name of the notification scheme. Must be unique (case-insensitive). */ - name: string; - /** The list of notifications which should be added to the notification scheme. */ - notificationSchemeEvents?: NotificationSchemeEventDetails[]; -} diff --git a/src/version2/models/createPermissionHolderRequest.ts b/src/version2/models/createPermissionHolderRequest.ts deleted file mode 100644 index 1e0ab09af0..0000000000 --- a/src/version2/models/createPermissionHolderRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 9663522443..0000000000 --- a/src/version2/models/createPermissionRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { 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 deleted file mode 100644 index f53a44b781..0000000000 --- a/src/version2/models/createPlanOnlyTeamRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index d978637672..0000000000 --- a/src/version2/models/createPlanRequest.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { CreateCrossProjectReleaseRequest } from './createCrossProjectReleaseRequest'; -import type { CreateCustomFieldRequest } from './createCustomFieldRequest'; -import type { CreateExclusionRulesRequest } from './createExclusionRulesRequest'; -import type { CreateIssueSourceRequest } from './createIssueSourceRequest'; -import type { CreatePermissionRequest } from './createPermissionRequest'; -import type { CreateSchedulingRequest } from './createSchedulingRequest'; - -export interface CreatePlanRequest { - /** The cross-project releases to include in the plan. */ - crossProjectReleases?: CreateCrossProjectReleaseRequest[]; - /** The custom fields for the plan. */ - customFields?: CreateCustomFieldRequest[]; - exclusionRules?: CreateExclusionRulesRequest; - /** The issue sources to include in the plan. */ - issueSources: CreateIssueSourceRequest[]; - /** The account ID of the plan lead. */ - leadAccountId?: string; - /** The plan name. */ - name: string; - /** The permissions for the plan. */ - permissions?: CreatePermissionRequest[]; - scheduling?: CreateSchedulingRequest; -} diff --git a/src/version2/models/createPriorityDetails.ts b/src/version2/models/createPriorityDetails.ts deleted file mode 100644 index 934f9993bf..0000000000 --- a/src/version2/models/createPriorityDetails.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** 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. Either - * the iconUrl or avatarId must be defined, but not both. - * - * @deprecated This property is deprecated and will be removed in a future version. Use `avatarId` instead. - */ - iconUrl?: - | '/images/icons/priorities/blocker.png' - | '/images/icons/priorities/critical.png' - | '/images/icons/priorities/high.png' - | '/images/icons/priorities/highest.png' - | '/images/icons/priorities/low.png' - | '/images/icons/priorities/lowest.png' - | '/images/icons/priorities/major.png' - | '/images/icons/priorities/medium.png' - | '/images/icons/priorities/minor.png' - | '/images/icons/priorities/trivial.png' - | '/images/icons/priorities/blocker_new.png' - | '/images/icons/priorities/critical_new.png' - | '/images/icons/priorities/high_new.png' - | '/images/icons/priorities/highest_new.png' - | '/images/icons/priorities/low_new.png' - | '/images/icons/priorities/lowest_new.png' - | '/images/icons/priorities/major_new.png' - | '/images/icons/priorities/medium_new.png' - | '/images/icons/priorities/minor_new.png' - | '/images/icons/priorities/trivial_new.png' - | string; - /** The name of the priority. Must be unique. */ - name: string; - /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ - statusColor: string; -} diff --git a/src/version2/models/createPrioritySchemeDetails.ts b/src/version2/models/createPrioritySchemeDetails.ts deleted file mode 100644 index acc1b95f1b..0000000000 --- a/src/version2/models/createPrioritySchemeDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { 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/createProjectDetails.ts b/src/version2/models/createProjectDetails.ts deleted file mode 100644 index 328addfaf9..0000000000 --- a/src/version2/models/createProjectDetails.ts +++ /dev/null @@ -1,101 +0,0 @@ -/** Details about the project. */ -export interface CreateProjectDetails { - /** - * 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. - */ - key: string; - /** The name of the project. */ - name: string; - /** A brief description of the project. */ - description?: string; - /** - * The account ID of the project lead. Either `lead` or `leadAccountId` must be set when creating a project. 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 - * scheme IDs. - */ - issueSecurityScheme?: 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. - */ - 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 project's category. A complete list of category IDs is found using the [Get all project - * categories](#api-rest-api-2-projectCategory-get) operation. - */ - categoryId?: number; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes), which - * defines the application-specific feature set. If you don't specify the project template you have to specify the - * project type. - */ - projectTypeKey: 'business' | 'service_desk' | 'software' | string; - /** - * A predefined configuration for a project. The type of the `projectTemplateKey` must match with the type of the - * `projectTypeKey`. - */ - projectTemplateKey?: - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-content-management' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-process-control' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-procurement' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-project-management' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking' - | 'com.atlassian.servicedesk:simplified-it-service-management' - | 'com.atlassian.servicedesk:simplified-general-service-desk' - | 'com.atlassian.servicedesk:simplified-internal-service-desk' - | 'com.atlassian.servicedesk:simplified-external-service-desk' - | 'com.atlassian.servicedesk:simplified-hr-service-desk' - | 'com.atlassian.servicedesk:simplified-facilities-service-desk' - | 'com.atlassian.servicedesk:simplified-legal-service-desk' - | 'com.pyxis.greenhopper.jira:gh-simplified-agility-kanban' - | 'com.pyxis.greenhopper.jira:gh-simplified-agility-scrum' - | 'com.pyxis.greenhopper.jira:gh-simplified-basic' - | 'com.pyxis.greenhopper.jira:gh-simplified-kanban-classic' - | 'com.pyxis.greenhopper.jira:gh-simplified-scrum-classic' - | string; - /** - * The ID of the workflow scheme for the project. Use the [Get all workflow - * schemes](#api-rest-api-2-workflowscheme-get) operation to get a list of workflow scheme IDs. If you specify the - * workflow scheme you cannot specify the project template key. - */ - workflowScheme?: number; - /** - * The ID of the issue type screen scheme for the project. Use the [Get all issue type screen - * schemes](#api-rest-api-2-issuetypescreenscheme-get) operation to get a list of issue type screen scheme IDs. If you - * specify the issue type screen scheme you cannot specify the project template key. - */ - issueTypeScreenScheme?: number; - /** - * The ID of the issue type scheme for the project. Use the [Get all issue type - * schemes](#api-rest-api-2-issuetypescheme-get) operation to get a list of issue type scheme IDs. If you specify the - * issue type scheme you cannot specify the project template key. - */ - issueTypeScheme?: number; - /** - * The ID of the field configuration scheme for the project. Use the [Get all field configuration - * schemes](#api-rest-api-2-fieldconfigurationscheme-get) operation to get a list of field configuration scheme IDs. - * If you specify the field configuration scheme you cannot specify the project template key. - */ - fieldConfigurationScheme?: number; -} diff --git a/src/version2/models/createResolutionDetails.ts b/src/version2/models/createResolutionDetails.ts deleted file mode 100644 index c5bd664c91..0000000000 --- a/src/version2/models/createResolutionDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of an issue resolution. */ -export interface CreateResolutionDetails { - /** The description of the resolution. */ - description?: string; - /** The name of the resolution. Must be unique (case-insensitive). */ - name: string; -} diff --git a/src/version2/models/createSchedulingRequest.ts b/src/version2/models/createSchedulingRequest.ts deleted file mode 100644 index 1d00ee5c74..0000000000 --- a/src/version2/models/createSchedulingRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { 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/createUiModificationDetails.ts b/src/version2/models/createUiModificationDetails.ts deleted file mode 100644 index 9ffff335a4..0000000000 --- a/src/version2/models/createUiModificationDetails.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { UiModificationContextDetails } from './uiModificationContextDetails'; - -/** The details of a UI modification. */ -export interface CreateUiModificationDetails { - /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ - contexts?: UiModificationContextDetails[]; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The name of the UI modification. The maximum length is 255 characters. */ - name: string; -} diff --git a/src/version2/models/createUpdateRoleRequest.ts b/src/version2/models/createUpdateRoleRequest.ts deleted file mode 100644 index 2c1e6e6beb..0000000000 --- a/src/version2/models/createUpdateRoleRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface CreateUpdateRoleRequest { - /** - * A description of the project role. Required when fully updating a project role. Optional when creating or partially - * updating a project role. - */ - description?: string; - /** - * The name of the project role. Must be unique. Cannot begin or end with whitespace. The maximum length is 255 - * characters. Required when creating a project role. Optional when partially updating a project role. - */ - name?: string; -} diff --git a/src/version2/models/createWorkflowCondition.ts b/src/version2/models/createWorkflowCondition.ts deleted file mode 100644 index af45b411d9..0000000000 --- a/src/version2/models/createWorkflowCondition.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** A workflow transition condition. */ -export interface CreateWorkflowCondition { - /** The list of workflow conditions. */ - conditions?: CreateWorkflowCondition[]; - /** EXPERIMENTAL. The configuration of the transition rule. */ - configuration?: unknown; - /** The compound condition operator. */ - operator?: string; - /** The type of the transition rule. */ - type?: string; -} diff --git a/src/version2/models/createWorkflowDetails.ts b/src/version2/models/createWorkflowDetails.ts deleted file mode 100644 index 4adf75af24..0000000000 --- a/src/version2/models/createWorkflowDetails.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { CreateWorkflowStatusDetails } from './createWorkflowStatusDetails'; -import type { CreateWorkflowTransitionDetails } from './createWorkflowTransitionDetails'; - -/** The details of a workflow. */ -export interface CreateWorkflowDetails { - /** The description of the workflow. The maximum length is 1000 characters. */ - description?: string; - /** - * The name of the workflow. The name must be unique. The maximum length is 255 characters. Characters can be - * separated by a whitespace but the name cannot start or end with a whitespace. - */ - name: string; - /** - * The statuses of the workflow. Any status that does not include a transition is added to the workflow without a - * transition. - */ - statuses: CreateWorkflowStatusDetails[]; - /** - * The transitions of the workflow. For the request to be valid, these transitions must: - * - * Include one _initial_ transition. not use the same name for a _global_ and _directed_ transition. have a unique - * name for each _global_ transition. have a unique 'to' status for each _global_ transition. have unique names for - * each transition from a status. not have a 'from' status on _initial_ and _global_ transitions. have a 'from' status - * on _directed_ transitions. - * - * All the transition statuses must be included in `statuses`. - */ - transitions: CreateWorkflowTransitionDetails[]; -} diff --git a/src/version2/models/createWorkflowStatusDetails.ts b/src/version2/models/createWorkflowStatusDetails.ts deleted file mode 100644 index 5e0fed8f4d..0000000000 --- a/src/version2/models/createWorkflowStatusDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The details of a transition status. */ -export interface CreateWorkflowStatusDetails { - /** The ID of the status. */ - id: string; - /** The properties of the status. */ - properties?: unknown; -} diff --git a/src/version2/models/createWorkflowTransitionDetails.ts b/src/version2/models/createWorkflowTransitionDetails.ts deleted file mode 100644 index b4350db4f3..0000000000 --- a/src/version2/models/createWorkflowTransitionDetails.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { CreateWorkflowTransitionRulesDetails } from './createWorkflowTransitionRulesDetails'; -import type { CreateWorkflowTransitionScreenDetails } from './createWorkflowTransitionScreenDetails'; - -/** The details of a workflow transition. */ -export interface CreateWorkflowTransitionDetails { - /** The description of the transition. The maximum length is 1000 characters. */ - description?: string; - /** The statuses the transition can start from. */ - from?: string[]; - /** The name of the transition. The maximum length is 60 characters. */ - name: string; - /** The properties of the transition. */ - properties?: unknown; - rules?: CreateWorkflowTransitionRulesDetails; - screen?: CreateWorkflowTransitionScreenDetails; - /** The status the transition goes to. */ - to: string; - /** The type of the transition. */ - type: string; -} diff --git a/src/version2/models/createWorkflowTransitionRule.ts b/src/version2/models/createWorkflowTransitionRule.ts deleted file mode 100644 index ae2223f18c..0000000000 --- a/src/version2/models/createWorkflowTransitionRule.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** A workflow transition rule. */ -export interface CreateWorkflowTransitionRule { - /** EXPERIMENTAL. The configuration of the transition rule. */ - configuration?: unknown; - /** The type of the transition rule. */ - type: string; -} diff --git a/src/version2/models/createWorkflowTransitionRulesDetails.ts b/src/version2/models/createWorkflowTransitionRulesDetails.ts deleted file mode 100644 index a6aaa61f54..0000000000 --- a/src/version2/models/createWorkflowTransitionRulesDetails.ts +++ /dev/null @@ -1,72 +0,0 @@ -import type { CreateWorkflowCondition } from './createWorkflowCondition'; -import type { CreateWorkflowTransitionRule } from './createWorkflowTransitionRule'; - -/** The details of a workflow transition rules. */ -export interface CreateWorkflowTransitionRulesDetails { - conditions?: CreateWorkflowCondition; - /** - * The workflow post functions. - * - * _Note:_* The default post functions are always added to the _initial_ transition, as in: - * - * "postFunctions": [ - * { - * "type": "IssueCreateFunction" - * }, - * { - * "type": "IssueReindexFunction" - * }, - * { - * "type": "FireIssueEventFunction", - * "configuration": { - * "event": { - * "id": "1", - * "name": "issue_created" - * } - * } - * } - * ] - * - * _Note:_* The default post functions are always added to the _global_ and _directed_ transitions, as in: - * - * "postFunctions": [ - * { - * "type": "UpdateIssueStatusFunction" - * }, - * { - * "type": "CreateCommentFunction" - * }, - * { - * "type": "GenerateChangeHistoryFunction" - * }, - * { - * "type": "IssueReindexFunction" - * }, - * { - * "type": "FireIssueEventFunction", - * "configuration": { - * "event": { - * "id": "13", - * "name": "issue_generic" - * } - * } - * } - * ] - */ - postFunctions?: CreateWorkflowTransitionRule[]; - /** - * The workflow validators. - * - * _Note:_* The default permission validator is always added to the _initial_ transition, as in: - * - * "validators": [ - * { - * "type": "PermissionValidator", - * "configuration": { - * "permissionKey": "CREATE_ISSUES" - * } - * } - * ] - */ - validators?: CreateWorkflowTransitionRule[]; -} diff --git a/src/version2/models/createWorkflowTransitionScreenDetails.ts b/src/version2/models/createWorkflowTransitionScreenDetails.ts deleted file mode 100644 index 91ac973e85..0000000000 --- a/src/version2/models/createWorkflowTransitionScreenDetails.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The details of a transition screen. */ -export interface CreateWorkflowTransitionScreenDetails { - /** The ID of the screen. */ - id: string; -} diff --git a/src/version2/models/createdIssue.ts b/src/version2/models/createdIssue.ts deleted file mode 100644 index e68afd0832..0000000000 --- a/src/version2/models/createdIssue.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { NestedResponse } from './nestedResponse'; - -/** Details about a created issue or subtask. */ -export interface CreatedIssue { - /** The ID of the created issue or subtask. */ - id: string; - /** The key of the created issue or subtask. */ - key: string; - /** The URL of the created issue or subtask. */ - self: string; - transition?: NestedResponse; - watchers?: NestedResponse; -} diff --git a/src/version2/models/createdIssues.ts b/src/version2/models/createdIssues.ts deleted file mode 100644 index bf6f332836..0000000000 --- a/src/version2/models/createdIssues.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { BulkOperationErrorResult } from './bulkOperationErrorResult'; -import type { CreatedIssue } from './createdIssue'; - -/** Details about the issues created and the errors for requests that failed. */ -export interface CreatedIssues { - /** Error details for failed issue creation requests. */ - errors?: BulkOperationErrorResult[]; - /** Details of the issues created. */ - issues?: CreatedIssue[]; -} diff --git a/src/version2/models/customContextVariable.ts b/src/version2/models/customContextVariable.ts deleted file mode 100644 index 234a860bcb..0000000000 --- a/src/version2/models/customContextVariable.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface CustomContextVariable { - /** Type of custom context variable. */ - type: string; -} diff --git a/src/version2/models/customFieldConfigurations.ts b/src/version2/models/customFieldConfigurations.ts deleted file mode 100644 index cc5682152c..0000000000 --- a/src/version2/models/customFieldConfigurations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ContextualConfiguration } from './contextualConfiguration'; - -/** Details of configurations for a custom field. */ -export interface CustomFieldConfigurations { - /** The list of custom field configuration details. */ - configurations: ContextualConfiguration[]; -} diff --git a/src/version2/models/customFieldContext.ts b/src/version2/models/customFieldContext.ts deleted file mode 100644 index b4792cb88e..0000000000 --- a/src/version2/models/customFieldContext.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** The details of a custom field context. */ -export interface CustomFieldContext { - /** The description of the context. */ - description: string; - /** The ID of the context. */ - id: string; - /** Whether the context apply to all issue types. */ - isAnyIssueType: boolean; - /** Whether the context is global. */ - isGlobalContext: boolean; - /** The name of the context. */ - name: string; -} diff --git a/src/version2/models/customFieldContextDefaultValue.ts b/src/version2/models/customFieldContextDefaultValue.ts deleted file mode 100644 index 968ba0e631..0000000000 --- a/src/version2/models/customFieldContextDefaultValue.ts +++ /dev/null @@ -1 +0,0 @@ -export interface CustomFieldContextDefaultValue {} diff --git a/src/version2/models/customFieldContextDefaultValueUpdate.ts b/src/version2/models/customFieldContextDefaultValueUpdate.ts deleted file mode 100644 index a0cd885189..0000000000 --- a/src/version2/models/customFieldContextDefaultValueUpdate.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue'; - -/** Default values to update. */ -export interface CustomFieldContextDefaultValueUpdate { - defaultValues?: CustomFieldContextDefaultValue[]; -} diff --git a/src/version2/models/customFieldContextOption.ts b/src/version2/models/customFieldContextOption.ts deleted file mode 100644 index 1181145b8e..0000000000 --- a/src/version2/models/customFieldContextOption.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** Details of the custom field options for a context. */ -export interface CustomFieldContextOption { - /** Whether the option is disabled. */ - disabled: boolean; - /** The ID of the custom field option. */ - id: string; - /** For cascading options, the ID of the custom field option containing the cascading option. */ - optionId?: string; - /** The value of the custom field option. */ - value: string; -} diff --git a/src/version2/models/customFieldContextProjectMapping.ts b/src/version2/models/customFieldContextProjectMapping.ts deleted file mode 100644 index e1f76ed9ee..0000000000 --- a/src/version2/models/customFieldContextProjectMapping.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of a context to project association. */ -export interface CustomFieldContextProjectMapping { - /** The ID of the context. */ - contextId: string; - /** Whether context is global. */ - isGlobalContext?: boolean; - /** The ID of the project. */ - projectId?: string; -} diff --git a/src/version2/models/customFieldContextUpdateDetails.ts b/src/version2/models/customFieldContextUpdateDetails.ts deleted file mode 100644 index 044a778b3a..0000000000 --- a/src/version2/models/customFieldContextUpdateDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of a custom field context. */ -export interface CustomFieldContextUpdateDetails { - /** The description of the custom field context. The maximum length is 255 characters. */ - description?: string; - /** The name of the custom field context. The name must be unique. The maximum length is 255 characters. */ - name?: string; -} diff --git a/src/version2/models/customFieldCreatedContextOptionsList.ts b/src/version2/models/customFieldCreatedContextOptionsList.ts deleted file mode 100644 index cc8308464d..0000000000 --- a/src/version2/models/customFieldCreatedContextOptionsList.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldContextOption } from './customFieldContextOption'; - -/** A list of custom field options for a context. */ -export interface CustomFieldCreatedContextOptionsList { - /** The created custom field options. */ - options?: CustomFieldContextOption[]; -} diff --git a/src/version2/models/customFieldDefinitionJson.ts b/src/version2/models/customFieldDefinitionJson.ts deleted file mode 100644 index b55d9a816e..0000000000 --- a/src/version2/models/customFieldDefinitionJson.ts +++ /dev/null @@ -1,61 +0,0 @@ -export interface CustomFieldDefinitionJson { - /** The name of the custom field, which is displayed in Jira. This is not the unique identifier. */ - name: string; - /** The description of the custom field, which is displayed in Jira. */ - description?: string; - /** - * The type of the custom field. These built-in custom field types are available: - * - * `cascadingselect`: Enables values to be selected from two levels of select lists (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect`) `datepicker`: Stores a date using a picker - * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:datepicker`) `datetime`: Stores a date with a - * time component (value: `com.atlassian.jira.plugin.system.customfieldtypes:datetime`) `float`: Stores and validates - * a numeric (floating point) input (value: `com.atlassian.jira.plugin.system.customfieldtypes:float`) `grouppicker`: - * Stores a user group using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker`) - * `importid`: A read-only field that stores the ID the issue had in the system it was imported from (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:importid`) `labels`: Stores labels (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:labels`) `multicheckboxes`: Stores multiple values using - * checkboxes (value: `) `multigrouppicker`: Stores multiple user groups using a picker control (value: `) - * `multiselect`: Stores multiple values using a select list (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes`) `multiuserpicker`: Stores multiple users using - * a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker`) `multiversion`: - * Stores multiple versions from the versions available in a project using a picker control (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:multiversion`) `project`: Stores a project from a list of - * projects that the user is permitted to view (value: `com.atlassian.jira.plugin.system.customfieldtypes:project`) - * `radiobuttons`: Stores a value using radio buttons (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons`) `readonlyfield`: Stores a read-only text value, - * which can only be populated via the API (value: `com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield`) - * `select`: Stores a value from a configurable list of options (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:select`) `textarea`: Stores a long text string using a multiline - * text area (value: `com.atlassian.jira.plugin.system.customfieldtypes:textarea`) `textfield`: Stores a text string - * using a single-line text box (value: `com.atlassian.jira.plugin.system.customfieldtypes:textfield`) `url`: Stores a - * URL (value: `com.atlassian.jira.plugin.system.customfieldtypes:url`) `userpicker`: Stores a user using a picker - * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:userpicker`) `version`: Stores a version using a - * picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:version`) - * - * To create a field based on a [Forge custom field - * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-), - * use the ID of the Forge custom field type as the value. For example, - * `ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key`. - */ - type: string; - /** - * The searcher defines the way the field is searched in Jira. For example, - * _com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher_. The search UI (basic search and JQL - * search) will display different operations and values for the field, based on the field searcher. You must specify a - * searcher that is valid for the field type, as listed below (abbreviated values shown): - * - * `cascadingselect`: `cascadingselectsearcher` `datepicker`: `daterange` `datetime`: `datetimerange` `float`: - * `exactnumber` or `numberrange` `grouppicker`: `grouppickersearcher` `importid`: `exactnumber` or `numberrange` - * `labels`: `labelsearcher` `multicheckboxes`: `multiselectsearcher` `multigrouppicker`: `multiselectsearcher` - * `multiselect`: `multiselectsearcher` `multiuserpicker`: `userpickergroupsearcher` `multiversion`: `versionsearcher` - * `project`: `projectsearcher` `radiobuttons`: `multiselectsearcher` `readonlyfield`: `textsearcher` `select`: - * `multiselectsearcher` `textarea`: `textsearcher` `textfield`: `textsearcher` `url`: `exacttextsearcher` - * `userpicker`: `userpickergroupsearcher` `version`: `versionsearcher` - * - * If no searcher is provided, the field isn't searchable. However, [Forge custom - * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-) - * have a searcher set automatically, so are always searchable. - */ - searcherKey?: string; -} diff --git a/src/version2/models/customFieldOption.ts b/src/version2/models/customFieldOption.ts deleted file mode 100644 index bd94d4336f..0000000000 --- a/src/version2/models/customFieldOption.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of a custom option for a field. */ -export interface CustomFieldOption { - /** The URL of these custom field option details. */ - self?: string; - /** The value of the custom field option. */ - value?: string; -} diff --git a/src/version2/models/customFieldOptionCreate.ts b/src/version2/models/customFieldOptionCreate.ts deleted file mode 100644 index 43c4e659a8..0000000000 --- a/src/version2/models/customFieldOptionCreate.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of a custom field option to create. */ -export interface CustomFieldOptionCreate { - /** Whether the option is disabled. */ - disabled?: boolean; - /** For cascading options, the ID of the custom field object containing the cascading option. */ - optionId?: string; - /** The value of the custom field option. */ - value: string; -} diff --git a/src/version2/models/customFieldOptionUpdate.ts b/src/version2/models/customFieldOptionUpdate.ts deleted file mode 100644 index 63bcd5547c..0000000000 --- a/src/version2/models/customFieldOptionUpdate.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of a custom field option for a context. */ -export interface CustomFieldOptionUpdate { - /** Whether the option is disabled. */ - disabled?: boolean; - /** The ID of the custom field option. */ - id: string; - /** The value of the custom field option. */ - value?: string; -} diff --git a/src/version2/models/customFieldPayload.ts b/src/version2/models/customFieldPayload.ts deleted file mode 100644 index 112a7b916d..0000000000 --- a/src/version2/models/customFieldPayload.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** - * Defines the payload for the custom field definitions. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/#api-rest-api-3-field-post - */ -export interface CustomFieldPayload { - /** The type of the custom field */ - cfType?: string; - /** The description of the custom field */ - description?: string; - /** The name of the custom field */ - name?: string; - /** - * The strategy to use when there is a conflict with an existing custom field. FAIL - Fail execution, this always - * needs to be unique; USE - Use the existing entity and ignore new entity parameters - */ - onConflict?: 'FAIL' | 'USE' | 'NEW' | string; - pcri?: ProjectCreateResourceIdentifier; - /** The searcher key of the custom field */ - searcherKey?: string; -} diff --git a/src/version2/models/customFieldReplacement.ts b/src/version2/models/customFieldReplacement.ts deleted file mode 100644 index ecee49402b..0000000000 --- a/src/version2/models/customFieldReplacement.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details about the replacement for a deleted version. */ -export interface CustomFieldReplacement { - /** The ID of the custom field in which to replace the version number. */ - customFieldId?: number; - /** The version number to use as a replacement for the deleted version. */ - moveTo?: number; -} diff --git a/src/version2/models/customFieldUpdatedContextOptionsList.ts b/src/version2/models/customFieldUpdatedContextOptionsList.ts deleted file mode 100644 index e53924fec8..0000000000 --- a/src/version2/models/customFieldUpdatedContextOptionsList.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldOptionUpdate } from './customFieldOptionUpdate'; - -/** A list of custom field options for a context. */ -export interface CustomFieldUpdatedContextOptionsList { - /** The updated custom field options. */ - options?: CustomFieldOptionUpdate[]; -} diff --git a/src/version2/models/customFieldValueUpdate.ts b/src/version2/models/customFieldValueUpdate.ts deleted file mode 100644 index 1bbe8a0ef0..0000000000 --- a/src/version2/models/customFieldValueUpdate.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** A list of issue IDs and the value to update a custom field to. */ -export interface CustomFieldValueUpdate { - /** The list of issue IDs. */ - issueIds: number[]; - /** - * The value for the custom field. The value must be compatible with the [custom field - * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/#data-types) as - * follows: - * - * - `string` the value must be a string. - * - `number` the value must be a number. - * - `datetime` the value must be a string that represents a date in the ISO format, for example - * `"2021-01-18T12:00:00-03:00"`. - * - `user` the value must be an object that contains the `accountId` field. - * - `group` the value must be an object that contains the group `name` field. - * - * A list of appropriate values must be provided if the field is of the `list` [collection - * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/#collection-types). - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - value: any; -} diff --git a/src/version2/models/customFieldValueUpdateDetails.ts b/src/version2/models/customFieldValueUpdateDetails.ts deleted file mode 100644 index b211c9be90..0000000000 --- a/src/version2/models/customFieldValueUpdateDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldValueUpdate } from './customFieldValueUpdate'; - -/** Details of updates for a custom field. */ -export interface CustomFieldValueUpdateDetails { - /** The list of custom field update details. */ - updates?: CustomFieldValueUpdate[]; -} diff --git a/src/version2/models/customTemplateRequest.ts b/src/version2/models/customTemplateRequest.ts deleted file mode 100644 index ec22d267c4..0000000000 --- a/src/version2/models/customTemplateRequest.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { BoardsPayload } from './boardsPayload'; -import type { FieldCapabilityPayload } from './fieldCapabilityPayload'; -import type { IssueTypeProjectCreatePayload } from './issueTypeProjectCreatePayload'; -import type { NotificationSchemePayload } from './notificationSchemePayload'; -import type { PermissionPayload } from './permissionPayload'; -import type { ProjectPayload } from './projectPayload'; -import type { RolesCapabilityPayload } from './rolesCapabilityPayload'; -import type { ScopePayload } from './scopePayload'; -import type { SecuritySchemePayload } from './securitySchemePayload'; -import type { WorkflowCapabilityPayload } from './workflowCapabilityPayload'; - -/** The specific request object for creating a project with template. */ -export interface CustomTemplateRequest { - boards?: BoardsPayload; - field?: FieldCapabilityPayload; - issueType?: IssueTypeProjectCreatePayload; - notification?: NotificationSchemePayload; - permissionScheme?: PermissionPayload; - project?: ProjectPayload; - role?: RolesCapabilityPayload; - scope?: ScopePayload; - security?: SecuritySchemePayload; - workflow?: WorkflowCapabilityPayload; -} diff --git a/src/version2/models/customTemplatesProjectDetails.ts b/src/version2/models/customTemplatesProjectDetails.ts deleted file mode 100644 index 7fe11b7509..0000000000 --- a/src/version2/models/customTemplatesProjectDetails.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** Project Details */ -export interface CustomTemplatesProjectDetails { - /** The access level of the project. Only used by team-managed project */ - accessLevel?: 'open' | 'limited' | 'private' | 'free' | string; - /** Additional properties of the project */ - additionalProperties?: {}; - /** The default assignee when creating issues in the project */ - assigneeType?: 'PROJECT_DEFAULT' | 'COMPONENT_LEAD' | 'PROJECT_LEAD' | 'UNASSIGNED' | string; - /** - * The ID of the project's avatar. Use the [Get project avatars](#api-rest-api-3-project-projectIdOrKey-avatar-get) - * operation to list the available avatars in a project. - */ - 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. - */ - categoryId?: number; - /** Brief description of the project */ - description?: string; - /** Whether components are enabled for the project. Only used by company-managed project */ - enableComponents?: boolean; - /** - * 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. - */ - key?: string; - /** The default language for the project */ - language?: string; - /** - * The account ID of the project lead. Either `lead` or `leadAccountId` must be set when creating a project. Cannot be - * provided with `lead`. - */ - leadAccountId?: string; - /** Name of the project */ - name?: string; - /** A link to information about this project, such as project documentation */ - url?: string; -} diff --git a/src/version2/models/dashboard.ts b/src/version2/models/dashboard.ts deleted file mode 100644 index fc63adef1b..0000000000 --- a/src/version2/models/dashboard.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { DashboardUser } from './dashboardUser'; -import type { SharePermission } from './sharePermission'; - -/** Details of a dashboard. */ -export interface Dashboard { - description?: string; - /** The ID of the dashboard. */ - id: string; - /** Whether the dashboard is selected as a favorite by the user. */ - isFavourite?: boolean; - /** The name of the dashboard. */ - name?: string; - owner?: DashboardUser; - /** The number of users who have this dashboard as a favorite. */ - popularity?: number; - /** The rank of this dashboard. */ - rank?: number; - /** The URL of these dashboard details. */ - self?: string; - /** The details of any view share permissions for the dashboard. */ - sharePermissions?: SharePermission[]; - /** The details of any edit share permissions for the dashboard. */ - editPermissions?: SharePermission[]; - /** The automatic refresh interval for the dashboard in milliseconds. */ - automaticRefreshMs?: number; - /** The URL of the dashboard. */ - view?: string; - /** Whether the current user has permission to edit the dashboard. */ - isWritable?: boolean; - /** Whether the current dashboard is system dashboard. */ - systemDashboard?: boolean; -} diff --git a/src/version2/models/dashboardDetails.ts b/src/version2/models/dashboardDetails.ts deleted file mode 100644 index 0ee094beac..0000000000 --- a/src/version2/models/dashboardDetails.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { SharePermission } from './sharePermission'; - -/** Details of a dashboard. */ -export interface DashboardDetails { - /** The description of the dashboard. */ - description?: string; - /** The edit permissions for the dashboard. */ - editPermissions: SharePermission[]; - /** The name of the dashboard. */ - name: string; - /** The share permissions for the dashboard. */ - sharePermissions: SharePermission[]; -} diff --git a/src/version2/models/dashboardGadget.ts b/src/version2/models/dashboardGadget.ts deleted file mode 100644 index 208ba49415..0000000000 --- a/src/version2/models/dashboardGadget.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { DashboardGadgetPosition } from './dashboardGadgetPosition'; - -/** Details of a gadget. */ -export interface DashboardGadget { - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color: string; - /** The ID of the gadget instance. */ - id: number; - /** The module key of the gadget type. */ - moduleKey?: string; - position?: DashboardGadgetPosition; - /** The title of the gadget. */ - title: string; - /** The URI of the gadget type. */ - uri?: string; -} diff --git a/src/version2/models/dashboardGadgetPosition.ts b/src/version2/models/dashboardGadgetPosition.ts deleted file mode 100644 index ff917da894..0000000000 --- a/src/version2/models/dashboardGadgetPosition.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Details of a gadget position. */ -export interface DashboardGadgetPosition { - 'The row position of the gadget.': number; - 'The column position of the gadget.': number; -} diff --git a/src/version2/models/dashboardGadgetResponse.ts b/src/version2/models/dashboardGadgetResponse.ts deleted file mode 100644 index 1930f07b84..0000000000 --- a/src/version2/models/dashboardGadgetResponse.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { DashboardGadget } from './dashboardGadget'; - -/** The list of gadgets on the dashboard. */ -export interface DashboardGadgetResponse { - /** The list of gadgets. */ - gadgets: DashboardGadget[]; -} diff --git a/src/version2/models/dashboardGadgetSettings.ts b/src/version2/models/dashboardGadgetSettings.ts deleted file mode 100644 index 4f55db822d..0000000000 --- a/src/version2/models/dashboardGadgetSettings.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { DashboardGadgetPosition } from './dashboardGadgetPosition'; - -/** Details of the settings for a dashboard gadget. */ -export interface DashboardGadgetSettings { - /** The module key of the gadget type. Can't be provided with `uri`. */ - moduleKey?: string; - /** The URI of the gadget type. Can't be provided with `moduleKey`. */ - uri?: string; - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color?: 'blue' | 'red' | 'yellow' | 'green' | 'cyan' | 'purple' | 'gray' | 'white' | string; - position?: DashboardGadgetPosition; - /** The title of the gadget. */ - title?: string; - /** - * Whether to ignore the validation of module key and URI. For example, when a gadget is created that is a part of an - * application that isn't installed. - */ - ignoreUriAndModuleKeyValidation?: boolean; -} diff --git a/src/version2/models/dashboardGadgetUpdateRequest.ts b/src/version2/models/dashboardGadgetUpdateRequest.ts deleted file mode 100644 index 78c4195698..0000000000 --- a/src/version2/models/dashboardGadgetUpdateRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { DashboardGadgetPosition } from './dashboardGadgetPosition'; - -/** The details of the gadget to update. */ -export interface DashboardGadgetUpdateRequest { - /** The title of the gadget. */ - title?: string; - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color?: 'blue' | 'red' | 'yellow' | 'green' | 'cyan' | 'purple' | 'gray' | 'white' | string; - position?: DashboardGadgetPosition; -} diff --git a/src/version2/models/dashboardUser.ts b/src/version2/models/dashboardUser.ts deleted file mode 100644 index 9216778e9f..0000000000 --- a/src/version2/models/dashboardUser.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { UserAvatarUrls } from './userAvatarUrls'; - -export interface DashboardUser { - /** The URL of the user. */ - self?: string; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - avatarUrls?: UserAvatarUrls; -} diff --git a/src/version2/models/dataClassificationLevels.ts b/src/version2/models/dataClassificationLevels.ts deleted file mode 100644 index 4d234f2665..0000000000 --- a/src/version2/models/dataClassificationLevels.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { DataClassificationTag } from './dataClassificationTag'; - -/** The data classification. */ -export interface DataClassificationLevels { - /** The data classifications. */ - classifications?: DataClassificationTag[]; -} diff --git a/src/version2/models/dataClassificationTag.ts b/src/version2/models/dataClassificationTag.ts deleted file mode 100644 index 672de56a1c..0000000000 --- a/src/version2/models/dataClassificationTag.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** 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/dateRangeFilter.ts b/src/version2/models/dateRangeFilter.ts deleted file mode 100644 index 230c346b24..0000000000 --- a/src/version2/models/dateRangeFilter.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** List issues archived within a specified date range. */ -export interface DateRangeFilter { - /** 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/defaultLevelValue.ts b/src/version2/models/defaultLevelValue.ts deleted file mode 100644 index c0a25b6e13..0000000000 --- a/src/version2/models/defaultLevelValue.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** Details of scheme and new default level. */ -export interface DefaultLevelValue { - /** - * The ID of the issue security level to set as default for the specified scheme. Providing null will reset the - * default level. - */ - defaultLevelId: string; - /** The ID of the issue security scheme to set default level for. */ - issueSecuritySchemeId: string; -} diff --git a/src/version2/models/defaultShareScope.ts b/src/version2/models/defaultShareScope.ts deleted file mode 100644 index 8547285c74..0000000000 --- a/src/version2/models/defaultShareScope.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** Details of the scope of the default sharing for new filters and dashboards. */ -export interface DefaultShareScope { - /** - * The scope of the default sharing for new filters and dashboards: - * - * `AUTHENTICATED` Shared with all logged-in users. `GLOBAL` Shared with all logged-in users. This shows as - * `AUTHENTICATED` in the response. `PRIVATE` Not shared with any users. - */ - scope: string; -} diff --git a/src/version2/models/defaultWorkflow.ts b/src/version2/models/defaultWorkflow.ts deleted file mode 100644 index 6cbc96d12a..0000000000 --- a/src/version2/models/defaultWorkflow.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** Details about the default workflow. */ -export interface DefaultWorkflow { - /** - * Whether a draft workflow scheme is created or updated when updating an active workflow scheme. The draft is updated - * with the new default workflow. Defaults to `false`. - */ - updateDraftIfNeeded?: boolean; - /** The name of the workflow to set as the default workflow. */ - workflow: string; -} diff --git a/src/version2/models/documentVersion.ts b/src/version2/models/documentVersion.ts deleted file mode 100644 index 072f220d94..0000000000 --- a/src/version2/models/documentVersion.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The version details of the workflow. */ -export interface DocumentVersion { - /** The version UUID. */ - id?: string; - /** The version number. */ - versionNumber?: number; -} diff --git a/src/version2/models/duplicatePlanRequest.ts b/src/version2/models/duplicatePlanRequest.ts deleted file mode 100644 index 3d5c98beaf..0000000000 --- a/src/version2/models/duplicatePlanRequest.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DuplicatePlanRequest { - /** The plan name. */ - name: string; -} diff --git a/src/version2/models/enhancedSearchRequest.ts b/src/version2/models/enhancedSearchRequest.ts deleted file mode 100644 index 063e9754a3..0000000000 --- a/src/version2/models/enhancedSearchRequest.ts +++ /dev/null @@ -1,99 +0,0 @@ -export interface EnhancedSearchRequest { - /** - * The [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a - * bounded query. A bounded query is a query with a search restriction. - * - * - Example of an unbounded query: `order by key desc`. - * - Example of a bounded query: `assignee = currentUser() order by key`. - * - * Additionally, `orderBy` clause can contain a maximum of 7 fields. - */ - jql?: string; - /** - * The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. Use the - * `nextPageToken` to fetch the next page of issues. - */ - nextPageToken?: string; - /** - * The maximum number of items to return per page. To manage page size, API may return fewer items per page where a - * large number of fields are requested. The greatest number of items returned per page is achieved when requesting - * `id` or `key` only. - * - * It returns max 5000 issues. - * - * Default: `50` - * - * Format: `int32` - */ - maxResults?: number; - /** - * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a - * comma-separated list. Expand options include: - * - * - `*all` Returns all fields. - * - `*navigable` Returns navigable fields. - * - `id` Returns only issue IDs. - * - Any issue field, prefixed with a minus to exclude. - * - * The default is `id`. - * - * Examples: - * - * - `summary,comment` Returns only the summary and comments fields. - * - `-description` Returns all navigable (default) fields except description. - * - `*all,-comment` Returns all fields except comments. - * - * Multiple `fields` parameters can be included in a request. - * - * Note: By default, this resource returns IDs only. This differs from [GET - * issue](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-get) - * where the default is all fields. - */ - fields?: string[]; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about issues in the response. Note that, unlike the majority of instances where `expand` is specified, - * `expand` is defined as a comma-delimited string of values. The expand options are: - * - * - `renderedFields` Returns field values rendered in HTML format. - * - `names` Returns the display name of each field. - * - `schema` Returns the schema describing a field type. - * - `transitions` Returns all possible transitions for the issue. - * - `operations` Returns all possible operations for the issue. - * - `editmeta` Returns information about how each field can be edited. - * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. - * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each - * version of a field's value, with the highest numbered item representing the most recent version. - * - * Examples: `names,changelog` Returns the display name of each field as well as a list of recent updates to an issue. - */ - expand?: - | 'renderedFields' - | 'names' - | 'schema' - | 'transitions' - | 'operations' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - | ( - | 'renderedFields' - | 'names' - | 'schema' - | 'transitions' - | 'operations' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - )[] - | string - | string[]; - /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ - properties?: string[]; - /** Reference fields by their key (rather than ID). The default is `false`. */ - fieldsByKeys?: boolean; - /** Fail this request early if we can't retrieve all field data. The default is `false`. */ - failFast?: boolean; - /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids. All issues must exist. */ - reconcileIssues?: number[]; -} diff --git a/src/version2/models/entityProperty.ts b/src/version2/models/entityProperty.ts deleted file mode 100644 index f00da59752..0000000000 --- a/src/version2/models/entityProperty.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * An entity property, for more information see [Entity - * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/). - */ -export interface EntityProperty { - /** The key of the property. Required on create and update. */ - key?: string; - /** The value of the property. Required on create and update. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - value?: any; -} diff --git a/src/version2/models/entityPropertyDetails.ts b/src/version2/models/entityPropertyDetails.ts deleted file mode 100644 index 9f53f7dc4b..0000000000 --- a/src/version2/models/entityPropertyDetails.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface EntityPropertyDetails { - /** The entity property ID. */ - entityId: number; - /** The entity property key. */ - key: string; - /** The new value of the entity property. */ - value: string; -} diff --git a/src/version2/models/error.ts b/src/version2/models/error.ts deleted file mode 100644 index 2163724641..0000000000 --- a/src/version2/models/error.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface Error { - count?: number; - issueIdsOrKeys?: string[]; - message?: string; -} diff --git a/src/version2/models/errorCollection.ts b/src/version2/models/errorCollection.ts deleted file mode 100644 index d020c8c401..0000000000 --- a/src/version2/models/errorCollection.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** Error messages from an operation. */ -export interface ErrorCollection { - /** 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?: unknown; - status?: number; -} diff --git a/src/version2/models/errors.ts b/src/version2/models/errors.ts deleted file mode 100644 index 2280513283..0000000000 --- a/src/version2/models/errors.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Error } from './error'; - -export interface Errors { - issueIsSubtask?: Error; - issuesInArchivedProjects?: Error; - issuesInUnlicensedProjects?: Error; - issuesNotFound?: Error; -} diff --git a/src/version2/models/evaluatedJiraExpression.ts b/src/version2/models/evaluatedJiraExpression.ts deleted file mode 100644 index 079f1fc53d..0000000000 --- a/src/version2/models/evaluatedJiraExpression.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { JExpEvaluateMetaData } from './jExpEvaluateMetaData'; - -/** - * The result of evaluating a Jira expression.This bean will be replacing `JiraExpressionResultBean` bean as part of new - * evaluate endpoint - */ -export interface EvaluatedJiraExpression { - meta?: JExpEvaluateMetaData; - /** - * The value of the evaluated expression. It may be a primitive JSON value or a Jira REST API object. (Some - * expressions do not produce any meaningful results—for example, an expression that returns a lambda function—if - * that's the case a simple string representation is returned. These string representations should not be relied upon - * and may change without notice.) - */ - value: unknown; -} diff --git a/src/version2/models/eventNotification.ts b/src/version2/models/eventNotification.ts deleted file mode 100644 index c62d13f3ed..0000000000 --- a/src/version2/models/eventNotification.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { FieldDetails } from './fieldDetails'; -import type { GroupName } from './groupName'; -import type { ProjectRole } from './projectRole'; -import type { UserDetails } from './userDetails'; - -/** Details about a notification associated with an event. */ -export interface EventNotification { - /** The email address. */ - emailAddress?: string; - /** Expand options that include additional event notification details in the response. */ - expand?: string; - field?: FieldDetails; - group?: GroupName; - /** The ID of the notification. */ - id?: number; - /** Identifies the recipients of the notification. */ - notificationType?: string; - /** - * As a group's name can change, use of `recipient` is recommended. The identifier associated with the - * `notificationType` value that defines the receiver of the notification, where the receiver isn't implied by - * `notificationType` value. So, when `notificationType` is: - * - * `User` The `parameter` is the user account ID. `Group` The `parameter` is the group name. `ProjectRole` The - * `parameter` is the project role ID. `UserCustomField` The `parameter` is the ID of the custom field. - * `GroupCustomField` The `parameter` is the ID of the custom field. - */ - parameter?: string; - projectRole?: ProjectRole; - /** - * The identifier associated with the `notificationType` value that defines the receiver of the notification, where - * the receiver isn't implied by the `notificationType` value. So, when `notificationType` is: - * - * `User`, `recipient` is the user account ID. `Group`, `recipient` is the group ID. `ProjectRole`, `recipient` is the - * project role ID. `UserCustomField`, `recipient` is the ID of the custom field. `GroupCustomField`, `recipient` is - * the ID of the custom field. - */ - recipient?: string; - user?: UserDetails; -} diff --git a/src/version2/models/exportArchivedIssuesTaskProgress.ts b/src/version2/models/exportArchivedIssuesTaskProgress.ts deleted file mode 100644 index 08b9940c42..0000000000 --- a/src/version2/models/exportArchivedIssuesTaskProgress.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** The response for status request for a running/completed export task. */ -export interface ExportArchivedIssuesTaskProgress { - fileUrl?: string; - payload?: string; - progress?: number; - status?: string; - submittedTime?: string; - taskId?: string; -} diff --git a/src/version2/models/failedWebhook.ts b/src/version2/models/failedWebhook.ts deleted file mode 100644 index 1672570ef6..0000000000 --- a/src/version2/models/failedWebhook.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** Details about a failed webhook. */ -export interface FailedWebhook { - /** The webhook body. */ - body?: string; - /** The time the webhook was added to the list of failed webhooks (that is, the time of the last failed retry). */ - failureTime: number; - /** The webhook ID, as sent in the `X-Atlassian-Webhook-Identifier` header with the webhook. */ - id: string; - /** The original webhook destination. */ - url: string; -} diff --git a/src/version2/models/failedWebhooks.ts b/src/version2/models/failedWebhooks.ts deleted file mode 100644 index 3673ad1616..0000000000 --- a/src/version2/models/failedWebhooks.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { FailedWebhook } from './failedWebhook'; - -/** A page of failed webhooks. */ -export interface FailedWebhooks { - /** - * The maximum number of items on the page. If the list of values is shorter than this number, then there are no more - * pages. - */ - maxResults: number; - /** - * The URL to the next page of results. Present only if the request returned at least one result.The next page may be - * empty at the time of receiving the response, but new failed webhooks may appear in time. You can save the URL to - * the next page and query for new results periodically (for example, every hour). - */ - next?: string; - /** The list of webhooks. */ - values: FailedWebhook[]; -} diff --git a/src/version2/models/field.ts b/src/version2/models/field.ts deleted file mode 100644 index 8b20d37cf2..0000000000 --- a/src/version2/models/field.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { FieldLastUsed } from './fieldLastUsed'; -import type { JsonType } from './jsonType'; - -/** Details of a field. */ -export interface Field { - /** Number of contexts where the field is used. */ - contextsCount?: number; - /** The description of the field. */ - description?: string; - /** The ID of the field. */ - id: string; - /** Whether the field is locked. */ - isLocked?: boolean; - /** Whether the field is shown on screen or not. */ - isUnscreenable?: boolean; - /** The key of the field. */ - key?: string; - lastUsed?: FieldLastUsed; - /** The name of the field. */ - name: string; - /** Number of projects where the field is used. */ - projectsCount?: number; - schema: JsonType; - /** Number of screens where the field is used. */ - screensCount?: number; - /** The searcher key of the field. Returned for custom fields. */ - searcherKey?: string; -} diff --git a/src/version2/models/fieldAssociationsRequest.ts b/src/version2/models/fieldAssociationsRequest.ts deleted file mode 100644 index d8212c240b..0000000000 --- a/src/version2/models/fieldAssociationsRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { AssociationContextObject } from './associationContextObject'; -import type { FieldIdentifierObject } from './fieldIdentifierObject'; - -/** Details of field associations with projects. */ -export interface FieldAssociationsRequest { - /** Contexts to associate/unassociate the fields with. */ - associationContexts: AssociationContextObject[]; - /** Fields to associate/unassociate with projects. */ - fields: FieldIdentifierObject[]; -} diff --git a/src/version2/models/fieldCapabilityPayload.ts b/src/version2/models/fieldCapabilityPayload.ts deleted file mode 100644 index 357157d451..0000000000 --- a/src/version2/models/fieldCapabilityPayload.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { CustomFieldPayload } from './customFieldPayload'; -import type { FieldLayoutSchemePayload } from './fieldLayoutSchemePayload'; -import type { FieldLayoutPayload } from './fieldLayoutPayload'; -import type { IssueLayoutPayload } from './issueLayoutPayload'; -import type { IssueTypeScreenSchemePayload } from './issueTypeScreenSchemePayload'; -import type { ScreenSchemePayload } from './screenSchemePayload'; -import type { ScreenPayload } from './screenPayload'; - -/** - * Defines the payload for the fields, screens, screen schemes, issue type screen schemes, field layouts, and field - * layout schemes - */ -export interface FieldCapabilityPayload { - /** - * The custom field definitions. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/#api-rest-api-3-field-post - */ - customFieldDefinitions?: CustomFieldPayload[]; - fieldLayoutScheme?: FieldLayoutSchemePayload; - /** The field layouts configuration. */ - fieldLayouts?: FieldLayoutPayload[]; - /** The issue layouts configuration */ - issueLayouts?: IssueLayoutPayload[]; - issueTypeScreenScheme?: IssueTypeScreenSchemePayload; - /** - * The screen schemes See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-schemes/#api-rest-api-3-screenscheme-post - */ - screenScheme?: ScreenSchemePayload[]; - /** - * The screens. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screens/#api-rest-api-3-screens-post - */ - screens?: ScreenPayload[]; -} diff --git a/src/version2/models/fieldConfiguration.ts b/src/version2/models/fieldConfiguration.ts deleted file mode 100644 index ba4ae234a8..0000000000 --- a/src/version2/models/fieldConfiguration.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** Details of a field configuration. */ -export interface FieldConfiguration { - /** The description of the field configuration. */ - description: string; - /** The ID of the field configuration. */ - id: number; - /** Whether the field configuration is the default. */ - isDefault?: boolean; - /** The name of the field configuration. */ - name: string; -} diff --git a/src/version2/models/fieldConfigurationDetails.ts b/src/version2/models/fieldConfigurationDetails.ts deleted file mode 100644 index 240de3c736..0000000000 --- a/src/version2/models/fieldConfigurationDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of a field configuration. */ -export interface FieldConfigurationDetails { - /** The description of the field configuration. */ - description?: string; - /** The name of the field configuration. Must be unique. */ - name: string; -} diff --git a/src/version2/models/fieldConfigurationIssueTypeItem.ts b/src/version2/models/fieldConfigurationIssueTypeItem.ts deleted file mode 100644 index f37e4bc98e..0000000000 --- a/src/version2/models/fieldConfigurationIssueTypeItem.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** The field configuration for an issue type. */ -export interface FieldConfigurationIssueTypeItem { - /** The ID of the field configuration. */ - fieldConfigurationId: string; - /** The ID of the field configuration scheme. */ - fieldConfigurationSchemeId: string; - /** - * The ID of the issue type or _default_. When set to _default_ this field configuration issue type item applies to - * all issue types without a field configuration. - */ - issueTypeId: string; -} diff --git a/src/version2/models/fieldConfigurationItem.ts b/src/version2/models/fieldConfigurationItem.ts deleted file mode 100644 index e16b9dacc9..0000000000 --- a/src/version2/models/fieldConfigurationItem.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** A field within a field configuration. */ -export interface FieldConfigurationItem { - /** The description of the field within the field configuration. */ - description?: string; - /** The ID of the field within the field configuration. */ - id: string; - /** Whether the field is hidden in the field configuration. */ - isHidden?: boolean; - /** Whether the field is required in the field configuration. */ - isRequired?: boolean; - /** The renderer type for the field within the field configuration. */ - renderer?: string; -} diff --git a/src/version2/models/fieldConfigurationItemsDetails.ts b/src/version2/models/fieldConfigurationItemsDetails.ts deleted file mode 100644 index 808d10a4fb..0000000000 --- a/src/version2/models/fieldConfigurationItemsDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { FieldConfigurationItem } from './fieldConfigurationItem'; - -/** Details of field configuration items. */ -export interface FieldConfigurationItemsDetails { - /** Details of fields in a field configuration. */ - fieldConfigurationItems: FieldConfigurationItem[]; -} diff --git a/src/version2/models/fieldConfigurationScheme.ts b/src/version2/models/fieldConfigurationScheme.ts deleted file mode 100644 index 180aaf0b89..0000000000 --- a/src/version2/models/fieldConfigurationScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of a field configuration scheme. */ -export interface FieldConfigurationScheme { - /** The description of the field configuration scheme. */ - description?: string; - /** The ID of the field configuration scheme. */ - id: string; - /** The name of the field configuration scheme. */ - name: string; -} diff --git a/src/version2/models/fieldConfigurationSchemeProjectAssociation.ts b/src/version2/models/fieldConfigurationSchemeProjectAssociation.ts deleted file mode 100644 index 9290121996..0000000000 --- a/src/version2/models/fieldConfigurationSchemeProjectAssociation.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** Associated field configuration scheme and project. */ -export interface FieldConfigurationSchemeProjectAssociation { - /** - * The ID of the field configuration scheme. If the field configuration scheme ID is `null`, the operation assigns the - * default field configuration scheme. - */ - fieldConfigurationSchemeId?: string; - /** The ID of the project. */ - projectId: string; -} diff --git a/src/version2/models/fieldConfigurationSchemeProjects.ts b/src/version2/models/fieldConfigurationSchemeProjects.ts deleted file mode 100644 index eb719b4e92..0000000000 --- a/src/version2/models/fieldConfigurationSchemeProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { FieldConfigurationScheme } from './fieldConfigurationScheme'; - -/** Project list with assigned field configuration schema. */ -export interface FieldConfigurationSchemeProjects { - fieldConfigurationScheme?: FieldConfigurationScheme; - /** The IDs of projects using the field configuration scheme. */ - projectIds: string[]; -} diff --git a/src/version2/models/fieldConfigurationToIssueTypeMapping.ts b/src/version2/models/fieldConfigurationToIssueTypeMapping.ts deleted file mode 100644 index 9e4ebfa70e..0000000000 --- a/src/version2/models/fieldConfigurationToIssueTypeMapping.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** The field configuration to issue type mapping. */ -export interface FieldConfigurationToIssueTypeMapping { - /** The ID of the field configuration. */ - fieldConfigurationId: string; - /** - * The ID of the issue type or _default_. When set to _default_ this field configuration issue type item applies to - * all issue types without a field configuration. An issue type can be included only once in a request. - */ - issueTypeId: string; -} diff --git a/src/version2/models/fieldCreateMetadata.ts b/src/version2/models/fieldCreateMetadata.ts deleted file mode 100644 index 5a04e16a1c..0000000000 --- a/src/version2/models/fieldCreateMetadata.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { JsonType } from './jsonType'; - -/** The metadata describing an issue field for createmeta. */ -export interface FieldCreateMetadata { - /** The list of values allowed in the field. */ - allowedValues?: unknown[]; - /** The URL that can be used to automatically complete the field. */ - autoCompleteUrl?: string; - /** The configuration properties. */ - configuration?: unknown; - /** The default value of the field. */ - defaultValue?: unknown; - /** The field id. */ - fieldId: string; - /** Whether the field has a default value. */ - hasDefaultValue?: boolean; - /** The key of the field. */ - key: string; - /** The name of the field. */ - name: string; - /** The list of operations that can be performed on the field. */ - operations: string[]; - /** Whether the field is required. */ - required: boolean; - schema?: JsonType; -} diff --git a/src/version2/models/fieldDetails.ts b/src/version2/models/fieldDetails.ts deleted file mode 100644 index e6c4d29036..0000000000 --- a/src/version2/models/fieldDetails.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { JsonType } from './jsonType'; -import type { Scope } from './scope'; - -/** Details about a field. */ -export interface FieldDetails { - /** - * The names that can be used to reference the field in an advanced search. For more information, see [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ). - */ - clauseNames?: string[]; - /** Whether the field is a custom field. */ - custom?: boolean; - /** The ID of the field. */ - id?: string; - /** The key of the field. */ - key?: string; - /** The name of the field. */ - name?: string; - /** Whether the field can be used as a column on the issue navigator. */ - navigable?: boolean; - /** Whether the content of the field can be used to order lists. */ - orderable?: boolean; - schema?: JsonType; - scope?: Scope; - /** Whether the content of the field can be searched. */ - searchable?: boolean; -} diff --git a/src/version2/models/fieldIdentifierObject.ts b/src/version2/models/fieldIdentifierObject.ts deleted file mode 100644 index b257aa2a7c..0000000000 --- a/src/version2/models/fieldIdentifierObject.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Identifier for a field for example FIELD_ID. */ -export interface FieldIdentifierObject { - identifier?: {}; - type: string; -} diff --git a/src/version2/models/fieldLastUsed.ts b/src/version2/models/fieldLastUsed.ts deleted file mode 100644 index cf4e41f0de..0000000000 --- a/src/version2/models/fieldLastUsed.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** Information about the most recent use of a field. */ -export interface FieldLastUsed { - /** - * Last used value type: - * - * _TRACKED_: field is tracked and a last used date is available. _NOT_TRACKED_: field is not tracked, last used date - * is not available. _NO_INFORMATION_: field is tracked, but no last used date is available. - */ - type?: string; - /** The date when the value of the field last changed. */ - value?: string; -} diff --git a/src/version2/models/fieldLayoutConfiguration.ts b/src/version2/models/fieldLayoutConfiguration.ts deleted file mode 100644 index 1a2256bb0b..0000000000 --- a/src/version2/models/fieldLayoutConfiguration.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** - * Defines the payload for the field layout configuration. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-field-configurations/#api-rest-api-3-fieldconfiguration-post - */ -export interface FieldLayoutConfiguration { - /** Whether to show the field */ - field?: boolean; - pcri?: ProjectCreateResourceIdentifier; - /** Whether the field is required */ - required?: boolean; -} diff --git a/src/version2/models/fieldLayoutPayload.ts b/src/version2/models/fieldLayoutPayload.ts deleted file mode 100644 index 744cfde4bc..0000000000 --- a/src/version2/models/fieldLayoutPayload.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { FieldLayoutConfiguration } from './fieldLayoutConfiguration'; -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** - * Defines the payload for the field layouts. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-field-configurations/#api-group-issue-field-configurations" - * - * - Fieldlayout is what users would see as "Field Configuration" in Jira's UI - - * https://support.atlassian.com/jira-cloud-administration/docs/manage-issue-field-configurations/ - */ -export interface FieldLayoutPayload { - /** - * The field layout configuration. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-field-configurations/#api-rest-api-3-fieldconfiguration-post - */ - configuration?: FieldLayoutConfiguration[]; - /** The description of the field layout */ - description?: string; - /** The name of the field layout */ - name?: string; - pcri?: ProjectCreateResourceIdentifier; -} diff --git a/src/version2/models/fieldLayoutSchemePayload.ts b/src/version2/models/fieldLayoutSchemePayload.ts deleted file mode 100644 index 76f237040d..0000000000 --- a/src/version2/models/fieldLayoutSchemePayload.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** - * Defines the payload for the field layout schemes. See "Field Configuration Scheme" - - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-field-configurations/#api-rest-api-3-fieldconfigurationscheme-post - * https://support.atlassian.com/jira-cloud-administration/docs/configure-a-field-configuration-scheme/ - */ -export interface FieldLayoutSchemePayload { - defaultFieldLayout?: ProjectCreateResourceIdentifier; - /** The description of the field layout scheme */ - description?: string; - /** - * There is a default configuration "fieldlayout" that is applied to all issue types using this scheme that don't have - * an explicit mapping users can create (or re-use existing) configurations for other issue types and map them to this - * scheme - */ - explicitMappings?: {}; - /** The name of the field layout scheme */ - name?: string; - pcri?: ProjectCreateResourceIdentifier; -} diff --git a/src/version2/models/fieldMetadata.ts b/src/version2/models/fieldMetadata.ts deleted file mode 100644 index 83c703bd1a..0000000000 --- a/src/version2/models/fieldMetadata.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import type { JsonType } from './jsonType'; - -/** The metadata describing an issue field. */ -export interface FieldMetadata { - /** The list of values allowed in the field. */ - allowedValues?: any[]; - /** The URL that can be used to automatically complete the field. */ - autoCompleteUrl?: string; - /** The configuration properties. */ - configuration?: any; - /** The default value of the field. */ - defaultValue?: any; - /** Whether the field has a default value. */ - hasDefaultValue?: boolean; - /** The key of the field. */ - key: string; - /** The name of the field. */ - name: string; - /** The list of operations that can be performed on the field. */ - operations: string[]; - /** Whether the field is required. */ - required: boolean; - schema?: JsonType; -} diff --git a/src/version2/models/fieldReferenceData.ts b/src/version2/models/fieldReferenceData.ts deleted file mode 100644 index 79f421f4ac..0000000000 --- a/src/version2/models/fieldReferenceData.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** Details of a field that can be used in advanced searches. */ -export interface FieldReferenceData { - /** Whether the field provide auto-complete suggestions. */ - auto?: string; - /** If the item is a custom field, the ID of the custom field. */ - cfid?: string; - /** Whether this field has been deprecated. */ - deprecated?: string; - /** The searcher key of the field, only passed when the field is deprecated. */ - deprecatedSearcherKey?: string; - /** - * The display name contains the following: - * - * For system fields, the field name. For example, `Summary`. for collapsed custom fields, the field name followed by - * a hyphen and then the field name and field type. For example, `Component - Component[Dropdown]`. for other custom - * fields, the field name followed by a hyphen and then the custom field ID. For example, `Component - cf[10061]`. - */ - displayName?: string; - /** The valid search operators for the field. */ - operators?: string[]; - /** Whether the field can be used in a query's `ORDER BY` clause. */ - orderable?: string; - /** Whether the content of this field can be searched. */ - searchable?: string; - /** The data types of items in the field. */ - types?: string[]; - /** The field identifier. */ - value?: string; -} diff --git a/src/version2/models/fields.ts b/src/version2/models/fields.ts deleted file mode 100644 index 195cebc286..0000000000 --- a/src/version2/models/fields.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import type { Attachment } from './attachment'; -import type { Comment } from './comment'; -import type { FixVersion } from './fixVersion'; -import type { Issue } from './issue'; -import type { IssueLink } from './issueLink'; -import type { IssueTypeDetails } from './issueTypeDetails'; -import type { Priority } from './priority'; -import type { ProjectComponent } from './projectComponent'; -import type { Resolution } from './resolution'; -import type { RichText } from './richText'; -import type { StatusDetails } from './statusDetails'; -import type { TimeTrackingDetails } from './timeTrackingDetails'; -import type { User } from './user'; -import type { UserDetails } from './userDetails'; -import type { Votes } from './votes'; -import type { Watchers } from './watchers'; -import type { Worklog } from './worklog'; - -/** Key fields from the linked issue. */ -export interface Fields extends Record { - /** The estimate of how much longer working on the issue will take, in seconds. */ - aggregatetimespent: number | null; - /** The assignee of the linked issue. */ - assignee: UserDetails; - /** The list of issue attachments. */ - attachment: Attachment[]; - /** The list of issue comment. */ - comment: { - /** The list of issue comment. */ - comments: Comment[]; - self: string; - maxResults: number; - total: number; - startAt: number; - }; - /** The list of project components the issue belongs to. */ - components: ProjectComponent[]; - /** The creation time of the issue. */ - created: string; - /** The user who created the issue */ - creator: User; - /** The issue description. */ - description?: string; - /** The time the issue is due. */ - duedate: string | null; - /** The value of the environment field. */ - environment: RichText | null; - /** The list of versions where the issue was fixed. */ - fixVersions: FixVersion[]; - /** The list of issue links. */ - issuelinks: IssueLink[]; - issuerestriction?: { - issuerestrictions: any; - shouldDisplay: boolean; - }; - /** The type of the linked issue. */ - issuetype: IssueTypeDetails; - /** The list of labels associated with the issue. */ - labels: string[]; - lastViewed: string | null; - /** The issue parent. */ - parent?: Issue; - /** The priority of the linked issue. */ - priority: Priority; - /** The reporter of the issue. */ - reporter: User; - /** The resolution of the issue. */ - resolution: Resolution | null; - /** The time the issue was resolved at. */ - resolutiondate: string | null; - /** The status of the linked issue. */ - status: StatusDetails; - statuscategorychangedate?: string; - /** The list of subtasks. */ - subtasks: Issue[]; - /** The summary description of the linked issue. */ - summary: string; - timeoriginalestimate?: any; - /** The time that was spent working on the issue, in seconds. */ - timespent: number | null; - /** The time tracking of the linked issue. */ - timetracking: TimeTrackingDetails; - /** The time when the issue was last updated at. */ - updated: string; - /** The number of voters of the issue. Returns an error if voting is disabled. */ - votes: Votes & { voters: never }; - /** The number of watchers of the issue. Returns an error if watching is disabled. */ - watches: Watchers; - worklog: { - startAt: number; - maxResults: number; - total: number; - worklogs: Worklog[]; - }; - workratio: number; -} diff --git a/src/version2/models/filter.ts b/src/version2/models/filter.ts deleted file mode 100644 index d52451c2ea..0000000000 --- a/src/version2/models/filter.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { FilterSubscriptionsList } from './filterSubscriptionsList'; -import type { SharePermission } from './sharePermission'; -import type { User } from './user'; -import type { 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. */ - editPermissions?: SharePermission[]; - /** Whether the filter is selected as a favorite. */ - favourite?: boolean; - /** The count of how many users have selected this filter as a favorite, including the filter owner. */ - favouritedCount?: number; - /** The unique identifier for the filter. */ - id?: string; - /** The JQL query for the filter. For example, _project = SSP AND issuetype = Bug_. */ - jql?: string; - /** The name of the filter. Must be unique. */ - name: string; - owner?: User; - /** - * A URL to view the filter results in Jira, using the [Search for issues using - * JQL](#api-rest-api-2-filter-search-get) operation with the filter's JQL string to return the filter results. For - * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. - */ - searchUrl?: string; - /** The URL of the filter. */ - self?: string; - /** The groups and projects that the filter is shared with. */ - sharePermissions?: SharePermission[]; - sharedUsers?: UserList; - subscriptions?: FilterSubscriptionsList; - /** - * A URL to view the filter results in Jira, using the ID of the filter. For example, - * _https://your-domain.atlassian.net/issues/?filter=10100_. - */ - viewUrl?: string; -} diff --git a/src/version2/models/filterDetails.ts b/src/version2/models/filterDetails.ts deleted file mode 100644 index 240b0d525e..0000000000 --- a/src/version2/models/filterDetails.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { FilterSubscription } from './filterSubscription'; -import type { SharePermission } from './sharePermission'; -import type { 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; - /** - * The groups and projects that can edit the filter. This can be specified when updating a filter, but not when - * creating a filter. - */ - editPermissions?: SharePermission[]; - /** Expand options that include additional filter details in the response. */ - expand?: string; - /** Whether the filter is selected as a favorite by any users, not including the filter owner. */ - favourite?: boolean; - /** The count of how many users have selected this filter as a favorite, including the filter owner. */ - favouritedCount?: number; - /** The unique identifier for the filter. */ - id?: string; - /** The JQL query for the filter. For example, _project = SSP AND issuetype = Bug_. */ - jql?: string; - /** The name of the filter. */ - name: string; - owner?: User; - /** - * A URL to view the filter results in Jira, using the [Search for issues using - * JQL](#api-rest-api-2-filter-search-get) operation with the filter's JQL string to return the filter results. For - * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. - */ - searchUrl?: string; - /** The URL of the filter. */ - self?: string; - /** - * The groups and projects that the filter is shared with. This can be specified when updating a filter, but not when - * creating a filter. - */ - sharePermissions?: SharePermission[]; - /** The users that are subscribed to the filter. */ - subscriptions?: FilterSubscription[]; - /** - * A URL to view the filter results in Jira, using the ID of the filter. For example, - * _https://your-domain.atlassian.net/issues/?filter=10100_. - */ - viewUrl?: string; -} diff --git a/src/version2/models/filterSubscription.ts b/src/version2/models/filterSubscription.ts deleted file mode 100644 index cc45a1c502..0000000000 --- a/src/version2/models/filterSubscription.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { GroupName } from './groupName'; -import type { User } from './user'; - -/** Details of a user or group subscribing to a filter. */ -export interface FilterSubscription { - group?: GroupName; - /** The ID of the filter subscription. */ - id?: number; - user?: User; -} diff --git a/src/version2/models/filterSubscriptionsList.ts b/src/version2/models/filterSubscriptionsList.ts deleted file mode 100644 index 62d4b4b37b..0000000000 --- a/src/version2/models/filterSubscriptionsList.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { FilterSubscription } from './filterSubscription'; - -/** A paginated list of subscriptions to a filter. */ -export interface FilterSubscriptionsList { - /** The index of the last item returned on the page. */ - 'end-index'?: number; - /** The list of items. */ - items?: FilterSubscription[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The number of items on the page. */ - size?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; -} diff --git a/src/version2/models/fixVersion.ts b/src/version2/models/fixVersion.ts deleted file mode 100644 index 7f44b29886..0000000000 --- a/src/version2/models/fixVersion.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface FixVersion { - self: string; - id: string; - description: string; - name: string; - archived: boolean; - released: boolean; - releaseDate?: string; -} diff --git a/src/version2/models/foundGroup.ts b/src/version2/models/foundGroup.ts deleted file mode 100644 index f2f5c49337..0000000000 --- a/src/version2/models/foundGroup.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { GroupLabel } from './groupLabel'; - -/** A group found in a search. */ -export interface FoundGroup { - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. - */ - groupId?: string; - /** The group name with the matched query string highlighted with the HTML bold tag. */ - html?: string; - labels?: GroupLabel[]; - /** The name of the group. The name of a group is mutable, to reliably identify a group use ``groupId`.` */ - name?: string; -} diff --git a/src/version2/models/foundGroups.ts b/src/version2/models/foundGroups.ts deleted file mode 100644 index 2e6200dae9..0000000000 --- a/src/version2/models/foundGroups.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { FoundGroup } from './foundGroup'; - -/** - * The list of groups found in a search, including header text (Showing X of Y matching groups) and total of matched - * groups. - */ -export interface FoundGroups { - groups?: FoundGroup[]; - /** Header text indicating the number of groups in the response and the total number of groups found in the search. */ - header?: string; - /** The total number of groups found in the search. */ - total?: number; -} diff --git a/src/version2/models/foundUsers.ts b/src/version2/models/foundUsers.ts deleted file mode 100644 index 58e524d41a..0000000000 --- a/src/version2/models/foundUsers.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { UserPickerUser } from './userPickerUser'; - -/** - * The list of users found in a search, including header text (Showing X of Y matching users) and total of matched - * users. - */ -export interface FoundUsers { - /** Header text indicating the number of users in the response and the total number of users found in the search. */ - header?: string; - /** The total number of users found in the search. */ - total?: number; - users?: UserPickerUser[]; -} diff --git a/src/version2/models/foundUsersAndGroups.ts b/src/version2/models/foundUsersAndGroups.ts deleted file mode 100644 index 618ad27402..0000000000 --- a/src/version2/models/foundUsersAndGroups.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { FoundGroups } from './foundGroups'; -import type { FoundUsers } from './foundUsers'; - -/** List of users and groups found in a search. */ -export interface FoundUsersAndGroups { - groups?: FoundGroups; - users?: FoundUsers; -} diff --git a/src/version2/models/fromLayoutPayload.ts b/src/version2/models/fromLayoutPayload.ts deleted file mode 100644 index 872976485e..0000000000 --- a/src/version2/models/fromLayoutPayload.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** The payload for the layout details for the start end of a transition */ -export interface FromLayoutPayload { - /** The port that the transition can be made from */ - fromPort?: number; - status?: ProjectCreateResourceIdentifier; - /** The port that the transition goes to */ - toPortOverride?: number; -} diff --git a/src/version2/models/functionReferenceData.ts b/src/version2/models/functionReferenceData.ts deleted file mode 100644 index 1d3e4a90b7..0000000000 --- a/src/version2/models/functionReferenceData.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** Details of functions that can be used in advanced searches. */ -export interface FunctionReferenceData { - /** The display name of the function. */ - displayName?: string; - /** Whether the function can take a list of arguments. */ - isList?: string; - /** The data types returned by the function. */ - types?: string[]; - /** The function identifier. */ - value?: string; -} diff --git a/src/version2/models/getAtlassianTeamResponse.ts b/src/version2/models/getAtlassianTeamResponse.ts deleted file mode 100644 index ad60480d52..0000000000 --- a/src/version2/models/getAtlassianTeamResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 4e41368cc5..0000000000 --- a/src/version2/models/getCrossProjectReleaseResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index 8ac304ff9b..0000000000 --- a/src/version2/models/getCustomFieldResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index d2293240a8..0000000000 --- a/src/version2/models/getDateFieldResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index c2852ef738..0000000000 --- a/src/version2/models/getExclusionRulesResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index fd864bf6ad..0000000000 --- a/src/version2/models/getIssueSourceResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 4d44c9cb87..0000000000 --- a/src/version2/models/getPermissionHolderResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 88f99a4ed6..0000000000 --- a/src/version2/models/getPermissionResponse.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { 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 deleted file mode 100644 index 5dd4cf00e0..0000000000 --- a/src/version2/models/getPlanOnlyTeamResponse.ts +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index ece49a14a4..0000000000 --- a/src/version2/models/getPlanResponseForPage.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { 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 deleted file mode 100644 index 9ab73c2343..0000000000 --- a/src/version2/models/getSchedulingResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { 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 deleted file mode 100644 index 6d49ebff03..0000000000 --- a/src/version2/models/getTeamResponseForPage.ts +++ /dev/null @@ -1,8 +0,0 @@ -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/globalScope.ts b/src/version2/models/globalScope.ts deleted file mode 100644 index 6f3e1c1fbe..0000000000 --- a/src/version2/models/globalScope.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface GlobalScope { - /** - * Defines the behavior of the option in the global context.If notSelectable is set, the option cannot be set as the - * field's value. This is useful for archiving an option that has previously been selected but shouldn't be used - * anymore.If defaultValue is set, the option is selected by default. - */ - attributes?: string[]; -} diff --git a/src/version2/models/group.ts b/src/version2/models/group.ts deleted file mode 100644 index 98c57214f3..0000000000 --- a/src/version2/models/group.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PagedListUserDetailsApplicationUser } from './pagedListUserDetailsApplicationUser'; - -export interface Group { - /** Expand options that include additional group details in the response. */ - expand?: string; - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. - */ - groupId?: string; - /** The name of group. */ - name?: string; - /** The URL for these group details. */ - self?: string; - users?: PagedListUserDetailsApplicationUser; -} diff --git a/src/version2/models/groupDetails.ts b/src/version2/models/groupDetails.ts deleted file mode 100644 index 9f9b6e2238..0000000000 --- a/src/version2/models/groupDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** Details about a group. */ -export interface GroupDetails { - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. - */ - groupId?: string; - /** The name of the group. */ - name?: string; -} diff --git a/src/version2/models/groupLabel.ts b/src/version2/models/groupLabel.ts deleted file mode 100644 index 212fe39271..0000000000 --- a/src/version2/models/groupLabel.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** A group label. */ -export interface GroupLabel { - /** The group label name. */ - text?: string; - /** The title of the group label. */ - title?: string; - /** The type of the group label. */ - type?: string; -} diff --git a/src/version2/models/groupName.ts b/src/version2/models/groupName.ts deleted file mode 100644 index 795475dc2f..0000000000 --- a/src/version2/models/groupName.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** Details about a group. */ -export interface GroupName { - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. - */ - groupId?: string; - /** The name of group. */ - name?: string; - /** The URL for these group details. */ - self?: string; -} diff --git a/src/version2/models/hierarchy.ts b/src/version2/models/hierarchy.ts deleted file mode 100644 index 103450005b..0000000000 --- a/src/version2/models/hierarchy.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { HierarchyLevel } from './hierarchyLevel'; - -/** The project issue type hierarchy. */ -export interface Hierarchy { - /** Details about the hierarchy level. */ - levels?: HierarchyLevel[]; -} diff --git a/src/version2/models/hierarchyLevel.ts b/src/version2/models/hierarchyLevel.ts deleted file mode 100644 index 2eb191fb3d..0000000000 --- a/src/version2/models/hierarchyLevel.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface HierarchyLevel { - /** The name of this hierarchy level. */ - name?: string; - /** The level of this item in the hierarchy. */ - level?: number; - /** The issue types available in this hierarchy level. */ - issueTypeIds?: number[]; - globalHierarchyLevel?: string; -} diff --git a/src/version2/models/historyMetadata.ts b/src/version2/models/historyMetadata.ts deleted file mode 100644 index 49d868d702..0000000000 --- a/src/version2/models/historyMetadata.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { HistoryMetadataParticipant } from './historyMetadataParticipant'; - -/** Details of issue history metadata. */ -export interface HistoryMetadata { - /** The activity described in the history record. */ - activityDescription?: string; - /** The key of the activity described in the history record. */ - activityDescriptionKey?: string; - actor?: HistoryMetadataParticipant; - cause?: HistoryMetadataParticipant; - /** The description of the history record. */ - description?: string; - /** The description key of the history record. */ - descriptionKey?: string; - /** The description of the email address associated the history record. */ - emailDescription?: string; - /** The description key of the email address associated the history record. */ - emailDescriptionKey?: string; - /** Additional arbitrary information about the history record. */ - extraData?: unknown; - generator?: HistoryMetadataParticipant; - /** The type of the history record. */ - type?: string; -} diff --git a/src/version2/models/historyMetadataParticipant.ts b/src/version2/models/historyMetadataParticipant.ts deleted file mode 100644 index 2715e785fb..0000000000 --- a/src/version2/models/historyMetadataParticipant.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** Details of user or system associated with a issue history metadata item. */ -export interface HistoryMetadataParticipant { - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; - /** The display name of the user or system associated with a history record. */ - displayName?: string; - /** The key of the display name of the user or system associated with a history record. */ - displayNameKey?: string; - /** The ID of the user or system associated with a history record. */ - id?: string; - /** The type of the user or system associated with a history record. */ - type?: string; - /** The URL of the user or system associated with a history record. */ - url?: string; -} diff --git a/src/version2/models/icon.ts b/src/version2/models/icon.ts deleted file mode 100644 index 1968bf19ca..0000000000 --- a/src/version2/models/icon.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * An icon. If no icon is defined: - * - * - For a status icon, no status icon displays in Jira. - * - For the remote object icon, the default link icon displays in Jira. - */ -export interface Icon { - /** The URL of the tooltip, used only for a status icon. If not set, the status icon in Jira is not clickable. */ - link?: string; - /** - * The title of the icon. This is used as follows: - * - * For a status icon it is used as a tooltip on the icon. If not set, the status icon doesn't display a tooltip in - * Jira. For the remote object icon it is used in conjunction with the application name to display a tooltip for the - * link's icon. The tooltip takes the format "[application name] icon title". Blank itemsare excluded from the tooltip - * title. If both items are blank, the icon tooltop displays as "Web Link". - */ - title?: string; - /** The URL of an icon that displays at 16x16 pixel in Jira. */ - url16x16?: string; -} diff --git a/src/version2/models/id.ts b/src/version2/models/id.ts deleted file mode 100644 index 3507d539c1..0000000000 --- a/src/version2/models/id.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface Id { - /** - * The ID of the permission scheme to associate with the project. Use the [Get all permission - * schemes](#api-rest-api-2-permissionscheme-get) resource to get a list of permission scheme IDs. - */ - id: number; -} diff --git a/src/version2/models/idOrKey.ts b/src/version2/models/idOrKey.ts deleted file mode 100644 index 1d5fc03ee9..0000000000 --- a/src/version2/models/idOrKey.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface IdOrKey { - /** The ID of the referenced item. */ - id?: number; - /** The key of the referenced item. */ - key?: string; -} diff --git a/src/version2/models/idSearchRequest.ts b/src/version2/models/idSearchRequest.ts deleted file mode 100644 index 4f15da0140..0000000000 --- a/src/version2/models/idSearchRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 596045fb5c..0000000000 --- a/src/version2/models/idSearchResults.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** 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/includedFields.ts b/src/version2/models/includedFields.ts deleted file mode 100644 index 5af83231ee..0000000000 --- a/src/version2/models/includedFields.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface IncludedFields { - actuallyIncluded?: string[]; - excluded?: string[]; - included?: string[]; -} diff --git a/src/version2/models/index.ts b/src/version2/models/index.ts deleted file mode 100644 index 54dc179fe7..0000000000 --- a/src/version2/models/index.ts +++ /dev/null @@ -1,728 +0,0 @@ -export * from './attachmentContent'; -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 './associatedItem'; -export * from './associateFieldConfigurationsWithIssueTypesRequest'; -export * from './associationContextObject'; -export * from './attachment'; -export * from './attachmentArchiveEntry'; -export * from './attachmentArchiveImpl'; -export * from './attachmentArchiveItemReadable'; -export * from './attachmentArchiveMetadataReadable'; -export * from './attachmentMetadata'; -export * from './attachmentSettings'; -export * from './auditRecord'; -export * from './auditRecords'; -export * from './autoCompleteSuggestion'; -export * from './autoCompleteSuggestions'; -export * from './availableDashboardGadget'; -export * from './availableDashboardGadgetsResponse'; -export * from './availableWorkflowConnectRule'; -export * from './availableWorkflowForgeRule'; -export * from './availableWorkflowSystemRule'; -export * from './availableWorkflowTriggers'; -export * from './availableWorkflowTriggerTypes'; -export * from './avatar'; -export * from './avatars'; -export * from './avatarUrls'; -export * from './avatarWithDetails'; -export * from './boardColumnPayload'; -export * from './boardFeaturePayload'; -export * from './boardPayload'; -export * from './boardsPayload'; -export * from './bulkChangelog'; -export * from './bulkChangelogRequest'; -export * from './bulkChangeOwnerDetails'; -export * from './bulkContextualConfiguration'; -export * from './bulkCustomFieldOptionCreateRequest'; -export * from './bulkCustomFieldOptionUpdateRequest'; -export * from './bulkEditShareableEntity'; -export * from './bulkIssue'; -export * from './bulkIssueIsWatching'; -export * from './bulkIssuePropertyUpdateRequest'; -export * from './bulkOperationErrorResult'; -export * from './bulkPermissionGrants'; -export * from './bulkPermissionsRequest'; -export * from './bulkProjectPermissionGrants'; -export * from './bulkProjectPermissions'; -export * from './cardLayout'; -export * from './cardLayoutField'; -export * from './changeDetails'; -export * from './changedValue'; -export * from './changedWorklog'; -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 './conditionGroupPayload'; -export * from './conditionGroupUpdate'; -export * from './configuration'; -export * from './configurationsListParameters'; -export * from './connectCustomFieldValue'; -export * from './connectCustomFieldValues'; -export * from './connectModule'; -export * from './connectModules'; -export * from './connectWorkflowTransitionRule'; -export * from './containerForProjectFeatures'; -export * from './containerForRegisteredWebhooks'; -export * from './containerForWebhookIDs'; -export * from './containerOfWorkflowSchemeAssociations'; -export * from './contextForProjectAndIssueType'; -export * from './contextualConfiguration'; -export * from './convertedJQLQueries'; -export * from './createCrossProjectReleaseRequest'; -export * from './createCustomFieldContext'; -export * from './createCustomFieldRequest'; -export * from './createDateFieldRequest'; -export * from './createdIssue'; -export * from './createdIssues'; -export * from './createExclusionRulesRequest'; -export * from './createIssueSecuritySchemeDetails'; -export * from './createIssueSourceRequest'; -export * from './createNotificationSchemeDetails'; -export * from './createPermissionHolderRequest'; -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'; -export * from './createWorkflowDetails'; -export * from './createWorkflowStatusDetails'; -export * from './createWorkflowTransitionDetails'; -export * from './createWorkflowTransitionRule'; -export * from './createWorkflowTransitionRulesDetails'; -export * from './createWorkflowTransitionScreenDetails'; -export * from './customContextVariable'; -export * from './customFieldConfigurations'; -export * from './customFieldContext'; -export * from './customFieldContextDefaultValue'; -export * from './customFieldContextDefaultValueUpdate'; -export * from './customFieldContextOption'; -export * from './customFieldContextProjectMapping'; -export * from './customFieldContextUpdateDetails'; -export * from './customFieldCreatedContextOptionsList'; -export * from './customFieldDefinitionJson'; -export * from './customFieldOption'; -export * from './customFieldOptionCreate'; -export * from './customFieldOptionUpdate'; -export * from './customFieldPayload'; -export * from './customFieldReplacement'; -export * from './customFieldUpdatedContextOptionsList'; -export * from './customFieldValueUpdate'; -export * from './customFieldValueUpdateDetails'; -export * from './customTemplateRequest'; -export * from './customTemplatesProjectDetails'; -export * from './dashboard'; -export * from './dashboardDetails'; -export * from './dashboardGadget'; -export * from './dashboardGadgetPosition'; -export * from './dashboardGadgetResponse'; -export * from './dashboardGadgetSettings'; -export * from './dashboardGadgetUpdateRequest'; -export * from './dashboardUser'; -export * from './dataClassificationLevels'; -export * from './dataClassificationTag'; -export * from './dateRangeFilter'; -export * from './defaultLevelValue'; -export * from './defaultShareScope'; -export * from './defaultWorkflow'; -export * from './documentVersion'; -export * from './duplicatePlanRequest'; -export * from './enhancedSearchRequest'; -export * from './entityProperty'; -export * from './entityPropertyDetails'; -export * from './error'; -export * from './errorCollection'; -export * from './errors'; -export * from './evaluatedJiraExpression'; -export * from './eventNotification'; -export * from './exportArchivedIssuesTaskProgress'; -export * from './exportArchivedIssuesTaskProgress'; -export * from './failedWebhook'; -export * from './failedWebhooks'; -export * from './field'; -export * from './fieldAssociationsRequest'; -export * from './fieldCapabilityPayload'; -export * from './fieldConfiguration'; -export * from './fieldConfigurationDetails'; -export * from './fieldConfigurationIssueTypeItem'; -export * from './fieldConfigurationItem'; -export * from './fieldConfigurationItemsDetails'; -export * from './fieldConfigurationScheme'; -export * from './fieldConfigurationSchemeProjectAssociation'; -export * from './fieldConfigurationSchemeProjects'; -export * from './fieldConfigurationToIssueTypeMapping'; -export * from './fieldCreateMetadata'; -export * from './fieldDetails'; -export * from './fieldIdentifierObject'; -export * from './fieldLastUsed'; -export * from './fieldLayoutConfiguration'; -export * from './fieldLayoutPayload'; -export * from './fieldLayoutSchemePayload'; -export * from './fieldMetadata'; -export * from './fieldReferenceData'; -export * from './fields'; -export * from './filter'; -export * from './filterDetails'; -export * from './filterSubscription'; -export * from './filterSubscriptionsList'; -export * from './fixVersion'; -export * from './foundGroup'; -export * from './foundGroups'; -export * from './foundUsers'; -export * from './foundUsersAndGroups'; -export * from './fromLayoutPayload'; -export * from './functionReferenceData'; -export * from './getAtlassianTeamResponse'; -export * from './getCrossProjectReleaseResponse'; -export * from './getCustomFieldResponse'; -export * from './getDateFieldResponse'; -export * from './getExclusionRulesResponse'; -export * from './getIssueSourceResponse'; -export * from './getPermissionHolderResponse'; -export * from './getPermissionResponse'; -export * from './getPlanOnlyTeamResponse'; -export * from './getPlanResponseForPage'; -export * from './getSchedulingResponse'; -export * from './getTeamResponseForPage'; -export * from './globalScope'; -export * from './group'; -export * from './groupDetails'; -export * from './groupLabel'; -export * from './groupName'; -export * from './hierarchy'; -export * from './hierarchyLevel'; -export * from './historyMetadata'; -export * from './historyMetadataParticipant'; -export * from './icon'; -export * from './id'; -export * from './idOrKey'; -export * from './idSearchRequest'; -export * from './idSearchResults'; -export * from './includedFields'; -export * from './issue'; -export * from './issueArchivalSync'; -export * from './issueChangeLog'; -export * from './issueChangelogIds'; -export * from './issueCommentListRequest'; -export * from './issueContextVariable'; -export * from './issueCreateMetadata'; -export * from './issueEntityProperties'; -export * from './issueEntityPropertiesForMultiUpdate'; -export * from './issueError'; -export * from './issueEvent'; -export * from './issueFieldOption'; -export * from './issueFieldOptionConfiguration'; -export * from './issueFieldOptionCreate'; -export * from './issueFieldOptionScope'; -export * from './issueFilterForBulkPropertyDelete'; -export * from './issueFilterForBulkPropertySet'; -export * from './issueLayoutItemPayload'; -export * from './issueLayoutPayload'; -export * from './issueLimitReport'; -export * from './issueLimitReportRequest'; -export * from './issueLink'; -export * from './issueLinkType'; -export * from './issueLinkTypes'; -export * from './issueList'; -export * from './issueMatches'; -export * from './issueMatchesForJQL'; -export * from './issuePickerSuggestions'; -export * from './issuePickerSuggestionsIssueType'; -export * from './issuesAndJQLQueries'; -export * from './issueSecurityLevelMember'; -export * from './issueSecuritySchemeToProjectMapping'; -export * from './issuesJqlMetaData'; -export * from './issuesMeta'; -export * from './issuesUpdate'; -export * from './issueTransition'; -export * from './issueTypeCreate'; -export * from './issueTypeDetails'; -export * from './issueTypeHierarchyPayload'; -export * from './issueTypeIds'; -export * from './issueTypeIdsToRemove'; -export * from './issueTypeInfo'; -export * from './issueTypeIssueCreateMetadata'; -export * from './issueTypePayload'; -export * from './issueTypeProjectCreatePayload'; -export * from './issueTypeScheme'; -export * from './issueTypeSchemeDetails'; -export * from './issueTypeSchemeID'; -export * from './issueTypeSchemeMapping'; -export * from './issueTypeSchemePayload'; -export * from './issueTypeSchemeProjectAssociation'; -export * from './issueTypeSchemeProjects'; -export * from './issueTypeSchemeUpdateDetails'; -export * from './issueTypeScreenScheme'; -export * from './issueTypeScreenSchemeDetails'; -export * from './issueTypeScreenSchemeId'; -export * from './issueTypeScreenSchemeItem'; -export * from './issueTypeScreenSchemeMapping'; -export * from './issueTypeScreenSchemeMappingDetails'; -export * from './issueTypeScreenSchemePayload'; -export * from './issueTypeScreenSchemeProjectAssociation'; -export * from './issueTypeScreenSchemesProjects'; -export * from './issueTypeScreenSchemeUpdateDetails'; -export * from './issueTypesWorkflowMapping'; -export * from './issueTypeToContextMapping'; -export * from './issueTypeUpdate'; -export * from './issueTypeWithStatus'; -export * from './issueTypeWorkflowMapping'; -export * from './issueUpdateDetails'; -export * from './issueUpdateMetadata'; -export * from './jexpEvaluateCtxIssues'; -export * from './jexpEvaluateCtxJqlIssues'; -export * from './jExpEvaluateIssuesJqlMetaData'; -export * from './jExpEvaluateIssuesMeta'; -export * from './jExpEvaluateMetaData'; -export * from './jexpIssues'; -export * from './jexpJqlIssues'; -export * from './jiraExpressionAnalysis'; -export * from './jiraExpressionComplexity'; -export * from './jiraExpressionEvalContext'; -export * from './jiraExpressionEvalRequest'; -export * from './jiraExpressionEvaluateContext'; -export * from './jiraExpressionEvaluationMetaData'; -export * from './jiraExpressionEvalUsingEnhancedSearchRequest'; -export * from './jiraExpressionForAnalysis'; -export * from './jiraExpressionResult'; -export * from './jiraExpressionsAnalysis'; -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'; -export * from './jqlQueriesToParse'; -export * from './jqlQueriesToSanitize'; -export * from './jqlQuery'; -export * from './jqlQueryClause'; -export * from './jqlQueryField'; -export * from './jqlQueryFieldEntityProperty'; -export * from './jqlQueryOrderByClause'; -export * from './jqlQueryOrderByClauseElement'; -export * from './jqlQueryToSanitize'; -export * from './jQLQueryWithUnknownUsers'; -export * from './jQLReferenceData'; -export * from './jsonContextVariable'; -export * from './jsonNode'; -export * from './jsonType'; -export * from './license'; -export * from './licensedApplication'; -export * from './licenseMetric'; -export * from './linkedIssue'; -export * from './linkGroup'; -export * from './linkIssueRequestJson'; -export * from './listWrapperCallbackApplicationRole'; -export * from './listWrapperCallbackGroupName'; -export * from './locale'; -export * from './mappingsByIssueTypeOverride'; -export * from './mappingsByWorkflow'; -export * from './moveField'; -export * from './multiIssueEntityProperties'; -export * from './multipleCustomFieldValuesUpdate'; -export * from './multipleCustomFieldValuesUpdateDetails'; -export * from './nestedResponse'; -export * from './newUserDetails'; -export * from './nonWorkingDay'; -export * from './notification'; -export * from './notificationEvent'; -export * from './notificationRecipients'; -export * from './notificationRecipientsRestrictions'; -export * from './notificationScheme'; -export * from './notificationSchemeAndProjectMapping'; -export * from './notificationSchemeAndProjectMappingPage'; -export * from './notificationSchemeEvent'; -export * from './notificationSchemeEventDetails'; -export * from './notificationSchemeEventIDPayload'; -export * from './notificationSchemeEventPayload'; -export * from './notificationSchemeEventTypeId'; -export * from './notificationSchemeId'; -export * from './notificationSchemeNotificationDetails'; -export * from './notificationSchemeNotificationDetailsPayload'; -export * from './notificationSchemePayload'; -export * from './oldToNewSecurityLevelMappings'; -export * from './operationMessage'; -export * from './operations'; -export * from './orderOfCustomFieldOptions'; -export * from './orderOfIssueTypes'; -export * from './pageBulkContextualConfiguration'; -export * from './pageChangelog'; -export * from './pageComment'; -export * from './pageComponentWithIssueCount'; -export * from './pageContextForProjectAndIssueType'; -export * from './pageContextualConfiguration'; -export * from './pageCustomFieldContext'; -export * from './pageCustomFieldContextDefaultValue'; -export * from './pageCustomFieldContextOption'; -export * from './pageCustomFieldContextProjectMapping'; -export * from './pageDashboard'; -export * from './pagedListUserDetailsApplicationUser'; -export * from './pageField'; -export * from './pageFieldConfiguration'; -export * from './pageFieldConfigurationIssueTypeItem'; -export * from './pageFieldConfigurationItem'; -export * from './pageFieldConfigurationScheme'; -export * from './pageFieldConfigurationSchemeProjects'; -export * from './pageFilterDetails'; -export * from './pageGroupDetails'; -export * from './pageIssueFieldOption'; -export * from './pageIssueSecurityLevelMember'; -export * from './pageIssueSecuritySchemeToProjectMapping'; -export * from './pageIssueTypeScheme'; -export * from './pageIssueTypeSchemeMapping'; -export * from './pageIssueTypeSchemeProjects'; -export * from './pageIssueTypeScreenScheme'; -export * from './pageIssueTypeScreenSchemeItem'; -export * from './pageIssueTypeScreenSchemesProjects'; -export * from './pageIssueTypeToContextMapping'; -export * from './pageJqlFunctionPrecomputation'; -export * from './pageNotificationScheme'; -export * from './pageOfChangelogs'; -export * from './pageOfComments'; -export * from './pageOfCreateMetaIssueTypes'; -export * from './pageOfCreateMetaIssueTypeWithField'; -export * from './pageOfDashboards'; -export * from './pageOfStatuses'; -export * from './pageOfWorklogs'; -export * from './pagePriority'; -export * from './pageProject'; -export * from './pageProjectDetails'; -export * from './pageResolution'; -export * from './pageScreen'; -export * from './pageScreenScheme'; -export * from './pageScreenWithTab'; -export * from './pageSecurityLevel'; -export * from './pageSecurityLevelMember'; -export * from './pageSecuritySchemeWithProjects'; -export * from './pageString'; -export * from './pageUiModificationDetails'; -export * from './pageUser'; -export * from './pageUserDetails'; -export * from './pageUserKey'; -export * from './pageVersion'; -export * from './pageWebhook'; -export * from './pageWithCursorGetPlanResponseForPage'; -export * from './pageWithCursorGetTeamResponseForPage'; -export * from './pageWorkflow'; -export * from './pageWorkflowScheme'; -export * from './pageWorkflowTransitionRules'; -export * from './parsedJqlQueries'; -export * from './parsedJqlQuery'; -export * from './permissionDetails'; -export * from './permissionGrant'; -export * from './permissionGrantDTO'; -export * from './permissionGrants'; -export * from './permissionHolder'; -export * from './permissionPayload'; -export * from './permissions'; -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 './prioritySchemeChangesWithoutMappings'; -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 './projectCreateResourceIdentifier'; -export * from './projectCustomTemplateCreateRequest'; -export * from './projectDataPolicies'; -export * from './projectDataPolicy'; -export * from './projectDetails'; -export * from './projectEmailAddress'; -export * from './projectFeature'; -export * from './projectFeatureToggleRequest'; -export * from './projectId'; -export * from './projectIdentifier'; -export * from './projectIdentifiers'; -export * from './projectIds'; -export * from './projectInsight'; -export * from './projectIssueCreateMetadata'; -export * from './projectIssueSecurityLevels'; -export * from './projectIssueTypeHierarchy'; -export * from './projectIssueTypeMapping'; -export * from './projectIssueTypeMappings'; -export * from './projectIssueTypes'; -export * from './projectIssueTypesHierarchyLevel'; -export * from './projectLandingPageInfo'; -export * from './projectPayload'; -export * from './projectPermissions'; -export * from './projectRole'; -export * from './projectRoleActorsUpdate'; -export * from './projectRoleDetails'; -export * from './projectRoleGroup'; -export * from './projectRoleUser'; -export * from './projectScope'; -export * from './projectType'; -export * from './projectUsage'; -export * from './projectUsagePage'; -export * from './projectWithDataPolicy'; -export * from './propertyKey'; -export * from './propertyKeys'; -export * from './publishedWorkflowId'; -export * from './quickFilterPayload'; -export * from './registeredWebhook'; -export * from './remoteIssueLink'; -export * from './remoteIssueLinkIdentifies'; -export * from './remoteIssueLinkRequest'; -export * from './remoteObject'; -export * from './removeOptionFromIssuesResult'; -export * from './reorderIssuePriorities'; -export * from './reorderIssueResolutionsRequest'; -export * from './requiredMappingByIssueType'; -export * from './requiredMappingByWorkflows'; -export * from './resolution'; -export * from './resolutionId'; -export * from './restrictedPermission'; -export * from './richText'; -export * from './roleActor'; -export * from './rolePayload'; -export * from './rolePayload'; -export * from './rolesCapabilityPayload'; -export * from './ruleConfiguration'; -export * from './rulePayload'; -export * from './sanitizedJqlQueries'; -export * from './sanitizedJqlQuery'; -export * from './scope'; -export * from './scopePayload'; -export * from './screen'; -export * from './screenableField'; -export * from './screenableTab'; -export * from './screenDetails'; -export * from './screenPayload'; -export * from './screenScheme'; -export * from './screenSchemeDetails'; -export * from './screenSchemeId'; -export * from './screenSchemePayload'; -export * from './screenTypes'; -export * from './screenWithTab'; -export * from './searchAndReconcileResults'; -export * from './searchAutoComplete'; -export * from './searchRequest'; -export * from './searchResults'; -export * from './securityLevel'; -export * from './securityLevelMember'; -export * from './securityLevelMemberPayload'; -export * from './securityLevelPayload'; -export * from './securityScheme'; -export * from './securitySchemeId'; -export * from './securitySchemeLevel'; -export * from './securitySchemeLevelMember'; -export * from './securitySchemeMembersRequest'; -export * from './securitySchemePayload'; -export * from './securitySchemes'; -export * from './securitySchemeWithProjects'; -export * from './serverInformation'; -export * from './serviceRegistry'; -export * from './serviceRegistryTier'; -export * from './setDefaultLevelsRequest'; -export * from './setDefaultPriorityRequest'; -export * from './setDefaultResolutionRequest'; -export * from './sharePermission'; -export * from './sharePermissionInput'; -export * from './simpleApplicationProperty'; -export * from './simpleErrorCollection'; -export * from './simpleLink'; -export * from './simpleListWrapperApplicationRole'; -export * from './simpleListWrapperGroupName'; -export * from './simpleUsage'; -export * from './status'; -export * from './statusCategory'; -export * from './statusCreate'; -export * from './statusCreateRequest'; -export * from './statusDetails'; -export * from './statusesPerWorkflow'; -export * from './statusLayoutUpdate'; -export * from './statusMapping'; -export * from './statusMappingDTO'; -export * from './statusMetadata'; -export * from './statusMigration'; -export * from './statusPayload'; -export * from './statusProjectIssueTypeUsage'; -export * from './statusProjectIssueTypeUsageDTO'; -export * from './statusProjectIssueTypeUsagePage'; -export * from './statusProjectUsage'; -export * from './statusProjectUsageDTO'; -export * from './statusProjectUsagePage'; -export * from './statusReferenceAndPort'; -export * from './statusScope'; -export * from './statusUpdate'; -export * from './statusUpdateRequest'; -export * from './statusWorkflowUsageDTO'; -export * from './statusWorkflowUsagePage'; -export * from './statusWorkflowUsageWorkflow'; -export * from './suggestedIssue'; -export * from './suggestedMappingsForPrioritiesRequestBean'; -export * from './suggestedMappingsForProjectsRequestBean'; -export * from './suggestedMappingsRequest'; -export * from './swimlanesPayload'; -export * from './systemAvatars'; -export * from './tabMetadata'; -export * from './tabPayload'; -export * from './taskProgressNode'; -export * from './taskProgressObject'; -export * from './taskProgressRemoveOptionFromIssuesResult'; -export * from './timeTrackingConfiguration'; -export * from './timeTrackingDetails'; -export * from './timeTrackingProvider'; -export * from './toLayoutPayload'; -export * from './transition'; -export * from './transitionPayload'; -export * from './transitions'; -export * from './transitionScreenDetails'; -export * from './transitionUpdateDTO'; -export * from './uiModificationContextDetails'; -export * from './uiModificationDetails'; -export * from './uiModificationIdentifiers'; -export * from './unrestrictedUserEmail'; -export * from './updateCustomFieldDetails'; -export * from './updateDefaultProjectClassification'; -export * from './updatedProjectCategory'; -export * from './updateFieldConfigurationSchemeDetails'; -export * from './updateIssueSecurityLevelDetails'; -export * from './updateIssueSecuritySchemeRequest'; -export * from './updateNotificationSchemeDetails'; -export * from './updatePrioritiesInSchemeRequest'; -export * from './updatePriorityDetails'; -export * from './updatePrioritySchemeRequest'; -export * from './updatePrioritySchemeResponse'; -export * from './updateProjectDetails'; -export * from './updateProjectsInSchemeRequest'; -export * from './updateResolutionDetails'; -export * from './updateScreenDetails'; -export * from './updateScreenSchemeDetails'; -export * from './updateScreenTypes'; -export * from './updateUiModificationDetails'; -export * from './updateUserToGroup'; -export * from './user'; -export * from './userAvatarUrls'; -export * from './userContextVariable'; -export * from './userDetails'; -export * from './userKey'; -export * from './userList'; -export * from './userMigration'; -export * from './userNavProperty'; -export * from './userPickerUser'; -export * from './validationOptionsForCreate'; -export * from './validationOptionsForUpdate'; -export * from './version'; -export * from './versionApprover'; -export * from './versionIssueCounts'; -export * from './versionIssuesStatus'; -export * from './versionMove'; -export * from './versionRelatedWork'; -export * from './versionUnresolvedIssuesCount'; -export * from './versionUsageInCustomField'; -export * from './visibility'; -export * from './votes'; -export * from './warningCollection'; -export * from './watchers'; -export * from './webhook'; -export * from './webhookDetails'; -export * from './webhookRegistrationDetails'; -export * from './webhooksExpirationDate'; -export * from './workflow'; -export * from './workflowAssociationStatusMapping'; -export * from './workflowCapabilities'; -export * from './workflowCapabilityPayload'; -export * from './workflowCondition'; -export * from './workflowCreate'; -export * from './workflowCreateRequest'; -export * from './workflowElementReference'; -export * from './workflowId'; -export * from './workflowLayout'; -export * from './workflowMetadataAndIssueTypeRestModel'; -export * from './workflowMetadataRestModel'; -export * from './workflowOperations'; -export * from './workflowPayload'; -export * from './workflowProjectIssueTypeUsage'; -export * from './workflowProjectIssueTypeUsageDTO'; -export * from './workflowProjectIssueTypeUsagePage'; -export * from './workflowProjectUsageDTO'; -export * from './workflowRead'; -export * from './workflowReferenceStatus'; -export * from './workflowRuleConfiguration'; -export * from './workflowRules'; -export * from './workflowRulesSearch'; -export * from './workflowRulesSearchDetails'; -export * from './workflowScheme'; -export * from './workflowSchemeAssociation'; -export * from './workflowSchemeAssociations'; -export * from './workflowSchemeIdName'; -export * from './workflowSchemePayload'; -export * from './workflowSchemeProjectAssociation'; -export * from './workflowSchemeProjectUsage'; -export * from './workflowSchemeReadRequest'; -export * from './workflowSchemeReadResponse'; -export * from './workflowSchemeUpdateRequest'; -export * from './workflowSchemeUpdateRequiredMappingsRequest'; -export * from './workflowSchemeUpdateRequiredMappingsResponse'; -export * from './workflowSchemeUsage'; -export * from './workflowSchemeUsageDTO'; -export * from './workflowSchemeUsagePage'; -export * from './workflowScope'; -export * from './workflowSearchResponse'; -export * from './workflowStatus'; -export * from './workflowStatusAndPort'; -export * from './workflowStatusLayout'; -export * from './workflowStatusLayoutPayload'; -export * from './workflowStatusPayload'; -export * from './workflowStatusProperties'; -export * from './workflowStatusUpdate'; -export * from './workflowsWithTransitionRulesDetails'; -export * from './workflowTransition'; -export * from './workflowTransitionProperty'; -export * from './workflowTransitionRule'; -export * from './workflowTransitionRules'; -export * from './workflowTransitionRulesDetails'; -export * from './workflowTransitionRulesUpdate'; -export * from './workflowTransitionRulesUpdateErrorDetails'; -export * from './workflowTransitionRulesUpdateErrors'; -export * from './workflowTransitions'; -export * from './workflowTrigger'; -export * from './workflowUpdate'; -export * from './workflowUpdateRequest'; -export * from './workflowValidationError'; -export * from './workflowValidationErrorList'; -export * from './workingDaysConfig'; -export * from './worklog'; -export * from './worklogIdsRequest'; -export * from './worklogsMoveRequest'; -export * from './workspaceDataPolicy'; diff --git a/src/version2/models/issue.ts b/src/version2/models/issue.ts deleted file mode 100644 index bd29b34849..0000000000 --- a/src/version2/models/issue.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { Fields } from './fields'; -import type { IncludedFields } from './includedFields'; -import type { IssueTransition } from './issueTransition'; -import type { IssueUpdateMetadata } from './issueUpdateMetadata'; -import type { Operations } from './operations'; -import type { PageOfChangelogs } from './pageOfChangelogs'; - -/** Details about an issue. */ -export interface Issue { - /** Expand options that include additional issue details in the response. */ - expand?: string; - /** The ID of the issue. */ - id: string; - /** The URL of the issue details. */ - self?: string; - /** The key of the issue. */ - key: string; - /** The rendered value of each field present on the issue. */ - renderedFields?: Fields; - /** Details of the issue properties identified in the request. */ - properties?: unknown; - /** The ID and name of each field present on the issue. */ - names?: Record; - /** The schema describing each field present on the issue. */ - schema?: unknown; - /** The transitions that can be performed on the issue. */ - transitions?: IssueTransition[]; - operations?: Operations; - editmeta?: IssueUpdateMetadata; - changelog?: PageOfChangelogs; - /** The versions of each field on the issue. */ - versionedRepresentations?: unknown; - fieldsToInclude?: IncludedFields; - fields: Fields; -} diff --git a/src/version2/models/issueArchivalSync.ts b/src/version2/models/issueArchivalSync.ts deleted file mode 100644 index 5a5d2bd2b4..0000000000 --- a/src/version2/models/issueArchivalSync.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Errors } from './errors'; - -/** Number of archived/unarchived issues and list of errors that occurred during the action, if any. */ -export interface IssueArchivalSync { - errors?: Errors; - numberOfIssuesUpdated?: number; -} diff --git a/src/version2/models/issueChangeLog.ts b/src/version2/models/issueChangeLog.ts deleted file mode 100644 index 5d5dfc324e..0000000000 --- a/src/version2/models/issueChangeLog.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { 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/issueChangelogIds.ts b/src/version2/models/issueChangelogIds.ts deleted file mode 100644 index 471d9adaae..0000000000 --- a/src/version2/models/issueChangelogIds.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** A list of changelog IDs. */ -export interface IssueChangelogIds { - /** The list of changelog IDs. */ - changelogIds: number[]; -} diff --git a/src/version2/models/issueCommentListRequest.ts b/src/version2/models/issueCommentListRequest.ts deleted file mode 100644 index 3a3aae0cd3..0000000000 --- a/src/version2/models/issueCommentListRequest.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface IssueCommentListRequest { - /** The list of comment IDs. A maximum of 1000 IDs can be specified. */ - ids: number[]; -} diff --git a/src/version2/models/issueContextVariable.ts b/src/version2/models/issueContextVariable.ts deleted file mode 100644 index 5307834f70..0000000000 --- a/src/version2/models/issueContextVariable.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface IssueContextVariable { - /** The issue ID. */ - id?: number; - /** The issue key. */ - key?: string; - /** Type of custom context variable. */ - type: string; -} diff --git a/src/version2/models/issueCreateMetadata.ts b/src/version2/models/issueCreateMetadata.ts deleted file mode 100644 index b6fa646922..0000000000 --- a/src/version2/models/issueCreateMetadata.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ProjectIssueCreateMetadata } from './projectIssueCreateMetadata'; - -/** The wrapper for the issue creation metadata for a list of projects. */ -export interface IssueCreateMetadata { - /** Expand options that include additional project details in the response. */ - expand?: string; - /** List of projects and their issue creation metadata. */ - projects?: ProjectIssueCreateMetadata[]; -} diff --git a/src/version2/models/issueEntityProperties.ts b/src/version2/models/issueEntityProperties.ts deleted file mode 100644 index 4c5b4e9b80..0000000000 --- a/src/version2/models/issueEntityProperties.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Lists of issues and entity properties. See [Entity - * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. - */ -export interface IssueEntityProperties { - /** A list of entity property IDs. */ - entitiesIds?: number[]; - /** A list of entity property keys and values. */ - properties?: unknown; -} diff --git a/src/version2/models/issueEntityPropertiesForMultiUpdate.ts b/src/version2/models/issueEntityPropertiesForMultiUpdate.ts deleted file mode 100644 index 470792d02a..0000000000 --- a/src/version2/models/issueEntityPropertiesForMultiUpdate.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * An issue ID with entity property values. See [Entity - * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. - */ -export interface IssueEntityPropertiesForMultiUpdate { - /** The ID of the issue. */ - issueID?: number; - /** Entity properties to set on the issue. The maximum length of an issue property value is 32768 characters. */ - properties?: unknown; -} diff --git a/src/version2/models/issueError.ts b/src/version2/models/issueError.ts deleted file mode 100644 index e48a85799f..0000000000 --- a/src/version2/models/issueError.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** 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/issueEvent.ts b/src/version2/models/issueEvent.ts deleted file mode 100644 index b2154144ae..0000000000 --- a/src/version2/models/issueEvent.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details about an issue event. */ -export interface IssueEvent { - /** The ID of the event. */ - id: number; - /** The name of the event. */ - name: string; -} diff --git a/src/version2/models/issueFieldOption.ts b/src/version2/models/issueFieldOption.ts deleted file mode 100644 index 825e1a5469..0000000000 --- a/src/version2/models/issueFieldOption.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration'; - -/** Details of the options for a select list issue field. */ -export interface IssueFieldOption { - config?: IssueFieldOptionConfiguration; - /** The unique identifier for the option. This is only unique within the select field's set of options. */ - id: number; - /** - * The properties of the object, as arbitrary key-value pairs. These properties can be searched using JQL, if the - * extractions (see [Issue Field Option Property - * Index](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/)) are defined - * in the descriptor for the issue field module. - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - properties?: Record; - /** The option's name, which is displayed in Jira. */ - value: string; -} diff --git a/src/version2/models/issueFieldOptionConfiguration.ts b/src/version2/models/issueFieldOptionConfiguration.ts deleted file mode 100644 index 7bea5a6ea1..0000000000 --- a/src/version2/models/issueFieldOptionConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueFieldOptionScope } from './issueFieldOptionScope'; - -/** Details of the projects the option is available in. */ -export interface IssueFieldOptionConfiguration { - scope?: IssueFieldOptionScope; -} diff --git a/src/version2/models/issueFieldOptionCreate.ts b/src/version2/models/issueFieldOptionCreate.ts deleted file mode 100644 index c7ce3f73b3..0000000000 --- a/src/version2/models/issueFieldOptionCreate.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration'; - -export interface IssueFieldOptionCreate { - config?: IssueFieldOptionConfiguration; - /** - * The properties of the option as arbitrary key-value pairs. These properties can be searched using JQL, if the - * extractions (see https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/) - * are defined in the descriptor for the issue field module. - */ - properties?: unknown; - /** The option's name, which is displayed in Jira. */ - value: string; -} diff --git a/src/version2/models/issueFieldOptionScope.ts b/src/version2/models/issueFieldOptionScope.ts deleted file mode 100644 index 7dbb09575c..0000000000 --- a/src/version2/models/issueFieldOptionScope.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { GlobalScope } from './globalScope'; -import type { ProjectScope } from './projectScope'; - -export interface IssueFieldOptionScope { - global?: GlobalScope; - /** - * Defines the projects in which the option is available and the behavior of the option within each project. Specify - * one object per project. The behavior of the option in a project context overrides the behavior in the global - * context. - */ - projects2?: ProjectScope[]; -} diff --git a/src/version2/models/issueFilterForBulkPropertyDelete.ts b/src/version2/models/issueFilterForBulkPropertyDelete.ts deleted file mode 100644 index dcc7abca91..0000000000 --- a/src/version2/models/issueFilterForBulkPropertyDelete.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** Bulk operation filter details. */ -export interface IssueFilterForBulkPropertyDelete { - /** The value of properties to perform the bulk operation on. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - currentValue?: any; - /** List of issues to perform the bulk delete operation on. */ - entityIds?: number[]; -} diff --git a/src/version2/models/issueFilterForBulkPropertySet.ts b/src/version2/models/issueFilterForBulkPropertySet.ts deleted file mode 100644 index 17fda9aa83..0000000000 --- a/src/version2/models/issueFilterForBulkPropertySet.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** Bulk operation filter details. */ -export interface IssueFilterForBulkPropertySet { - /** The value of properties to perform the bulk operation on. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - currentValue?: any; - /** List of issues to perform the bulk operation on. */ - entityIds?: number[]; - /** Whether the bulk operation occurs only when the property is present on or absent from an issue. */ - hasProperty?: boolean; -} diff --git a/src/version2/models/issueLayoutItemPayload.ts b/src/version2/models/issueLayoutItemPayload.ts deleted file mode 100644 index e13282c17a..0000000000 --- a/src/version2/models/issueLayoutItemPayload.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** Defines the payload to configure the issue layout item for a project. */ -export interface IssueLayoutItemPayload { - itemKey?: ProjectCreateResourceIdentifier; - /** The item section type */ - sectionType?: 'content' | 'primaryContext' | 'secondaryContext' | string; - /** The item type. Currently only support FIELD */ - type?: 'FIELD' | string; -} diff --git a/src/version2/models/issueLayoutPayload.ts b/src/version2/models/issueLayoutPayload.ts deleted file mode 100644 index 52c52ce562..0000000000 --- a/src/version2/models/issueLayoutPayload.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; -import type { IssueLayoutItemPayload } from './issueLayoutItemPayload'; - -/** Defines the payload to configure the issue layouts for a project. */ -export interface IssueLayoutPayload { - containerId?: ProjectCreateResourceIdentifier; - /** The issue layout type */ - issueLayoutType?: 'ISSUE_VIEW' | 'ISSUE_CREATE' | 'REQUEST_FORM' | string; - /** The configuration of items in the issue layout */ - items?: IssueLayoutItemPayload[]; - pcri?: ProjectCreateResourceIdentifier; -} diff --git a/src/version2/models/issueLimitReport.ts b/src/version2/models/issueLimitReport.ts deleted file mode 100644 index 9a9068630b..0000000000 --- a/src/version2/models/issueLimitReport.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface IssueLimitReport { - /** A list of ids of issues approaching the limit and their field count */ - issuesApproachingLimit?: unknown; - /** A list of ids of issues breaching the limit and their field count */ - issuesBreachingLimit?: unknown; - /** The fields and their defined limits */ - limits?: unknown; -} diff --git a/src/version2/models/issueLimitReportRequest.ts b/src/version2/models/issueLimitReportRequest.ts deleted file mode 100644 index 0f3201b454..0000000000 --- a/src/version2/models/issueLimitReportRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -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?: unknown; -} diff --git a/src/version2/models/issueLink.ts b/src/version2/models/issueLink.ts deleted file mode 100644 index 30fc37173c..0000000000 --- a/src/version2/models/issueLink.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { IssueLinkType } from './issueLinkType'; -import type { LinkedIssue } from './linkedIssue'; - -/** Details of a link between issues. */ -export interface IssueLink { - /** The ID of the issue link. */ - id?: string; - inwardIssue?: LinkedIssue; - outwardIssue?: LinkedIssue; - /** The URL of the issue link. */ - self?: string; - type?: IssueLinkType; -} diff --git a/src/version2/models/issueLinkType.ts b/src/version2/models/issueLinkType.ts deleted file mode 100644 index 7f69fb1307..0000000000 --- a/src/version2/models/issueLinkType.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This object is used as follows:* - * - * - In the [issueLink](#api-rest-api-2-issueLink-post) resource it defines and reports on the type of link between the - * issues. Find a list of issue link types with [Get issue link types](#api-rest-api-2-issueLinkType-get). - * - In the [issueLinkType](#api-rest-api-2-issueLinkType-post) resource it defines and reports on issue link types. - */ -export interface IssueLinkType { - /** - * The ID of the issue link type and is used as follows: - * - * In the [issueLink](#api-rest-api-2-issueLink-post) resource it is the type of issue link. Required on create when - * `name` isn't provided. Otherwise, read only. In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource - * it is read only. - */ - id?: string; - /** - * The description of the issue link type inward link and is used as follows: - * - * In the [issueLink](#api-rest-api-2-issueLink-post) resource it is read only. In the [ - * issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is required on create and optional on update. - * Otherwise, read only. - */ - inward?: string; - /** - * The name of the issue link type and is used as follows: - * - * In the [issueLink](#api-rest-api-2-issueLink-post) resource it is the type of issue link. Required on create when - * `id` isn't provided. Otherwise, read only. In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it - * is required on create and optional on update. Otherwise, read only. - */ - name?: string; - /** - * The description of the issue link type outward link and is used as follows: - * - * In the [issueLink](#api-rest-api-2-issueLink-post) resource it is read only. In the [ - * issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is required on create and optional on update. - * Otherwise, read only. - */ - outward?: string; - /** The URL of the issue link type. Read only. */ - self?: string; -} diff --git a/src/version2/models/issueLinkTypes.ts b/src/version2/models/issueLinkTypes.ts deleted file mode 100644 index b5bb438f0a..0000000000 --- a/src/version2/models/issueLinkTypes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IssueLinkType } from './issueLinkType'; - -/** A list of issue link type beans. */ -export interface IssueLinkTypes { - /** The issue link type bean. */ - issueLinkTypes?: IssueLinkType[]; -} diff --git a/src/version2/models/issueList.ts b/src/version2/models/issueList.ts deleted file mode 100644 index 1aba1e3488..0000000000 --- a/src/version2/models/issueList.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** A list of issue IDs. */ -export interface IssueList { - /** The list of issue IDs. */ - issueIds: string[]; -} diff --git a/src/version2/models/issueMatches.ts b/src/version2/models/issueMatches.ts deleted file mode 100644 index 4eaad8bc95..0000000000 --- a/src/version2/models/issueMatches.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueMatchesForJQL } from './issueMatchesForJQL'; - -/** A list of matched issues or errors for each JQL query, in the order the JQL queries were passed. */ -export interface IssueMatches { - matches: IssueMatchesForJQL[]; -} diff --git a/src/version2/models/issueMatchesForJQL.ts b/src/version2/models/issueMatchesForJQL.ts deleted file mode 100644 index 3e641200c8..0000000000 --- a/src/version2/models/issueMatchesForJQL.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** A list of the issues matched to a JQL query or details of errors encountered during matching. */ -export interface IssueMatchesForJQL { - /** A list of errors. */ - errors: string[]; - /** A list of issue IDs. */ - matchedIssues: number[]; -} diff --git a/src/version2/models/issuePickerSuggestions.ts b/src/version2/models/issuePickerSuggestions.ts deleted file mode 100644 index 006d11bc54..0000000000 --- a/src/version2/models/issuePickerSuggestions.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IssuePickerSuggestionsIssueType } from './issuePickerSuggestionsIssueType'; - -/** A list of issues suggested for use in auto-completion. */ -export interface IssuePickerSuggestions { - /** A list of issues for an issue type suggested for use in auto-completion. */ - sections?: IssuePickerSuggestionsIssueType[]; -} diff --git a/src/version2/models/issuePickerSuggestionsIssueType.ts b/src/version2/models/issuePickerSuggestionsIssueType.ts deleted file mode 100644 index 235003509b..0000000000 --- a/src/version2/models/issuePickerSuggestionsIssueType.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { SuggestedIssue } from './suggestedIssue'; - -/** A type of issue suggested for use in auto-completion. */ -export interface IssuePickerSuggestionsIssueType { - /** The ID of the type of issues suggested for use in auto-completion. */ - id?: string; - /** A list of issues suggested for use in auto-completion. */ - issues?: SuggestedIssue[]; - /** The label of the type of issues suggested for use in auto-completion. */ - label?: string; - /** If no issue suggestions are found, returns a message indicating no suggestions were found, */ - msg?: string; - /** If issue suggestions are found, returns a message indicating the number of issues suggestions found and returned. */ - sub?: string; -} diff --git a/src/version2/models/issueSecurityLevelMember.ts b/src/version2/models/issueSecurityLevelMember.ts deleted file mode 100644 index 0519fd5334..0000000000 --- a/src/version2/models/issueSecurityLevelMember.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { PermissionHolder } from './permissionHolder'; - -/** Issue security level member. */ -export interface IssueSecurityLevelMember { - holder?: PermissionHolder; - /** The ID of the issue security level member. */ - id: number; - /** The ID of the issue security level. */ - issueSecurityLevelId: number; -} diff --git a/src/version2/models/issueSecuritySchemeToProjectMapping.ts b/src/version2/models/issueSecuritySchemeToProjectMapping.ts deleted file mode 100644 index e6c92d5876..0000000000 --- a/src/version2/models/issueSecuritySchemeToProjectMapping.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Details about a project using security scheme mapping. */ -export interface IssueSecuritySchemeToProjectMapping { - issueSecuritySchemeId: string; - projectId: string; -} diff --git a/src/version2/models/issueTransition.ts b/src/version2/models/issueTransition.ts deleted file mode 100644 index f400abcd3b..0000000000 --- a/src/version2/models/issueTransition.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { StatusDetails } from './statusDetails'; -import type { TabMetadata } from './tabMetadata'; - -/** Details of an issue transition. */ -export interface IssueTransition { - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** The name of the issue transition. */ - name?: string; - to?: StatusDetails; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: unknown; - /** Details of the tabs associated with the issue transition screen and the fields within these tabs. */ - tabs?: TabMetadata[]; - /** Expand options that include additional transition details in the response. */ - expand?: string; - looped?: boolean; -} diff --git a/src/version2/models/issueTypeCreate.ts b/src/version2/models/issueTypeCreate.ts deleted file mode 100644 index 46e78dee25..0000000000 --- a/src/version2/models/issueTypeCreate.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface IssueTypeCreate { - /** The description of the issue type. */ - description?: string; - /** - * The hierarchy level of the issue type. Use: - * - * `-1` for Subtask. `0` for Base. - * - * Defaults to `0`. - */ - hierarchyLevel?: number; - /** The unique name for the issue type. The maximum length is 60 characters. */ - name: string; -} diff --git a/src/version2/models/issueTypeDetails.ts b/src/version2/models/issueTypeDetails.ts deleted file mode 100644 index 10bcbf3a5c..0000000000 --- a/src/version2/models/issueTypeDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Scope } from './scope'; - -/** Details about an issue type. */ -export interface IssueTypeDetails { - /** The ID of the issue type's avatar. */ - avatarId?: number; - /** The description of the issue type. */ - description?: string; - /** Unique ID for next-gen projects. */ - entityId?: string; - /** Hierarchy level of the issue type. */ - hierarchyLevel?: number; - /** The URL of the issue type's avatar. */ - iconUrl?: string; - /** The ID of the issue type. */ - id?: string; - /** The name of the issue type. */ - name?: string; - scope?: Scope; - /** The URL of these issue type details. */ - self?: string; - /** Whether this issue type is used to create subtasks. */ - subtask?: boolean; -} diff --git a/src/version2/models/issueTypeHierarchyPayload.ts b/src/version2/models/issueTypeHierarchyPayload.ts deleted file mode 100644 index 0d0b33f95b..0000000000 --- a/src/version2/models/issueTypeHierarchyPayload.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** The payload for creating an issue type hierarchy */ -export interface IssueTypeHierarchyPayload { - /** The hierarchy level of the issue type. 0, 1, 2, 3 .. n; Negative values for subtasks */ - hierarchyLevel?: number; - /** The name of the issue type */ - name?: string; - /** - * The conflict strategy to use when the issue type already exists. FAIL - Fail execution, this always needs to be - * unique; USE - Use the existing entity and ignore new entity parameters - */ - onConflict?: 'FAIL' | 'USE' | 'NEW' | string; - pcri?: ProjectCreateResourceIdentifier; -} diff --git a/src/version2/models/issueTypeIds.ts b/src/version2/models/issueTypeIds.ts deleted file mode 100644 index 3964ff2dc7..0000000000 --- a/src/version2/models/issueTypeIds.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The list of issue type IDs. */ -export interface IssueTypeIds { - /** The list of issue type IDs. */ - issueTypeIds: string[]; -} diff --git a/src/version2/models/issueTypeIdsToRemove.ts b/src/version2/models/issueTypeIdsToRemove.ts deleted file mode 100644 index 9941deef87..0000000000 --- a/src/version2/models/issueTypeIdsToRemove.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** The list of issue type IDs to be removed from the field configuration scheme. */ -export interface IssueTypeIdsToRemove { - /** - * The list of issue type IDs. Must contain unique values not longer than 255 characters and not be empty. Maximum of - * 100 IDs. - */ - issueTypeIds: string[]; -} diff --git a/src/version2/models/issueTypeInfo.ts b/src/version2/models/issueTypeInfo.ts deleted file mode 100644 index 6d444d9020..0000000000 --- a/src/version2/models/issueTypeInfo.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of an issue type. */ -export interface IssueTypeInfo { - /** The avatar of the issue type. */ - avatarId?: number; - /** The ID of the issue type. */ - id?: number; - /** The name of the issue type. */ - name?: string; -} diff --git a/src/version2/models/issueTypeIssueCreateMetadata.ts b/src/version2/models/issueTypeIssueCreateMetadata.ts deleted file mode 100644 index 23c1ad1208..0000000000 --- a/src/version2/models/issueTypeIssueCreateMetadata.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Scope } from './scope'; - -/** Details of the issue creation metadata for an issue type. */ -export interface IssueTypeIssueCreateMetadata { - /** The ID of the issue type's avatar. */ - avatarId?: number; - /** The description of the issue type. */ - description?: string; - /** Unique ID for next-gen projects. */ - entityId?: string; - /** Expand options that include additional issue type metadata details in the response. */ - expand?: string; - /** List of the fields available when creating an issue for the issue type. */ - fields?: unknown; - /** Hierarchy level of the issue type. */ - hierarchyLevel?: number; - /** The URL of the issue type's avatar. */ - iconUrl?: string; - /** The ID of the issue type. */ - id?: string; - /** The name of the issue type. */ - name?: string; - scope?: Scope; - /** The URL of these issue type details. */ - self?: string; - /** Whether this issue type is used to create subtasks. */ - subtask?: boolean; -} diff --git a/src/version2/models/issueTypePayload.ts b/src/version2/models/issueTypePayload.ts deleted file mode 100644 index b9e9cb1fe2..0000000000 --- a/src/version2/models/issueTypePayload.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** The payload for creating an issue type */ -export interface IssueTypePayload { - /** - * The avatar ID of the issue type. Go to - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-avatars/#api-rest-api-3-avatar-type-system-get - * to choose an avatarId existing in Jira - */ - avatarId?: number; - /** The description of the issue type */ - description?: string; - /** The hierarchy level of the issue type. 0, 1, 2, 3 .. n; Negative values for subtasks */ - hierarchyLevel?: number; - /** The name of the issue type */ - name?: string; - /** - * The conflict strategy to use when the issue type already exists. FAIL - Fail execution, this always needs to be - * unique; USE - Use the existing entity and ignore new entity parameters - */ - onConflict?: 'FAIL' | 'USE' | 'NEW' | string; - pcri?: ProjectCreateResourceIdentifier; -} diff --git a/src/version2/models/issueTypeProjectCreatePayload.ts b/src/version2/models/issueTypeProjectCreatePayload.ts deleted file mode 100644 index 67f9f2637e..0000000000 --- a/src/version2/models/issueTypeProjectCreatePayload.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { IssueTypeHierarchyPayload } from './issueTypeHierarchyPayload'; -import type { IssueTypeSchemePayload } from './issueTypeSchemePayload'; -import type { IssueTypePayload } from './issueTypePayload'; - -/** The payload for creating issue types in a project */ -export interface IssueTypeProjectCreatePayload { - /** - * Defines the issue type hierarhy to be created and used during this project creation. This will only add new levels - * if there isn't an existing level - */ - issueTypeHierarchy?: IssueTypeHierarchyPayload[]; - issueTypeScheme?: IssueTypeSchemePayload; - /** - * Only needed if you want to create issue types, you can otherwise use the ids of issue types in the scheme - * configuration - */ - issueTypes?: IssueTypePayload[]; -} diff --git a/src/version2/models/issueTypeScheme.ts b/src/version2/models/issueTypeScheme.ts deleted file mode 100644 index 38e75a2f97..0000000000 --- a/src/version2/models/issueTypeScheme.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** Details of an issue type scheme. */ -export interface IssueTypeScheme { - /** The ID of the default issue type of the issue type scheme. */ - defaultIssueTypeId?: string; - /** The description of the issue type scheme. */ - description?: string; - /** The ID of the issue type scheme. */ - id: string; - /** Whether the issue type scheme is the default. */ - isDefault?: boolean; - /** The name of the issue type scheme. */ - name: string; -} diff --git a/src/version2/models/issueTypeSchemeDetails.ts b/src/version2/models/issueTypeSchemeDetails.ts deleted file mode 100644 index d7daa0c278..0000000000 --- a/src/version2/models/issueTypeSchemeDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** Details of an issue type scheme and its associated issue types. */ -export interface IssueTypeSchemeDetails { - /** The ID of the default issue type of the issue type scheme. This ID must be included in `issueTypeIds`. */ - defaultIssueTypeId?: string; - /** The description of the issue type scheme. The maximum length is 4000 characters. */ - description?: string; - /** The list of issue types IDs of the issue type scheme. At least one standard issue type ID is required. */ - issueTypeIds: string[]; - /** The name of the issue type scheme. The name must be unique. The maximum length is 255 characters. */ - name: string; -} diff --git a/src/version2/models/issueTypeSchemeID.ts b/src/version2/models/issueTypeSchemeID.ts deleted file mode 100644 index 7c326668dc..0000000000 --- a/src/version2/models/issueTypeSchemeID.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The ID of an issue type scheme. */ -export interface IssueTypeSchemeID { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: string; -} diff --git a/src/version2/models/issueTypeSchemeMapping.ts b/src/version2/models/issueTypeSchemeMapping.ts deleted file mode 100644 index e5cff525b9..0000000000 --- a/src/version2/models/issueTypeSchemeMapping.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Issue type scheme item. */ -export interface IssueTypeSchemeMapping { - /** The ID of the issue type. */ - issueTypeId: string; - /** The ID of the issue type scheme. */ - issueTypeSchemeId: string; -} diff --git a/src/version2/models/issueTypeSchemePayload.ts b/src/version2/models/issueTypeSchemePayload.ts deleted file mode 100644 index 7a4dc0d69b..0000000000 --- a/src/version2/models/issueTypeSchemePayload.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** The payload for creating issue type schemes */ -export interface IssueTypeSchemePayload { - defaultIssueTypeId?: ProjectCreateResourceIdentifier; - /** The description of the issue type scheme */ - description?: string; - /** The issue type IDs for the issue type scheme */ - issueTypeIds?: ProjectCreateResourceIdentifier[]; - /** The name of the issue type scheme */ - name?: string; - pcri?: ProjectCreateResourceIdentifier; -} diff --git a/src/version2/models/issueTypeSchemeProjectAssociation.ts b/src/version2/models/issueTypeSchemeProjectAssociation.ts deleted file mode 100644 index 0ddc0c46c0..0000000000 --- a/src/version2/models/issueTypeSchemeProjectAssociation.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of the association between an issue type scheme and project. */ -export interface IssueTypeSchemeProjectAssociation { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: string; - /** The ID of the project. */ - projectId: string; -} diff --git a/src/version2/models/issueTypeSchemeProjects.ts b/src/version2/models/issueTypeSchemeProjects.ts deleted file mode 100644 index 544c33e46e..0000000000 --- a/src/version2/models/issueTypeSchemeProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypeScheme } from './issueTypeScheme'; - -/** Issue type scheme with a list of the projects that use it. */ -export interface IssueTypeSchemeProjects { - issueTypeScheme?: IssueTypeScheme; - /** The IDs of the projects using the issue type scheme. */ - projectIds: string[]; -} diff --git a/src/version2/models/issueTypeSchemeUpdateDetails.ts b/src/version2/models/issueTypeSchemeUpdateDetails.ts deleted file mode 100644 index 4ea8882272..0000000000 --- a/src/version2/models/issueTypeSchemeUpdateDetails.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of the name, description, and default issue type for an issue type scheme. */ -export interface IssueTypeSchemeUpdateDetails { - /** The ID of the default issue type of the issue type scheme. */ - defaultIssueTypeId?: string; - /** The description of the issue type scheme. The maximum length is 4000 characters. */ - description?: string; - /** The name of the issue type scheme. The name must be unique. The maximum length is 255 characters. */ - name?: string; -} diff --git a/src/version2/models/issueTypeScreenScheme.ts b/src/version2/models/issueTypeScreenScheme.ts deleted file mode 100644 index 63be401961..0000000000 --- a/src/version2/models/issueTypeScreenScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of an issue type screen scheme. */ -export interface IssueTypeScreenScheme { - /** The description of the issue type screen scheme. */ - description?: string; - /** The ID of the issue type screen scheme. */ - id: string; - /** The name of the issue type screen scheme. */ - name: string; -} diff --git a/src/version2/models/issueTypeScreenSchemeDetails.ts b/src/version2/models/issueTypeScreenSchemeDetails.ts deleted file mode 100644 index e37db75811..0000000000 --- a/src/version2/models/issueTypeScreenSchemeDetails.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping'; - -/** The details of an issue type screen scheme. */ -export interface IssueTypeScreenSchemeDetails { - /** The description of the issue type screen scheme. The maximum length is 255 characters. */ - description?: string; - /** - * The IDs of the screen schemes for the issue type IDs and _default_. A _default_ entry is required to create an - * issue type screen scheme, it defines the mapping for all issue types without a screen scheme. - */ - issueTypeMappings: IssueTypeScreenSchemeMapping[]; - /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ - name: string; -} diff --git a/src/version2/models/issueTypeScreenSchemeId.ts b/src/version2/models/issueTypeScreenSchemeId.ts deleted file mode 100644 index a3bd2ba4af..0000000000 --- a/src/version2/models/issueTypeScreenSchemeId.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The ID of an issue type screen scheme. */ -export interface IssueTypeScreenSchemeId { - /** The ID of the issue type screen scheme. */ - id: string; -} diff --git a/src/version2/models/issueTypeScreenSchemeItem.ts b/src/version2/models/issueTypeScreenSchemeItem.ts deleted file mode 100644 index 0af5e69f69..0000000000 --- a/src/version2/models/issueTypeScreenSchemeItem.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** The screen scheme for an issue type. */ -export interface IssueTypeScreenSchemeItem { - /** - * The ID of the issue type or _default_. Only issue types used in classic projects are accepted. When creating an - * issue screen scheme, an entry for _default_ must be provided and defines the mapping for all issue types without a - * screen scheme. Otherwise, a _default_ entry can't be provided. - */ - issueTypeId: string; - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; - /** The ID of the screen scheme. */ - screenSchemeId: string; -} diff --git a/src/version2/models/issueTypeScreenSchemeMapping.ts b/src/version2/models/issueTypeScreenSchemeMapping.ts deleted file mode 100644 index 04779486a6..0000000000 --- a/src/version2/models/issueTypeScreenSchemeMapping.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** The IDs of the screen schemes for the issue type IDs. */ -export interface IssueTypeScreenSchemeMapping { - /** - * The ID of the issue type or _default_. Only issue types used in classic projects are accepted. An entry for - * _default_ must be provided and defines the mapping for all issue types without a screen scheme. - */ - issueTypeId: string; - /** The ID of the screen scheme. Only screen schemes used in classic projects are accepted. */ - screenSchemeId: string; -} diff --git a/src/version2/models/issueTypeScreenSchemeMappingDetails.ts b/src/version2/models/issueTypeScreenSchemeMappingDetails.ts deleted file mode 100644 index 4d9e0c01ea..0000000000 --- a/src/version2/models/issueTypeScreenSchemeMappingDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping'; - -/** A list of issue type screen scheme mappings. */ -export interface IssueTypeScreenSchemeMappingDetails { - /** - * The list of issue type to screen scheme mappings. A _default_ entry cannot be specified because a default entry is - * added when an issue type screen scheme is created. - */ - issueTypeMappings: IssueTypeScreenSchemeMapping[]; -} diff --git a/src/version2/models/issueTypeScreenSchemePayload.ts b/src/version2/models/issueTypeScreenSchemePayload.ts deleted file mode 100644 index ee456f2174..0000000000 --- a/src/version2/models/issueTypeScreenSchemePayload.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** - * Defines the payload for the issue type screen schemes. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-type-screen-schemes/#api-rest-api-3-issuetypescreenscheme-post - */ -export interface IssueTypeScreenSchemePayload { - defaultScreenScheme?: ProjectCreateResourceIdentifier; - /** The description of the issue type screen scheme */ - description?: string; - /** - * The IDs of the screen schemes for the issue type IDs and default. A default entry is required to create an issue - * type screen scheme, it defines the mapping for all issue types without a screen scheme. - */ - explicitMappings?: {}; - /** The name of the issue type screen scheme */ - name?: string; - pcri?: ProjectCreateResourceIdentifier; -} diff --git a/src/version2/models/issueTypeScreenSchemeProjectAssociation.ts b/src/version2/models/issueTypeScreenSchemeProjectAssociation.ts deleted file mode 100644 index 49c71c8999..0000000000 --- a/src/version2/models/issueTypeScreenSchemeProjectAssociation.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Associated issue type screen scheme and project. */ -export interface IssueTypeScreenSchemeProjectAssociation { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId?: string; - /** The ID of the project. */ - projectId?: string; -} diff --git a/src/version2/models/issueTypeScreenSchemeUpdateDetails.ts b/src/version2/models/issueTypeScreenSchemeUpdateDetails.ts deleted file mode 100644 index 6f2aa557d7..0000000000 --- a/src/version2/models/issueTypeScreenSchemeUpdateDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of an issue type screen scheme. */ -export interface IssueTypeScreenSchemeUpdateDetails { - /** The description of the issue type screen scheme. The maximum length is 255 characters. */ - description?: string; - /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ - name?: string; -} diff --git a/src/version2/models/issueTypeScreenSchemesProjects.ts b/src/version2/models/issueTypeScreenSchemesProjects.ts deleted file mode 100644 index e7a054a8fb..0000000000 --- a/src/version2/models/issueTypeScreenSchemesProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypeScreenScheme } from './issueTypeScreenScheme'; - -/** Issue type screen scheme with a list of the projects that use it. */ -export interface IssueTypeScreenSchemesProjects { - issueTypeScreenScheme?: IssueTypeScreenScheme; - /** The IDs of the projects using the issue type screen scheme. */ - projectIds: string[]; -} diff --git a/src/version2/models/issueTypeToContextMapping.ts b/src/version2/models/issueTypeToContextMapping.ts deleted file mode 100644 index f0f381ac68..0000000000 --- a/src/version2/models/issueTypeToContextMapping.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Mapping of an issue type to a context. */ -export interface IssueTypeToContextMapping { - /** The ID of the context. */ - contextId: string; - /** Whether the context is mapped to any issue type. */ - isAnyIssueType?: boolean; - /** The ID of the issue type. */ - issueTypeId?: string; -} diff --git a/src/version2/models/issueTypeUpdate.ts b/src/version2/models/issueTypeUpdate.ts deleted file mode 100644 index 989759bb78..0000000000 --- a/src/version2/models/issueTypeUpdate.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface IssueTypeUpdate { - /** The ID of an issue type avatar. */ - avatarId?: number; - /** The description of the issue type. */ - description?: string; - /** The unique name for the issue type. The maximum length is 60 characters. */ - name?: string; -} diff --git a/src/version2/models/issueTypeWithStatus.ts b/src/version2/models/issueTypeWithStatus.ts deleted file mode 100644 index dd22022fd2..0000000000 --- a/src/version2/models/issueTypeWithStatus.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { StatusDetails } from './statusDetails'; - -/** Status details for an issue type. */ -export interface IssueTypeWithStatus { - /** The ID of the issue type. */ - id: string; - /** The name of the issue type. */ - name: string; - /** The URL of the issue type's status details. */ - self: string; - /** List of status details for the issue type. */ - statuses: StatusDetails[]; - /** Whether this issue type represents subtasks. */ - subtask: boolean; -} diff --git a/src/version2/models/issueTypeWorkflowMapping.ts b/src/version2/models/issueTypeWorkflowMapping.ts deleted file mode 100644 index 1007838384..0000000000 --- a/src/version2/models/issueTypeWorkflowMapping.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** Details about the mapping between an issue type and a workflow. */ -export interface IssueTypeWorkflowMapping { - /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ - issueType?: string; - /** - * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types - * mapping. - */ - updateDraftIfNeeded?: boolean; - /** The name of the workflow. */ - workflow?: string; -} diff --git a/src/version2/models/issueTypesWorkflowMapping.ts b/src/version2/models/issueTypesWorkflowMapping.ts deleted file mode 100644 index 53e557cc26..0000000000 --- a/src/version2/models/issueTypesWorkflowMapping.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** Details about the mapping between issue types and a workflow. */ -export interface IssueTypesWorkflowMapping { - /** Whether the workflow is the default workflow for the workflow scheme. */ - defaultMapping?: boolean; - /** The list of issue type IDs. */ - issueTypes?: string[]; - /** - * Whether a draft workflow scheme is created or updated when updating an active workflow scheme. The draft is updated - * with the new workflow-issue types mapping. Defaults to `false`. - */ - updateDraftIfNeeded?: boolean; - /** The name of the workflow. Optional if updating the workflow-issue types mapping. */ - workflow?: string; -} diff --git a/src/version2/models/issueUpdateDetails.ts b/src/version2/models/issueUpdateDetails.ts deleted file mode 100644 index a39d50662e..0000000000 --- a/src/version2/models/issueUpdateDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { EntityProperty } from './entityProperty'; -import type { Fields } from './fields'; -import type { HistoryMetadata } from './historyMetadata'; -import type { IssueTransition } from './issueTransition'; - -/** Details of an issue update request. */ -export interface IssueUpdateDetails { - /** - * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field - * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are - * required, use `update`. Fields included in here cannot be included in `update`. - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - fields?: Partial | any; - historyMetadata?: HistoryMetadata; - /** Details of issue properties to be added or update. */ - properties?: EntityProperty[]; - transition?: IssueTransition; - /** - * A Map containing the field name and a list of operations to perform on the issue screen field. Note that fields - * included in here cannot be included in `fields`. - */ - update?: unknown; -} diff --git a/src/version2/models/issueUpdateMetadata.ts b/src/version2/models/issueUpdateMetadata.ts deleted file mode 100644 index 140561da96..0000000000 --- a/src/version2/models/issueUpdateMetadata.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Fields } from './fields'; - -/** A list of editable field details. */ -export interface IssueUpdateMetadata { - /** A list of editable field details. */ - fields?: Fields; -} diff --git a/src/version2/models/issuesAndJQLQueries.ts b/src/version2/models/issuesAndJQLQueries.ts deleted file mode 100644 index 4a036ad0ea..0000000000 --- a/src/version2/models/issuesAndJQLQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** List of issues and JQL queries. */ -export interface IssuesAndJQLQueries { - /** A list of issue IDs. */ - issueIds: number[]; - /** A list of JQL queries. */ - jqls: string[]; -} diff --git a/src/version2/models/issuesJqlMetaData.ts b/src/version2/models/issuesJqlMetaData.ts deleted file mode 100644 index 35e4987b75..0000000000 --- a/src/version2/models/issuesJqlMetaData.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** The description of the page of issues loaded by the provided JQL query. */ -export interface IssuesJqlMetaData { - /** The number of issues that were loaded in this evaluation. */ - count: number; - /** The maximum number of issues that could be loaded in this evaluation. */ - maxResults: number; - /** The index of the first issue. */ - startAt: number; - /** The total number of issues the JQL returned. */ - totalCount: number; - /** Any warnings related to the JQL query. Present only if the validation mode was set to `warn`. */ - validationWarnings?: string[]; -} diff --git a/src/version2/models/issuesMeta.ts b/src/version2/models/issuesMeta.ts deleted file mode 100644 index aebde70710..0000000000 --- a/src/version2/models/issuesMeta.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssuesJqlMetaData } from './issuesJqlMetaData'; - -/** Meta data describing the `issues` context variable. */ -export interface IssuesMeta { - jql?: IssuesJqlMetaData; -} diff --git a/src/version2/models/issuesUpdate.ts b/src/version2/models/issuesUpdate.ts deleted file mode 100644 index adbb3a3a81..0000000000 --- a/src/version2/models/issuesUpdate.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { IssueUpdateDetails } from './issueUpdateDetails'; - -export interface IssuesUpdate { - issueUpdates?: IssueUpdateDetails[]; -} diff --git a/src/version2/models/jExpEvaluateIssuesJqlMetaData.ts b/src/version2/models/jExpEvaluateIssuesJqlMetaData.ts deleted file mode 100644 index c97480a3e2..0000000000 --- a/src/version2/models/jExpEvaluateIssuesJqlMetaData.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The description of the page of issues loaded by the provided JQL query. */ -export interface JExpEvaluateIssuesJqlMetaData { - /** Next Page token for the next page of issues. */ - nextPageToken?: string; -} diff --git a/src/version2/models/jExpEvaluateIssuesMeta.ts b/src/version2/models/jExpEvaluateIssuesMeta.ts deleted file mode 100644 index 923828e245..0000000000 --- a/src/version2/models/jExpEvaluateIssuesMeta.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { JExpEvaluateIssuesJqlMetaData } from './jExpEvaluateIssuesJqlMetaData'; - -/** Meta data describing the `issues` context variable. */ -export interface JExpEvaluateIssuesMeta { - /** - * The description of the page of issues loaded by the provided JQL query. This bean will be replacing - * IssuesJqlMetaDataBean bean as part of new `evaluate` endpoint - */ - jql?: JExpEvaluateIssuesJqlMetaData; -} diff --git a/src/version2/models/jExpEvaluateMetaData.ts b/src/version2/models/jExpEvaluateMetaData.ts deleted file mode 100644 index ca162644fe..0000000000 --- a/src/version2/models/jExpEvaluateMetaData.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { JExpEvaluateIssuesMeta } from './jExpEvaluateIssuesMeta'; -import type { JiraExpressionsComplexity } from './jiraExpressionsComplexity'; - -export interface JExpEvaluateMetaData { - /** - * Contains information about the expression complexity. For example, the number of steps it took to evaluate the - * expression. - */ - complexity?: JiraExpressionsComplexity; - /** - * Contains information about the `issues` variable in the context. For example, is the issues were loaded with JQL, - * information about the page will be included here. - */ - issues?: JExpEvaluateIssuesMeta; -} diff --git a/src/version2/models/jQLCount.ts b/src/version2/models/jQLCount.ts deleted file mode 100644 index a3270ef92a..0000000000 --- a/src/version2/models/jQLCount.ts +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 3eb6cce3be..0000000000 --- a/src/version2/models/jQLCountRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -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/jQLPersonalDataMigrationRequest.ts b/src/version2/models/jQLPersonalDataMigrationRequest.ts deleted file mode 100644 index 0a07308173..0000000000 --- a/src/version2/models/jQLPersonalDataMigrationRequest.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The JQL queries to be converted. */ -export interface JQLPersonalDataMigrationRequest { - /** A list of queries with user identifiers. Maximum of 100 queries. */ - queryStrings?: string[]; -} diff --git a/src/version2/models/jQLQueryWithUnknownUsers.ts b/src/version2/models/jQLQueryWithUnknownUsers.ts deleted file mode 100644 index 81661d53e3..0000000000 --- a/src/version2/models/jQLQueryWithUnknownUsers.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** JQL queries that contained users that could not be found */ -export interface JQLQueryWithUnknownUsers { - /** The converted query, with accountIDs instead of user identifiers, or 'unknown' for users that could not be found */ - convertedQuery?: string; - /** The original query, for reference */ - originalQuery?: string; -} diff --git a/src/version2/models/jQLReferenceData.ts b/src/version2/models/jQLReferenceData.ts deleted file mode 100644 index 4da358c7fd..0000000000 --- a/src/version2/models/jQLReferenceData.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FieldReferenceData } from './fieldReferenceData'; -import type { FunctionReferenceData } from './functionReferenceData'; - -/** Lists of JQL reference data. */ -export interface JQLReferenceData { - /** List of JQL query reserved words. */ - jqlReservedWords?: string[]; - /** List of fields usable in JQL queries. */ - visibleFieldNames?: FieldReferenceData[]; - /** List of functions usable in JQL queries. */ - visibleFunctionNames?: FunctionReferenceData[]; -} diff --git a/src/version2/models/jexpEvaluateCtxIssues.ts b/src/version2/models/jexpEvaluateCtxIssues.ts deleted file mode 100644 index 9edd6675ca..0000000000 --- a/src/version2/models/jexpEvaluateCtxIssues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { JexpEvaluateCtxJqlIssues } from './jexpEvaluateCtxJqlIssues'; - -/** The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ -export interface JexpEvaluateCtxIssues { - jql?: JexpEvaluateCtxJqlIssues; -} diff --git a/src/version2/models/jexpEvaluateCtxJqlIssues.ts b/src/version2/models/jexpEvaluateCtxJqlIssues.ts deleted file mode 100644 index 4fc211b9d9..0000000000 --- a/src/version2/models/jexpEvaluateCtxJqlIssues.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** The JQL query that specifies the set of issues available in the Jira expression. */ -export interface JexpEvaluateCtxJqlIssues { - /** - * The maximum number of issues to return from the JQL query. Inspect `meta.issues.jql.maxResults` in the response to - * ensure the maximum value has not been exceeded. - */ - maxResults?: number; - /** - * The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. Use the - * `nextPageToken` to fetch the next page of issues. - */ - nextPageToken?: string; - /** The JQL query, required to be bounded. Additionally, `orderBy` clause can contain a maximum of 7 fields */ - query?: string; -} diff --git a/src/version2/models/jexpIssues.ts b/src/version2/models/jexpIssues.ts deleted file mode 100644 index ef6d0e6ec3..0000000000 --- a/src/version2/models/jexpIssues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { JexpJqlIssues } from './jexpJqlIssues'; - -/** The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ -export interface JexpIssues { - jql?: JexpJqlIssues; -} diff --git a/src/version2/models/jexpJqlIssues.ts b/src/version2/models/jexpJqlIssues.ts deleted file mode 100644 index aeb69f78a3..0000000000 --- a/src/version2/models/jexpJqlIssues.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. Not all - * issues returned by the JQL query are loaded, only those described by the `startAt` and `maxResults` properties. To - * determine whether it is necessary to iterate to ensure all the issues returned by the JQL query are evaluated, - * inspect `meta.issues.jql.count` in the response. - */ -export interface JexpJqlIssues { - /** - * The maximum number of issues to return from the JQL query. Inspect `meta.issues.jql.maxResults` in the response to - * ensure the maximum value has not been exceeded. - */ - maxResults?: number; - /** The JQL query. */ - query?: string; - /** The index of the first issue to return from the JQL query. */ - startAt?: number; - /** Determines how to validate the JQL query and treat the validation results. */ - validation?: string; -} diff --git a/src/version2/models/jiraExpressionAnalysis.ts b/src/version2/models/jiraExpressionAnalysis.ts deleted file mode 100644 index 85f09ad843..0000000000 --- a/src/version2/models/jiraExpressionAnalysis.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { JiraExpressionComplexity } from './jiraExpressionComplexity'; -import type { JiraExpressionValidationError } from './jiraExpressionValidationError'; - -/** Details about the analysed Jira expression. */ -export interface JiraExpressionAnalysis { - complexity?: JiraExpressionComplexity; - /** A list of validation errors. Not included if the expression is valid. */ - errors?: JiraExpressionValidationError[]; - /** The analysed expression. */ - expression: string; - /** EXPERIMENTAL. The inferred type of the expression. */ - type?: string; - /** - * Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime - * (for example, if it executes too many expensive operations). - */ - valid: boolean; -} diff --git a/src/version2/models/jiraExpressionComplexity.ts b/src/version2/models/jiraExpressionComplexity.ts deleted file mode 100644 index b65d7b9cad..0000000000 --- a/src/version2/models/jiraExpressionComplexity.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** Details about the complexity of the analysed Jira expression. */ -export interface JiraExpressionComplexity { - /** - * Information that can be used to determine how many [expensive - * operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) the - * evaluation of the expression will perform. This information may be a formula or number. For example: - * - * `issues.map(i => i.comments)` performs as many expensive operations as there are issues on the issues list. So this - * parameter returns `N`, where `N` is the size of issue list. `new Issue(10010).comments` gets comments for one - * issue, so its complexity is `2` (`1` to retrieve issue 10010 from the database plus `1` to get its comments). - */ - expensiveOperations: string; - /** Variables used in the formula, mapped to the parts of the expression they refer to. */ - variables?: unknown; -} diff --git a/src/version2/models/jiraExpressionEvalContext.ts b/src/version2/models/jiraExpressionEvalContext.ts deleted file mode 100644 index c7a8f682e2..0000000000 --- a/src/version2/models/jiraExpressionEvalContext.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { CustomContextVariable } from './customContextVariable'; -import type { IdOrKey } from './idOrKey'; -import type { JexpIssues } from './jexpIssues'; - -export interface JiraExpressionEvalContext { - /** The ID of the board that is available under the `board` variable when evaluating the expression. */ - board?: number; - /** - * Custom context variables and their types. These variable types are available for use in a custom context: - * - * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) - * specified as an Atlassian account ID. - * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) - * specified by ID or key. All the fields of the issue object are available in the Jira expression. - * - `json`: A JSON object containing custom content. - * - `list`: A JSON list of `user`, `issue`, or `json` variable types. - */ - custom?: CustomContextVariable[]; - /** - * The ID of the customer request that is available under the `customerRequest` variable when evaluating the - * expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will - * have a different type. - */ - customerRequest?: number; - issue?: IdOrKey; - issues?: JexpIssues; - project?: IdOrKey; - /** The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. */ - serviceDesk?: number; - /** The ID of the sprint that is available under the `sprint` variable when evaluating the expression. */ - sprint?: number; -} diff --git a/src/version2/models/jiraExpressionEvalRequest.ts b/src/version2/models/jiraExpressionEvalRequest.ts deleted file mode 100644 index 333e7a1e78..0000000000 --- a/src/version2/models/jiraExpressionEvalRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { JiraExpressionEvalContext } from './jiraExpressionEvalContext'; - -export interface JiraExpressionEvalRequest { - context?: JiraExpressionEvalContext; - /** The Jira expression to evaluate. */ - expression: string; -} diff --git a/src/version2/models/jiraExpressionEvalUsingEnhancedSearchRequest.ts b/src/version2/models/jiraExpressionEvalUsingEnhancedSearchRequest.ts deleted file mode 100644 index 11a68ed8fe..0000000000 --- a/src/version2/models/jiraExpressionEvalUsingEnhancedSearchRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { JiraExpressionEvaluateContext } from './jiraExpressionEvaluateContext'; - -export interface JiraExpressionEvalUsingEnhancedSearchRequest { - /** The Jira expression to evaluate. */ - expression: string; - /** The context in which the Jira expression is evaluated. */ - context?: JiraExpressionEvaluateContext; -} diff --git a/src/version2/models/jiraExpressionEvaluateContext.ts b/src/version2/models/jiraExpressionEvaluateContext.ts deleted file mode 100644 index 13d8764b29..0000000000 --- a/src/version2/models/jiraExpressionEvaluateContext.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { IssueContextVariable } from './issueContextVariable'; -import type { JsonContextVariable } from './jsonContextVariable'; -import type { UserContextVariable } from './userContextVariable'; -import type { IdOrKey } from './idOrKey'; -import type { JexpEvaluateCtxIssues } from './jexpEvaluateCtxIssues'; - -export interface JiraExpressionEvaluateContext { - issue?: IdOrKey; - issues?: JexpEvaluateCtxIssues; - project?: IdOrKey; - /** The ID of the sprint that is available under the `sprint` variable when evaluating the expression. */ - sprint?: number; - /** The ID of the board that is available under the `board` variable when evaluating the expression. */ - board?: number; - /** The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. */ - serviceDesk?: number; - /** - * The ID of the customer request that is available under the `customerRequest` variable when evaluating the - * expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will - * have a different type. - */ - customerRequest?: number; - /** - * Custom context variables and their types. These variable types are available for use in a custom context: - * - * `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) - * specified as an Atlassian account ID. `issue`: An - * [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) specified by ID - * or key. All the fields of the issue object are available in the Jira expression. `json`: A JSON object containing - * custom content. `list`: A JSON list of `user`, `issue`, or `json` variable types. - */ - custom?: (UserContextVariable | IssueContextVariable | JsonContextVariable)[]; -} diff --git a/src/version2/models/jiraExpressionEvaluationMetaData.ts b/src/version2/models/jiraExpressionEvaluationMetaData.ts deleted file mode 100644 index 30488f8645..0000000000 --- a/src/version2/models/jiraExpressionEvaluationMetaData.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IssuesMeta } from './issuesMeta'; -import type { JiraExpressionsComplexity } from './jiraExpressionsComplexity'; - -export interface JiraExpressionEvaluationMetaData { - complexity?: JiraExpressionsComplexity; - issues?: IssuesMeta; -} diff --git a/src/version2/models/jiraExpressionForAnalysis.ts b/src/version2/models/jiraExpressionForAnalysis.ts deleted file mode 100644 index 959019bd32..0000000000 --- a/src/version2/models/jiraExpressionForAnalysis.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** Details of Jira expressions for analysis. */ -export interface JiraExpressionForAnalysis { - /** - * Context variables and their types. The type checker assumes that [common context - * variables](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables), such as - * `issue` or `project`, are available in context and sets their type. Use this property to override the default types - * or provide details of new variables. - */ - contextVariables?: unknown; - /** The list of Jira expressions to analyse. */ - expressions: string[]; -} diff --git a/src/version2/models/jiraExpressionResult.ts b/src/version2/models/jiraExpressionResult.ts deleted file mode 100644 index 219d087f26..0000000000 --- a/src/version2/models/jiraExpressionResult.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { JiraExpressionEvaluationMetaData } from './jiraExpressionEvaluationMetaData'; - -/** The result of evaluating a Jira expression. */ -export interface JiraExpressionResult { - meta?: JiraExpressionEvaluationMetaData; - /** - * The value of the evaluated expression. It may be a primitive JSON value or a Jira REST API object. (Some - * expressions do not produce any meaningful results—for example, an expression that returns a lambda function—if - * that's the case a simple string representation is returned. These string representations should not be relied upon - * and may change without notice.) - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - value: any; -} diff --git a/src/version2/models/jiraExpressionValidationError.ts b/src/version2/models/jiraExpressionValidationError.ts deleted file mode 100644 index 04d6051c22..0000000000 --- a/src/version2/models/jiraExpressionValidationError.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Details about syntax and type errors. The error details apply to the entire expression, unless the object includes:* - * - * - `line` and `column` - * - `expression` - */ -export interface JiraExpressionValidationError { - /** The text column in which the error occurred. */ - column?: number; - /** The part of the expression in which the error occurred. */ - expression?: string; - /** The text line in which the error occurred. */ - line?: number; - /** Details about the error. */ - message: string; - /** The error type. */ - type: string; -} diff --git a/src/version2/models/jiraExpressionsAnalysis.ts b/src/version2/models/jiraExpressionsAnalysis.ts deleted file mode 100644 index 9721cee673..0000000000 --- a/src/version2/models/jiraExpressionsAnalysis.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { JiraExpressionAnalysis } from './jiraExpressionAnalysis'; - -/** Details about the analysed Jira expression. */ -export interface JiraExpressionsAnalysis { - /** The results of Jira expressions analysis. */ - results: JiraExpressionAnalysis[]; -} diff --git a/src/version2/models/jiraExpressionsComplexity.ts b/src/version2/models/jiraExpressionsComplexity.ts deleted file mode 100644 index 5de2043707..0000000000 --- a/src/version2/models/jiraExpressionsComplexity.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { JiraExpressionsComplexityValue } from './jiraExpressionsComplexityValue'; - -export interface JiraExpressionsComplexity { - steps?: JiraExpressionsComplexityValue; - expensiveOperations?: JiraExpressionsComplexityValue; - beans?: JiraExpressionsComplexityValue; - primitiveValues?: JiraExpressionsComplexityValue; -} diff --git a/src/version2/models/jiraExpressionsComplexityValue.ts b/src/version2/models/jiraExpressionsComplexityValue.ts deleted file mode 100644 index 3157f941b0..0000000000 --- a/src/version2/models/jiraExpressionsComplexityValue.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface JiraExpressionsComplexityValue { - /** The maximum allowed complexity. The evaluation will fail if this value is exceeded. */ - limit: number; - /** The complexity value of the current expression. */ - value: number; -} diff --git a/src/version2/models/jiraStatus.ts b/src/version2/models/jiraStatus.ts deleted file mode 100644 index 7dfd194e10..0000000000 --- a/src/version2/models/jiraStatus.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ProjectIssueTypes } from './projectIssueTypes'; -import type { StatusScope } from './statusScope'; - -/** Details of a status. */ -export interface JiraStatus { - /** The description of the status. */ - description?: string; - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name?: string; - scope?: StatusScope; - /** The category of the status. */ - statusCategory?: string; - /** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ - usages?: ProjectIssueTypes[]; -} diff --git a/src/version2/models/jiraWorkflow.ts b/src/version2/models/jiraWorkflow.ts deleted file mode 100644 index 8d60273c39..0000000000 --- a/src/version2/models/jiraWorkflow.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { DocumentVersion } from './documentVersion'; -import type { ProjectIssueTypes } from './projectIssueTypes'; -import type { WorkflowLayout } from './workflowLayout'; -import type { WorkflowReferenceStatus } from './workflowReferenceStatus'; -import type { WorkflowScope } from './workflowScope'; -import type { WorkflowTransitions } from './workflowTransitions'; - -/** Details of a workflow. */ -export interface JiraWorkflow { - /** The description of the workflow. */ - description?: string; - /** The ID of the workflow. */ - id?: string; - /** Indicates if the workflow can be edited. */ - isEditable?: boolean; - /** The name of the workflow. */ - name?: string; - scope?: WorkflowScope; - startPointLayout?: WorkflowLayout; - /** The statuses referenced in this workflow. */ - statuses?: WorkflowReferenceStatus[]; - /** If there is a current [asynchronous task](#async-operations) operation for this workflow. */ - taskId?: string; - /** The transitions of the workflow. */ - transitions?: WorkflowTransitions[]; - /** - * Use the optional `workflows.usages` expand to get additional information about the projects and issue types - * associated with the requested workflows. - */ - usages?: ProjectIssueTypes[]; - version?: DocumentVersion; -} diff --git a/src/version2/models/jiraWorkflowStatus.ts b/src/version2/models/jiraWorkflowStatus.ts deleted file mode 100644 index ffe29cc97b..0000000000 --- a/src/version2/models/jiraWorkflowStatus.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ProjectIssueTypes } from './projectIssueTypes'; -import type { WorkflowScope } from './workflowScope'; - -/** Details of a status. */ -export interface JiraWorkflowStatus { - /** The description of the status. */ - description?: string; - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name?: string; - scope?: WorkflowScope; - /** The category of the status. */ - statusCategory?: string; - /** The reference of the status. */ - statusReference?: string; - /** - * The `statuses.usages` expand is an optional parameter that can be used when reading and updating statuses in Jira. - * It provides additional information about the projects and issue types associated with the requested statuses. - */ - usages?: ProjectIssueTypes[]; -} diff --git a/src/version2/models/jqlFunctionPrecomputation.ts b/src/version2/models/jqlFunctionPrecomputation.ts deleted file mode 100644 index 7aa38ea2c4..0000000000 --- a/src/version2/models/jqlFunctionPrecomputation.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** Jql function precomputation. */ -export interface JqlFunctionPrecomputation { - arguments?: string[]; - created?: string; - field?: string; - functionKey?: string; - functionName?: string; - id?: string; - operator?: string; - updated?: string; - used?: string; - value?: string; -} diff --git a/src/version2/models/jqlFunctionPrecomputationGetByIdRequest.ts b/src/version2/models/jqlFunctionPrecomputationGetByIdRequest.ts deleted file mode 100644 index f9afb489d9..0000000000 --- a/src/version2/models/jqlFunctionPrecomputationGetByIdRequest.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** 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 deleted file mode 100644 index d4ded65d8c..0000000000 --- a/src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation'; - -/** Get precomputations by ID response. */ -export interface JqlFunctionPrecomputationGetByIdResponse { - /** List of precomputations that were not found. */ - notFoundPrecomputationIDs?: string[]; - /** The list of precomputations. */ - precomputations?: JqlFunctionPrecomputation[]; -} diff --git a/src/version2/models/jqlFunctionPrecomputationUpdate.ts b/src/version2/models/jqlFunctionPrecomputationUpdate.ts deleted file mode 100644 index 79075db7fe..0000000000 --- a/src/version2/models/jqlFunctionPrecomputationUpdate.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Precomputation id and its new value. */ -export interface JqlFunctionPrecomputationUpdate { - id: number; - value: string; -} diff --git a/src/version2/models/jqlFunctionPrecomputationUpdateRequest.ts b/src/version2/models/jqlFunctionPrecomputationUpdateRequest.ts deleted file mode 100644 index 815fec10af..0000000000 --- a/src/version2/models/jqlFunctionPrecomputationUpdateRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { JqlFunctionPrecomputationUpdate } from './jqlFunctionPrecomputationUpdate'; - -/** List of pairs (id and value) for precomputation updates. */ -export interface JqlFunctionPrecomputationUpdateRequest { - values: JqlFunctionPrecomputationUpdate[]; -} diff --git a/src/version2/models/jqlQueriesToParse.ts b/src/version2/models/jqlQueriesToParse.ts deleted file mode 100644 index 69990243f3..0000000000 --- a/src/version2/models/jqlQueriesToParse.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** A list of JQL queries to parse. */ -export interface JqlQueriesToParse { - /** A list of queries to parse. */ - queries: string[]; -} diff --git a/src/version2/models/jqlQueriesToSanitize.ts b/src/version2/models/jqlQueriesToSanitize.ts deleted file mode 100644 index bae77b5058..0000000000 --- a/src/version2/models/jqlQueriesToSanitize.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { JqlQueryToSanitize } from './jqlQueryToSanitize'; - -/** The list of JQL queries to sanitize for the given account IDs. */ -export interface JqlQueriesToSanitize { - /** The list of JQL queries to sanitize. Must contain unique values. Maximum of 20 queries. */ - queries: JqlQueryToSanitize[]; -} diff --git a/src/version2/models/jqlQuery.ts b/src/version2/models/jqlQuery.ts deleted file mode 100644 index 8c83f9d7db..0000000000 --- a/src/version2/models/jqlQuery.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { JqlQueryClause } from './jqlQueryClause'; -import type { JqlQueryOrderByClause } from './jqlQueryOrderByClause'; - -/** A parsed JQL query. */ -export interface JqlQuery { - orderBy?: JqlQueryOrderByClause; - where?: JqlQueryClause; -} diff --git a/src/version2/models/jqlQueryClause.ts b/src/version2/models/jqlQueryClause.ts deleted file mode 100644 index 15c1a05c57..0000000000 --- a/src/version2/models/jqlQueryClause.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** A JQL query clause. */ -export interface JqlQueryClause {} diff --git a/src/version2/models/jqlQueryField.ts b/src/version2/models/jqlQueryField.ts deleted file mode 100644 index c974383868..0000000000 --- a/src/version2/models/jqlQueryField.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { JqlQueryFieldEntityProperty } from './jqlQueryFieldEntityProperty'; - -/** - * A field used in a JQL query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) - * for more information about fields in JQL queries. - */ -export interface JqlQueryField { - /** The encoded name of the field, which can be used directly in a JQL query. */ - encodedName?: string; - /** The name of the field. */ - name: string; - /** When the field refers to a value in an entity property, details of the entity property value. */ - property?: JqlQueryFieldEntityProperty[]; -} diff --git a/src/version2/models/jqlQueryFieldEntityProperty.ts b/src/version2/models/jqlQueryFieldEntityProperty.ts deleted file mode 100644 index cdb74a8b40..0000000000 --- a/src/version2/models/jqlQueryFieldEntityProperty.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** Details of an entity property. */ -export interface JqlQueryFieldEntityProperty { - /** The object on which the property is set. */ - entity: string; - /** The key of the property. */ - key: string; - /** The path in the property value to query. */ - path: string; - /** - * The type of the property value extraction. Not available if the extraction for the property is not registered on - * the instance with the [Entity - * property](https://developer.atlassian.com/cloud/jira/platform/modules/entity-property/) module. - */ - type?: string; -} diff --git a/src/version2/models/jqlQueryOrderByClause.ts b/src/version2/models/jqlQueryOrderByClause.ts deleted file mode 100644 index 28e8f090ad..0000000000 --- a/src/version2/models/jqlQueryOrderByClause.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { JqlQueryOrderByClauseElement } from './jqlQueryOrderByClauseElement'; - -/** Details of the order-by JQL clause. */ -export interface JqlQueryOrderByClause { - /** The list of order-by clause fields and their ordering directives. */ - fields: JqlQueryOrderByClauseElement[]; -} diff --git a/src/version2/models/jqlQueryOrderByClauseElement.ts b/src/version2/models/jqlQueryOrderByClauseElement.ts deleted file mode 100644 index a758911e7d..0000000000 --- a/src/version2/models/jqlQueryOrderByClauseElement.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { JqlQueryField } from './jqlQueryField'; - -/** An element of the order-by JQL clause. */ -export interface JqlQueryOrderByClauseElement { - /** The direction in which to order the results. */ - direction?: string; - field: JqlQueryField; -} diff --git a/src/version2/models/jqlQueryToSanitize.ts b/src/version2/models/jqlQueryToSanitize.ts deleted file mode 100644 index e774eaf2af..0000000000 --- a/src/version2/models/jqlQueryToSanitize.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The JQL query to sanitize for the account ID. If the account ID is null, sanitizing is performed for an anonymous - * user. - */ -export interface JqlQueryToSanitize { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The query to sanitize. */ - query: string; -} diff --git a/src/version2/models/jsonContextVariable.ts b/src/version2/models/jsonContextVariable.ts deleted file mode 100644 index aba02aa1d7..0000000000 --- a/src/version2/models/jsonContextVariable.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface JsonContextVariable { - /** Type of custom context variable. */ - type: string; - /** A JSON object containing custom content. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - value?: any; -} diff --git a/src/version2/models/jsonNode.ts b/src/version2/models/jsonNode.ts deleted file mode 100644 index b5a835d326..0000000000 --- a/src/version2/models/jsonNode.ts +++ /dev/null @@ -1,38 +0,0 @@ -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?: unknown; - fieldNames?: unknown; - fields?: unknown; - 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/jsonType.ts b/src/version2/models/jsonType.ts deleted file mode 100644 index 0213056b2f..0000000000 --- a/src/version2/models/jsonType.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** The schema of a field. */ -export interface JsonType { - /** If the field is a custom field, the configuration of the field. */ - configuration?: unknown; - /** If the field is a custom field, the URI of the field. */ - custom?: string; - /** If the field is a custom field, the custom ID of the field. */ - customId?: number; - /** When the data type is an array, the name of the field items within the array. */ - items?: string; - /** If the field is a system field, the name of the field. */ - system?: string; - /** The data type of the field. */ - type: string; -} diff --git a/src/version2/models/license.ts b/src/version2/models/license.ts deleted file mode 100644 index b5d694ffdc..0000000000 --- a/src/version2/models/license.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { LicensedApplication } from './licensedApplication'; - -/** Details about a license for the Jira instance. */ -export interface License { - /** The applications under this license. */ - applications: LicensedApplication[]; -} diff --git a/src/version2/models/licenseMetric.ts b/src/version2/models/licenseMetric.ts deleted file mode 100644 index 6a647f5676..0000000000 --- a/src/version2/models/licenseMetric.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** A license metric */ -export interface LicenseMetric { - /** The key of the license metric. */ - key: string; - /** The value for the license metric. */ - value: string; -} diff --git a/src/version2/models/licensedApplication.ts b/src/version2/models/licensedApplication.ts deleted file mode 100644 index b094df45ef..0000000000 --- a/src/version2/models/licensedApplication.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details about a licensed Jira application. */ -export interface LicensedApplication { - /** The ID of the application. */ - id: string; - /** The licensing plan. */ - plan: string; -} diff --git a/src/version2/models/linkGroup.ts b/src/version2/models/linkGroup.ts deleted file mode 100644 index 75d277a047..0000000000 --- a/src/version2/models/linkGroup.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { SimpleLink } from './simpleLink'; - -/** Details a link group, which defines issue operations. */ -export interface LinkGroup { - groups?: LinkGroup[]; - header?: SimpleLink; - id?: string; - links?: SimpleLink[]; - styleClass?: string; - weight?: number; -} diff --git a/src/version2/models/linkIssueRequestJson.ts b/src/version2/models/linkIssueRequestJson.ts deleted file mode 100644 index 50fabd064e..0000000000 --- a/src/version2/models/linkIssueRequestJson.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Comment } from './comment'; -import type { IssueLinkType } from './issueLinkType'; -import type { LinkedIssue } from './linkedIssue'; - -export interface LinkIssueRequestJson { - comment?: Comment; - inwardIssue: LinkedIssue; - outwardIssue: LinkedIssue; - type: IssueLinkType; -} diff --git a/src/version2/models/linkedIssue.ts b/src/version2/models/linkedIssue.ts deleted file mode 100644 index 46148a254f..0000000000 --- a/src/version2/models/linkedIssue.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Fields } from './fields'; - -/** The ID or key of a linked issue. */ -export interface LinkedIssue { - fields?: Fields; - /** The ID of an issue. Required if `key` isn't provided. */ - id?: string; - /** The key of an issue. Required if `id` isn't provided. */ - key?: string; - /** The URL of the issue. */ - self?: string; -} diff --git a/src/version2/models/listWrapperCallbackApplicationRole.ts b/src/version2/models/listWrapperCallbackApplicationRole.ts deleted file mode 100644 index 1029c9e2ab..0000000000 --- a/src/version2/models/listWrapperCallbackApplicationRole.ts +++ /dev/null @@ -1 +0,0 @@ -export interface ListWrapperCallbackApplicationRole {} diff --git a/src/version2/models/listWrapperCallbackGroupName.ts b/src/version2/models/listWrapperCallbackGroupName.ts deleted file mode 100644 index 76ac6b9fa8..0000000000 --- a/src/version2/models/listWrapperCallbackGroupName.ts +++ /dev/null @@ -1 +0,0 @@ -export interface ListWrapperCallbackGroupName {} diff --git a/src/version2/models/locale.ts b/src/version2/models/locale.ts deleted file mode 100644 index 495f55482c..0000000000 --- a/src/version2/models/locale.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of a locale. */ -export interface Locale { - /** - * The locale code. The Java the locale format is used: a two character language code (ISO 639), an underscore, and - * two letter country code (ISO 3166). For example, en_US represents a locale of English (United States). Required on - * create. - */ - locale?: string; -} diff --git a/src/version2/models/mappingsByIssueTypeOverride.ts b/src/version2/models/mappingsByIssueTypeOverride.ts deleted file mode 100644 index 483a6d03fb..0000000000 --- a/src/version2/models/mappingsByIssueTypeOverride.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { 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 deleted file mode 100644 index c60e8c2c2e..0000000000 --- a/src/version2/models/mappingsByWorkflow.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { 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/moveField.ts b/src/version2/models/moveField.ts deleted file mode 100644 index 2402f43f45..0000000000 --- a/src/version2/models/moveField.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface MoveField { - /** - * The ID of the screen tab field after which to place the moved screen tab field. Required if `position` isn't - * provided. - */ - after?: string; - /** The named position to which the screen tab field should be moved. Required if `after` isn't provided. */ - position?: string; -} diff --git a/src/version2/models/multiIssueEntityProperties.ts b/src/version2/models/multiIssueEntityProperties.ts deleted file mode 100644 index 765357d122..0000000000 --- a/src/version2/models/multiIssueEntityProperties.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { IssueEntityPropertiesForMultiUpdate } from './issueEntityPropertiesForMultiUpdate'; - -/** - * A list of issues and their respective properties to set or update. See [Entity - * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. - */ -export interface MultiIssueEntityProperties { - /** A list of issue IDs and their respective properties. */ - issues?: IssueEntityPropertiesForMultiUpdate[]; -} diff --git a/src/version2/models/multipleCustomFieldValuesUpdate.ts b/src/version2/models/multipleCustomFieldValuesUpdate.ts deleted file mode 100644 index 9aed54825e..0000000000 --- a/src/version2/models/multipleCustomFieldValuesUpdate.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** A custom field and its new value with a list of issue to update. */ -export interface MultipleCustomFieldValuesUpdate { - /** The ID or key of the custom field. For example, `customfield_10010`. */ - customField: string; - /** The list of issue IDs. */ - issueIds: number[]; - /** - * The value for the custom field. The value must be compatible with the [custom field - * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/#data-types) as - * follows: - * - * `string` the value must be a string. `number` the value must be a number. `datetime` the value must be a string - * that represents a date in the ISO format or the simplified extended ISO format. For example, - * `"2023-01-18T12:00:00-03:00"` or `"2023-01-18T12:00:00.000Z"`. However, the milliseconds part is ignored. `user` - * the value must be an object that contains the `accountId` field. `group` the value must be an object that contains - * the group `name` or `groupId` field. Because group names can change, we recommend using `groupId`. - * - * A list of appropriate values must be provided if the field is of the `list` [collection - * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/#collection-types). - */ - value: unknown; -} diff --git a/src/version2/models/multipleCustomFieldValuesUpdateDetails.ts b/src/version2/models/multipleCustomFieldValuesUpdateDetails.ts deleted file mode 100644 index 35d513a312..0000000000 --- a/src/version2/models/multipleCustomFieldValuesUpdateDetails.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { MultipleCustomFieldValuesUpdate } from './multipleCustomFieldValuesUpdate'; - -/** List of updates for a custom fields. */ -export interface MultipleCustomFieldValuesUpdateDetails { - updates?: MultipleCustomFieldValuesUpdate[]; -} diff --git a/src/version2/models/nestedResponse.ts b/src/version2/models/nestedResponse.ts deleted file mode 100644 index 20d1c66e5d..0000000000 --- a/src/version2/models/nestedResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ErrorCollection } from './errorCollection'; -import type { WarningCollection } from './warningCollection'; - -export interface NestedResponse { - errorCollection?: ErrorCollection; - status?: number; - warningCollection?: WarningCollection; -} diff --git a/src/version2/models/newUserDetails.ts b/src/version2/models/newUserDetails.ts deleted file mode 100644 index a6908343c8..0000000000 --- a/src/version2/models/newUserDetails.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** The user details. */ -export interface NewUserDetails { - /** The email address for the user. */ - emailAddress: string; - /** - * This property is no longer available. See the [migration - * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - key?: string; - /** - * This property is no longer available. See the [migration - * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; - /** - * This property is no longer available. If the user has an Atlassian account, their password is not changed. If the - * user does not have an Atlassian account, they are sent an email asking them set up an account. - */ - password?: string; - /** - * Products the new user has access to. Valid products are: jira-core, jira-servicedesk, jira-product-discovery, - * jira-software. If left empty, the user will get default product access. To create a user without product access, - * set this field to be an empty array. - */ - products?: 'jira-core' | 'jira-servicedesk' | 'jira-product-discovery' | 'jira-software' | '' | string | string[]; - /** The URL of the user. */ - self?: string; -} diff --git a/src/version2/models/nonWorkingDay.ts b/src/version2/models/nonWorkingDay.ts deleted file mode 100644 index 27fdd7a5a6..0000000000 --- a/src/version2/models/nonWorkingDay.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface NonWorkingDay { - id?: number; - iso8601Date?: string; -} diff --git a/src/version2/models/notification.ts b/src/version2/models/notification.ts deleted file mode 100644 index 25ab1fe945..0000000000 --- a/src/version2/models/notification.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { NotificationRecipients } from './notificationRecipients'; -import type { NotificationRecipientsRestrictions } from './notificationRecipientsRestrictions'; - -/** Details about a notification. */ -export interface Notification { - /** The HTML body of the email notification for the issue. */ - htmlBody?: string; - restrict?: NotificationRecipientsRestrictions; - /** - * The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue - * key and summary. - */ - subject?: string; - /** The plain text body of the email notification for the issue. */ - textBody?: string; - to?: NotificationRecipients; -} diff --git a/src/version2/models/notificationEvent.ts b/src/version2/models/notificationEvent.ts deleted file mode 100644 index e8b16e1498..0000000000 --- a/src/version2/models/notificationEvent.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** Details about a notification event. */ -export interface NotificationEvent { - /** The description of the event. */ - description?: string; - /** - * The ID of the event. The event can be a [Jira system - * event](https://confluence.atlassian.com/x/8YdKLg#Creatinganotificationscheme-eventsEvents) or a [custom - * event](https://confluence.atlassian.com/x/AIlKLg). - */ - id?: number; - /** The name of the event. */ - name?: string; - templateEvent?: NotificationEvent; -} diff --git a/src/version2/models/notificationRecipients.ts b/src/version2/models/notificationRecipients.ts deleted file mode 100644 index d30599fcdb..0000000000 --- a/src/version2/models/notificationRecipients.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { GroupName } from './groupName'; -import type { UserDetails } from './userDetails'; - -/** Details of the users and groups to receive the notification. */ -export interface NotificationRecipients { - /** Whether the notification should be sent to the issue's assignees. */ - assignee?: boolean; - /** List of groupIds to receive the notification. */ - groupIds?: string[]; - /** List of groups to receive the notification. */ - groups?: GroupName[]; - /** Whether the notification should be sent to the issue's reporter. */ - reporter?: boolean; - /** List of users to receive the notification. */ - users?: UserDetails[]; - /** Whether the notification should be sent to the issue's voters. */ - voters?: boolean; - /** Whether the notification should be sent to the issue's watchers. */ - watchers?: boolean; -} diff --git a/src/version2/models/notificationRecipientsRestrictions.ts b/src/version2/models/notificationRecipientsRestrictions.ts deleted file mode 100644 index 07b811ca83..0000000000 --- a/src/version2/models/notificationRecipientsRestrictions.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { GroupName } from './groupName'; -import type { RestrictedPermission } from './restrictedPermission'; - -/** Details of the group membership or permissions needed to receive the notification. */ -export interface NotificationRecipientsRestrictions { - /** List of groupId memberships required to receive the notification. */ - groupIds?: string[]; - /** List of group memberships required to receive the notification. */ - groups?: GroupName[]; - /** List of permissions required to receive the notification. */ - permissions?: RestrictedPermission[]; -} diff --git a/src/version2/models/notificationScheme.ts b/src/version2/models/notificationScheme.ts deleted file mode 100644 index c828a4f5af..0000000000 --- a/src/version2/models/notificationScheme.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { NotificationSchemeEvent } from './notificationSchemeEvent'; -import type { Scope } from './scope'; - -/** Details about a notification scheme. */ -export interface NotificationScheme { - /** The description of the notification scheme. */ - description?: string; - /** Expand options that include additional notification scheme details in the response. */ - expand?: string; - /** The ID of the notification scheme. */ - id?: number; - /** The name of the notification scheme. */ - name?: string; - /** The notification events and associated recipients. */ - notificationSchemeEvents?: NotificationSchemeEvent[]; - /** The list of project IDs associated with the notification scheme. */ - projects?: number[]; - scope?: Scope; - self?: string; -} diff --git a/src/version2/models/notificationSchemeAndProjectMapping.ts b/src/version2/models/notificationSchemeAndProjectMapping.ts deleted file mode 100644 index 58f0f9f4a6..0000000000 --- a/src/version2/models/notificationSchemeAndProjectMapping.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface NotificationSchemeAndProjectMapping { - notificationSchemeId?: string; - projectId?: string; -} diff --git a/src/version2/models/notificationSchemeAndProjectMappingPage.ts b/src/version2/models/notificationSchemeAndProjectMappingPage.ts deleted file mode 100644 index a64c9465f1..0000000000 --- a/src/version2/models/notificationSchemeAndProjectMappingPage.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { NotificationSchemeAndProjectMapping } from './notificationSchemeAndProjectMapping'; - -/** A page of items. */ -export interface NotificationSchemeAndProjectMappingPage { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: NotificationSchemeAndProjectMapping[]; -} diff --git a/src/version2/models/notificationSchemeEvent.ts b/src/version2/models/notificationSchemeEvent.ts deleted file mode 100644 index 1f90c75202..0000000000 --- a/src/version2/models/notificationSchemeEvent.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { EventNotification } from './eventNotification'; -import type { NotificationEvent } from './notificationEvent'; - -/** Details about a notification scheme event. */ -export interface NotificationSchemeEvent { - event?: NotificationEvent; - notifications?: EventNotification[]; -} diff --git a/src/version2/models/notificationSchemeEventDetails.ts b/src/version2/models/notificationSchemeEventDetails.ts deleted file mode 100644 index fce8e5b624..0000000000 --- a/src/version2/models/notificationSchemeEventDetails.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { NotificationSchemeEventTypeId } from './notificationSchemeEventTypeId'; -import type { NotificationSchemeNotificationDetails } from './notificationSchemeNotificationDetails'; - -/** Details of a notification scheme event. */ -export interface NotificationSchemeEventDetails { - event?: NotificationSchemeEventTypeId; - /** The list of notifications mapped to a specified event. */ - notifications: NotificationSchemeNotificationDetails[]; -} diff --git a/src/version2/models/notificationSchemeEventIDPayload.ts b/src/version2/models/notificationSchemeEventIDPayload.ts deleted file mode 100644 index bb4dd88b37..0000000000 --- a/src/version2/models/notificationSchemeEventIDPayload.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The event ID to use for reference in the payload */ -export interface NotificationSchemeEventIDPayload { - /** The event ID to use for reference in the payload */ - id?: string; -} diff --git a/src/version2/models/notificationSchemeEventPayload.ts b/src/version2/models/notificationSchemeEventPayload.ts deleted file mode 100644 index 0a2eb3fab1..0000000000 --- a/src/version2/models/notificationSchemeEventPayload.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { NotificationSchemeEventIDPayload } from './notificationSchemeEventIDPayload'; -import type { NotificationSchemeNotificationDetailsPayload } from './notificationSchemeNotificationDetailsPayload'; - -/** The payload for creating a notification scheme event. Defines which notifications should be sent for a specific event */ -export interface NotificationSchemeEventPayload { - event?: NotificationSchemeEventIDPayload; - /** The configuration for notification recipents */ - notifications?: NotificationSchemeNotificationDetailsPayload[]; -} diff --git a/src/version2/models/notificationSchemeEventTypeId.ts b/src/version2/models/notificationSchemeEventTypeId.ts deleted file mode 100644 index c6bef77e33..0000000000 --- a/src/version2/models/notificationSchemeEventTypeId.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The ID of an event that is being mapped to notifications. */ -export interface NotificationSchemeEventTypeId { - /** The ID of the notification scheme event. */ - id: string; -} diff --git a/src/version2/models/notificationSchemeId.ts b/src/version2/models/notificationSchemeId.ts deleted file mode 100644 index 970cd402e4..0000000000 --- a/src/version2/models/notificationSchemeId.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The ID of a notification scheme. */ -export interface NotificationSchemeId { - /** The ID of a notification scheme. */ - id: string; -} diff --git a/src/version2/models/notificationSchemeNotificationDetails.ts b/src/version2/models/notificationSchemeNotificationDetails.ts deleted file mode 100644 index a29a7c6e94..0000000000 --- a/src/version2/models/notificationSchemeNotificationDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of a notification within a notification scheme. */ -export interface NotificationSchemeNotificationDetails { - /** The notification type, e.g `CurrentAssignee`, `Group`, `EmailAddress`. */ - notificationType: string; - /** The value corresponding to the specified notification type. */ - parameter?: string; -} diff --git a/src/version2/models/notificationSchemeNotificationDetailsPayload.ts b/src/version2/models/notificationSchemeNotificationDetailsPayload.ts deleted file mode 100644 index 52d3516fd7..0000000000 --- a/src/version2/models/notificationSchemeNotificationDetailsPayload.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The configuration for notification recipents */ -export interface NotificationSchemeNotificationDetailsPayload { - /** The type of notification. */ - notificationType?: string; - /** The parameter of the notification, should be eiither null if not required, or PCRI. */ - parameter?: string; -} diff --git a/src/version2/models/notificationSchemePayload.ts b/src/version2/models/notificationSchemePayload.ts deleted file mode 100644 index 4d8aa22456..0000000000 --- a/src/version2/models/notificationSchemePayload.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { NotificationSchemeEventPayload } from './notificationSchemeEventPayload'; -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** - * The payload for creating a notification scheme. The user has to supply the ID for the default notification scheme. - * For CMP this is provided in the project payload and should be left empty, for TMP it's provided using this payload - */ -export interface NotificationSchemePayload { - /** The description of the notification scheme */ - description?: string; - /** The name of the notification scheme */ - name?: string; - /** The events and notifications for the notification scheme */ - notificationSchemeEvents?: NotificationSchemeEventPayload[]; - /** The strategy to use when there is a conflict with an existing entity */ - onConflict?: 'FAIL' | 'USE' | 'NEW' | string; - pcri?: ProjectCreateResourceIdentifier; -} diff --git a/src/version2/models/oldToNewSecurityLevelMappings.ts b/src/version2/models/oldToNewSecurityLevelMappings.ts deleted file mode 100644 index ab3d7a459a..0000000000 --- a/src/version2/models/oldToNewSecurityLevelMappings.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface OldToNewSecurityLevelMappings { - /** 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/operationMessage.ts b/src/version2/models/operationMessage.ts deleted file mode 100644 index 5e9b8121db..0000000000 --- a/src/version2/models/operationMessage.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface OperationMessage { - /** The human-readable message that describes the result. */ - message: string; - /** The status code of the response. */ - statusCode: number; -} diff --git a/src/version2/models/operations.ts b/src/version2/models/operations.ts deleted file mode 100644 index 72a81023af..0000000000 --- a/src/version2/models/operations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { LinkGroup } from './linkGroup'; - -/** Details of the operations that can be performed on the issue. */ -export interface Operations { - /** Details of the link groups defining issue operations. */ - linkGroups?: LinkGroup[]; -} diff --git a/src/version2/models/orderOfCustomFieldOptions.ts b/src/version2/models/orderOfCustomFieldOptions.ts deleted file mode 100644 index f5912366e5..0000000000 --- a/src/version2/models/orderOfCustomFieldOptions.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** An ordered list of custom field option IDs and information on where to move them. */ -export interface OrderOfCustomFieldOptions { - /** - * The ID of the custom field option or cascading option to place the moved options after. Required if `position` - * isn't provided. - */ - after?: string; - /** - * A list of IDs of custom field options to move. The order of the custom field option IDs in the list is the order - * they are given after the move. The list must contain custom field options or cascading options, but not both. - */ - customFieldOptionIds: string[]; - /** The position the custom field options should be moved to. Required if `after` isn't provided. */ - position?: string; -} diff --git a/src/version2/models/orderOfIssueTypes.ts b/src/version2/models/orderOfIssueTypes.ts deleted file mode 100644 index dfdf537398..0000000000 --- a/src/version2/models/orderOfIssueTypes.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** An ordered list of issue type IDs and information about where to move them. */ -export interface OrderOfIssueTypes { - /** The ID of the issue type to place the moved issue types after. Required if `position` isn't provided. */ - after?: string; - /** - * A list of the issue type IDs to move. The order of the issue type IDs in the list is the order they are given after - * the move. - */ - issueTypeIds: string[]; - /** The position the issue types should be moved to. Required if `after` isn't provided. */ - position?: string; -} diff --git a/src/version2/models/pageBulkContextualConfiguration.ts b/src/version2/models/pageBulkContextualConfiguration.ts deleted file mode 100644 index 2b13f3ab95..0000000000 --- a/src/version2/models/pageBulkContextualConfiguration.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { 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/pageChangelog.ts b/src/version2/models/pageChangelog.ts deleted file mode 100644 index 8ea9e50534..0000000000 --- a/src/version2/models/pageChangelog.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Changelog } from './changelog'; - -/** A page of items. */ -export interface PageChangelog { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Changelog[]; -} diff --git a/src/version2/models/pageComment.ts b/src/version2/models/pageComment.ts deleted file mode 100644 index 1f1d38db80..0000000000 --- a/src/version2/models/pageComment.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Comment } from './comment'; - -/** A page of items. */ -export interface PageComment { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Comment[]; -} diff --git a/src/version2/models/pageComponentWithIssueCount.ts b/src/version2/models/pageComponentWithIssueCount.ts deleted file mode 100644 index 5d014d3ad6..0000000000 --- a/src/version2/models/pageComponentWithIssueCount.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ComponentWithIssueCount } from './componentWithIssueCount'; - -/** A page of items. */ -export interface PageComponentWithIssueCount { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: ComponentWithIssueCount[]; -} diff --git a/src/version2/models/pageContextForProjectAndIssueType.ts b/src/version2/models/pageContextForProjectAndIssueType.ts deleted file mode 100644 index 4956c70e4c..0000000000 --- a/src/version2/models/pageContextForProjectAndIssueType.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ContextForProjectAndIssueType } from './contextForProjectAndIssueType'; - -/** A page of items. */ -export interface PageContextForProjectAndIssueType { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: ContextForProjectAndIssueType[]; -} diff --git a/src/version2/models/pageContextualConfiguration.ts b/src/version2/models/pageContextualConfiguration.ts deleted file mode 100644 index f044a71e01..0000000000 --- a/src/version2/models/pageContextualConfiguration.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ContextualConfiguration } from './contextualConfiguration'; - -/** A page of items. */ -export interface PageContextualConfiguration { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: ContextualConfiguration[]; -} diff --git a/src/version2/models/pageCustomFieldContext.ts b/src/version2/models/pageCustomFieldContext.ts deleted file mode 100644 index 0855608cc1..0000000000 --- a/src/version2/models/pageCustomFieldContext.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CustomFieldContext } from './customFieldContext'; - -/** A page of items. */ -export interface PageCustomFieldContext { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: CustomFieldContext[]; -} diff --git a/src/version2/models/pageCustomFieldContextDefaultValue.ts b/src/version2/models/pageCustomFieldContextDefaultValue.ts deleted file mode 100644 index cea36e3ad2..0000000000 --- a/src/version2/models/pageCustomFieldContextDefaultValue.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue'; - -/** A page of items. */ -export interface PageCustomFieldContextDefaultValue { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: CustomFieldContextDefaultValue[]; -} diff --git a/src/version2/models/pageCustomFieldContextOption.ts b/src/version2/models/pageCustomFieldContextOption.ts deleted file mode 100644 index 89c19821ec..0000000000 --- a/src/version2/models/pageCustomFieldContextOption.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CustomFieldContextOption } from './customFieldContextOption'; - -/** A page of items. */ -export interface PageCustomFieldContextOption { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: CustomFieldContextOption[]; -} diff --git a/src/version2/models/pageCustomFieldContextProjectMapping.ts b/src/version2/models/pageCustomFieldContextProjectMapping.ts deleted file mode 100644 index 10b981205e..0000000000 --- a/src/version2/models/pageCustomFieldContextProjectMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CustomFieldContextProjectMapping } from './customFieldContextProjectMapping'; - -/** A page of items. */ -export interface PageCustomFieldContextProjectMapping { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: CustomFieldContextProjectMapping[]; -} diff --git a/src/version2/models/pageDashboard.ts b/src/version2/models/pageDashboard.ts deleted file mode 100644 index 9ee100c56e..0000000000 --- a/src/version2/models/pageDashboard.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Dashboard } from './dashboard'; - -/** A page of items. */ -export interface PageDashboard { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Dashboard[]; -} diff --git a/src/version2/models/pageField.ts b/src/version2/models/pageField.ts deleted file mode 100644 index 14b33ee171..0000000000 --- a/src/version2/models/pageField.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Field } from './field'; - -/** A page of items. */ -export interface PageField { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Field[]; -} diff --git a/src/version2/models/pageFieldConfiguration.ts b/src/version2/models/pageFieldConfiguration.ts deleted file mode 100644 index acf0cad1ad..0000000000 --- a/src/version2/models/pageFieldConfiguration.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfiguration } from './fieldConfiguration'; - -/** A page of items. */ -export interface PageFieldConfiguration { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: FieldConfiguration[]; -} diff --git a/src/version2/models/pageFieldConfigurationIssueTypeItem.ts b/src/version2/models/pageFieldConfigurationIssueTypeItem.ts deleted file mode 100644 index 91957597d8..0000000000 --- a/src/version2/models/pageFieldConfigurationIssueTypeItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationIssueTypeItem } from './fieldConfigurationIssueTypeItem'; - -/** A page of items. */ -export interface PageFieldConfigurationIssueTypeItem { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: FieldConfigurationIssueTypeItem[]; -} diff --git a/src/version2/models/pageFieldConfigurationItem.ts b/src/version2/models/pageFieldConfigurationItem.ts deleted file mode 100644 index 8323263ef8..0000000000 --- a/src/version2/models/pageFieldConfigurationItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationItem } from './fieldConfigurationItem'; - -/** A page of items. */ -export interface PageFieldConfigurationItem { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: FieldConfigurationItem[]; -} diff --git a/src/version2/models/pageFieldConfigurationScheme.ts b/src/version2/models/pageFieldConfigurationScheme.ts deleted file mode 100644 index 37b5585264..0000000000 --- a/src/version2/models/pageFieldConfigurationScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationScheme } from './fieldConfigurationScheme'; - -/** A page of items. */ -export interface PageFieldConfigurationScheme { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: FieldConfigurationScheme[]; -} diff --git a/src/version2/models/pageFieldConfigurationSchemeProjects.ts b/src/version2/models/pageFieldConfigurationSchemeProjects.ts deleted file mode 100644 index 6560370472..0000000000 --- a/src/version2/models/pageFieldConfigurationSchemeProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationSchemeProjects } from './fieldConfigurationSchemeProjects'; - -/** A page of items. */ -export interface PageFieldConfigurationSchemeProjects { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: FieldConfigurationSchemeProjects[]; -} diff --git a/src/version2/models/pageFilterDetails.ts b/src/version2/models/pageFilterDetails.ts deleted file mode 100644 index 27f7f32bbd..0000000000 --- a/src/version2/models/pageFilterDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FilterDetails } from './filterDetails'; - -/** A page of items. */ -export interface PageFilterDetails { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: FilterDetails[]; -} diff --git a/src/version2/models/pageGroupDetails.ts b/src/version2/models/pageGroupDetails.ts deleted file mode 100644 index 1d65011d47..0000000000 --- a/src/version2/models/pageGroupDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { GroupDetails } from './groupDetails'; - -/** A page of items. */ -export interface PageGroupDetails { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: GroupDetails[]; -} diff --git a/src/version2/models/pageIssueFieldOption.ts b/src/version2/models/pageIssueFieldOption.ts deleted file mode 100644 index d10b7293eb..0000000000 --- a/src/version2/models/pageIssueFieldOption.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueFieldOption } from './issueFieldOption'; - -/** A page of items. */ -export interface PageIssueFieldOption { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueFieldOption[]; -} diff --git a/src/version2/models/pageIssueSecurityLevelMember.ts b/src/version2/models/pageIssueSecurityLevelMember.ts deleted file mode 100644 index 2e264273a3..0000000000 --- a/src/version2/models/pageIssueSecurityLevelMember.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueSecurityLevelMember } from './issueSecurityLevelMember'; - -/** A page of items. */ -export interface PageIssueSecurityLevelMember { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueSecurityLevelMember[]; -} diff --git a/src/version2/models/pageIssueSecuritySchemeToProjectMapping.ts b/src/version2/models/pageIssueSecuritySchemeToProjectMapping.ts deleted file mode 100644 index 6a6851752c..0000000000 --- a/src/version2/models/pageIssueSecuritySchemeToProjectMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueSecuritySchemeToProjectMapping } from './issueSecuritySchemeToProjectMapping'; - -/** A page of items. */ -export interface PageIssueSecuritySchemeToProjectMapping { - /** Whether this is the last page. */ - isLast: boolean; - /** The maximum number of items that could be returned. */ - maxResults: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self: string; - /** The index of the first item returned. */ - startAt: number; - /** The number of items returned. */ - total: number; - /** The list of items. */ - values: IssueSecuritySchemeToProjectMapping[]; -} diff --git a/src/version2/models/pageIssueTypeScheme.ts b/src/version2/models/pageIssueTypeScheme.ts deleted file mode 100644 index a065561e12..0000000000 --- a/src/version2/models/pageIssueTypeScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeScheme } from './issueTypeScheme'; - -/** A page of items. */ -export interface PageIssueTypeScheme { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeScheme[]; -} diff --git a/src/version2/models/pageIssueTypeSchemeMapping.ts b/src/version2/models/pageIssueTypeSchemeMapping.ts deleted file mode 100644 index 97ff7ea573..0000000000 --- a/src/version2/models/pageIssueTypeSchemeMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeSchemeMapping } from './issueTypeSchemeMapping'; - -/** A page of items. */ -export interface PageIssueTypeSchemeMapping { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeSchemeMapping[]; -} diff --git a/src/version2/models/pageIssueTypeSchemeProjects.ts b/src/version2/models/pageIssueTypeSchemeProjects.ts deleted file mode 100644 index 15f7716fb5..0000000000 --- a/src/version2/models/pageIssueTypeSchemeProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeSchemeProjects } from './issueTypeSchemeProjects'; - -/** A page of items. */ -export interface PageIssueTypeSchemeProjects { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeSchemeProjects[]; -} diff --git a/src/version2/models/pageIssueTypeScreenScheme.ts b/src/version2/models/pageIssueTypeScreenScheme.ts deleted file mode 100644 index d0d9093087..0000000000 --- a/src/version2/models/pageIssueTypeScreenScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeScreenScheme } from './issueTypeScreenScheme'; - -/** A page of items. */ -export interface PageIssueTypeScreenScheme { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeScreenScheme[]; -} diff --git a/src/version2/models/pageIssueTypeScreenSchemeItem.ts b/src/version2/models/pageIssueTypeScreenSchemeItem.ts deleted file mode 100644 index 7da8c0b607..0000000000 --- a/src/version2/models/pageIssueTypeScreenSchemeItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeScreenSchemeItem } from './issueTypeScreenSchemeItem'; - -/** A page of items. */ -export interface PageIssueTypeScreenSchemeItem { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeScreenSchemeItem[]; -} diff --git a/src/version2/models/pageIssueTypeScreenSchemesProjects.ts b/src/version2/models/pageIssueTypeScreenSchemesProjects.ts deleted file mode 100644 index cf3bf00c07..0000000000 --- a/src/version2/models/pageIssueTypeScreenSchemesProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeScreenSchemesProjects } from './issueTypeScreenSchemesProjects'; - -/** A page of items. */ -export interface PageIssueTypeScreenSchemesProjects { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeScreenSchemesProjects[]; -} diff --git a/src/version2/models/pageIssueTypeToContextMapping.ts b/src/version2/models/pageIssueTypeToContextMapping.ts deleted file mode 100644 index a6f374ce19..0000000000 --- a/src/version2/models/pageIssueTypeToContextMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeToContextMapping } from './issueTypeToContextMapping'; - -/** A page of items. */ -export interface PageIssueTypeToContextMapping { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeToContextMapping[]; -} diff --git a/src/version2/models/pageJqlFunctionPrecomputation.ts b/src/version2/models/pageJqlFunctionPrecomputation.ts deleted file mode 100644 index ede44519d5..0000000000 --- a/src/version2/models/pageJqlFunctionPrecomputation.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation'; - -/** A page of items. */ -export interface PageJqlFunctionPrecomputation { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: JqlFunctionPrecomputation[]; -} diff --git a/src/version2/models/pageNotificationScheme.ts b/src/version2/models/pageNotificationScheme.ts deleted file mode 100644 index bea4c85d51..0000000000 --- a/src/version2/models/pageNotificationScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { NotificationScheme } from './notificationScheme'; - -/** A page of items. */ -export interface PageNotificationScheme { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: NotificationScheme[]; -} diff --git a/src/version2/models/pageOfChangelogs.ts b/src/version2/models/pageOfChangelogs.ts deleted file mode 100644 index 5249143122..0000000000 --- a/src/version2/models/pageOfChangelogs.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Changelog } from './changelog'; - -/** A page of changelogs. */ -export interface PageOfChangelogs { - /** The list of changelogs. */ - histories?: Changelog[]; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The number of results on the page. */ - total?: number; -} diff --git a/src/version2/models/pageOfComments.ts b/src/version2/models/pageOfComments.ts deleted file mode 100644 index 5492ea1839..0000000000 --- a/src/version2/models/pageOfComments.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Comment } from './comment'; - -/** A page of comments. */ -export interface PageOfComments { - /** The list of comments. */ - comments?: Comment[]; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; -} diff --git a/src/version2/models/pageOfCreateMetaIssueTypeWithField.ts b/src/version2/models/pageOfCreateMetaIssueTypeWithField.ts deleted file mode 100644 index 4006c2789f..0000000000 --- a/src/version2/models/pageOfCreateMetaIssueTypeWithField.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { 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 deleted file mode 100644 index d6fe5c787a..0000000000 --- a/src/version2/models/pageOfCreateMetaIssueTypes.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { 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/pageOfDashboards.ts b/src/version2/models/pageOfDashboards.ts deleted file mode 100644 index 0f6308c70a..0000000000 --- a/src/version2/models/pageOfDashboards.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Dashboard } from './dashboard'; - -/** A page containing dashboard details. */ -export interface PageOfDashboards { - /** List of dashboards. */ - dashboards?: Dashboard[]; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The URL of the next page of results, if any. */ - next?: string; - /** The URL of the previous page of results, if any. */ - prev?: string; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The number of results on the page. */ - total?: number; -} diff --git a/src/version2/models/pageOfStatuses.ts b/src/version2/models/pageOfStatuses.ts deleted file mode 100644 index dde8e850d3..0000000000 --- a/src/version2/models/pageOfStatuses.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { JiraStatus } from './jiraStatus'; - -export interface PageOfStatuses { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The URL of the next page of results, if any. */ - nextPage?: string; - /** The URL of this page. */ - self?: string; - /** The index of the first item returned on the page. */ - startAt?: number; - /** Number of items that satisfy the search. */ - total?: number; - /** The list of items. */ - values?: JiraStatus[]; -} diff --git a/src/version2/models/pageOfWorklogs.ts b/src/version2/models/pageOfWorklogs.ts deleted file mode 100644 index 263042b9da..0000000000 --- a/src/version2/models/pageOfWorklogs.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Worklog } from './worklog'; - -/** Paginated list of worklog details */ -export interface PageOfWorklogs { - /** The maximum number of results that could be on the page. */ - maxResults: number; - /** The index of the first item returned on the page. */ - startAt: number; - /** The number of results on the page. */ - total: number; - /** List of worklogs. */ - worklogs: Worklog[]; -} diff --git a/src/version2/models/pagePriority.ts b/src/version2/models/pagePriority.ts deleted file mode 100644 index e1712f6390..0000000000 --- a/src/version2/models/pagePriority.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Priority } from './priority'; - -/** A page of items. */ -export interface PagePriority { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Priority[]; -} diff --git a/src/version2/models/pageProject.ts b/src/version2/models/pageProject.ts deleted file mode 100644 index b7cfa8c4f3..0000000000 --- a/src/version2/models/pageProject.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Project } from './project'; - -/** A page of items. */ -export interface PageProject { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values: Project[]; -} diff --git a/src/version2/models/pageProjectDetails.ts b/src/version2/models/pageProjectDetails.ts deleted file mode 100644 index 8855bce89c..0000000000 --- a/src/version2/models/pageProjectDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ProjectDetails } from './projectDetails'; - -/** A page of items. */ -export interface PageProjectDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: ProjectDetails[]; -} diff --git a/src/version2/models/pageResolution.ts b/src/version2/models/pageResolution.ts deleted file mode 100644 index c786e9e50a..0000000000 --- a/src/version2/models/pageResolution.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Resolution } from './resolution'; - -/** A page of items. */ -export interface PageResolution { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Resolution[]; -} diff --git a/src/version2/models/pageScreen.ts b/src/version2/models/pageScreen.ts deleted file mode 100644 index 85daf17dff..0000000000 --- a/src/version2/models/pageScreen.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Screen } from './screen'; - -/** A page of items. */ -export interface PageScreen { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Screen[]; -} diff --git a/src/version2/models/pageScreenScheme.ts b/src/version2/models/pageScreenScheme.ts deleted file mode 100644 index 505114c995..0000000000 --- a/src/version2/models/pageScreenScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ScreenScheme } from './screenScheme'; - -/** A page of items. */ -export interface PageScreenScheme { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: ScreenScheme[]; -} diff --git a/src/version2/models/pageScreenWithTab.ts b/src/version2/models/pageScreenWithTab.ts deleted file mode 100644 index 9d93820ed2..0000000000 --- a/src/version2/models/pageScreenWithTab.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ScreenWithTab } from './screenWithTab'; - -/** A page of items. */ -export interface PageScreenWithTab { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: ScreenWithTab[]; -} diff --git a/src/version2/models/pageSecurityLevel.ts b/src/version2/models/pageSecurityLevel.ts deleted file mode 100644 index d069d3304d..0000000000 --- a/src/version2/models/pageSecurityLevel.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { SecurityLevel } from './securityLevel'; - -/** A page of items. */ -export interface PageSecurityLevel { - /** Whether this is the last page. */ - isLast: boolean; - /** The maximum number of items that could be returned. */ - maxResults: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self: string; - /** The index of the first item returned. */ - startAt: number; - /** The number of items returned. */ - total: number; - /** The list of items. */ - values: SecurityLevel[]; -} diff --git a/src/version2/models/pageSecurityLevelMember.ts b/src/version2/models/pageSecurityLevelMember.ts deleted file mode 100644 index 0a0101a51d..0000000000 --- a/src/version2/models/pageSecurityLevelMember.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { SecurityLevelMember } from './securityLevelMember'; - -/** A page of items. */ -export interface PageSecurityLevelMember { - /** Whether this is the last page. */ - isLast: boolean; - /** The maximum number of items that could be returned. */ - maxResults: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self: string; - /** The index of the first item returned. */ - startAt: number; - /** The number of items returned. */ - total: number; - /** The list of items. */ - values: SecurityLevelMember[]; -} diff --git a/src/version2/models/pageSecuritySchemeWithProjects.ts b/src/version2/models/pageSecuritySchemeWithProjects.ts deleted file mode 100644 index 84c0ff4fb3..0000000000 --- a/src/version2/models/pageSecuritySchemeWithProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { SecuritySchemeWithProjects } from './securitySchemeWithProjects'; - -/** A page of items. */ -export interface PageSecuritySchemeWithProjects { - /** Whether this is the last page. */ - isLast: boolean; - /** The maximum number of items that could be returned. */ - maxResults: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self: string; - /** The index of the first item returned. */ - startAt: number; - /** The number of items returned. */ - total: number; - /** The list of items. */ - values: SecuritySchemeWithProjects[]; -} diff --git a/src/version2/models/pageString.ts b/src/version2/models/pageString.ts deleted file mode 100644 index f4ec2eca43..0000000000 --- a/src/version2/models/pageString.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** A page of items. */ -export interface PageString { - /** 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?: string[]; -} diff --git a/src/version2/models/pageUiModificationDetails.ts b/src/version2/models/pageUiModificationDetails.ts deleted file mode 100644 index 987ec10816..0000000000 --- a/src/version2/models/pageUiModificationDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { UiModificationDetails } from './uiModificationDetails'; - -/** A page of items. */ -export interface PageUiModificationDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: UiModificationDetails[]; -} diff --git a/src/version2/models/pageUser.ts b/src/version2/models/pageUser.ts deleted file mode 100644 index 88009ac5dc..0000000000 --- a/src/version2/models/pageUser.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { User } from './user'; - -/** A page of items. */ -export interface PageUser { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: User[]; -} diff --git a/src/version2/models/pageUserDetails.ts b/src/version2/models/pageUserDetails.ts deleted file mode 100644 index d2df5f822a..0000000000 --- a/src/version2/models/pageUserDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { UserDetails } from './userDetails'; - -/** A page of items. */ -export interface PageUserDetails { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: UserDetails[]; -} diff --git a/src/version2/models/pageUserKey.ts b/src/version2/models/pageUserKey.ts deleted file mode 100644 index 9ae2cd1fc5..0000000000 --- a/src/version2/models/pageUserKey.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { UserKey } from './userKey'; - -/** A page of items. */ -export interface PageUserKey { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: UserKey[]; -} diff --git a/src/version2/models/pageVersion.ts b/src/version2/models/pageVersion.ts deleted file mode 100644 index add3f1c04a..0000000000 --- a/src/version2/models/pageVersion.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Version } from './version'; - -/** A page of items. */ -export interface PageVersion { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Version[]; -} diff --git a/src/version2/models/pageWebhook.ts b/src/version2/models/pageWebhook.ts deleted file mode 100644 index 45769994a2..0000000000 --- a/src/version2/models/pageWebhook.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Webhook } from './webhook'; - -/** A page of items. */ -export interface PageWebhook { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Webhook[]; -} diff --git a/src/version2/models/pageWithCursorGetPlanResponseForPage.ts b/src/version2/models/pageWithCursorGetPlanResponseForPage.ts deleted file mode 100644 index 201a7e61f0..0000000000 --- a/src/version2/models/pageWithCursorGetPlanResponseForPage.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { 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 deleted file mode 100644 index 5fbdcf6a53..0000000000 --- a/src/version2/models/pageWithCursorGetTeamResponseForPage.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { GetTeamResponseForPage } from './getTeamResponseForPage'; - -export interface PageWithCursorGetTeamResponseForPage { - cursor?: string; - last?: boolean; - nextPageCursor?: string; - size?: number; - total?: number; - values?: GetTeamResponseForPage[]; -} diff --git a/src/version2/models/pageWorkflow.ts b/src/version2/models/pageWorkflow.ts deleted file mode 100644 index 9f3be37bd0..0000000000 --- a/src/version2/models/pageWorkflow.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Workflow } from './workflow'; - -/** A page of items. */ -export interface PageWorkflow { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Workflow[]; -} diff --git a/src/version2/models/pageWorkflowScheme.ts b/src/version2/models/pageWorkflowScheme.ts deleted file mode 100644 index d6257df80c..0000000000 --- a/src/version2/models/pageWorkflowScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { WorkflowScheme } from './workflowScheme'; - -/** A page of items. */ -export interface PageWorkflowScheme { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: WorkflowScheme[]; -} diff --git a/src/version2/models/pageWorkflowTransitionRules.ts b/src/version2/models/pageWorkflowTransitionRules.ts deleted file mode 100644 index 0db2bad382..0000000000 --- a/src/version2/models/pageWorkflowTransitionRules.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { WorkflowTransitionRules } from './workflowTransitionRules'; - -/** A page of items. */ -export interface PageWorkflowTransitionRules { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: WorkflowTransitionRules[]; -} diff --git a/src/version2/models/pagedListUserDetailsApplicationUser.ts b/src/version2/models/pagedListUserDetailsApplicationUser.ts deleted file mode 100644 index c3b3664a8a..0000000000 --- a/src/version2/models/pagedListUserDetailsApplicationUser.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { UserDetails } from './userDetails'; - -/** - * A paged list. To access additional details append `[start-index:end-index]` to the expand request. For example, - * `?expand=sharedUsers[10:40]` returns a list starting at item 10 and finishing at item 40. - */ -export interface PagedListUserDetailsApplicationUser { - /** The index of the last item returned on the page. */ - 'end-index'?: number; - /** The list of items. */ - items?: UserDetails[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The number of items on the page. */ - size?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; -} diff --git a/src/version2/models/parsedJqlQueries.ts b/src/version2/models/parsedJqlQueries.ts deleted file mode 100644 index e5f3ba7e0a..0000000000 --- a/src/version2/models/parsedJqlQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ParsedJqlQuery } from './parsedJqlQuery'; - -/** A list of parsed JQL queries. */ -export interface ParsedJqlQueries { - /** A list of parsed JQL queries. */ - queries: ParsedJqlQuery[]; -} diff --git a/src/version2/models/parsedJqlQuery.ts b/src/version2/models/parsedJqlQuery.ts deleted file mode 100644 index 5d296ecd66..0000000000 --- a/src/version2/models/parsedJqlQuery.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { JqlQuery } from './jqlQuery'; - -/** Details of a parsed JQL query. */ -export interface ParsedJqlQuery { - /** The list of syntax or validation errors. */ - errors?: string[]; - /** The JQL query that was parsed and validated. */ - query: string; - structure?: JqlQuery; -} diff --git a/src/version2/models/permissionDetails.ts b/src/version2/models/permissionDetails.ts deleted file mode 100644 index a1d751e2e6..0000000000 --- a/src/version2/models/permissionDetails.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SharePermission } from './sharePermission'; - -/** Details for permissions of shareable entities */ -export interface PermissionDetails { - /** The edit permissions for the shareable entities. */ - editPermissions: SharePermission[]; - /** The share permissions for the shareable entities. */ - sharePermissions: SharePermission[]; -} diff --git a/src/version2/models/permissionGrant.ts b/src/version2/models/permissionGrant.ts deleted file mode 100644 index e96aace807..0000000000 --- a/src/version2/models/permissionGrant.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { PermissionHolder } from './permissionHolder'; - -/** Details about a permission granted to a user or group. */ -export interface PermissionGrant { - holder?: PermissionHolder; - /** The ID of the permission granted details. */ - id?: number; - /** - * The permission to grant. This permission can be one of the built-in permissions or a custom permission added by an - * app. See [Built-in permissions](../api-group-permission-schemes/#built-in-permissions) in _Get all permission - * schemes_ for more information about the built-in permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information about custom permissions. - */ - permission?: string; - /** The URL of the permission granted details. */ - self?: string; -} diff --git a/src/version2/models/permissionGrantDTO.ts b/src/version2/models/permissionGrantDTO.ts deleted file mode 100644 index 8f73bc226c..0000000000 --- a/src/version2/models/permissionGrantDTO.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** List of permission grants */ -export interface PermissionGrantDTO { - applicationAccess?: string[]; - groupCustomFields?: ProjectCreateResourceIdentifier[]; - groups?: ProjectCreateResourceIdentifier[]; - permissionKeys?: string[]; - projectRoles?: ProjectCreateResourceIdentifier[]; - specialGrants?: string[]; - userCustomFields?: ProjectCreateResourceIdentifier[]; - users?: ProjectCreateResourceIdentifier[]; -} diff --git a/src/version2/models/permissionGrants.ts b/src/version2/models/permissionGrants.ts deleted file mode 100644 index 0f2dd97153..0000000000 --- a/src/version2/models/permissionGrants.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { PermissionGrant } from './permissionGrant'; - -/** List of permission grants. */ -export interface PermissionGrants { - /** Expand options that include additional permission grant details in the response. */ - expand?: string; - /** Permission grants list. */ - permissions?: PermissionGrant[]; -} diff --git a/src/version2/models/permissionHolder.ts b/src/version2/models/permissionHolder.ts deleted file mode 100644 index ce9c86f731..0000000000 --- a/src/version2/models/permissionHolder.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Details of a user, group, field, or project role that holds a permission. See [Holder - * object](../api-group-permission-schemes/#holder-object) in _Get all permission schemes_ for more information. - */ -export interface PermissionHolder { - /** Expand options that include additional permission holder details in the response. */ - expand?: string; - /** - * As a group's name can change, use of `value` is recommended. The identifier associated withthe `type` value that - * defines the holder of the permission. - */ - parameter?: string; - /** The type of permission holder. */ - type: string; - /** The identifier associated with the `type` value that defines the holder of the permission. */ - value?: string; -} diff --git a/src/version2/models/permissionPayload.ts b/src/version2/models/permissionPayload.ts deleted file mode 100644 index 726bb33614..0000000000 --- a/src/version2/models/permissionPayload.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { PermissionGrantDTO } from './permissionGrantDTO'; -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** The payload to create a permission scheme */ -export interface PermissionPayload { - /** Configuration to generate addon role. Default is false if null */ - addAddonRole?: boolean; - /** The description of the permission scheme */ - description?: string; - /** List of permission grants */ - grants?: PermissionGrantDTO[]; - /** The name of the permission scheme */ - name?: string; - /** - * The strategy to use when there is a conflict with an existing permission scheme. FAIL - Fail execution, this always - * needs to be unique; USE - Use the existing entity and ignore new entity parameters; NEW - If the entity exist, try - * and create a new one with a different name - */ - onConflict?: 'FAIL' | 'USE' | 'NEW' | string; - pcri?: ProjectCreateResourceIdentifier; -} diff --git a/src/version2/models/permissionScheme.ts b/src/version2/models/permissionScheme.ts deleted file mode 100644 index bef89ad79f..0000000000 --- a/src/version2/models/permissionScheme.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { PermissionGrant } from './permissionGrant'; -import type { Scope } from './scope'; - -/** Details of a permission scheme. */ -export interface PermissionScheme { - /** A description for the permission scheme. */ - description?: string; - /** The expand options available for the permission scheme. */ - expand?: string; - /** The ID of the permission scheme. */ - id?: number; - /** The name of the permission scheme. Must be unique. */ - name: string; - /** - * The permission scheme to create or update. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. - */ - permissions?: PermissionGrant[]; - scope?: Scope; - /** The URL of the permission scheme. */ - self?: string; -} diff --git a/src/version2/models/permissionSchemes.ts b/src/version2/models/permissionSchemes.ts deleted file mode 100644 index 9195f0ecfe..0000000000 --- a/src/version2/models/permissionSchemes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PermissionScheme } from './permissionScheme'; - -/** List of all permission schemes. */ -export interface PermissionSchemes { - /** Permission schemes list. */ - permissionSchemes?: PermissionScheme[]; -} diff --git a/src/version2/models/permissions.ts b/src/version2/models/permissions.ts deleted file mode 100644 index e68ab30abc..0000000000 --- a/src/version2/models/permissions.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Details about permissions. */ -export interface Permissions { - /** List of permissions. */ - permissions?: unknown; -} diff --git a/src/version2/models/permissionsKeys.ts b/src/version2/models/permissionsKeys.ts deleted file mode 100644 index 3fc65387c3..0000000000 --- a/src/version2/models/permissionsKeys.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface PermissionsKeys { - /** A list of permission keys. */ - permissions: string[]; -} diff --git a/src/version2/models/permittedProjects.ts b/src/version2/models/permittedProjects.ts deleted file mode 100644 index 02a8982bde..0000000000 --- a/src/version2/models/permittedProjects.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ProjectIdentifier } from './projectIdentifier'; - -/** A list of projects in which a user is granted permissions. */ -export interface PermittedProjects { - /** A list of projects. */ - projects?: ProjectIdentifier[]; -} diff --git a/src/version2/models/plan.ts b/src/version2/models/plan.ts deleted file mode 100644 index 516e7bbfe3..0000000000 --- a/src/version2/models/plan.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { GetCrossProjectReleaseResponse } from './getCrossProjectReleaseResponse'; -import type { GetCustomFieldResponse } from './getCustomFieldResponse'; -import type { GetExclusionRulesResponse } from './getExclusionRulesResponse'; -import type { GetIssueSourceResponse } from './getIssueSourceResponse'; -import type { GetPermissionResponse } from './getPermissionResponse'; -import type { 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/priority.ts b/src/version2/models/priority.ts deleted file mode 100644 index 64f92a9683..0000000000 --- a/src/version2/models/priority.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** An issue priority. */ -export interface Priority { - /** 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 color used to indicate the issue priority. */ - statusColor?: string; -} diff --git a/src/version2/models/priorityId.ts b/src/version2/models/priorityId.ts deleted file mode 100644 index 6c427acad2..0000000000 --- a/src/version2/models/priorityId.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The ID of an issue priority. */ -export interface PriorityId { - /** The ID of the issue priority. */ - id: string; -} diff --git a/src/version2/models/priorityMapping.ts b/src/version2/models/priorityMapping.ts deleted file mode 100644 index cbe0a2654e..0000000000 --- a/src/version2/models/priorityMapping.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** 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?: unknown; - /** - * 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?: unknown; -} diff --git a/src/version2/models/prioritySchemeChangesWithoutMappings.ts b/src/version2/models/prioritySchemeChangesWithoutMappings.ts deleted file mode 100644 index 51c1ea7e02..0000000000 --- a/src/version2/models/prioritySchemeChangesWithoutMappings.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface PrioritySchemeChangesWithoutMappings { - /** Affected entity ids. */ - ids: number[]; -} diff --git a/src/version2/models/prioritySchemeId.ts b/src/version2/models/prioritySchemeId.ts deleted file mode 100644 index f21e2e965c..0000000000 --- a/src/version2/models/prioritySchemeId.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { TaskProgressNode } from './taskProgressNode'; - -/** The ID of a priority scheme. */ -export interface PrioritySchemeId { - /** The ID of the priority scheme. */ - id?: string; - task?: TaskProgressNode; -} diff --git a/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts b/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts deleted file mode 100644 index a7e466fabd..0000000000 --- a/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Paginated } from '../../paginated'; -import type { ProjectDetails } from './projectDetails'; -import type { PriorityWithSequence } from './priorityWithSequence'; - -/** A priority scheme with paginated priorities and projects. */ -export interface PrioritySchemeWithPaginatedPrioritiesAndProjects { - default?: boolean; - /** The ID of the default issue priority. */ - defaultPriorityId?: string; - /** The description of the priority scheme */ - description?: string; - /** The ID of the priority scheme. */ - id: string; - isDefault?: boolean; - /** The name of the priority scheme */ - name: string; - priorities?: Paginated; - projects?: Paginated; - /** The URL of the priority scheme. */ - self?: string; -} diff --git a/src/version2/models/priorityWithSequence.ts b/src/version2/models/priorityWithSequence.ts deleted file mode 100644 index 8012f612ad..0000000000 --- a/src/version2/models/priorityWithSequence.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** 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/project.ts b/src/version2/models/project.ts deleted file mode 100644 index ed8e0c4dc0..0000000000 --- a/src/version2/models/project.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type { AvatarUrls } from './avatarUrls'; -import type { Hierarchy } from './hierarchy'; -import type { IssueTypeDetails } from './issueTypeDetails'; -import type { ProjectCategory } from './projectCategory'; -import type { ProjectComponent } from './projectComponent'; -import type { ProjectInsight } from './projectInsight'; -import type { ProjectLandingPageInfo } from './projectLandingPageInfo'; -import type { ProjectPermissions } from './projectPermissions'; -import type { User } from './user'; -import type { Version } from './version'; - -/** Details about a project. */ -export interface Project { - /** Whether the project is archived. */ - archived?: boolean; - archivedBy?: User; - /** The date when the project was archived. */ - archivedDate?: string; - /** The default assignee when creating issues for this project. */ - assigneeType?: string; - avatarUrls?: AvatarUrls; - /** List of the components contained in the project. */ - components?: ProjectComponent[]; - /** Whether the project is marked as deleted. */ - deleted?: boolean; - deletedBy?: User; - /** The date when the project was marked as deleted. */ - deletedDate?: string; - /** A brief description of the project. */ - description?: string; - /** An email address associated with the project. */ - email?: string; - /** Expand options that include additional project details in the response. */ - expand?: string; - /** Whether the project is selected as a favorite. */ - favourite?: boolean; - /** The ID of the project. */ - id?: string; - insight?: ProjectInsight; - /** Whether the project is private. */ - isPrivate?: boolean; - issueTypeHierarchy?: Hierarchy; - /** List of the issue types available in the project. */ - issueTypes?: IssueTypeDetails[]; - /** The key of the project. */ - key?: string; - landingPageInfo?: ProjectLandingPageInfo; - lead?: User; - /** The name of the project. */ - name?: string; - permissions?: ProjectPermissions; - projectCategory?: ProjectCategory; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey?: string; - /** Map of project properties */ - properties?: unknown; - /** The date when the project is deleted permanently. */ - retentionTillDate?: string; - /** - * The name and self URL for each role defined in the project. For more information, see [Create project - * role](#api-rest-api-2-role-post). - */ - roles?: unknown; - /** The URL of the project details. */ - self?: string; - /** Whether the project is simplified. */ - simplified?: boolean; - /** The type of the project. */ - style?: string; - /** A link to information about this project, such as project documentation. */ - url?: string; - /** Unique ID for next-gen projects. */ - uuid?: string; - /** The versions defined in the project. For more information, see [Create version](#api-rest-api-2-version-post). */ - versions?: Version[]; -} diff --git a/src/version2/models/projectAndIssueTypePair.ts b/src/version2/models/projectAndIssueTypePair.ts deleted file mode 100644 index 96adac43fc..0000000000 --- a/src/version2/models/projectAndIssueTypePair.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** A project and issueType ID pair that identifies a status mapping. */ -export interface ProjectAndIssueTypePair { - /** The ID of the issue type. */ - issueTypeId: string; - /** The ID of the project. */ - projectId: string; -} diff --git a/src/version2/models/projectAvatars.ts b/src/version2/models/projectAvatars.ts deleted file mode 100644 index a197537133..0000000000 --- a/src/version2/models/projectAvatars.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Avatar } from './avatar'; - -/** List of project avatars. */ -export interface ProjectAvatars { - /** List of avatars added to Jira. These avatars may be deleted. */ - custom?: Avatar[]; - /** List of avatars included with Jira. These avatars cannot be deleted. */ - system?: Avatar[]; -} diff --git a/src/version2/models/projectCategory.ts b/src/version2/models/projectCategory.ts deleted file mode 100644 index a62133daf8..0000000000 --- a/src/version2/models/projectCategory.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** A project category. */ -export interface ProjectCategory { - /** The description of the project category. */ - description?: string; - /** The ID of the project category. */ - id?: string; - /** The name of the project category. Required on create, optional on update. */ - name?: string; - /** The URL of the project category. */ - self?: string; -} diff --git a/src/version2/models/projectComponent.ts b/src/version2/models/projectComponent.ts deleted file mode 100644 index 273236fde9..0000000000 --- a/src/version2/models/projectComponent.ts +++ /dev/null @@ -1,70 +0,0 @@ -import type { User } from './user'; - -/** Details about a project component. */ -export interface ProjectComponent { - /** Compass component's ID. Can't be updated. Not required for creating a Project Component. */ - ari?: string; - assignee?: User; - /** - * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` - * for details on how the type of the user, and hence the user, assigned to issues is determined. Can take the - * following values: - * - * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the - * component is in. `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for - * the component. `UNASSIGNED` an assignee is not set for issues created with this component. `PROJECT_DEFAULT` the - * assignee to any issues created with this component is nominally the default assignee for the project that the - * component is in. - * - * Default value: `PROJECT_DEFAULT`. - * Optional when creating or updating a component. - */ - assigneeType?: string; - /** The description for the component. Optional when creating or updating a component. */ - description?: string; - /** The unique identifier for the component. */ - id?: string; - /** - * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but - * the component lead is not set, then `false` is returned. - */ - isAssigneeTypeValid?: boolean; - lead?: User; - /** - * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian - * products. For example, _5b10ac8d82e05b22cc7d4ef5_. - */ - leadAccountId?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - leadUserName?: string; - /** Compass component's metadata. Can't be updated. Not required for creating a Project Component. */ - metadata?: unknown; - /** - * The unique name for the component in the project. Required when creating a component. Optional when updating a - * component. The maximum length is 255 characters. - */ - name?: string; - /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ - project?: string; - /** The ID of the project the component is assigned to. */ - projectId?: number; - realAssignee?: User; - /** - * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set - * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This - * property is set to one of the following values: - * - * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in - * the project that the component is in. `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component - * lead has permission to be assigned issues in the project that the component is in. `UNASSIGNED` when `assigneeType` - * is `UNASSIGNED` and Jira is configured to allow unassigned issues. `PROJECT_DEFAULT` when none of the preceding - * cases are true. - */ - realAssigneeType?: string; - /** The URL of the component. */ - self?: string; -} diff --git a/src/version2/models/projectCreateResourceIdentifier.ts b/src/version2/models/projectCreateResourceIdentifier.ts deleted file mode 100644 index 08a2ea76e8..0000000000 --- a/src/version2/models/projectCreateResourceIdentifier.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Every project-created entity has an ID that must be unique within the scope of the project creation. PCRI (Project - * Create Resource Identifier) is a standard format for creating IDs and references to other project entities. PCRI - * format is defined as follows: pcri:[entityType]:[type]:[entityId] entityType - the type of an entity, e.g. status, - * role, workflow type - PCRI type, either `id` - The ID of an entity that already exists in the target site, or `ref` - - * A unique reference to an entity that is being created entityId - entity identifier, if type is `id` - must be an - * existing entity ID that exists in the Jira site, if `ref` - must be unique across all entities in the scope of this - * project template creation - */ -export interface ProjectCreateResourceIdentifier { - anID?: boolean; - areference?: boolean; - entityId?: string; - entityType?: string; - id?: string; - type?: 'id' | 'ref' | string; -} diff --git a/src/version2/models/projectCustomTemplateCreateRequest.ts b/src/version2/models/projectCustomTemplateCreateRequest.ts deleted file mode 100644 index 13a36a1590..0000000000 --- a/src/version2/models/projectCustomTemplateCreateRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CustomTemplatesProjectDetails } from './customTemplatesProjectDetails'; -import type { CustomTemplateRequest } from './customTemplateRequest'; - -/** Request to create a project using a custom template */ -export interface ProjectCustomTemplateCreateRequest { - details?: CustomTemplatesProjectDetails; - template?: CustomTemplateRequest; -} diff --git a/src/version2/models/projectDataPolicies.ts b/src/version2/models/projectDataPolicies.ts deleted file mode 100644 index 1c937c69e0..0000000000 --- a/src/version2/models/projectDataPolicies.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ProjectWithDataPolicy } from './projectWithDataPolicy'; - -/** Details about data policies for a list of projects. */ -export interface ProjectDataPolicies { - /** List of projects with data policies. */ - projectDataPolicies?: ProjectWithDataPolicy[]; -} diff --git a/src/version2/models/projectDataPolicy.ts b/src/version2/models/projectDataPolicy.ts deleted file mode 100644 index 4a8b013ea6..0000000000 --- a/src/version2/models/projectDataPolicy.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** 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/projectDetails.ts b/src/version2/models/projectDetails.ts deleted file mode 100644 index fe613e98bd..0000000000 --- a/src/version2/models/projectDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { AvatarUrls } from './avatarUrls'; -import type { UpdatedProjectCategory } from './updatedProjectCategory'; - -/** Details about a project. */ -export interface ProjectDetails { - avatarUrls?: AvatarUrls; - /** The ID of the project. */ - id?: string; - /** The key of the project. */ - key?: string; - /** The name of the project. */ - name?: string; - projectCategory?: UpdatedProjectCategory; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey?: string; - /** The URL of the project details. */ - self?: string; - /** Whether or not the project is simplified. */ - simplified?: boolean; -} diff --git a/src/version2/models/projectEmailAddress.ts b/src/version2/models/projectEmailAddress.ts deleted file mode 100644 index 982219c237..0000000000 --- a/src/version2/models/projectEmailAddress.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** A project's sender email address. */ -export interface ProjectEmailAddress { - /** The email address. */ - emailAddress?: string; - /** When using a custom domain, the status of the email address. */ - emailAddressStatus?: string[]; -} diff --git a/src/version2/models/projectFeature.ts b/src/version2/models/projectFeature.ts deleted file mode 100644 index 97c5815872..0000000000 --- a/src/version2/models/projectFeature.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** Details of a project feature. */ -export interface ProjectFeature { - /** The key of the feature. */ - feature?: string; - /** URI for the image representing the feature. */ - imageUri?: string; - /** Localized display description for the feature. */ - localisedDescription?: string; - /** Localized display name for the feature. */ - localisedName?: string; - /** List of keys of the features required to enable the feature. */ - prerequisites?: string[]; - /** The ID of the project. */ - projectId?: number; - /** - * The state of the feature. When updating the state of a feature, only ENABLED and DISABLED are supported. Responses - * can contain all values - */ - state?: string; - /** Whether the state of the feature can be updated. */ - toggleLocked?: boolean; -} diff --git a/src/version2/models/projectFeatureToggleRequest.ts b/src/version2/models/projectFeatureToggleRequest.ts deleted file mode 100644 index ce5f29560e..0000000000 --- a/src/version2/models/projectFeatureToggleRequest.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Container for a request to toggle the state of the feature to ENABLED or DISABLED. */ -export interface ProjectFeatureToggleRequest { - /** The new state for the feature */ - state?: 'ENABLED' | 'DISABLED' | 'COMING_SOON'; -} diff --git a/src/version2/models/projectId.ts b/src/version2/models/projectId.ts deleted file mode 100644 index c86760d2cd..0000000000 --- a/src/version2/models/projectId.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Project ID details. */ -export interface ProjectId { - /** The ID of the project. */ - id: string; -} diff --git a/src/version2/models/projectIdentifier.ts b/src/version2/models/projectIdentifier.ts deleted file mode 100644 index 1a0c6852a1..0000000000 --- a/src/version2/models/projectIdentifier.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The identifiers for a project. */ -export interface ProjectIdentifier { - /** The ID of the project. */ - id?: number; - /** The key of the project. */ - key?: string; -} diff --git a/src/version2/models/projectIdentifiers.ts b/src/version2/models/projectIdentifiers.ts deleted file mode 100644 index 26ec8e333b..0000000000 --- a/src/version2/models/projectIdentifiers.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Identifiers for a project. */ -export interface ProjectIdentifiers { - /** The ID of the created project. */ - id: number; - /** The key of the created project. */ - key: string; - /** The URL of the created project. */ - self: string; -} diff --git a/src/version2/models/projectIds.ts b/src/version2/models/projectIds.ts deleted file mode 100644 index becc8da219..0000000000 --- a/src/version2/models/projectIds.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** A list of project IDs. */ -export interface ProjectIds { - /** The IDs of projects. */ - projectIds: string[]; -} diff --git a/src/version2/models/projectInsight.ts b/src/version2/models/projectInsight.ts deleted file mode 100644 index 5dd6d2bffe..0000000000 --- a/src/version2/models/projectInsight.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Additional details about a project. */ -export interface ProjectInsight { - /** The last issue update time. */ - lastIssueUpdateTime?: string; - /** Total issue count. */ - totalIssueCount?: number; -} diff --git a/src/version2/models/projectIssueCreateMetadata.ts b/src/version2/models/projectIssueCreateMetadata.ts deleted file mode 100644 index 15f1999ff3..0000000000 --- a/src/version2/models/projectIssueCreateMetadata.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { AvatarUrls } from './avatarUrls'; -import type { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata'; - -/** Details of the issue creation metadata for a project. */ -export interface ProjectIssueCreateMetadata { - avatarUrls?: AvatarUrls; - /** Expand options that include additional project issue create metadata details in the response. */ - expand?: string; - /** The ID of the project. */ - id?: string; - /** List of the issue types supported by the project. */ - issuetypes?: IssueTypeIssueCreateMetadata[]; - /** The key of the project. */ - key?: string; - /** The name of the project. */ - name?: string; - /** The URL of the project. */ - self?: string; -} diff --git a/src/version2/models/projectIssueSecurityLevels.ts b/src/version2/models/projectIssueSecurityLevels.ts deleted file mode 100644 index b88e4677c7..0000000000 --- a/src/version2/models/projectIssueSecurityLevels.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SecurityLevel } from './securityLevel'; - -/** List of issue level security items in a project. */ -export interface ProjectIssueSecurityLevels { - /** Issue level security items list. */ - levels: SecurityLevel[]; -} diff --git a/src/version2/models/projectIssueTypeHierarchy.ts b/src/version2/models/projectIssueTypeHierarchy.ts deleted file mode 100644 index c9ed6f8c0c..0000000000 --- a/src/version2/models/projectIssueTypeHierarchy.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ProjectIssueTypesHierarchyLevel } from './projectIssueTypesHierarchyLevel'; - -/** The hierarchy of issue types within a project. */ -export interface ProjectIssueTypeHierarchy { - /** Details of an issue type hierarchy level. */ - hierarchy?: ProjectIssueTypesHierarchyLevel[]; - /** The ID of the project. */ - projectId?: number; -} diff --git a/src/version2/models/projectIssueTypeMapping.ts b/src/version2/models/projectIssueTypeMapping.ts deleted file mode 100644 index fb89ce3e3a..0000000000 --- a/src/version2/models/projectIssueTypeMapping.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The project and issue type mapping. */ -export interface ProjectIssueTypeMapping { - /** The ID of the issue type. */ - issueTypeId: string; - /** The ID of the project. */ - projectId: string; -} diff --git a/src/version2/models/projectIssueTypeMappings.ts b/src/version2/models/projectIssueTypeMappings.ts deleted file mode 100644 index 68f560a86b..0000000000 --- a/src/version2/models/projectIssueTypeMappings.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ProjectIssueTypeMapping } from './projectIssueTypeMapping'; - -/** The project and issue type mappings. */ -export interface ProjectIssueTypeMappings { - /** The project and issue type mappings. */ - mappings: ProjectIssueTypeMapping[]; -} diff --git a/src/version2/models/projectIssueTypes.ts b/src/version2/models/projectIssueTypes.ts deleted file mode 100644 index 123d3908dd..0000000000 --- a/src/version2/models/projectIssueTypes.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectId } from './projectId'; - -/** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ -export interface ProjectIssueTypes { - /** IDs of the issue types */ - issueTypes?: string[]; - project?: ProjectId; -} diff --git a/src/version2/models/projectIssueTypesHierarchyLevel.ts b/src/version2/models/projectIssueTypesHierarchyLevel.ts deleted file mode 100644 index e1ad5187f6..0000000000 --- a/src/version2/models/projectIssueTypesHierarchyLevel.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { IssueTypeInfo } from './issueTypeInfo'; - -/** Details of an issue type hierarchy level. */ -export interface ProjectIssueTypesHierarchyLevel { - /** The list of issue types in the hierarchy level. */ - issueTypes?: IssueTypeInfo[]; - /** The level of the issue type hierarchy level. */ - level?: number; - /** The name of the issue type hierarchy level. */ - name?: string; -} diff --git a/src/version2/models/projectLandingPageInfo.ts b/src/version2/models/projectLandingPageInfo.ts deleted file mode 100644 index 4e4bfff307..0000000000 --- a/src/version2/models/projectLandingPageInfo.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface ProjectLandingPageInfo { - attributes?: unknown; - boardId?: number; - boardName?: string; - projectKey?: string; - projectType?: string; - queueCategory?: string; - queueId?: number; - queueName?: string; - simpleBoard?: boolean; - simplified?: boolean; - url?: string; -} diff --git a/src/version2/models/projectPayload.ts b/src/version2/models/projectPayload.ts deleted file mode 100644 index 32715b5a3c..0000000000 --- a/src/version2/models/projectPayload.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** The payload for creating a project */ -export interface ProjectPayload { - fieldLayoutSchemeId?: ProjectCreateResourceIdentifier; - issueSecuritySchemeId?: ProjectCreateResourceIdentifier; - issueTypeSchemeId?: ProjectCreateResourceIdentifier; - issueTypeScreenSchemeId?: ProjectCreateResourceIdentifier; - notificationSchemeId?: ProjectCreateResourceIdentifier; - pcri?: ProjectCreateResourceIdentifier; - permissionSchemeId?: ProjectCreateResourceIdentifier; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes), which - * defines the application-specific feature set. If you don't specify the project template you have to specify the - * project type. - */ - projectTypeKey?: 'software' | 'business' | 'service_desk' | 'product_discovery' | string; - workflowSchemeId?: ProjectCreateResourceIdentifier; -} diff --git a/src/version2/models/projectPermissions.ts b/src/version2/models/projectPermissions.ts deleted file mode 100644 index 4c1387e5e8..0000000000 --- a/src/version2/models/projectPermissions.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Permissions which a user has on a project. */ -export interface ProjectPermissions { - /** Whether the logged user can edit the project. */ - canEdit?: boolean; -} diff --git a/src/version2/models/projectRole.ts b/src/version2/models/projectRole.ts deleted file mode 100644 index b60e218a1d..0000000000 --- a/src/version2/models/projectRole.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { RoleActor } from './roleActor'; -import type { Scope } from './scope'; - -/** Details about the roles in a project. */ -export interface ProjectRole { - /** The list of users who act in this role. */ - actors?: RoleActor[]; - /** Whether this role is the admin role for the project. */ - admin?: boolean; - /** Whether the calling user is part of this role. */ - currentUserRole?: boolean; - /** Whether this role is the default role for the project */ - default?: boolean; - /** The description of the project role. */ - description?: string; - /** The ID of the project role. */ - id?: number; - /** The name of the project role. */ - name?: string; - /** Whether the roles are configurable for this project. */ - roleConfigurable?: boolean; - scope?: Scope; - /** The URL the project role details. */ - self?: string; - /** The translated name of the project role. */ - translatedName?: string; -} diff --git a/src/version2/models/projectRoleActorsUpdate.ts b/src/version2/models/projectRoleActorsUpdate.ts deleted file mode 100644 index 3e5054b323..0000000000 --- a/src/version2/models/projectRoleActorsUpdate.ts +++ /dev/null @@ -1,21 +0,0 @@ -export interface ProjectRoleActorsUpdate { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id?: number; - /** - * The actors to add to the project role. - * - * Add groups using: - * - * `atlassian-group-role-actor` and a list of group names. `atlassian-group-role-actor-id` and a list of group IDs. - * - * As a group's name can change, use of `atlassian-group-role-actor-id` is recommended. For example, - * `"atlassian-group-role-actor-id":["eef79f81-0b89-4fca-a736-4be531a10869","77f6ab39-e755-4570-a6ae-2d7a8df0bcb8"]`. - * - * Add users using `atlassian-user-role-actor` and a list of account IDs. For example, - * `"atlassian-user-role-actor":["12345678-9abc-def1-2345-6789abcdef12", "abcdef12-3456-789a-bcde-f123456789ab"]`. - */ - categorisedActors?: unknown; -} diff --git a/src/version2/models/projectRoleDetails.ts b/src/version2/models/projectRoleDetails.ts deleted file mode 100644 index 910a7b9738..0000000000 --- a/src/version2/models/projectRoleDetails.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { Scope } from './scope'; - -/** Details about a project role. */ -export interface ProjectRoleDetails { - /** Whether this role is the admin role for the project. */ - admin?: boolean; - /** Whether this role is the default role for the project. */ - default?: boolean; - /** The description of the project role. */ - description?: string; - /** The ID of the project role. */ - id?: number; - /** The name of the project role. */ - name?: string; - /** Whether the roles are configurable for this project. */ - roleConfigurable?: boolean; - scope?: Scope; - /** The URL the project role details. */ - self?: string; - /** The translated name of the project role. */ - translatedName?: string; -} diff --git a/src/version2/models/projectRoleGroup.ts b/src/version2/models/projectRoleGroup.ts deleted file mode 100644 index 75613784d4..0000000000 --- a/src/version2/models/projectRoleGroup.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of the group associated with the role. */ -export interface ProjectRoleGroup { - /** The display name of the group. */ - displayName?: string; - /** The ID of the group. */ - groupId?: string; - /** The name of the group. As a group's name can change, use of `groupId` is recommended to identify the group. */ - name?: string; -} diff --git a/src/version2/models/projectRoleUser.ts b/src/version2/models/projectRoleUser.ts deleted file mode 100644 index 3fe4026002..0000000000 --- a/src/version2/models/projectRoleUser.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of the user associated with the role. */ -export interface ProjectRoleUser { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. Returns _unknown_ if the record is deleted and corrupted, for example, as the result of - * a server import. - */ - accountId?: string; -} diff --git a/src/version2/models/projectScope.ts b/src/version2/models/projectScope.ts deleted file mode 100644 index cd4f9d4140..0000000000 --- a/src/version2/models/projectScope.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface ProjectScope { - /** - * Defines the behavior of the option in the project.If notSelectable is set, the option cannot be set as the field's - * value. This is useful for archiving an option that has previously been selected but shouldn't be used anymore.If - * defaultValue is set, the option is selected by default. - */ - attributes?: string[]; - /** The ID of the project that the option's behavior applies to. */ - id?: number; -} diff --git a/src/version2/models/projectType.ts b/src/version2/models/projectType.ts deleted file mode 100644 index 4975b62cd7..0000000000 --- a/src/version2/models/projectType.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** Details about a project type. */ -export interface ProjectType { - /** The color of the project type. */ - color: string; - /** The key of the project type's description. */ - descriptionI18nKey: string; - /** The formatted key of the project type. */ - formattedKey: string; - /** The icon of the project type. */ - icon: string; - /** The key of the project type. */ - key: string; -} diff --git a/src/version2/models/projectUsage.ts b/src/version2/models/projectUsage.ts deleted file mode 100644 index 2cc468d44c..0000000000 --- a/src/version2/models/projectUsage.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The project. */ -export interface ProjectUsage { - /** The project ID. */ - id?: string; -} diff --git a/src/version2/models/projectUsagePage.ts b/src/version2/models/projectUsagePage.ts deleted file mode 100644 index 698072b089..0000000000 --- a/src/version2/models/projectUsagePage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { 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 deleted file mode 100644 index 8a8c6b2494..0000000000 --- a/src/version2/models/projectWithDataPolicy.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { 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/propertyKey.ts b/src/version2/models/propertyKey.ts deleted file mode 100644 index d9a3b7015e..0000000000 --- a/src/version2/models/propertyKey.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Property key details. */ -export interface PropertyKey { - /** The key of the property. */ - key?: string; - /** The URL of the property. */ - self?: string; -} diff --git a/src/version2/models/propertyKeys.ts b/src/version2/models/propertyKeys.ts deleted file mode 100644 index de5af01691..0000000000 --- a/src/version2/models/propertyKeys.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PropertyKey } from './propertyKey'; - -/** List of property keys. */ -export interface PropertyKeys { - /** Property key details. */ - keys?: PropertyKey[]; -} diff --git a/src/version2/models/publishedWorkflowId.ts b/src/version2/models/publishedWorkflowId.ts deleted file mode 100644 index 49969b10cb..0000000000 --- a/src/version2/models/publishedWorkflowId.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Properties that identify a published workflow. */ -export interface PublishedWorkflowId { - /** The entity ID of the workflow. */ - entityId?: string; - /** The name of the workflow. */ - name: string; -} diff --git a/src/version2/models/quickFilterPayload.ts b/src/version2/models/quickFilterPayload.ts deleted file mode 100644 index c4573d3465..0000000000 --- a/src/version2/models/quickFilterPayload.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** The payload for defining quick filters */ -export interface QuickFilterPayload { - /** The description of the quick filter */ - description?: string; - /** The jql query for the quick filter */ - jqlQuery?: string; - /** The name of the quick filter */ - name?: string; -} diff --git a/src/version2/models/registeredWebhook.ts b/src/version2/models/registeredWebhook.ts deleted file mode 100644 index 19ea6422c0..0000000000 --- a/src/version2/models/registeredWebhook.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** ID of a registered webhook or error messages explaining why a webhook wasn't registered. */ -export interface RegisteredWebhook { - /** The ID of the webhook. Returned if the webhook is created. */ - createdWebhookId?: number; - /** Error messages specifying why the webhook creation failed. */ - errors?: string[]; -} diff --git a/src/version2/models/remoteIssueLink.ts b/src/version2/models/remoteIssueLink.ts deleted file mode 100644 index 391ac0f1d8..0000000000 --- a/src/version2/models/remoteIssueLink.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Application } from './application'; -import type { RemoteObject } from './remoteObject'; - -/** Details of an issue remote link. */ -export interface RemoteIssueLink { - application?: Application; - /** The global ID of the link, such as the ID of the item on the remote system. */ - globalId?: string; - /** The ID of the link. */ - id?: number; - object?: RemoteObject; - /** Description of the relationship between the issue and the linked item. */ - relationship?: string; - /** The URL of the link. */ - self?: string; -} diff --git a/src/version2/models/remoteIssueLinkIdentifies.ts b/src/version2/models/remoteIssueLinkIdentifies.ts deleted file mode 100644 index 89d483e92b..0000000000 --- a/src/version2/models/remoteIssueLinkIdentifies.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of the identifiers for a created or updated remote issue link. */ -export interface RemoteIssueLinkIdentifies { - /** The ID of the remote issue link, such as the ID of the item on the remote system. */ - id?: number; - /** The URL of the remote issue link. */ - self?: string; -} diff --git a/src/version2/models/remoteIssueLinkRequest.ts b/src/version2/models/remoteIssueLinkRequest.ts deleted file mode 100644 index 04b239e1ee..0000000000 --- a/src/version2/models/remoteIssueLinkRequest.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Application } from './application'; -import type { RemoteObject } from './remoteObject'; - -/** Details of a remote issue link. */ -export interface RemoteIssueLinkRequest { - /** - * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence - * would consist of the app ID and page ID, like this: `appId=456&pageId=123`. - * - * Setting this field enables the remote issue link details to be updated or deleted using remote system and item - * details as the record identifier, rather than using the record's Jira ID. - * - * The maximum length is 255 characters. - */ - globalId?: string; - application?: Application; - /** - * Description of the relationship between the issue and the linked item. If not set, the relationship description - * "links to" is used in Jira. - */ - relationship?: string; - object?: RemoteObject; -} diff --git a/src/version2/models/remoteObject.ts b/src/version2/models/remoteObject.ts deleted file mode 100644 index ff4a80edd2..0000000000 --- a/src/version2/models/remoteObject.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Icon } from './icon'; -import type { Status } from './status'; - -/** The linked item. */ -export interface RemoteObject { - icon?: Icon; - status?: Status; - /** The summary details of the item. */ - summary?: string; - /** The title of the item. */ - title: string; - /** The URL of the item. */ - url: string; -} diff --git a/src/version2/models/removeOptionFromIssuesResult.ts b/src/version2/models/removeOptionFromIssuesResult.ts deleted file mode 100644 index e757363e2c..0000000000 --- a/src/version2/models/removeOptionFromIssuesResult.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { 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/reorderIssuePriorities.ts b/src/version2/models/reorderIssuePriorities.ts deleted file mode 100644 index 34d5b850bb..0000000000 --- a/src/version2/models/reorderIssuePriorities.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Change the order of issue priorities. */ -export interface ReorderIssuePriorities { - /** The ID of the priority. Required if `position` isn't provided. */ - after?: string; - /** The list of issue IDs to be reordered. Cannot contain duplicates nor after ID. */ - ids: string[]; - /** The position for issue priorities to be moved to. Required if `after` isn't provided. */ - position?: string; -} diff --git a/src/version2/models/reorderIssueResolutionsRequest.ts b/src/version2/models/reorderIssueResolutionsRequest.ts deleted file mode 100644 index 7537d0ead5..0000000000 --- a/src/version2/models/reorderIssueResolutionsRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Change the order of issue resolutions. */ -export interface ReorderIssueResolutionsRequest { - /** The ID of the resolution. Required if `position` isn't provided. */ - after?: string; - /** The list of resolution IDs to be reordered. Cannot contain duplicates nor after ID. */ - ids: string[]; - /** The position for issue resolutions to be moved to. Required if `after` isn't provided. */ - position?: string; -} diff --git a/src/version2/models/requiredMappingByIssueType.ts b/src/version2/models/requiredMappingByIssueType.ts deleted file mode 100644 index 3d85f836c5..0000000000 --- a/src/version2/models/requiredMappingByIssueType.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** 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 deleted file mode 100644 index b30e14666e..0000000000 --- a/src/version2/models/requiredMappingByWorkflows.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** 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/resolution.ts b/src/version2/models/resolution.ts deleted file mode 100644 index ea95592d8d..0000000000 --- a/src/version2/models/resolution.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** Details of an issue resolution. */ -export interface Resolution { - /** The URL of the issue resolution. */ - self?: string; - /** The ID of the issue resolution. */ - id?: string; - /** The description of the issue resolution. */ - description?: string; - /** The name of the issue resolution. */ - name?: string; - iconUrl?: string; - default?: boolean; -} diff --git a/src/version2/models/resolutionId.ts b/src/version2/models/resolutionId.ts deleted file mode 100644 index a0d40a3f85..0000000000 --- a/src/version2/models/resolutionId.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The ID of an issue resolution. */ -export interface ResolutionId { - /** The ID of the issue resolution. */ - id: string; -} diff --git a/src/version2/models/restrictedPermission.ts b/src/version2/models/restrictedPermission.ts deleted file mode 100644 index 336c5d8cab..0000000000 --- a/src/version2/models/restrictedPermission.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** Details of the permission. */ -export interface RestrictedPermission { - /** - * 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; -} diff --git a/src/version2/models/richText.ts b/src/version2/models/richText.ts deleted file mode 100644 index 9f5f7ba5d7..0000000000 --- a/src/version2/models/richText.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface RichText { - empty?: boolean; - emptyAdf?: boolean; - finalised?: boolean; - valueSet?: boolean; -} diff --git a/src/version2/models/roleActor.ts b/src/version2/models/roleActor.ts deleted file mode 100644 index 173ab17a06..0000000000 --- a/src/version2/models/roleActor.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { ProjectRoleGroup } from './projectRoleGroup'; -import type { ProjectRoleUser } from './projectRoleUser'; - -/** Details about a user assigned to a project role. */ -export interface RoleActor { - actorGroup?: ProjectRoleGroup; - actorUser?: ProjectRoleUser; - /** The avatar of the role actor. */ - avatarUrl?: string; - /** - * The display name of the role actor. For users, depending on the user’s privacy setting, this may return an - * alternative value for the user's name. - */ - displayName?: string; - /** The ID of the role actor. */ - id?: number; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; - /** The type of role actor. */ - type?: string; -} diff --git a/src/version2/models/rolePayload.ts b/src/version2/models/rolePayload.ts deleted file mode 100644 index 41bf4346b4..0000000000 --- a/src/version2/models/rolePayload.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** - * The payload used to create a project role. It is optional for CMP projects, as a default role actor will be provided. - * TMP will add new role actors to the table. - */ -export interface RolePayload { - /** The default actors for the role. By adding default actors, the role will be added to any future projects created */ - defaultActors?: ProjectCreateResourceIdentifier[]; - /** The description of the role */ - description?: string; - /** The name of the role */ - name?: string; - /** - * The strategy to use when there is a conflict with an existing project role. FAIL - Fail execution, this always - * needs to be unique; USE - Use the existing entity and ignore new entity parameters - */ - onConflict?: 'FAIL' | 'USE' | 'NEW' | string; - pcri?: ProjectCreateResourceIdentifier; - /** The type of the role. Only used by project-scoped project */ - type?: 'HIDDEN' | 'VIEWABLE' | 'EDITABLE' | string; -} diff --git a/src/version2/models/rolesCapabilityPayload.ts b/src/version2/models/rolesCapabilityPayload.ts deleted file mode 100644 index f75df0ffd5..0000000000 --- a/src/version2/models/rolesCapabilityPayload.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { RolePayload } from './rolePayload'; - -export interface RolesCapabilityPayload { - /** A map of role PCRI (can be ID or REF) to a list of user or group PCRI IDs to associate with the role and project. */ - roleToProjectActors?: {}; - /** The list of roles to create. */ - roles?: RolePayload[]; -} diff --git a/src/version2/models/ruleConfiguration.ts b/src/version2/models/ruleConfiguration.ts deleted file mode 100644 index 4acde27293..0000000000 --- a/src/version2/models/ruleConfiguration.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** A rule configuration. */ -export interface RuleConfiguration { - /** EXPERIMENTAL: Whether the rule is disabled. */ - disabled?: boolean; - /** - * EXPERIMENTAL: A tag used to filter rules in [Get workflow transition rule - * 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. */ - value: string; -} diff --git a/src/version2/models/rulePayload.ts b/src/version2/models/rulePayload.ts deleted file mode 100644 index 58019e6e81..0000000000 --- a/src/version2/models/rulePayload.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** The payload for creating rules in a workflow */ -export interface RulePayload { - /** The parameters of the rule */ - parameters?: {}; - /** - * The key of the rule. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflows-capabilities-get - */ - ruleKey?: string; -} diff --git a/src/version2/models/sanitizedJqlQueries.ts b/src/version2/models/sanitizedJqlQueries.ts deleted file mode 100644 index c5bc3474fe..0000000000 --- a/src/version2/models/sanitizedJqlQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SanitizedJqlQuery } from './sanitizedJqlQuery'; - -/** The sanitized JQL queries for the given account IDs. */ -export interface SanitizedJqlQueries { - /** The list of sanitized JQL queries. */ - queries?: SanitizedJqlQuery[]; -} diff --git a/src/version2/models/sanitizedJqlQuery.ts b/src/version2/models/sanitizedJqlQuery.ts deleted file mode 100644 index dbc27ee30c..0000000000 --- a/src/version2/models/sanitizedJqlQuery.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ErrorCollection } from './errorCollection'; - -/** Details of the sanitized JQL query. */ -export interface SanitizedJqlQuery { - /** The account ID of the user for whom sanitization was performed. */ - accountId?: string; - errors?: ErrorCollection; - /** The initial query. */ - initialQuery?: string; - /** The sanitized query, if there were no errors. */ - sanitizedQuery?: string; -} diff --git a/src/version2/models/scope.ts b/src/version2/models/scope.ts deleted file mode 100644 index 0d02efd5c1..0000000000 --- a/src/version2/models/scope.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ProjectDetails } from './projectDetails'; - -/** - * The projects the item is associated with. Indicated for items associated with [next-gen - * projects](https://confluence.atlassian.com/x/loMyO). - */ -export interface Scope { - project?: ProjectDetails; - /** The type of scope. */ - type?: string; -} diff --git a/src/version2/models/scopePayload.ts b/src/version2/models/scopePayload.ts deleted file mode 100644 index f4a54f83a5..0000000000 --- a/src/version2/models/scopePayload.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The payload for creating a scope. Defines if a project is team-managed project or company-managed project */ -export interface ScopePayload { - /** The type of the scope. Use `GLOBAL` or empty for company-managed project, and `PROJECT` for team-managed project */ - type?: 'GLOBAL' | 'PROJECT' | string; -} diff --git a/src/version2/models/screen.ts b/src/version2/models/screen.ts deleted file mode 100644 index 705503e13b..0000000000 --- a/src/version2/models/screen.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Scope } from './scope'; - -/** A screen. */ -export interface Screen { - /** The description of the screen. */ - description?: string; - /** The ID of the screen. */ - id?: number; - /** The name of the screen. */ - name?: string; - scope?: Scope; -} diff --git a/src/version2/models/screenDetails.ts b/src/version2/models/screenDetails.ts deleted file mode 100644 index 5d2bdfb2ec..0000000000 --- a/src/version2/models/screenDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of a screen. */ -export interface ScreenDetails { - /** The description of the screen. The maximum length is 255 characters. */ - description?: string; - /** The name of the screen. The name must be unique. The maximum length is 255 characters. */ - name: string; -} diff --git a/src/version2/models/screenPayload.ts b/src/version2/models/screenPayload.ts deleted file mode 100644 index 57b7d15863..0000000000 --- a/src/version2/models/screenPayload.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; -import type { TabPayload } from './tabPayload'; - -/** - * Defines the payload for the field screens. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screens/#api-rest-api-3-screens-post - */ -export interface ScreenPayload { - /** The description of the screen */ - description?: string; - /** The name of the screen */ - name?: string; - pcri?: ProjectCreateResourceIdentifier; - /** - * The tabs of the screen. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-tab-fields/#api-rest-api-3-screens-screenid-tabs-tabid-fields-post - */ - tabs?: TabPayload[]; -} diff --git a/src/version2/models/screenScheme.ts b/src/version2/models/screenScheme.ts deleted file mode 100644 index 06b70658d5..0000000000 --- a/src/version2/models/screenScheme.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { PageIssueTypeScreenScheme } from './pageIssueTypeScreenScheme'; -import type { ScreenTypes } from './screenTypes'; - -/** A screen scheme. */ -export interface ScreenScheme { - /** The description of the screen scheme. */ - description?: string; - /** The ID of the screen scheme. */ - id?: number; - issueTypeScreenSchemes?: PageIssueTypeScreenScheme; - /** The name of the screen scheme. */ - name?: string; - screens?: ScreenTypes; -} diff --git a/src/version2/models/screenSchemeDetails.ts b/src/version2/models/screenSchemeDetails.ts deleted file mode 100644 index 9286838b5f..0000000000 --- a/src/version2/models/screenSchemeDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ScreenTypes } from './screenTypes'; - -/** Details of a screen scheme. */ -export interface ScreenSchemeDetails { - /** The description of the screen scheme. The maximum length is 255 characters. */ - description?: string; - /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ - name: string; - screens?: ScreenTypes; -} diff --git a/src/version2/models/screenSchemeId.ts b/src/version2/models/screenSchemeId.ts deleted file mode 100644 index 392187734c..0000000000 --- a/src/version2/models/screenSchemeId.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The ID of a screen scheme. */ -export interface ScreenSchemeId { - /** The ID of the screen scheme. */ - id: number; -} diff --git a/src/version2/models/screenSchemePayload.ts b/src/version2/models/screenSchemePayload.ts deleted file mode 100644 index 1b799ffd1d..0000000000 --- a/src/version2/models/screenSchemePayload.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** - * Defines the payload for the screen schemes. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-schemes/#api-rest-api-3-screenscheme-post - */ -export interface ScreenSchemePayload { - defaultScreen?: ProjectCreateResourceIdentifier; - /** The description of the screen scheme */ - description?: string; - /** The name of the screen scheme */ - name?: string; - pcri?: ProjectCreateResourceIdentifier; - /** - * Similar to the field layout scheme those mappings allow users to set different screens for different operations: - * default - always there, applied to all operations that don't have an explicit mapping `create`, `view`, `edit` - - * specific operations that are available and users can assign a different screen for each one of them - * https://support.atlassian.com/jira-cloud-administration/docs/manage-screen-schemes/#Associating-a-screen-with-an-issue-operation - */ - screens?: {}; -} diff --git a/src/version2/models/screenTypes.ts b/src/version2/models/screenTypes.ts deleted file mode 100644 index 4feb7de6cf..0000000000 --- a/src/version2/models/screenTypes.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** The IDs of the screens for the screen types of the screen scheme. */ -export interface ScreenTypes { - /** The ID of the create screen. */ - create?: number; - /** The ID of the default screen. Required when creating a screen scheme. */ - default?: number; - /** The ID of the edit screen. */ - edit?: number; - /** The ID of the view screen. */ - view?: number; -} diff --git a/src/version2/models/screenWithTab.ts b/src/version2/models/screenWithTab.ts deleted file mode 100644 index b35d064df4..0000000000 --- a/src/version2/models/screenWithTab.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Scope } from './scope'; -import type { ScreenableTab } from './screenableTab'; - -/** A screen with tab details. */ -export interface ScreenWithTab { - /** The description of the screen. */ - description?: string; - /** The ID of the screen. */ - id?: number; - /** The name of the screen. */ - name?: string; - scope?: Scope; - tab?: ScreenableTab; -} diff --git a/src/version2/models/screenableField.ts b/src/version2/models/screenableField.ts deleted file mode 100644 index 20850cc8e3..0000000000 --- a/src/version2/models/screenableField.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** A screen tab field. */ -export interface ScreenableField { - /** The ID of the screen tab field. */ - id?: string; - /** The name of the screen tab field. Required on create and update. The maximum length is 255 characters. */ - name?: string; -} diff --git a/src/version2/models/screenableTab.ts b/src/version2/models/screenableTab.ts deleted file mode 100644 index df7e919c6b..0000000000 --- a/src/version2/models/screenableTab.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** A screen tab. */ -export interface ScreenableTab { - /** The ID of the screen tab. */ - id?: number; - /** The name of the screen tab. The maximum length is 255 characters. */ - name: string; -} diff --git a/src/version2/models/searchAndReconcileResults.ts b/src/version2/models/searchAndReconcileResults.ts deleted file mode 100644 index 977f9e4666..0000000000 --- a/src/version2/models/searchAndReconcileResults.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Issue } from './issue'; - -/** The result of a JQL search. */ -export interface SearchAndReconcileResults { - /** The list of issues found by the search or reconsiliation. */ - issues?: Issue[]; - /** The ID and name of each field in the search results. */ - names?: unknown; - /** - * Continuation token to fetch the next page. If this result represents the last or the only page this token will be - * null. This token will expire in 7 days. - */ - nextPageToken?: string; - /** The schema describing the field types in the search results. */ - schema?: unknown; -} diff --git a/src/version2/models/searchAutoComplete.ts b/src/version2/models/searchAutoComplete.ts deleted file mode 100644 index b15f733465..0000000000 --- a/src/version2/models/searchAutoComplete.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface SearchAutoComplete { - /** List of project IDs used to filter the visible field details returned. */ - projectIds?: number[]; - /** Include collapsed fields for fields that have non-unique names. */ - includeCollapsedFields?: boolean; -} diff --git a/src/version2/models/searchRequest.ts b/src/version2/models/searchRequest.ts deleted file mode 100644 index c5b8e9ba58..0000000000 --- a/src/version2/models/searchRequest.ts +++ /dev/null @@ -1,80 +0,0 @@ -export interface SearchRequest { - /** A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. */ - jql?: string; - /** The index of the first item to return in the page of results (page offset). The base index is `0`. */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a - * comma-separated list. Expand options include: - * - * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to - * exclude. - * - * The default is `*navigable`. - * - * Examples: - * - * `summary,comment` Returns the summary and comments fields only. `-description` Returns all navigable (default) - * fields except description. `*all,-comment` Returns all fields except comments. - * - * Multiple `fields` parameters can be included in a request. - * - * Note: All navigable fields are returned by default. This differs from [GET - * issue](#api-rest-api-2-issue-issueIdOrKey-get) where the default is all fields. - */ - fields?: string[]; - /** - * Determines how to validate the JQL query and treat the validation results. Supported values: - * - * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). - * `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for - * `strict`. `false` _Deprecated_ A legacy synonym for `warn`. - * - * The default is `strict`. - * - * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. - */ - validateQuery?: string; - /** - * Use [expand](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' - | ( - | 'renderedFields' - | 'names' - | 'schema' - | 'transitions' - | 'operations' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - )[] - | string - | string[]; - /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ - properties?: string[]; - /** Reference fields by their key (rather than ID). The default is `false`. */ - fieldsByKeys?: boolean; -} diff --git a/src/version2/models/searchResults.ts b/src/version2/models/searchResults.ts deleted file mode 100644 index 9dcc2994b4..0000000000 --- a/src/version2/models/searchResults.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Issue } from './issue'; - -/** The result of a JQL search. */ -export interface SearchResults { - /** Expand options that include additional search result details in the response. */ - expand?: string; - /** The list of issues found by the search. */ - issues?: Issue[]; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The ID and name of each field in the search results. */ - names?: unknown; - /** The schema describing the field types in the search results. */ - schema?: unknown; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The number of results on the page. */ - total?: number; - /** Any warnings related to the JQL query. */ - warningMessages?: string[]; -} diff --git a/src/version2/models/securityLevel.ts b/src/version2/models/securityLevel.ts deleted file mode 100644 index 47db4df159..0000000000 --- a/src/version2/models/securityLevel.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** Details of an issue level security item. */ -export interface SecurityLevel { - /** The description of the issue level security item. */ - description?: string; - /** The ID of the issue level security item. */ - id?: string; - /** Whether the issue level security item is the default. */ - isDefault?: boolean; - /** The ID of the issue level security scheme. */ - issueSecuritySchemeId?: string; - /** The name of the issue level security item. */ - name?: string; - /** The URL of the issue level security item. */ - self?: string; -} diff --git a/src/version2/models/securityLevelMember.ts b/src/version2/models/securityLevelMember.ts deleted file mode 100644 index b2b23aeb1e..0000000000 --- a/src/version2/models/securityLevelMember.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { PermissionHolder } from './permissionHolder'; - -/** Issue security level member. */ -export interface SecurityLevelMember { - holder?: PermissionHolder; - /** The ID of the issue security level member. */ - id: string; - /** The ID of the issue security level. */ - issueSecurityLevelId: string; - /** The ID of the issue security scheme. */ - issueSecuritySchemeId: string; -} diff --git a/src/version2/models/securityLevelMemberPayload.ts b/src/version2/models/securityLevelMemberPayload.ts deleted file mode 100644 index 7b6f8ab736..0000000000 --- a/src/version2/models/securityLevelMemberPayload.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * The payload for creating a security level member. See - * https://support.atlassian.com/jira-cloud-administration/docs/configure-issue-security-schemes/ - */ -export interface SecurityLevelMemberPayload { - /** - * Defines the value associated with the type. For reporter this would be {"null"}; for users this would be the names - * of specific users); for group this would be group names like {"administrators", "jira-administrators", - * "jira-users"} - */ - parameter?: string; - /** The type of the security level member */ - type?: 'group' | 'reporter' | 'users' | string; -} diff --git a/src/version2/models/securityLevelPayload.ts b/src/version2/models/securityLevelPayload.ts deleted file mode 100644 index 7d39a25ba4..0000000000 --- a/src/version2/models/securityLevelPayload.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SecurityLevelMemberPayload } from './securityLevelMemberPayload'; - -/** - * The payload for creating a security level. See - * https://support.atlassian.com/jira-cloud-administration/docs/configure-issue-security-schemes/ - */ -export interface SecurityLevelPayload { - /** The description of the security level */ - description?: string; - /** Whether the security level is default for the security scheme */ - isDefault?: boolean; - /** The name of the security level */ - name?: string; - /** The members of the security level */ - securityLevelMembers?: SecurityLevelMemberPayload[]; -} diff --git a/src/version2/models/securityScheme.ts b/src/version2/models/securityScheme.ts deleted file mode 100644 index af5d5ff947..0000000000 --- a/src/version2/models/securityScheme.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SecurityLevel } from './securityLevel'; - -/** Details about a security scheme. */ -export interface SecurityScheme { - /** The ID of the default security level. */ - defaultSecurityLevelId?: number; - /** The description of the issue security scheme. */ - description?: string; - /** The ID of the issue security scheme. */ - id?: number; - levels?: SecurityLevel[]; - /** The name of the issue security scheme. */ - name?: string; - /** The URL of the issue security scheme. */ - self?: string; -} diff --git a/src/version2/models/securitySchemeId.ts b/src/version2/models/securitySchemeId.ts deleted file mode 100644 index dfaa746d08..0000000000 --- a/src/version2/models/securitySchemeId.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The ID of the issue security scheme. */ -export interface SecuritySchemeId { - /** The ID of the issue security scheme. */ - id: string; -} diff --git a/src/version2/models/securitySchemeLevel.ts b/src/version2/models/securitySchemeLevel.ts deleted file mode 100644 index 38fbee213c..0000000000 --- a/src/version2/models/securitySchemeLevel.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember'; - -export interface SecuritySchemeLevel { - /** The description of the issue security scheme level. */ - description?: string; - /** Specifies whether the level is the default level. False by default. */ - isDefault?: boolean; - /** The list of level members which should be added to the issue security scheme level. */ - members?: SecuritySchemeLevelMember[]; - /** The name of the issue security scheme level. Must be unique. */ - name: string; -} diff --git a/src/version2/models/securitySchemeLevelMember.ts b/src/version2/models/securitySchemeLevelMember.ts deleted file mode 100644 index 5c57dc8522..0000000000 --- a/src/version2/models/securitySchemeLevelMember.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface SecuritySchemeLevelMember { - /** The value corresponding to the specified member type. */ - parameter?: string; - /** The issue security level member type, e.g `reporter`, `group`, `user`. */ - type: 'reporter' | 'group' | 'user' | string; -} diff --git a/src/version2/models/securitySchemeMembersRequest.ts b/src/version2/models/securitySchemeMembersRequest.ts deleted file mode 100644 index 0434fe8c49..0000000000 --- a/src/version2/models/securitySchemeMembersRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember'; - -/** Details of issue security scheme level new members. */ -export interface SecuritySchemeMembersRequest { - /** The list of level members which should be added to the issue security scheme level. */ - members: SecuritySchemeLevelMember[]; -} diff --git a/src/version2/models/securitySchemePayload.ts b/src/version2/models/securitySchemePayload.ts deleted file mode 100644 index b3a7e1a360..0000000000 --- a/src/version2/models/securitySchemePayload.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; -import type { SecurityLevelPayload } from './securityLevelPayload'; - -/** - * The payload for creating a security scheme. See - * https://support.atlassian.com/jira-cloud-administration/docs/configure-issue-security-schemes/ - */ -export interface SecuritySchemePayload { - /** The description of the security scheme */ - description?: string; - /** The name of the security scheme */ - name?: string; - pcri?: ProjectCreateResourceIdentifier; - /** The security levels for the security scheme */ - securityLevels?: SecurityLevelPayload[]; -} diff --git a/src/version2/models/securitySchemeWithProjects.ts b/src/version2/models/securitySchemeWithProjects.ts deleted file mode 100644 index 3726acea89..0000000000 --- a/src/version2/models/securitySchemeWithProjects.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** Details about an issue security scheme. */ -export interface SecuritySchemeWithProjects { - /** The default level ID of the issue security scheme. */ - defaultLevel?: number; - /** The description of the issue security scheme. */ - description?: string; - /** The ID of the issue security scheme. */ - id: number; - /** The name of the issue security scheme. */ - name: string; - /** The list of project IDs associated with the issue security scheme. */ - projectIds?: number[]; - /** The URL of the issue security scheme. */ - self: string; -} diff --git a/src/version2/models/securitySchemes.ts b/src/version2/models/securitySchemes.ts deleted file mode 100644 index fc0c9f7451..0000000000 --- a/src/version2/models/securitySchemes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SecurityScheme } from './securityScheme'; - -/** List of security schemes. */ -export interface SecuritySchemes { - /** List of security schemes. */ - issueSecuritySchemes?: SecurityScheme[]; -} diff --git a/src/version2/models/serverInformation.ts b/src/version2/models/serverInformation.ts deleted file mode 100644 index 4dd6bd88fa..0000000000 --- a/src/version2/models/serverInformation.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** Details about the Jira instance. */ -export interface ServerInformation { - /** The base URL of the Jira instance. */ - baseUrl?: string; - /** The timestamp when the Jira version was built. */ - buildDate?: string; - /** The build number of the Jira version. */ - buildNumber?: number; - /** The type of server deployment. This is always returned as _Cloud_. */ - deploymentType?: string; - /** The unique identifier of the Jira version. */ - scmInfo?: string; - /** The time in Jira when this request was responded to. */ - serverTime?: string; - /** The name of the Jira instance. */ - serverTitle?: string; - /** The version of Jira. */ - version?: string; - /** The major, minor, and revision version numbers of the Jira version. */ - versionNumbers?: number[]; -} diff --git a/src/version2/models/serviceRegistry.ts b/src/version2/models/serviceRegistry.ts deleted file mode 100644 index a28257c6a6..0000000000 --- a/src/version2/models/serviceRegistry.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { 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 deleted file mode 100644 index b9f2ff9ca8..0000000000 --- a/src/version2/models/serviceRegistryTier.ts +++ /dev/null @@ -1,12 +0,0 @@ -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/setDefaultLevelsRequest.ts b/src/version2/models/setDefaultLevelsRequest.ts deleted file mode 100644 index 22d95ebaad..0000000000 --- a/src/version2/models/setDefaultLevelsRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { DefaultLevelValue } from './defaultLevelValue'; - -/** Details of new default levels. */ -export interface SetDefaultLevelsRequest { - /** List of objects with issue security scheme ID and new default level ID. */ - defaultValues: DefaultLevelValue[]; -} diff --git a/src/version2/models/setDefaultPriorityRequest.ts b/src/version2/models/setDefaultPriorityRequest.ts deleted file mode 100644 index da98a9b7ab..0000000000 --- a/src/version2/models/setDefaultPriorityRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** The new default issue priority. */ -export interface SetDefaultPriorityRequest { - /** - * The ID of the new default issue priority. Must be an existing ID or null. Setting this to null erases the default - * priority setting. - */ - id: string; -} diff --git a/src/version2/models/setDefaultResolutionRequest.ts b/src/version2/models/setDefaultResolutionRequest.ts deleted file mode 100644 index 3530b824a4..0000000000 --- a/src/version2/models/setDefaultResolutionRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** The new default issue resolution. */ -export interface SetDefaultResolutionRequest { - /** - * The ID of the new default issue resolution. Must be an existing ID or null. Setting this to null erases the default - * resolution setting. - */ - id: string; -} diff --git a/src/version2/models/sharePermission.ts b/src/version2/models/sharePermission.ts deleted file mode 100644 index 265723b52f..0000000000 --- a/src/version2/models/sharePermission.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { GroupName } from './groupName'; -import type { Project } from './project'; -import type { ProjectRole } from './projectRole'; -import type { User } from './user'; - -/** Details of a share permission for the filter. */ -export interface SharePermission { - /** The unique identifier of the share permission. */ - id?: number; - /** - * The type of share permission: - * - * - `user` Shared with a user. - * - `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well. - * - `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well. - * - `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in - * requests, where it needs to be specify with `projectId` and `projectRoleId`. - * - `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified. - * - `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as - * the `type`. - * - `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request. - */ - type: 'user' | 'group' | 'project' | 'projectRole' | 'global' | 'loggedin' | 'project-unknown' | string; - project?: Project; - role?: ProjectRole; - group?: GroupName; - user?: User; -} diff --git a/src/version2/models/sharePermissionInput.ts b/src/version2/models/sharePermissionInput.ts deleted file mode 100644 index b0d3006d70..0000000000 --- a/src/version2/models/sharePermissionInput.ts +++ /dev/null @@ -1,36 +0,0 @@ -export interface SharePermissionInput { - /** - * The type of the share permission.Specify the type as follows: - * - * - `user` Share with a user. - * - `group` Share with a group. Specify `groupname` as well. - * - `project` Share with a project. Specify `projectId` as well. - * - `projectRole` Share with a project role in a project. Specify `projectId` and `projectRoleId` as well. - * - `global` Share globally, including anonymous users. If set, this type overrides all existing share permissions and - * must be deleted before any non-global share permissions is set. - * - `authenticated` Share with all logged-in users. This shows as `loggedin` in the response. If set, this type - * overrides all existing share permissions and must be deleted before any non-global share permissions is set. - */ - type: 'user' | 'group' | 'project' | 'projectRole' | 'global' | 'authenticated' | string; - /** The ID of the project to share the filter with. Set `type` to `project`. */ - projectId?: string; - /** - * The name of the group to share the filter with. Set `type` to `group`. Please note that the name of a group is - * mutable, to reliably identify a group use `groupId`. - */ - groupname?: string; - /** - * The ID of the project role to share the filter with. Set `type` to `projectRole` and the `projectId` for the - * project that the role is in. - */ - projectRoleId?: string; - /** The user account ID that the filter is shared with. For a request, specify the `accountId` property for the user. */ - accountId?: string; - /** The rights for the share permission. */ - rights?: number; - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products.For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. Cannot be provided with `groupname`. - */ - groupId?: string; -} diff --git a/src/version2/models/simpleApplicationProperty.ts b/src/version2/models/simpleApplicationProperty.ts deleted file mode 100644 index 98827ffd3b..0000000000 --- a/src/version2/models/simpleApplicationProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface SimpleApplicationProperty { - /** The ID of the application property. */ - id?: string; - /** The new value. */ - value?: string; -} diff --git a/src/version2/models/simpleErrorCollection.ts b/src/version2/models/simpleErrorCollection.ts deleted file mode 100644 index 6a88cb5392..0000000000 --- a/src/version2/models/simpleErrorCollection.ts +++ /dev/null @@ -1,10 +0,0 @@ -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?: unknown; - httpStatusCode?: number; -} diff --git a/src/version2/models/simpleLink.ts b/src/version2/models/simpleLink.ts deleted file mode 100644 index 6d5df0e364..0000000000 --- a/src/version2/models/simpleLink.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** Details about the operations available in this version. */ -export interface SimpleLink { - href?: string; - iconClass?: string; - id?: string; - label?: string; - styleClass?: string; - title?: string; - weight?: number; -} diff --git a/src/version2/models/simpleListWrapperApplicationRole.ts b/src/version2/models/simpleListWrapperApplicationRole.ts deleted file mode 100644 index 05789cbe50..0000000000 --- a/src/version2/models/simpleListWrapperApplicationRole.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ApplicationRole } from './applicationRole'; -import type { ListWrapperCallbackApplicationRole } from './listWrapperCallbackApplicationRole'; - -export interface SimpleListWrapperApplicationRole { - callback?: ListWrapperCallbackApplicationRole; - items?: ApplicationRole[]; - 'max-results'?: number; - pagingCallback?: ListWrapperCallbackApplicationRole; - size?: number; -} diff --git a/src/version2/models/simpleListWrapperGroupName.ts b/src/version2/models/simpleListWrapperGroupName.ts deleted file mode 100644 index 42df0091b2..0000000000 --- a/src/version2/models/simpleListWrapperGroupName.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { GroupName } from './groupName'; -import type { ListWrapperCallbackGroupName } from './listWrapperCallbackGroupName'; - -export interface SimpleListWrapperGroupName { - callback?: ListWrapperCallbackGroupName; - items?: GroupName[]; - 'max-results'?: number; - pagingCallback?: ListWrapperCallbackGroupName; - size?: number; -} diff --git a/src/version2/models/simpleUsage.ts b/src/version2/models/simpleUsage.ts deleted file mode 100644 index b1ddd95231..0000000000 --- a/src/version2/models/simpleUsage.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** 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/status.ts b/src/version2/models/status.ts deleted file mode 100644 index da1d589431..0000000000 --- a/src/version2/models/status.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Icon } from './icon'; - -/** The status of the item. */ -export interface Status { - icon?: Icon; - /** - * Whether the item is resolved. If set to "true", the link to the issue is displayed in a strikethrough font, - * otherwise the link displays in normal font. - */ - resolved?: boolean; -} diff --git a/src/version2/models/statusCategory.ts b/src/version2/models/statusCategory.ts deleted file mode 100644 index 40127eafb8..0000000000 --- a/src/version2/models/statusCategory.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** A status category. */ -export interface StatusCategory { - /** The name of the color used to represent the status category. */ - colorName?: string; - /** The ID of the status category. */ - id?: number; - /** The key of the status category. */ - key?: string; - /** The name of the status category. */ - name?: string; - /** The URL of the status category. */ - self?: string; -} diff --git a/src/version2/models/statusCreate.ts b/src/version2/models/statusCreate.ts deleted file mode 100644 index 2d2ccd1f1c..0000000000 --- a/src/version2/models/statusCreate.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details of the status being created. */ -export interface StatusCreate { - /** The description of the status. */ - description?: string; - /** The name of the status. */ - name: string; - /** The category of the status. */ - statusCategory: string; -} diff --git a/src/version2/models/statusCreateRequest.ts b/src/version2/models/statusCreateRequest.ts deleted file mode 100644 index e9abd17471..0000000000 --- a/src/version2/models/statusCreateRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { StatusCreate } from './statusCreate'; -import type { StatusScope } from './statusScope'; - -/** Details of the statuses being created and their scope. */ -export interface StatusCreateRequest { - scope: StatusScope; - /** Details of the statuses being created. */ - statuses: StatusCreate[]; -} diff --git a/src/version2/models/statusDetails.ts b/src/version2/models/statusDetails.ts deleted file mode 100644 index 79594b0489..0000000000 --- a/src/version2/models/statusDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { StatusCategory } from './statusCategory'; - -/** A status. */ -export interface StatusDetails { - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name?: string; - /** The URL of the status. */ - self?: string; - statusCategory?: StatusCategory; -} diff --git a/src/version2/models/statusLayoutUpdate.ts b/src/version2/models/statusLayoutUpdate.ts deleted file mode 100644 index 57fbf34077..0000000000 --- a/src/version2/models/statusLayoutUpdate.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { WorkflowLayout } from './workflowLayout'; - -/** The statuses associated with this workflow. */ -export interface StatusLayoutUpdate { - layout?: WorkflowLayout; - /** The properties for this status layout. */ - properties: unknown; - /** A unique ID which the status will use to refer to this layout configuration. */ - statusReference: string; -} diff --git a/src/version2/models/statusMapping.ts b/src/version2/models/statusMapping.ts deleted file mode 100644 index 09d52508c3..0000000000 --- a/src/version2/models/statusMapping.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details about the mapping from a status to a new status for an issue type. */ -export interface StatusMapping { - /** The ID of the issue type. */ - issueTypeId: string; - /** The ID of the new status. */ - newStatusId: string; - /** The ID of the status. */ - statusId: string; -} diff --git a/src/version2/models/statusMappingDTO.ts b/src/version2/models/statusMappingDTO.ts deleted file mode 100644 index e20b3e299b..0000000000 --- a/src/version2/models/statusMappingDTO.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { StatusMigration } from './statusMigration'; - -/** The mapping of old to new status ID for a specific project and issue type. */ -export interface StatusMappingDTO { - /** The issue type for the status mapping. */ - issueTypeId: string; - /** The project for the status mapping. */ - projectId: string; - /** The list of old and new status ID mappings for the specified project and issue type. */ - statusMigrations: StatusMigration[]; -} diff --git a/src/version2/models/statusMetadata.ts b/src/version2/models/statusMetadata.ts deleted file mode 100644 index f6eaa22aaf..0000000000 --- a/src/version2/models/statusMetadata.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** 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/statusMigration.ts b/src/version2/models/statusMigration.ts deleted file mode 100644 index 8c4cb05a1a..0000000000 --- a/src/version2/models/statusMigration.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The mapping of old to new status ID. */ -export interface StatusMigration { - /** The new status ID. */ - newStatusReference: string; - /** The old status ID. */ - oldStatusReference: string; -} diff --git a/src/version2/models/statusPayload.ts b/src/version2/models/statusPayload.ts deleted file mode 100644 index f34c96167b..0000000000 --- a/src/version2/models/statusPayload.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** The payload for creating a status */ -export interface StatusPayload { - /** The description of the status */ - description?: string; - /** The name of the status */ - name?: string; - /** - * The conflict strategy for the status already exists. FAIL - Fail execution, this always needs to be unique; USE - - * Use the existing entity and ignore new entity parameters; NEW - Create a new entity - */ - onConflict?: 'FAIL' | 'USE' | 'NEW' | string; - pcri?: ProjectCreateResourceIdentifier; - /** The status category of the status. The value is case-sensitive. */ - statusCategory?: 'TODO' | 'IN_PROGRESS' | 'DONE' | string; -} diff --git a/src/version2/models/statusProjectIssueTypeUsage.ts b/src/version2/models/statusProjectIssueTypeUsage.ts deleted file mode 100644 index 3141919ee9..0000000000 --- a/src/version2/models/statusProjectIssueTypeUsage.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** 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 deleted file mode 100644 index fd2842b286..0000000000 --- a/src/version2/models/statusProjectIssueTypeUsageDTO.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { 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 deleted file mode 100644 index 2704f4e6fe..0000000000 --- a/src/version2/models/statusProjectIssueTypeUsagePage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { 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 deleted file mode 100644 index 10f8b53619..0000000000 --- a/src/version2/models/statusProjectUsage.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The project. */ -export interface StatusProjectUsage { - /** The project ID. */ - id?: string; -} diff --git a/src/version2/models/statusProjectUsageDTO.ts b/src/version2/models/statusProjectUsageDTO.ts deleted file mode 100644 index 7ff72a62e1..0000000000 --- a/src/version2/models/statusProjectUsageDTO.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { 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 deleted file mode 100644 index 1b4657bf1c..0000000000 --- a/src/version2/models/statusProjectUsagePage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { 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/statusReferenceAndPort.ts b/src/version2/models/statusReferenceAndPort.ts deleted file mode 100644 index 3bf7340e89..0000000000 --- a/src/version2/models/statusReferenceAndPort.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The status reference and port that a transition is connected to. */ -export interface StatusReferenceAndPort { - /** The port this transition uses to connect to this status. */ - port?: number; - /** The reference of this status. */ - statusReference: string; -} diff --git a/src/version2/models/statusScope.ts b/src/version2/models/statusScope.ts deleted file mode 100644 index 64f6a67d13..0000000000 --- a/src/version2/models/statusScope.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectId } from './projectId'; - -/** The scope of the status. */ -export interface StatusScope { - project?: ProjectId; - /** The scope of the status. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ - type: string; -} diff --git a/src/version2/models/statusUpdate.ts b/src/version2/models/statusUpdate.ts deleted file mode 100644 index 3b95673734..0000000000 --- a/src/version2/models/statusUpdate.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** Details of the status being updated. */ -export interface StatusUpdate { - /** The description of the status. */ - description?: string; - /** The ID of the status. */ - id: string; - /** The name of the status. */ - name: string; - /** The category of the status. */ - statusCategory: string; -} diff --git a/src/version2/models/statusUpdateRequest.ts b/src/version2/models/statusUpdateRequest.ts deleted file mode 100644 index d4827623d9..0000000000 --- a/src/version2/models/statusUpdateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { StatusUpdate } from './statusUpdate'; - -/** The list of statuses that will be updated. */ -export interface StatusUpdateRequest { - /** The list of statuses that will be updated. */ - statuses?: StatusUpdate[]; -} diff --git a/src/version2/models/statusWorkflowUsageDTO.ts b/src/version2/models/statusWorkflowUsageDTO.ts deleted file mode 100644 index 24b5f84d61..0000000000 --- a/src/version2/models/statusWorkflowUsageDTO.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { 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 deleted file mode 100644 index 9571d77789..0000000000 --- a/src/version2/models/statusWorkflowUsagePage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { 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 deleted file mode 100644 index 3e860725b5..0000000000 --- a/src/version2/models/statusWorkflowUsageWorkflow.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The worflow. */ -export interface StatusWorkflowUsageWorkflow { - /** The workflow ID. */ - id?: string; -} diff --git a/src/version2/models/statusesPerWorkflow.ts b/src/version2/models/statusesPerWorkflow.ts deleted file mode 100644 index d4b31c1b71..0000000000 --- a/src/version2/models/statusesPerWorkflow.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** 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/suggestedIssue.ts b/src/version2/models/suggestedIssue.ts deleted file mode 100644 index c47d498b87..0000000000 --- a/src/version2/models/suggestedIssue.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** An issue suggested for use in the issue picker auto-completion. */ -export interface SuggestedIssue { - /** The ID of the issue. */ - id?: number; - /** The URL of the issue type's avatar. */ - img?: string; - /** The key of the issue. */ - key?: string; - /** The key of the issue in HTML format. */ - keyHtml?: string; - /** The phrase containing the query string in HTML format, with the string highlighted with HTML bold tags. */ - summary?: string; - /** The phrase containing the query string, as plain text. */ - summaryText?: string; -} diff --git a/src/version2/models/suggestedMappingsForPrioritiesRequestBean.ts b/src/version2/models/suggestedMappingsForPrioritiesRequestBean.ts deleted file mode 100644 index 9102196ab0..0000000000 --- a/src/version2/models/suggestedMappingsForPrioritiesRequestBean.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** 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 deleted file mode 100644 index 50b3d45b90..0000000000 --- a/src/version2/models/suggestedMappingsForProjectsRequestBean.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** 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 deleted file mode 100644 index c4cd9a5666..0000000000 --- a/src/version2/models/suggestedMappingsRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { SuggestedMappingsForPrioritiesRequestBean } from './suggestedMappingsForPrioritiesRequestBean'; -import type { 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/swimlanesPayload.ts b/src/version2/models/swimlanesPayload.ts deleted file mode 100644 index 5099095e5d..0000000000 --- a/src/version2/models/swimlanesPayload.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** The payload for customising a swimlanes on a board */ -export interface SwimlanesPayload { - /** The custom swimlane definitions. */ - customSwimlanes?: - | 'none, custom, parentChild, assignee, assigneeUnassignedFirst, epic, project, issueparent, issuechildren, request_type' - | string; - /** The name of the custom swimlane to use for work items that don't match any other swimlanes. */ - defaultCustomSwimlaneName?: string; - /** The swimlane strategy for the board. */ - swimlaneStrategy?: - | 'none' - | 'custom' - | 'parentChild' - | 'assignee' - | 'assigneeUnassignedFirst' - | 'epic' - | 'project' - | 'issueparent' - | 'issuechildren' - | 'request_type' - | string; -} diff --git a/src/version2/models/systemAvatars.ts b/src/version2/models/systemAvatars.ts deleted file mode 100644 index 67bcc0c6a4..0000000000 --- a/src/version2/models/systemAvatars.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Avatar } from './avatar'; - -/** List of system avatars. */ -export interface SystemAvatars { - /** A list of avatar details. */ - system: Omit[]; -} diff --git a/src/version2/models/tabMetadata.ts b/src/version2/models/tabMetadata.ts deleted file mode 100644 index b3d7c65b9f..0000000000 --- a/src/version2/models/tabMetadata.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { FieldMetadata } from './fieldMetadata'; - -/** The metadata describing a tab in an issue screen. */ -export interface TabMetadata { - /** The name of the tab. */ - name: string; - /** The fields within the tab */ - fields: FieldMetadata[]; -} diff --git a/src/version2/models/tabPayload.ts b/src/version2/models/tabPayload.ts deleted file mode 100644 index d5d77fd3c9..0000000000 --- a/src/version2/models/tabPayload.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** - * Defines the payload for the tabs of the screen. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-tab-fields/#api-rest-api-3-screens-screenid-tabs-tabid-fields-post - */ -export interface TabPayload { - /** - * The list of resource identifier of the field associated to the tab. See - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-tab-fields/#api-rest-api-3-screens-screenid-tabs-tabid-fields-post - */ - fields?: ProjectCreateResourceIdentifier[]; - /** The name of the tab */ - name?: string; -} diff --git a/src/version2/models/taskProgressNode.ts b/src/version2/models/taskProgressNode.ts deleted file mode 100644 index 6da96a227b..0000000000 --- a/src/version2/models/taskProgressNode.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { 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/taskProgressObject.ts b/src/version2/models/taskProgressObject.ts deleted file mode 100644 index 5d52fa5338..0000000000 --- a/src/version2/models/taskProgressObject.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** Details about a task. */ -export interface TaskProgressObject { - /** 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; - /** The result of the task execution. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - result?: any; - /** The URL of the task. */ - self: string; - /** A timestamp recording when the task was started. */ - started?: number; - /** The status of the task. */ - status: 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 deleted file mode 100644 index 4e525a7767..0000000000 --- a/src/version2/models/taskProgressRemoveOptionFromIssuesResult.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { 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/timeTrackingConfiguration.ts b/src/version2/models/timeTrackingConfiguration.ts deleted file mode 100644 index 33cbcb7432..0000000000 --- a/src/version2/models/timeTrackingConfiguration.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** Details of the time tracking configuration. */ -export interface TimeTrackingConfiguration { - /** The default unit of time applied to logged time. */ - defaultUnit: string; - /** The format that will appear on an issue's _Time Spent_ field. */ - timeFormat: string; - /** The number of days in a working week. */ - workingDaysPerWeek: number; - /** The number of hours in a working day. */ - workingHoursPerDay: number; -} diff --git a/src/version2/models/timeTrackingDetails.ts b/src/version2/models/timeTrackingDetails.ts deleted file mode 100644 index 7ce5e5ebeb..0000000000 --- a/src/version2/models/timeTrackingDetails.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** Time tracking details. */ -export interface TimeTrackingDetails { - /** The original estimate of time needed for this issue in readable format. */ - originalEstimate?: string; - /** The original estimate of time needed for this issue in seconds. */ - originalEstimateSeconds?: number; - /** The remaining estimate of time needed for this issue in readable format. */ - remainingEstimate?: string; - /** The remaining estimate of time needed for this issue in seconds. */ - remainingEstimateSeconds?: number; - /** Time worked on this issue in readable format. */ - timeSpent?: string; - /** Time worked on this issue in seconds. */ - timeSpentSeconds?: number; -} diff --git a/src/version2/models/timeTrackingProvider.ts b/src/version2/models/timeTrackingProvider.ts deleted file mode 100644 index 467569f53e..0000000000 --- a/src/version2/models/timeTrackingProvider.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** Details about the time tracking provider. */ -export interface TimeTrackingProvider { - /** The key for the time tracking provider. For example, _JIRA_. */ - key: string; - /** The name of the time tracking provider. For example, _JIRA provided time tracking_. */ - name?: string; - /** - * The URL of the configuration page for the time tracking provider app. For example, _/example/config/url_. This - * property is only returned if the `adminPageKey` property is set in the module descriptor of the time tracking - * provider app. - */ - url?: string; -} diff --git a/src/version2/models/toLayoutPayload.ts b/src/version2/models/toLayoutPayload.ts deleted file mode 100644 index 3092d29054..0000000000 --- a/src/version2/models/toLayoutPayload.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** The payload for the layout details for the destination end of a transition */ -export interface ToLayoutPayload { - /** Defines where the transition line will be connected to a status. Port 0 to 7 are acceptable values. */ - port?: number; - status?: ProjectCreateResourceIdentifier; -} diff --git a/src/version2/models/transition.ts b/src/version2/models/transition.ts deleted file mode 100644 index 2fa3fca283..0000000000 --- a/src/version2/models/transition.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { TransitionScreenDetails } from './transitionScreenDetails'; -import type { WorkflowRules } from './workflowRules'; - -/** Details of a workflow transition. */ -export interface Transition { - /** The description of the transition. */ - description: string; - /** The statuses the transition can start from. */ - from: string[]; - /** The ID of the transition. */ - id: string; - /** The name of the transition. */ - name: string; - /** The properties of the transition. */ - properties?: unknown; - rules?: WorkflowRules; - screen?: TransitionScreenDetails; - /** The status the transition goes to. */ - to: string; - /** The type of the transition. */ - type: string; -} diff --git a/src/version2/models/transitionPayload.ts b/src/version2/models/transitionPayload.ts deleted file mode 100644 index 40e79dc83e..0000000000 --- a/src/version2/models/transitionPayload.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { RulePayload } from './rulePayload'; -import type { ConditionGroupPayload } from './conditionGroupPayload'; -import type { FromLayoutPayload } from './fromLayoutPayload'; -import type { ToLayoutPayload } from './toLayoutPayload'; - -/** The payload for creating a transition in a workflow. Can be DIRECTED, GLOBAL, SELF-LOOPED, GLOBAL LOOPED */ -export interface TransitionPayload { - /** The actions that are performed when the transition is made */ - actions?: RulePayload[]; - conditions?: ConditionGroupPayload; - /** - * Mechanism in Jira for triggering certain actions, like notifications, automations, etc. Unless a custom - * notification scheme is configure, it's better not to provide any value here - */ - customIssueEventId?: string; - /** The description of the transition */ - description?: string; - /** The statuses that the transition can be made from */ - from?: FromLayoutPayload[]; - /** The id of the transition */ - id?: number; - /** The name of the transition */ - name?: string; - /** The properties of the transition */ - properties?: {}; - to?: ToLayoutPayload; - transitionScreen?: RulePayload; - /** The triggers that are performed when the transition is made */ - triggers?: RulePayload[]; - /** The type of the transition */ - type?: 'global' | 'initial' | 'directed' | string; - /** The validators that are performed when the transition is made */ - validators?: RulePayload[]; -} diff --git a/src/version2/models/transitionScreenDetails.ts b/src/version2/models/transitionScreenDetails.ts deleted file mode 100644 index 6207dc76fd..0000000000 --- a/src/version2/models/transitionScreenDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The details of a transition screen. */ -export interface TransitionScreenDetails { - /** The ID of the screen. */ - id: string; - /** The name of the screen. */ - name?: string; -} diff --git a/src/version2/models/transitionUpdateDTO.ts b/src/version2/models/transitionUpdateDTO.ts deleted file mode 100644 index 6aeb39e112..0000000000 --- a/src/version2/models/transitionUpdateDTO.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { ConditionGroupUpdate } from './conditionGroupUpdate'; -import type { StatusReferenceAndPort } from './statusReferenceAndPort'; -import type { WorkflowRuleConfiguration } from './workflowRuleConfiguration'; -import type { WorkflowTrigger } from './workflowTrigger'; - -/** The transitions of this workflow. */ -export interface TransitionUpdateDTO { - /** The post-functions of the transition. */ - actions?: WorkflowRuleConfiguration[]; - conditions?: ConditionGroupUpdate; - /** The custom event ID of the transition. */ - customIssueEventId?: string; - /** The description of the transition. */ - description?: string; - /** The statuses the transition can start from. */ - from?: StatusReferenceAndPort[]; - /** The ID of the transition. */ - id: string; - /** The name of the transition. */ - name: string; - /** The properties of the transition. */ - properties?: unknown; - to?: StatusReferenceAndPort; - transitionScreen?: WorkflowRuleConfiguration; - /** The triggers of the transition. */ - triggers?: WorkflowTrigger[]; - /** The transition type. */ - type: string; - /** The validators of the transition. */ - validators?: WorkflowRuleConfiguration[]; -} diff --git a/src/version2/models/transitions.ts b/src/version2/models/transitions.ts deleted file mode 100644 index bf9e2adce9..0000000000 --- a/src/version2/models/transitions.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { IssueTransition } from './issueTransition'; - -/** List of issue transitions. */ -export interface Transitions { - /** Expand options that include additional transitions details in the response. */ - expand?: string; - /** List of issue transitions. */ - transitions?: IssueTransition[]; -} diff --git a/src/version2/models/uiModificationContextDetails.ts b/src/version2/models/uiModificationContextDetails.ts deleted file mode 100644 index 1c6b64db17..0000000000 --- a/src/version2/models/uiModificationContextDetails.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** The details of a UI modification's context, which define where to activate the UI modification. */ -export interface UiModificationContextDetails { - /** The ID of the UI modification context. */ - id?: string; - /** Whether a context is available. For example, when a project is deleted the context becomes unavailable. */ - isAvailable?: boolean; - /** The issue type ID of the context. */ - issueTypeId: string; - /** The project ID of the context. */ - projectId: string; - /** The view type of the context. Only `GIC` (Global Issue Create) is supported. */ - viewType: string; -} diff --git a/src/version2/models/uiModificationDetails.ts b/src/version2/models/uiModificationDetails.ts deleted file mode 100644 index 0d912a809a..0000000000 --- a/src/version2/models/uiModificationDetails.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { UiModificationContextDetails } from './uiModificationContextDetails'; - -/** The details of a UI modification. */ -export interface UiModificationDetails { - /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ - contexts?: UiModificationContextDetails[]; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The ID of the UI modification. */ - id: string; - /** The name of the UI modification. The maximum length is 255 characters. */ - name: string; - /** The URL of the UI modification. */ - self: string; -} diff --git a/src/version2/models/uiModificationIdentifiers.ts b/src/version2/models/uiModificationIdentifiers.ts deleted file mode 100644 index ada6bac246..0000000000 --- a/src/version2/models/uiModificationIdentifiers.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Identifiers for a UI modification. */ -export interface UiModificationIdentifiers { - /** The ID of the UI modification. */ - id: string; - /** The URL of the UI modification. */ - self: string; -} diff --git a/src/version2/models/unrestrictedUserEmail.ts b/src/version2/models/unrestrictedUserEmail.ts deleted file mode 100644 index 0d48c1bf52..0000000000 --- a/src/version2/models/unrestrictedUserEmail.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface UnrestrictedUserEmail { - /** The accountId of the user */ - accountId?: string; - /** The email of the user */ - email?: string; -} diff --git a/src/version2/models/updateCustomFieldDetails.ts b/src/version2/models/updateCustomFieldDetails.ts deleted file mode 100644 index 6e155fedd3..0000000000 --- a/src/version2/models/updateCustomFieldDetails.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** Details of a custom field. */ -export interface UpdateCustomFieldDetails { - /** The description of the custom field. The maximum length is 40000 characters. */ - description?: string; - /** The name of the custom field. It doesn't have to be unique. The maximum length is 255 characters. */ - name?: string; - /** - * The searcher that defines the way the field is searched in Jira. It can be set to `null`, otherwise you must - * specify the valid searcher for the field type, as listed below (abbreviated values shown): - * - * `cascadingselect`: `cascadingselectsearcher` `datepicker`: `daterange` `datetime`: `datetimerange` `float`: - * `exactnumber` or `numberrange` `grouppicker`: `grouppickersearcher` `importid`: `exactnumber` or `numberrange` - * `labels`: `labelsearcher` `multicheckboxes`: `multiselectsearcher` `multigrouppicker`: `multiselectsearcher` - * `multiselect`: `multiselectsearcher` `multiuserpicker`: `userpickergroupsearcher` `multiversion`: `versionsearcher` - * `project`: `projectsearcher` `radiobuttons`: `multiselectsearcher` `readonlyfield`: `textsearcher` `select`: - * `multiselectsearcher` `textarea`: `textsearcher` `textfield`: `textsearcher` `url`: `exacttextsearcher` - * `userpicker`: `userpickergroupsearcher` `version`: `versionsearcher` - */ - searcherKey?: string; -} diff --git a/src/version2/models/updateDefaultProjectClassification.ts b/src/version2/models/updateDefaultProjectClassification.ts deleted file mode 100644 index 70ce9a4184..0000000000 --- a/src/version2/models/updateDefaultProjectClassification.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** 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/updateFieldConfigurationSchemeDetails.ts b/src/version2/models/updateFieldConfigurationSchemeDetails.ts deleted file mode 100644 index eb66779231..0000000000 --- a/src/version2/models/updateFieldConfigurationSchemeDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The details of the field configuration scheme. */ -export interface UpdateFieldConfigurationSchemeDetails { - /** The description of the field configuration scheme. */ - description?: string; - /** The name of the field configuration scheme. The name must be unique. */ - name: string; -} diff --git a/src/version2/models/updateIssueSecurityLevelDetails.ts b/src/version2/models/updateIssueSecurityLevelDetails.ts deleted file mode 100644 index 6cad319f39..0000000000 --- a/src/version2/models/updateIssueSecurityLevelDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of issue security scheme level. */ -export interface UpdateIssueSecurityLevelDetails { - /** The description of the issue security scheme level. */ - description?: string; - /** The name of the issue security scheme level. Must be unique. */ - name?: string; -} diff --git a/src/version2/models/updateIssueSecuritySchemeRequest.ts b/src/version2/models/updateIssueSecuritySchemeRequest.ts deleted file mode 100644 index 86f0ba32e3..0000000000 --- a/src/version2/models/updateIssueSecuritySchemeRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface UpdateIssueSecuritySchemeRequest { - /** The description of the security scheme. */ - description?: string; - /** The name of the security scheme. Must be unique. */ - name?: string; -} diff --git a/src/version2/models/updateNotificationSchemeDetails.ts b/src/version2/models/updateNotificationSchemeDetails.ts deleted file mode 100644 index e442105233..0000000000 --- a/src/version2/models/updateNotificationSchemeDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of a notification scheme. */ -export interface UpdateNotificationSchemeDetails { - /** The description of the notification scheme. */ - description?: string; - /** The name of the notification scheme. Must be unique. */ - name?: string; -} diff --git a/src/version2/models/updatePrioritiesInSchemeRequest.ts b/src/version2/models/updatePrioritiesInSchemeRequest.ts deleted file mode 100644 index 0707a75410..0000000000 --- a/src/version2/models/updatePrioritiesInSchemeRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PrioritySchemeChangesWithoutMappings } from './prioritySchemeChangesWithoutMappings'; - -/** Update priorities in a scheme */ -export interface UpdatePrioritiesInSchemeRequest { - add?: PrioritySchemeChangesWithoutMappings; - remove?: PrioritySchemeChangesWithoutMappings; -} diff --git a/src/version2/models/updatePriorityDetails.ts b/src/version2/models/updatePriorityDetails.ts deleted file mode 100644 index 5d61df8da2..0000000000 --- a/src/version2/models/updatePriorityDetails.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** 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. Both - * iconUrl and avatarId cannot be defined. - * - * @deprecated This property is deprecated and will be removed in a future version. Use `avatarId` instead. - */ - iconUrl?: - | '/images/icons/priorities/blocker.png' - | '/images/icons/priorities/critical.png' - | '/images/icons/priorities/high.png' - | '/images/icons/priorities/highest.png' - | '/images/icons/priorities/low.png' - | '/images/icons/priorities/lowest.png' - | '/images/icons/priorities/major.png' - | '/images/icons/priorities/medium.png' - | '/images/icons/priorities/minor.png' - | '/images/icons/priorities/trivial.png' - | '/images/icons/priorities/blocker_new.png' - | '/images/icons/priorities/critical_new.png' - | '/images/icons/priorities/high_new.png' - | '/images/icons/priorities/highest_new.png' - | '/images/icons/priorities/low_new.png' - | '/images/icons/priorities/lowest_new.png' - | '/images/icons/priorities/major_new.png' - | '/images/icons/priorities/medium_new.png' - | '/images/icons/priorities/minor_new.png' - | '/images/icons/priorities/trivial_new.png' - | string; - /** The name of the priority. Must be unique. */ - name?: string; - /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ - statusColor?: string; -} diff --git a/src/version2/models/updatePrioritySchemeRequest.ts b/src/version2/models/updatePrioritySchemeRequest.ts deleted file mode 100644 index 5474958996..0000000000 --- a/src/version2/models/updatePrioritySchemeRequest.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PriorityMapping } from './priorityMapping'; -import type { UpdatePrioritiesInSchemeRequest } from './updatePrioritiesInSchemeRequest'; -import type { UpdateProjectsInSchemeRequest } from './updateProjectsInSchemeRequest'; - -/** Details of a priority scheme. */ -export interface UpdatePrioritySchemeRequest { - /** The default priority of the scheme. */ - defaultPriorityId?: number; - /** The description of the priority scheme. */ - description?: string; - mappings?: PriorityMapping; - /** The name of the priority scheme. Must be unique. */ - name?: string; - priorities?: UpdatePrioritiesInSchemeRequest; - projects?: UpdateProjectsInSchemeRequest; -} diff --git a/src/version2/models/updatePrioritySchemeResponse.ts b/src/version2/models/updatePrioritySchemeResponse.ts deleted file mode 100644 index f038fa423e..0000000000 --- a/src/version2/models/updatePrioritySchemeResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { PrioritySchemeWithPaginatedPrioritiesAndProjects } from './prioritySchemeWithPaginatedPrioritiesAndProjects'; -import type { TaskProgressNode } from './taskProgressNode'; - -/** Details of the updated priority scheme. */ -export interface UpdatePrioritySchemeResponse { - priorityScheme?: PrioritySchemeWithPaginatedPrioritiesAndProjects; - task?: TaskProgressNode; -} diff --git a/src/version2/models/updateProjectDetails.ts b/src/version2/models/updateProjectDetails.ts deleted file mode 100644 index 6fc4a51306..0000000000 --- a/src/version2/models/updateProjectDetails.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** Details about the project. */ -export interface UpdateProjectDetails { - /** - * 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. - */ - 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 - * scheme IDs. - */ - issueSecurityScheme?: 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. - */ - 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 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.` - */ - categoryId?: number; - /** - * Previous project keys to be released from the current project. Released keys must belong to the current project and - * not contain the current project key - */ - releasedProjectKeys?: string[]; -} diff --git a/src/version2/models/updateProjectsInSchemeRequest.ts b/src/version2/models/updateProjectsInSchemeRequest.ts deleted file mode 100644 index 75538d2adb..0000000000 --- a/src/version2/models/updateProjectsInSchemeRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PrioritySchemeChangesWithoutMappings } from './prioritySchemeChangesWithoutMappings'; - -/** Update projects in a scheme */ -export interface UpdateProjectsInSchemeRequest { - add?: PrioritySchemeChangesWithoutMappings; - remove?: PrioritySchemeChangesWithoutMappings; -} diff --git a/src/version2/models/updateResolutionDetails.ts b/src/version2/models/updateResolutionDetails.ts deleted file mode 100644 index 3b244271b8..0000000000 --- a/src/version2/models/updateResolutionDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of an issue resolution. */ -export interface UpdateResolutionDetails { - /** The description of the resolution. */ - description?: string; - /** The name of the resolution. Must be unique. */ - name: string; -} diff --git a/src/version2/models/updateScreenDetails.ts b/src/version2/models/updateScreenDetails.ts deleted file mode 100644 index 0cde2c0e0e..0000000000 --- a/src/version2/models/updateScreenDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Details of a screen. */ -export interface UpdateScreenDetails { - /** The description of the screen. The maximum length is 255 characters. */ - description?: string; - /** The name of the screen. The name must be unique. The maximum length is 255 characters. */ - name?: string; -} diff --git a/src/version2/models/updateScreenSchemeDetails.ts b/src/version2/models/updateScreenSchemeDetails.ts deleted file mode 100644 index bad626f80c..0000000000 --- a/src/version2/models/updateScreenSchemeDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { UpdateScreenTypes } from './updateScreenTypes'; - -/** Details of a screen scheme. */ -export interface UpdateScreenSchemeDetails { - /** The description of the screen scheme. The maximum length is 255 characters. */ - description?: string; - /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ - name?: string; - screens?: UpdateScreenTypes; -} diff --git a/src/version2/models/updateScreenTypes.ts b/src/version2/models/updateScreenTypes.ts deleted file mode 100644 index 497c914da8..0000000000 --- a/src/version2/models/updateScreenTypes.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** The IDs of the screens for the screen types of the screen scheme. */ -export interface UpdateScreenTypes { - /** The ID of the create screen. To remove the screen association, pass a null. */ - create?: string; - /** The ID of the default screen. When specified, must include a screen ID as a default screen is required. */ - default?: string; - /** The ID of the edit screen. To remove the screen association, pass a null. */ - edit?: string; - /** The ID of the view screen. To remove the screen association, pass a null. */ - view?: string; -} diff --git a/src/version2/models/updateUiModificationDetails.ts b/src/version2/models/updateUiModificationDetails.ts deleted file mode 100644 index c8018988c6..0000000000 --- a/src/version2/models/updateUiModificationDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { UiModificationContextDetails } from './uiModificationContextDetails'; - -/** The details of a UI modification. */ -export interface UpdateUiModificationDetails { - /** - * List of contexts of the UI modification. The maximum number of contexts is 1000. If provided, replaces all existing - * contexts. - */ - contexts?: UiModificationContextDetails[]; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The name of the UI modification. The maximum length is 255 characters. */ - name?: string; -} diff --git a/src/version2/models/updateUserToGroup.ts b/src/version2/models/updateUserToGroup.ts deleted file mode 100644 index 3d52246c60..0000000000 --- a/src/version2/models/updateUserToGroup.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface UpdateUserToGroup { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** - * This property is no longer available. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; -} diff --git a/src/version2/models/updatedProjectCategory.ts b/src/version2/models/updatedProjectCategory.ts deleted file mode 100644 index c61a84e949..0000000000 --- a/src/version2/models/updatedProjectCategory.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** A project category. */ -export interface UpdatedProjectCategory { - /** The name of the project category. */ - description?: string; - /** The ID of the project category. */ - id?: string; - /** The description of the project category. */ - name?: string; - /** The URL of the project category. */ - self?: string; -} diff --git a/src/version2/models/user.ts b/src/version2/models/user.ts deleted file mode 100644 index 97d0d35f62..0000000000 --- a/src/version2/models/user.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { AvatarUrls } from './avatarUrls'; -import type { SimpleListWrapperApplicationRole } from './simpleListWrapperApplicationRole'; -import type { SimpleListWrapperGroupName } from './simpleListWrapperGroupName'; - -/** - * A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these - * exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface User { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. Required in requests. - */ - accountId?: string; - /** - * The user account type. Can take the following values: - * - * `atlassian` regular Atlassian user account `app` system account used for Connect applications and OAuth to - * represent external systems `customer` Jira Service Desk account representing an external service desk - */ - accountType?: string; - /** Whether the user is active. */ - active?: boolean; - applicationRoles?: SimpleListWrapperApplicationRole; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** The email address of the user. Depending on the user’s privacy setting, this may be returned as null. */ - emailAddress?: string; - /** Expand options that include additional user details in the response. */ - expand?: string; - groups?: SimpleListWrapperGroupName; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - key?: string; - /** The locale of the user. Depending on the user’s privacy setting, this may be returned as null. */ - locale?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; - /** The URL of the user. */ - self?: string; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy setting, this may be returned as - * null. - */ - timeZone?: string; -} diff --git a/src/version2/models/userAvatarUrls.ts b/src/version2/models/userAvatarUrls.ts deleted file mode 100644 index e59b51f113..0000000000 --- a/src/version2/models/userAvatarUrls.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface UserAvatarUrls { - /** The URL of the user's 16x16 pixel avatar. */ - '16x16'?: string; - /** The URL of the user's 24x24 pixel avatar. */ - '24x24'?: string; - /** The URL of the user's 32x32 pixel avatar. */ - '32x32'?: string; - /** The URL of the user's 48x48 pixel avatar. */ - '48x48'?: string; -} diff --git a/src/version2/models/userContextVariable.ts b/src/version2/models/userContextVariable.ts deleted file mode 100644 index 3db08c9615..0000000000 --- a/src/version2/models/userContextVariable.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface UserContextVariable { - /** The account ID of the user. */ - accountId: string; - /** Type of custom context variable. */ - type: string; -} diff --git a/src/version2/models/userDetails.ts b/src/version2/models/userDetails.ts deleted file mode 100644 index da1db3bc6c..0000000000 --- a/src/version2/models/userDetails.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { AvatarUrls } from './avatarUrls'; - -/** - * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface UserDetails { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application - * user) or 'customer' (Jira Service Desk customer user) - */ - accountType?: string; - /** Whether the user is active. */ - active?: boolean; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName?: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - key?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; - /** The URL of the user. */ - self?: string; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as - * null. - */ - timeZone?: string; -} diff --git a/src/version2/models/userKey.ts b/src/version2/models/userKey.ts deleted file mode 100644 index 71742646ad..0000000000 --- a/src/version2/models/userKey.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** List of user account IDs. */ -export interface UserKey { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. Returns _unknown_ if the record is deleted and corrupted, for example, as the result of - * a server import. - */ - accountId?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - key?: string; -} diff --git a/src/version2/models/userList.ts b/src/version2/models/userList.ts deleted file mode 100644 index 88209e53a4..0000000000 --- a/src/version2/models/userList.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { User } from './user'; - -/** - * A paginated list of users sharing the filter. This includes users that are members of the groups or can browse the - * projects that the filter is shared with. - */ -export interface UserList { - /** The index of the last item returned on the page. */ - 'end-index'?: number; - /** The list of items. */ - items?: User[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The number of items on the page. */ - size?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; -} diff --git a/src/version2/models/userMigration.ts b/src/version2/models/userMigration.ts deleted file mode 100644 index 3797c69592..0000000000 --- a/src/version2/models/userMigration.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface UserMigration { - accountId?: string; - key?: string; - username?: string; -} diff --git a/src/version2/models/userNavProperty.ts b/src/version2/models/userNavProperty.ts deleted file mode 100644 index fe0d1abfe8..0000000000 --- a/src/version2/models/userNavProperty.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface UserNavProperty { - key?: string; - value?: string; -} diff --git a/src/version2/models/userPickerUser.ts b/src/version2/models/userPickerUser.ts deleted file mode 100644 index 30da187e5c..0000000000 --- a/src/version2/models/userPickerUser.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** A user found in a search. */ -export interface UserPickerUser { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The avatar URL of the user. */ - avatarUrl?: string; - /** The display name of the user. Depending on the user’s privacy setting, this may be returned as null. */ - displayName?: string; - /** - * The display name, email address, and key of the user with the matched query string highlighted with the HTML bold - * tag. - */ - html?: string; - /** - * This property 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; - /** - * This property is no longer available . See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; -} diff --git a/src/version2/models/validationOptionsForCreate.ts b/src/version2/models/validationOptionsForCreate.ts deleted file mode 100644 index 3b59fe691c..0000000000 --- a/src/version2/models/validationOptionsForCreate.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * The level of validation to return from the API. If no values are provided, the default would return `WARNING` and - * `ERROR` level validation results. - */ -export interface ValidationOptionsForCreate { - levels?: string[]; -} diff --git a/src/version2/models/validationOptionsForUpdate.ts b/src/version2/models/validationOptionsForUpdate.ts deleted file mode 100644 index 8930e73a3f..0000000000 --- a/src/version2/models/validationOptionsForUpdate.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * The level of validation to return from the API. If no values are provided, the default would return `WARNING` and - * `ERROR` level validation results. - */ -export interface ValidationOptionsForUpdate { - levels?: string[]; -} diff --git a/src/version2/models/version.ts b/src/version2/models/version.ts deleted file mode 100644 index 4711a78bf0..0000000000 --- a/src/version2/models/version.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type { VersionApprover } from './versionApprover'; -import type { VersionIssuesStatus } from './versionIssuesStatus'; -import type { 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: - * - * - `operations` Returns the list of operations available for this version. - * - `issuesstatus` Returns the count of issues in this version for each of the status categories _to do_, _in - * progress_, _done_, and _unmapped_. The _unmapped_ property contains a count of issues with a status other than - * _to do_, _in progress_, and _done_. - * - * Optional for create and update. - */ - expand?: 'operations' | 'issuesstatus' | ('operations' | 'issuesstatus')[] | string | string[]; - /** The URL of the version. */ - self?: string; - /** The ID of the version. */ - id?: string; - /** - * The 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 released. If the version is released a request to release again is ignored. Not - * applicable when creating a version. Optional when updating a version. - */ - released?: boolean; - /** - * The start date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a - * version. - */ - startDate?: string; - /** - * The release date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a - * version. - */ - releaseDate?: string; - /** Indicates that the version is overdue. */ - overdue?: boolean; - /** - * The date on which work on this version is expected to start, expressed in the instance's _Day/Month/Year Format_ - * date format. - */ - userStartDate?: string; - /** - * The date on which work on this version is expected to finish, expressed in the instance's _Day/Month/Year Format_ - * date format. - */ - userReleaseDate?: string; - /** - * The ID of the project to which this version is attached. Required when creating a version. Not applicable when - * updating a version. - */ - projectId: string | number; - /** - * The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not - * applicable when creating a version. Optional when updating a version. - */ - moveUnfixedIssuesTo?: string; - /** If the expand option `operations` is used, returns the list of operations available for this version. */ - operations?: SimpleLink[]; - issuesStatusForFixVersion?: VersionIssuesStatus; -} diff --git a/src/version2/models/versionApprover.ts b/src/version2/models/versionApprover.ts deleted file mode 100644 index 2a4b447c5a..0000000000 --- a/src/version2/models/versionApprover.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** 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/versionIssueCounts.ts b/src/version2/models/versionIssueCounts.ts deleted file mode 100644 index 523b850284..0000000000 --- a/src/version2/models/versionIssueCounts.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { VersionUsageInCustomField } from './versionUsageInCustomField'; - -/** Various counts of issues within a version. */ -export interface VersionIssueCounts { - /** List of custom fields using the version. */ - customFieldUsage?: VersionUsageInCustomField[]; - /** Count of issues where a version custom field is set to the version. */ - issueCountWithCustomFieldsShowingVersion?: number; - /** Count of issues where the `affectedVersion` is set to the version. */ - issuesAffectedCount?: number; - /** Count of issues where the `fixVersion` is set to the version. */ - issuesFixedCount?: number; - /** The URL of these count details. */ - self?: string; -} diff --git a/src/version2/models/versionIssuesStatus.ts b/src/version2/models/versionIssuesStatus.ts deleted file mode 100644 index 8962f12643..0000000000 --- a/src/version2/models/versionIssuesStatus.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** Counts of the number of issues in various statuses. */ -export interface VersionIssuesStatus { - /** Count of issues with status _done_. */ - done?: number; - /** Count of issues with status _in progress_. */ - inProgress?: number; - /** Count of issues with status _to do_. */ - toDo?: number; - /** Count of issues with a status other than _to do_, _in progress_, and _done_. */ - unmapped?: number; -} diff --git a/src/version2/models/versionMove.ts b/src/version2/models/versionMove.ts deleted file mode 100644 index 413ca61218..0000000000 --- a/src/version2/models/versionMove.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface VersionMove { - /** The URL (self link) of the version after which to place the moved version. Cannot be used with `position`. */ - after?: string; - /** An absolute position in which to place the moved version. Cannot be used with `after`. */ - position?: string; -} diff --git a/src/version2/models/versionRelatedWork.ts b/src/version2/models/versionRelatedWork.ts deleted file mode 100644 index d8e8e88a06..0000000000 --- a/src/version2/models/versionRelatedWork.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** 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/versionUnresolvedIssuesCount.ts b/src/version2/models/versionUnresolvedIssuesCount.ts deleted file mode 100644 index 853227c3dd..0000000000 --- a/src/version2/models/versionUnresolvedIssuesCount.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Count of a version's unresolved issues. */ -export interface VersionUnresolvedIssuesCount { - /** Count of issues. */ - issuesCount?: number; - /** Count of unresolved issues. */ - issuesUnresolvedCount?: number; - /** The URL of these count details. */ - self?: string; -} diff --git a/src/version2/models/versionUsageInCustomField.ts b/src/version2/models/versionUsageInCustomField.ts deleted file mode 100644 index 5b8d6daa6c..0000000000 --- a/src/version2/models/versionUsageInCustomField.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** List of custom fields using the version. */ -export interface VersionUsageInCustomField { - /** The ID of the custom field. */ - customFieldId?: number; - /** The name of the custom field. */ - fieldName?: string; - /** Count of the issues where the custom field contains the version. */ - issueCountWithVersionInCustomField?: number; -} diff --git a/src/version2/models/visibility.ts b/src/version2/models/visibility.ts deleted file mode 100644 index 59eb4b6d88..0000000000 --- a/src/version2/models/visibility.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** The group or role to which this item is visible. */ -export interface Visibility { - /** The ID of the group or the name of the role that visibility of this item is restricted to. */ - identifier?: string; - /** Whether visibility of this item is restricted to a group or role. */ - type?: string; - /** - * The name of the group or role that visibility of this item is restricted to. Please note that the name of a group - * is mutable, to reliably identify a group use `identifier`. - */ - value?: string; -} diff --git a/src/version2/models/votes.ts b/src/version2/models/votes.ts deleted file mode 100644 index 8e0f5c3579..0000000000 --- a/src/version2/models/votes.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { User } from './user'; - -/** The details of votes on an issue. */ -export interface Votes { - /** Whether the user making this request has voted on the issue. */ - hasVoted?: boolean; - /** The URL of these issue vote details. */ - self?: string; - /** - * List of the users who have voted on this issue. An empty list is returned when the calling user doesn't have the - * _View voters and watchers_ project permission. - */ - voters?: User[]; - /** The number of votes on the issue. */ - votes?: number; -} diff --git a/src/version2/models/warningCollection.ts b/src/version2/models/warningCollection.ts deleted file mode 100644 index 2cc2f83d77..0000000000 --- a/src/version2/models/warningCollection.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface WarningCollection { - warnings?: string[]; -} diff --git a/src/version2/models/watchers.ts b/src/version2/models/watchers.ts deleted file mode 100644 index 1f96974e09..0000000000 --- a/src/version2/models/watchers.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { UserDetails } from './userDetails'; - -/** The details of watchers on an issue. */ -export interface Watchers { - /** Whether the calling user is watching this issue. */ - isWatching?: boolean; - /** The URL of these issue watcher details. */ - self?: string; - /** The number of users watching this issue. */ - watchCount?: number; - /** Details of the users watching this issue. */ - watchers?: UserDetails[]; -} diff --git a/src/version2/models/webhook.ts b/src/version2/models/webhook.ts deleted file mode 100644 index e9e804f184..0000000000 --- a/src/version2/models/webhook.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** A webhook. */ -export interface Webhook { - /** The Jira events that trigger the webhook. */ - events: string[]; - /** - * The date after which the webhook is no longer sent. Use [Extend webhook - * life](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-webhooks/#api-rest-api-2-webhook-refresh-put) - * to extend the date. - */ - expirationDate?: number; - /** - * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. - * If this parameter is not present, the app is notified about all field updates. - */ - fieldIdsFilter?: string[]; - /** The ID of the webhook. */ - id: number; - /** - * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or - * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property - * updates. - */ - issuePropertyKeysFilter?: string[]; - /** The JQL filter that specifies which issues the webhook is sent for. */ - jqlFilter: string; -} diff --git a/src/version2/models/webhookDetails.ts b/src/version2/models/webhookDetails.ts deleted file mode 100644 index 2fb3e0f981..0000000000 --- a/src/version2/models/webhookDetails.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** A list of webhooks. */ -export interface WebhookDetails { - /** The Jira events that trigger the webhook. */ - events: string[]; - /** - * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. - * If this parameter is not present, the app is notified about all field updates. - */ - fieldIdsFilter?: string[]; - /** - * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or - * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property - * updates. - */ - issuePropertyKeysFilter?: string[]; - /** - * The JQL filter that specifies which issues the webhook is sent for. Only a subset of JQL can be used. The supported - * elements are: - * - * Fields: `issueKey`, `project`, `issuetype`, `status`, `assignee`, `reporter`, `issue.property`, and `cf[id]`. For - * custom fields (`cf[id]`), only the epic label custom field is supported.". Operators: `=`, `!=`, `IN`, and `NOT - * IN`. - */ - jqlFilter: string; -} diff --git a/src/version2/models/webhookRegistrationDetails.ts b/src/version2/models/webhookRegistrationDetails.ts deleted file mode 100644 index 91257f5567..0000000000 --- a/src/version2/models/webhookRegistrationDetails.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { WebhookDetails } from './webhookDetails'; - -/** Details of webhooks to register. */ -export interface WebhookRegistrationDetails { - /** - * The URL that specifies where to send the webhooks. This URL must use the same base URL as the Connect app. Only a - * single URL per app is allowed to be registered. - */ - url: string; - /** A list of webhooks. */ - webhooks: WebhookDetails[]; -} diff --git a/src/version2/models/webhooksExpirationDate.ts b/src/version2/models/webhooksExpirationDate.ts deleted file mode 100644 index a39eed7ad9..0000000000 --- a/src/version2/models/webhooksExpirationDate.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The date the refreshed webhooks expire. */ -export interface WebhooksExpirationDate { - /** The expiration date of all the refreshed webhooks. */ - expirationDate: number; -} diff --git a/src/version2/models/workflow.ts b/src/version2/models/workflow.ts deleted file mode 100644 index ba42d6e268..0000000000 --- a/src/version2/models/workflow.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { ProjectDetails } from './projectDetails'; -import type { PublishedWorkflowId } from './publishedWorkflowId'; -import type { Transition } from './transition'; -import type { WorkflowOperations } from './workflowOperations'; -import type { WorkflowSchemeIdName } from './workflowSchemeIdName'; -import type { WorkflowStatus } from './workflowStatus'; - -/** Details about a workflow. */ -export interface Workflow { - /** The creation date of the workflow. */ - created?: string; - /** The description of the workflow. */ - description: string; - /** Whether the workflow has a draft version. */ - hasDraftWorkflow?: boolean; - id: PublishedWorkflowId; - /** Whether this is the default workflow. */ - isDefault?: boolean; - operations?: WorkflowOperations; - /** The projects the workflow is assigned to, through workflow schemes. */ - projects?: ProjectDetails[]; - /** The workflow schemes the workflow is assigned to. */ - schemes?: WorkflowSchemeIdName[]; - /** The statuses of the workflow. */ - statuses?: WorkflowStatus[]; - /** The transitions of the workflow. */ - transitions?: Transition[]; - /** The last edited date of the workflow. */ - updated?: string; -} diff --git a/src/version2/models/workflowAssociationStatusMapping.ts b/src/version2/models/workflowAssociationStatusMapping.ts deleted file mode 100644 index 17d5e22fe6..0000000000 --- a/src/version2/models/workflowAssociationStatusMapping.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** 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/workflowCapabilities.ts b/src/version2/models/workflowCapabilities.ts deleted file mode 100644 index bfbe5dcc81..0000000000 --- a/src/version2/models/workflowCapabilities.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { AvailableWorkflowConnectRule } from './availableWorkflowConnectRule'; -import type { AvailableWorkflowForgeRule } from './availableWorkflowForgeRule'; -import type { AvailableWorkflowSystemRule } from './availableWorkflowSystemRule'; -import type { AvailableWorkflowTriggers } from './availableWorkflowTriggers'; - -export interface WorkflowCapabilities { - /** The Connect provided ecosystem rules available. */ - connectRules?: AvailableWorkflowConnectRule[]; - /** - * The scope of the workflow capabilities. `GLOBAL` for company-managed projects and `PROJECT` for team-managed - * projects. - */ - editorScope?: string; - /** The Forge provided ecosystem rules available. */ - forgeRules?: AvailableWorkflowForgeRule[]; - /** The types of projects that this capability set is available for. */ - projectTypes?: string[]; - /** The Atlassian provided system rules available. */ - systemRules?: AvailableWorkflowSystemRule[]; - /** The trigger rules available. */ - triggerRules?: AvailableWorkflowTriggers[]; -} diff --git a/src/version2/models/workflowCapabilityPayload.ts b/src/version2/models/workflowCapabilityPayload.ts deleted file mode 100644 index f4d6b4e650..0000000000 --- a/src/version2/models/workflowCapabilityPayload.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { StatusPayload } from './statusPayload'; -import type { WorkflowSchemePayload } from './workflowSchemePayload'; -import type { WorkflowPayload } from './workflowPayload'; - -/** - * The payload for creating a workflows. See - * https://www.atlassian.com/software/jira/guides/workflows/overview#what-is-a-jira-workflow - */ -export interface WorkflowCapabilityPayload { - /** The statuses for the workflow */ - statuses?: StatusPayload[]; - workflowScheme?: WorkflowSchemePayload; - /** The transitions for the workflow */ - workflows?: WorkflowPayload[]; -} diff --git a/src/version2/models/workflowCondition.ts b/src/version2/models/workflowCondition.ts deleted file mode 100644 index 51d7101635..0000000000 --- a/src/version2/models/workflowCondition.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** The workflow transition rule conditions tree. */ -export interface WorkflowCondition {} diff --git a/src/version2/models/workflowCreate.ts b/src/version2/models/workflowCreate.ts deleted file mode 100644 index d87c7e907b..0000000000 --- a/src/version2/models/workflowCreate.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { StatusLayoutUpdate } from './statusLayoutUpdate'; -import type { TransitionUpdateDTO } from './transitionUpdateDTO'; -import type { WorkflowLayout } from './workflowLayout'; - -/** The details of the workflows to create. */ -export interface WorkflowCreate { - /** The description of the workflow to create. */ - description?: string; - /** The name of the workflow to create. */ - name: string; - startPointLayout?: WorkflowLayout; - /** The statuses associated with this workflow. */ - statuses: StatusLayoutUpdate[]; - /** The transitions of this workflow. */ - transitions: TransitionUpdateDTO[]; -} diff --git a/src/version2/models/workflowCreateRequest.ts b/src/version2/models/workflowCreateRequest.ts deleted file mode 100644 index c58012a7dd..0000000000 --- a/src/version2/models/workflowCreateRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { WorkflowCreate } from './workflowCreate'; -import type { WorkflowScope } from './workflowScope'; -import type { WorkflowStatusUpdate } from './workflowStatusUpdate'; - -/** The create workflows payload. */ -export interface WorkflowCreateRequest { - scope: WorkflowScope; - /** The statuses to associate with the workflows. */ - statuses: WorkflowStatusUpdate[]; - /** The details of the workflows to create. */ - workflows: WorkflowCreate[]; -} diff --git a/src/version2/models/workflowElementReference.ts b/src/version2/models/workflowElementReference.ts deleted file mode 100644 index 5d07b8ce9e..0000000000 --- a/src/version2/models/workflowElementReference.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { ProjectAndIssueTypePair } from './projectAndIssueTypePair'; - -/** A reference to the location of the error. This will be null if the error does not refer to a specific element. */ -export interface WorkflowElementReference { - /** A property key. */ - propertyKey?: string; - /** A rule ID. */ - ruleId?: string; - statusMappingReference?: ProjectAndIssueTypePair; - /** A status reference. */ - statusReference?: string; - /** A transition ID. */ - transitionId?: string; -} diff --git a/src/version2/models/workflowId.ts b/src/version2/models/workflowId.ts deleted file mode 100644 index b25bbdcd59..0000000000 --- a/src/version2/models/workflowId.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Properties that identify a workflow. */ -export interface WorkflowId { - /** Whether the workflow is in the draft state. */ - draft: boolean; - /** The name of the workflow. */ - name: string; -} diff --git a/src/version2/models/workflowLayout.ts b/src/version2/models/workflowLayout.ts deleted file mode 100644 index a11cd570b1..0000000000 --- a/src/version2/models/workflowLayout.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The starting point for the statuses in the workflow. */ -export interface WorkflowLayout { - /** The x axis location. */ - x?: number; - /** The y axis location. */ - y?: number; -} diff --git a/src/version2/models/workflowMetadataAndIssueTypeRestModel.ts b/src/version2/models/workflowMetadataAndIssueTypeRestModel.ts deleted file mode 100644 index 8cec350b0b..0000000000 --- a/src/version2/models/workflowMetadataAndIssueTypeRestModel.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { 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 deleted file mode 100644 index d3c482c643..0000000000 --- a/src/version2/models/workflowMetadataRestModel.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { SimpleUsage } from './simpleUsage'; -import type { 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/workflowOperations.ts b/src/version2/models/workflowOperations.ts deleted file mode 100644 index e467c1befb..0000000000 --- a/src/version2/models/workflowOperations.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** Operations allowed on a workflow */ -export interface WorkflowOperations { - /** Whether the workflow can be deleted. */ - canDelete: boolean; - /** Whether the workflow can be updated. */ - canEdit: boolean; -} diff --git a/src/version2/models/workflowPayload.ts b/src/version2/models/workflowPayload.ts deleted file mode 100644 index 9090be063e..0000000000 --- a/src/version2/models/workflowPayload.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { WorkflowStatusLayoutPayload } from './workflowStatusLayoutPayload'; -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; -import type { WorkflowStatusPayload } from './workflowStatusPayload'; -import type { TransitionPayload } from './transitionPayload'; - -/** - * The payload for creating workflow, see - * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflows-create-post - */ -export interface WorkflowPayload { - /** The description of the workflow */ - description?: string; - loopedTransitionContainerLayout?: WorkflowStatusLayoutPayload; - /** The name of the workflow */ - name?: string; - /** The strategy to use if there is a conflict with another workflow */ - onConflict?: 'FAIL' | 'USE' | 'NEW' | string; - pcri?: ProjectCreateResourceIdentifier; - startPointLayout?: WorkflowStatusLayoutPayload; - /** The statuses to be used in the workflow */ - statuses?: WorkflowStatusPayload[]; - /** The transitions for the workflow */ - transitions?: TransitionPayload[]; -} diff --git a/src/version2/models/workflowProjectIssueTypeUsage.ts b/src/version2/models/workflowProjectIssueTypeUsage.ts deleted file mode 100644 index 9e5e7f3ec1..0000000000 --- a/src/version2/models/workflowProjectIssueTypeUsage.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** 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 deleted file mode 100644 index 0a63884776..0000000000 --- a/src/version2/models/workflowProjectIssueTypeUsageDTO.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { 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 deleted file mode 100644 index be9a01519c..0000000000 --- a/src/version2/models/workflowProjectIssueTypeUsagePage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { 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 deleted file mode 100644 index a6fda2aa8e..0000000000 --- a/src/version2/models/workflowProjectUsageDTO.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectUsagePage } from './projectUsagePage'; - -/** Projects using the workflow. */ -export interface WorkflowProjectUsageDTO { - projects?: ProjectUsagePage; - /** The workflow ID. */ - workflowId?: string; -} diff --git a/src/version2/models/workflowRead.ts b/src/version2/models/workflowRead.ts deleted file mode 100644 index bc37b56d45..0000000000 --- a/src/version2/models/workflowRead.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { JiraWorkflow } from './jiraWorkflow'; -import type { JiraWorkflowStatus } from './jiraWorkflowStatus'; - -/** Details of workflows and related statuses. */ -export interface WorkflowRead { - /** List of statuses. */ - statuses?: JiraWorkflowStatus[]; - /** List of workflows. */ - workflows?: JiraWorkflow[]; -} diff --git a/src/version2/models/workflowReferenceStatus.ts b/src/version2/models/workflowReferenceStatus.ts deleted file mode 100644 index b59aa7c1ae..0000000000 --- a/src/version2/models/workflowReferenceStatus.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { WorkflowStatusLayout } from './workflowStatusLayout'; - -/** The statuses referenced in the workflow. */ -export interface WorkflowReferenceStatus { - /** Indicates if the status is deprecated. */ - deprecated?: boolean; - layout?: WorkflowStatusLayout; - /** The properties associated with the status. */ - properties?: unknown; - /** The reference of the status. */ - statusReference?: string; -} diff --git a/src/version2/models/workflowRuleConfiguration.ts b/src/version2/models/workflowRuleConfiguration.ts deleted file mode 100644 index 3a4160aca8..0000000000 --- a/src/version2/models/workflowRuleConfiguration.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** The configuration of the rule. */ -export interface WorkflowRuleConfiguration { - /** The ID of the rule. */ - id?: string; - /** The parameters related to the rule. */ - parameters?: unknown; - /** The rule key of the rule. */ - ruleKey: string; -} diff --git a/src/version2/models/workflowRules.ts b/src/version2/models/workflowRules.ts deleted file mode 100644 index 53324914cb..0000000000 --- a/src/version2/models/workflowRules.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { WorkflowCondition } from './workflowCondition'; -import type { WorkflowTransitionRule } from './workflowTransitionRule'; - -/** A collection of transition rules. */ -export interface WorkflowRules { - conditionsTree?: WorkflowCondition; - /** The workflow post functions. */ - postFunctions?: WorkflowTransitionRule[]; - /** The workflow validators. */ - validators?: WorkflowTransitionRule[]; -} diff --git a/src/version2/models/workflowRulesSearch.ts b/src/version2/models/workflowRulesSearch.ts deleted file mode 100644 index e3ebc7b671..0000000000 --- a/src/version2/models/workflowRulesSearch.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** Details of the workflow and its transition rules. */ -export interface WorkflowRulesSearch { - /** - * Use expand to include additional information in the response. This parameter accepts `transition` which, for each - * rule, returns information about the transition the rule is assigned to. - */ - expand?: string; - /** The list of workflow rule IDs. */ - ruleIds: string[]; - /** The workflow ID. */ - workflowEntityId: string; -} diff --git a/src/version2/models/workflowRulesSearchDetails.ts b/src/version2/models/workflowRulesSearchDetails.ts deleted file mode 100644 index 2cae65044b..0000000000 --- a/src/version2/models/workflowRulesSearchDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { WorkflowTransitionRules } from './workflowTransitionRules'; - -/** Details of workflow transition rules. */ -export interface WorkflowRulesSearchDetails { - /** List of workflow rule IDs that do not belong to the workflow or can not be found. */ - invalidRules?: string[]; - /** List of valid workflow transition rules. */ - validRules?: WorkflowTransitionRules[]; - /** The workflow ID. */ - workflowEntityId?: string; -} diff --git a/src/version2/models/workflowScheme.ts b/src/version2/models/workflowScheme.ts deleted file mode 100644 index d3711c5fc8..0000000000 --- a/src/version2/models/workflowScheme.ts +++ /dev/null @@ -1,61 +0,0 @@ -import type { User } from './user'; - -/** Details about a workflow scheme. */ -export interface WorkflowScheme { - /** - * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ - * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira - * Workflow (jira)_. - */ - defaultWorkflow?: string; - /** The description of the workflow scheme. */ - description?: string; - /** Whether the workflow scheme is a draft or not. */ - draft?: boolean; - /** The ID of the workflow scheme. */ - id?: number; - /** - * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an - * issue type can only be mapped to one workflow in a workflow scheme. - */ - issueTypeMappings?: unknown; - /** The issue types available in Jira. */ - issueTypes?: unknown; - /** - * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue - * type-project mappings only. This property does not apply to non-draft workflows. - */ - lastModified?: string; - lastModifiedUser?: User; - /** - * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when - * creating a workflow scheme. - */ - name?: string; - /** - * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The - * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. - */ - originalDefaultWorkflow?: string; - /** - * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, - * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one - * workflow in a workflow scheme. - */ - originalIssueTypeMappings?: unknown; - self?: string; - /** - * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow - * scheme is a workflow scheme that is used by at least one project. The following examples show how this property - * works: - * - * Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is - * updated. Otherwise, a draft workflow scheme is created. Update an active workflow scheme with `updateDraftIfNeeded` - * set to `false`: An error is returned, as active workflow schemes cannot be updated. Update an inactive workflow - * scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as inactive workflow schemes do - * not require drafts to update. - * - * Defaults to `false`. - */ - updateDraftIfNeeded?: boolean; -} diff --git a/src/version2/models/workflowSchemeAssociation.ts b/src/version2/models/workflowSchemeAssociation.ts deleted file mode 100644 index 9e119c9edb..0000000000 --- a/src/version2/models/workflowSchemeAssociation.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** 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/workflowSchemeAssociations.ts b/src/version2/models/workflowSchemeAssociations.ts deleted file mode 100644 index f18c55da36..0000000000 --- a/src/version2/models/workflowSchemeAssociations.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { WorkflowScheme } from './workflowScheme'; - -/** A workflow scheme along with a list of projects that use it. */ -export interface WorkflowSchemeAssociations { - /** The list of projects that use the workflow scheme. */ - projectIds: string[]; - workflowScheme?: WorkflowScheme; -} diff --git a/src/version2/models/workflowSchemeIdName.ts b/src/version2/models/workflowSchemeIdName.ts deleted file mode 100644 index ec7df013b7..0000000000 --- a/src/version2/models/workflowSchemeIdName.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The ID and the name of the workflow scheme. */ -export interface WorkflowSchemeIdName { - /** The ID of the workflow scheme. */ - id: string; - /** The name of the workflow scheme. */ - name: string; -} diff --git a/src/version2/models/workflowSchemePayload.ts b/src/version2/models/workflowSchemePayload.ts deleted file mode 100644 index 16f222e047..0000000000 --- a/src/version2/models/workflowSchemePayload.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** - * The payload for creating a workflow scheme. See - * https://www.atlassian.com/software/jira/guides/workflows/overview#what-is-a-jira-workflow-scheme - */ -export interface WorkflowSchemePayload { - defaultWorkflow?: ProjectCreateResourceIdentifier; - /** The description of the workflow scheme */ - description?: string; - /** Association between issuetypes and workflows */ - explicitMappings?: {}; - /** The name of the workflow scheme */ - name?: string; - pcri?: ProjectCreateResourceIdentifier; -} diff --git a/src/version2/models/workflowSchemeProjectAssociation.ts b/src/version2/models/workflowSchemeProjectAssociation.ts deleted file mode 100644 index ab997e2efa..0000000000 --- a/src/version2/models/workflowSchemeProjectAssociation.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** An associated workflow scheme and project. */ -export interface WorkflowSchemeProjectAssociation { - /** The ID of the project. */ - projectId: string; - /** - * The ID of the workflow scheme. If the workflow scheme ID is `null`, the operation assigns the default workflow - * scheme. - */ - workflowSchemeId?: string; -} diff --git a/src/version2/models/workflowSchemeProjectUsage.ts b/src/version2/models/workflowSchemeProjectUsage.ts deleted file mode 100644 index a0f3118e9c..0000000000 --- a/src/version2/models/workflowSchemeProjectUsage.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectUsagePage } from './projectUsagePage'; - -/** Projects using the workflow scheme. */ -export interface WorkflowSchemeProjectUsage { - projects?: ProjectUsagePage; - /** The workflow scheme ID. */ - workflowSchemeId?: string; -} diff --git a/src/version2/models/workflowSchemeReadRequest.ts b/src/version2/models/workflowSchemeReadRequest.ts deleted file mode 100644 index 448fe7361e..0000000000 --- a/src/version2/models/workflowSchemeReadRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** 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 deleted file mode 100644 index 66f94b7496..0000000000 --- a/src/version2/models/workflowSchemeReadResponse.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { WorkflowMetadataRestModel } from './workflowMetadataRestModel'; -import type { WorkflowScope } from './workflowScope'; -import type { DocumentVersion } from './documentVersion'; -import type { 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 deleted file mode 100644 index b2df0daaa5..0000000000 --- a/src/version2/models/workflowSchemeUpdateRequest.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { MappingsByIssueTypeOverride } from './mappingsByIssueTypeOverride'; -import type { MappingsByWorkflow } from './mappingsByWorkflow'; -import type { DocumentVersion } from './documentVersion'; -import type { 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 deleted file mode 100644 index e3e999d0b6..0000000000 --- a/src/version2/models/workflowSchemeUpdateRequiredMappingsRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { 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 deleted file mode 100644 index 09a5840ead..0000000000 --- a/src/version2/models/workflowSchemeUpdateRequiredMappingsResponse.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { RequiredMappingByIssueType } from './requiredMappingByIssueType'; -import type { RequiredMappingByWorkflows } from './requiredMappingByWorkflows'; -import type { StatusMetadata } from './statusMetadata'; -import type { 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 deleted file mode 100644 index a6b0fe9530..0000000000 --- a/src/version2/models/workflowSchemeUsage.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** 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 deleted file mode 100644 index b0feb9d84b..0000000000 --- a/src/version2/models/workflowSchemeUsageDTO.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { 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 deleted file mode 100644 index 563b7e00da..0000000000 --- a/src/version2/models/workflowSchemeUsagePage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { 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/workflowScope.ts b/src/version2/models/workflowScope.ts deleted file mode 100644 index 790805b0c4..0000000000 --- a/src/version2/models/workflowScope.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectId } from './projectId'; - -/** The scope of the workflow. */ -export interface WorkflowScope { - project?: ProjectId; - /** The scope of the workflow. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ - type: string; -} diff --git a/src/version2/models/workflowSearchResponse.ts b/src/version2/models/workflowSearchResponse.ts deleted file mode 100644 index 8612123fbf..0000000000 --- a/src/version2/models/workflowSearchResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { JiraWorkflowStatus } from './jiraWorkflowStatus'; -import type { 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/workflowStatus.ts b/src/version2/models/workflowStatus.ts deleted file mode 100644 index 4f75aa8324..0000000000 --- a/src/version2/models/workflowStatus.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { WorkflowStatusProperties } from './workflowStatusProperties'; - -/** Details of a workflow status. */ -export interface WorkflowStatus { - /** The ID of the issue status. */ - id: string; - /** The name of the status in the workflow. */ - name: string; - /** - * Additional properties that modify the behavior of issues in this status. Supports the properties - * `jira.issue.editable` and `issueEditable` (deprecated) that indicate whether issues are editable. - */ - properties?: WorkflowStatusProperties; -} diff --git a/src/version2/models/workflowStatusAndPort.ts b/src/version2/models/workflowStatusAndPort.ts deleted file mode 100644 index 1ef65ed402..0000000000 --- a/src/version2/models/workflowStatusAndPort.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The status reference and port that a transition is connected to. */ -export interface WorkflowStatusAndPort { - /** The port the transition is connected to this status. */ - port?: number; - /** The reference of this status. */ - statusReference?: string; -} diff --git a/src/version2/models/workflowStatusLayout.ts b/src/version2/models/workflowStatusLayout.ts deleted file mode 100644 index 2b760493dc..0000000000 --- a/src/version2/models/workflowStatusLayout.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The x and y location of the status in the workflow. */ -export interface WorkflowStatusLayout { - /** The x axis location. */ - x?: number; - /** The y axis location. */ - y?: number; -} diff --git a/src/version2/models/workflowStatusLayoutPayload.ts b/src/version2/models/workflowStatusLayoutPayload.ts deleted file mode 100644 index 6a41ccd404..0000000000 --- a/src/version2/models/workflowStatusLayoutPayload.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The layout of the workflow status. */ -export interface WorkflowStatusLayoutPayload { - /** The x coordinate of the status. */ - x?: number; - /** The y coordinate of the status. */ - y?: number; -} diff --git a/src/version2/models/workflowStatusPayload.ts b/src/version2/models/workflowStatusPayload.ts deleted file mode 100644 index fdc13957c7..0000000000 --- a/src/version2/models/workflowStatusPayload.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { WorkflowStatusLayoutPayload } from './workflowStatusLayoutPayload'; -import type { ProjectCreateResourceIdentifier } from './projectCreateResourceIdentifier'; - -/** The statuses to be used in the workflow */ -export interface WorkflowStatusPayload { - layout?: WorkflowStatusLayoutPayload; - pcri?: ProjectCreateResourceIdentifier; - /** The properties of the workflow status. */ - properties?: {}; -} diff --git a/src/version2/models/workflowStatusProperties.ts b/src/version2/models/workflowStatusProperties.ts deleted file mode 100644 index 9701e6a4e5..0000000000 --- a/src/version2/models/workflowStatusProperties.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Properties of a workflow status. */ -export interface WorkflowStatusProperties { - /** Whether issues are editable in this status. */ - issueEditable: boolean; -} diff --git a/src/version2/models/workflowStatusUpdate.ts b/src/version2/models/workflowStatusUpdate.ts deleted file mode 100644 index 5f077332e2..0000000000 --- a/src/version2/models/workflowStatusUpdate.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** Details of the status being updated. */ -export interface WorkflowStatusUpdate { - /** The description of the status. */ - description?: string; - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name: string; - /** The category of the status. */ - statusCategory: string; - /** The reference of the status. */ - statusReference: string; -} diff --git a/src/version2/models/workflowTransition.ts b/src/version2/models/workflowTransition.ts deleted file mode 100644 index 7744c17ca3..0000000000 --- a/src/version2/models/workflowTransition.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** A workflow transition. */ -export interface WorkflowTransition { - /** The transition ID. */ - id: number; - /** The transition name. */ - name: string; -} diff --git a/src/version2/models/workflowTransitionProperty.ts b/src/version2/models/workflowTransitionProperty.ts deleted file mode 100644 index e3d385ded9..0000000000 --- a/src/version2/models/workflowTransitionProperty.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** Details about the server Jira is running on. */ -export interface WorkflowTransitionProperty { - /** The ID of the transition property. */ - id?: string; - /** The key of the transition property. Also known as the name of the transition property. */ - key?: string; - /** The value of the transition property. */ - value: string; -} diff --git a/src/version2/models/workflowTransitionRule.ts b/src/version2/models/workflowTransitionRule.ts deleted file mode 100644 index a29324738e..0000000000 --- a/src/version2/models/workflowTransitionRule.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** A workflow transition rule. */ -export interface WorkflowTransitionRule { - /** EXPERIMENTAL. The configuration of the transition rule. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - configuration?: any; - /** The type of the transition rule. */ - type: string; -} diff --git a/src/version2/models/workflowTransitionRules.ts b/src/version2/models/workflowTransitionRules.ts deleted file mode 100644 index e4589b17b2..0000000000 --- a/src/version2/models/workflowTransitionRules.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { ConnectWorkflowTransitionRule } from './connectWorkflowTransitionRule'; -import type { WorkflowId } from './workflowId'; - -/** A workflow with transition rules. */ -export interface WorkflowTransitionRules { - workflowId: WorkflowId; - /** The list of post functions within the workflow. */ - postFunctions: ConnectWorkflowTransitionRule[]; - /** The list of conditions within the workflow. */ - conditions: ConnectWorkflowTransitionRule[]; - /** The list of validators within the workflow. */ - validators: ConnectWorkflowTransitionRule[]; -} diff --git a/src/version2/models/workflowTransitionRulesDetails.ts b/src/version2/models/workflowTransitionRulesDetails.ts deleted file mode 100644 index 14aec83c9f..0000000000 --- a/src/version2/models/workflowTransitionRulesDetails.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { WorkflowId } from './workflowId'; - -/** Details about a workflow configuration update request. */ -export interface WorkflowTransitionRulesDetails { - workflowId: WorkflowId; - /** The list of connect workflow rule IDs. */ - workflowRuleIds: string[]; -} diff --git a/src/version2/models/workflowTransitionRulesUpdate.ts b/src/version2/models/workflowTransitionRulesUpdate.ts deleted file mode 100644 index 81e63681f5..0000000000 --- a/src/version2/models/workflowTransitionRulesUpdate.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkflowTransitionRules } from './workflowTransitionRules'; - -/** Details about a workflow configuration update request. */ -export interface WorkflowTransitionRulesUpdate { - /** The list of workflows with transition rules to update. */ - workflows: WorkflowTransitionRules[]; -} diff --git a/src/version2/models/workflowTransitionRulesUpdateErrorDetails.ts b/src/version2/models/workflowTransitionRulesUpdateErrorDetails.ts deleted file mode 100644 index 404de9cfc4..0000000000 --- a/src/version2/models/workflowTransitionRulesUpdateErrorDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { WorkflowId } from './workflowId'; - -/** Details of any errors encountered while updating workflow transition rules for a workflow. */ -export interface WorkflowTransitionRulesUpdateErrorDetails { - /** - * A list of transition rule update errors, indexed by the transition rule ID. Any transition rule that appears here - * wasn't updated. - */ - ruleUpdateErrors: unknown; - /** - * The list of errors that specify why the workflow update failed. The workflow was not updated if the list contains - * any entries. - */ - updateErrors: string[]; - workflowId: WorkflowId; -} diff --git a/src/version2/models/workflowTransitionRulesUpdateErrors.ts b/src/version2/models/workflowTransitionRulesUpdateErrors.ts deleted file mode 100644 index 0bd9d592b3..0000000000 --- a/src/version2/models/workflowTransitionRulesUpdateErrors.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkflowTransitionRulesUpdateErrorDetails } from './workflowTransitionRulesUpdateErrorDetails'; - -/** Details of any errors encountered while updating workflow transition rules. */ -export interface WorkflowTransitionRulesUpdateErrors { - /** A list of workflows. */ - updateResults: WorkflowTransitionRulesUpdateErrorDetails[]; -} diff --git a/src/version2/models/workflowTransitions.ts b/src/version2/models/workflowTransitions.ts deleted file mode 100644 index d847e53d5a..0000000000 --- a/src/version2/models/workflowTransitions.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { ConditionGroupConfiguration } from './conditionGroupConfiguration'; -import type { WorkflowRuleConfiguration } from './workflowRuleConfiguration'; -import type { WorkflowStatusAndPort } from './workflowStatusAndPort'; -import type { WorkflowTrigger } from './workflowTrigger'; - -/** The transitions of the workflow. */ -export interface WorkflowTransitions { - /** The post-functions of the transition. */ - actions?: WorkflowRuleConfiguration[]; - conditions?: ConditionGroupConfiguration; - /** The custom event ID of the transition. */ - customIssueEventId?: string; - /** The description of the transition. */ - description?: string; - /** The statuses the transition can start from. */ - from?: WorkflowStatusAndPort[]; - /** The ID of the transition. */ - id?: string; - /** The name of the transition. */ - name?: string; - /** The properties of the transition. */ - properties?: unknown; - to?: WorkflowStatusAndPort; - transitionScreen?: WorkflowRuleConfiguration; - /** The triggers of the transition. */ - triggers?: WorkflowTrigger[]; - /** The transition type. */ - type?: string; - /** The validators of the transition. */ - validators?: WorkflowRuleConfiguration[]; -} diff --git a/src/version2/models/workflowTrigger.ts b/src/version2/models/workflowTrigger.ts deleted file mode 100644 index 6a01b17784..0000000000 --- a/src/version2/models/workflowTrigger.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** The trigger configuration associated with a workflow. */ -export interface WorkflowTrigger { - /** The ID of the trigger. */ - id?: string; - /** The parameters of the trigger. */ - parameters: unknown; - /** The rule key of the trigger. */ - ruleKey: string; -} diff --git a/src/version2/models/workflowUpdate.ts b/src/version2/models/workflowUpdate.ts deleted file mode 100644 index 90a546acc9..0000000000 --- a/src/version2/models/workflowUpdate.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { DocumentVersion } from './documentVersion'; -import type { StatusLayoutUpdate } from './statusLayoutUpdate'; -import type { StatusMappingDTO } from './statusMappingDTO'; -import type { StatusMigration } from './statusMigration'; -import type { TransitionUpdateDTO } from './transitionUpdateDTO'; -import type { WorkflowLayout } from './workflowLayout'; - -/** The details of the workflows to update. */ -export interface WorkflowUpdate { - /** The mapping of old to new status ID. */ - defaultStatusMappings?: StatusMigration[]; - /** The new description for this workflow. */ - description?: string; - /** The ID of this workflow. */ - id: string; - startPointLayout?: WorkflowLayout; - /** The mapping of old to new status ID for a specific project and issue type. */ - statusMappings?: StatusMappingDTO[]; - /** The statuses associated with this workflow. */ - statuses: StatusLayoutUpdate[]; - /** The transitions of this workflow. */ - transitions: TransitionUpdateDTO[]; - version: DocumentVersion; -} diff --git a/src/version2/models/workflowUpdateRequest.ts b/src/version2/models/workflowUpdateRequest.ts deleted file mode 100644 index 5e253817c0..0000000000 --- a/src/version2/models/workflowUpdateRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { WorkflowStatusUpdate } from './workflowStatusUpdate'; -import type { WorkflowUpdate } from './workflowUpdate'; - -/** The update workflows payload. */ -export interface WorkflowUpdateRequest { - /** The statuses to associate with the workflows. */ - statuses: WorkflowStatusUpdate[]; - /** The details of the workflows to update. */ - workflows: WorkflowUpdate[]; -} diff --git a/src/version2/models/workflowValidationError.ts b/src/version2/models/workflowValidationError.ts deleted file mode 100644 index d5f6462be0..0000000000 --- a/src/version2/models/workflowValidationError.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { WorkflowElementReference } from './workflowElementReference'; - -/** The details about a workflow validation error. */ -export interface WorkflowValidationError { - /** An error code. */ - code?: string; - elementReference?: WorkflowElementReference; - /** The validation error level. */ - level?: string; - /** An error message. */ - message?: string; - /** The type of element the error or warning references. */ - type?: string; -} diff --git a/src/version2/models/workflowValidationErrorList.ts b/src/version2/models/workflowValidationErrorList.ts deleted file mode 100644 index faee13ce28..0000000000 --- a/src/version2/models/workflowValidationErrorList.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { WorkflowValidationError } from './workflowValidationError'; - -export interface WorkflowValidationErrorList { - /** The list of validation errors. */ - errors?: WorkflowValidationError[]; -} diff --git a/src/version2/models/workflowsWithTransitionRulesDetails.ts b/src/version2/models/workflowsWithTransitionRulesDetails.ts deleted file mode 100644 index 883d8b1012..0000000000 --- a/src/version2/models/workflowsWithTransitionRulesDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkflowTransitionRulesDetails } from './workflowTransitionRulesDetails'; - -/** Details of workflows and their transition rules to delete. */ -export interface WorkflowsWithTransitionRulesDetails { - /** The list of workflows with transition rules to delete. */ - workflows: WorkflowTransitionRulesDetails[]; -} diff --git a/src/version2/models/workingDaysConfig.ts b/src/version2/models/workingDaysConfig.ts deleted file mode 100644 index 3cc7594ae8..0000000000 --- a/src/version2/models/workingDaysConfig.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { NonWorkingDay } from './nonWorkingDay'; - -/** Working days configuration */ -export interface WorkingDaysConfig { - friday?: boolean; - id?: number; - monday?: boolean; - nonWorkingDays?: NonWorkingDay[]; - saturday?: boolean; - sunday?: boolean; - thursday?: boolean; - timezoneId?: string; - tuesday?: boolean; - wednesday?: boolean; -} diff --git a/src/version2/models/worklog.ts b/src/version2/models/worklog.ts deleted file mode 100644 index 799eeb3f04..0000000000 --- a/src/version2/models/worklog.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { EntityProperty } from './entityProperty'; -import type { UserDetails } from './userDetails'; -import type { Visibility } from './visibility'; - -/** Details of a worklog. */ -export interface Worklog { - author?: UserDetails; - /** A comment about the worklog. Optional when creating or updating a worklog. */ - comment?: string; - /** The datetime on which the worklog was created. */ - created?: string; - /** The ID of the worklog record. */ - id?: string; - /** The ID of the issue this worklog is for. */ - issueId?: string; - /** Details of properties for the worklog. Optional when creating or updating a worklog. */ - properties?: EntityProperty[]; - /** The URL of the worklog item. */ - self?: string; - /** - * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a - * worklog. - */ - started?: string; - /** - * The time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a - * worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if - * `timeSpentSecond` is provided. - */ - timeSpent?: string; - /** - * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. - * Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. - */ - timeSpentSeconds?: number; - updateAuthor?: UserDetails; - /** The datetime on which the worklog was last updated. */ - updated?: string; - visibility?: Visibility; -} diff --git a/src/version2/models/worklogIdsRequest.ts b/src/version2/models/worklogIdsRequest.ts deleted file mode 100644 index aa20d7e6ad..0000000000 --- a/src/version2/models/worklogIdsRequest.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface WorklogIdsRequest { - /** A list of worklog IDs. */ - ids: number[]; -} diff --git a/src/version2/models/worklogsMoveRequest.ts b/src/version2/models/worklogsMoveRequest.ts deleted file mode 100644 index 212d9419a7..0000000000 --- a/src/version2/models/worklogsMoveRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index cc0f7bcebb..0000000000 --- a/src/version2/models/workspaceDataPolicy.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** 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 c8dc560477..7a407c134b 100644 --- a/src/version2/myself.ts +++ b/src/version2/myself.ts @@ -1,263 +1,157 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { RemovePreferenceParameters } from './parameters/removePreferenceParameters'; +import type { GetPreferenceParameters } from './parameters/getPreferenceParameters'; +import type { SetPreferenceParameters } from './parameters/setPreferenceParameters'; +import type { GetCurrentUserParameters } from './parameters/getCurrentUserParameters'; export class Myself { constructor(private client: Client) {} - /** - * Returns the value of a preference of the current user. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the - * instance. - * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the - * instance. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * Deletes a preference of the user, which restores the default value of system defined settings. * + * + * - Note that these keys are deprecated: + * - + * - - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. + * - - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. + * - + * - Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async getPreference(parameters: Parameters.GetPreference, callback: Callback): Promise; - /** - * Returns the value of a preference of the current user. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the - * instance. - * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the - * instance. - * - * 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. - * - * **[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): Promise { - const config: Request = { + async removePreference(parameters: RemovePreferenceParameters) { + const request: Request = { url: '/rest/api/2/mypreferences', - method: 'GET', + method: 'DELETE', query: { key: parameters.key, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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.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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * Returns the value of a preference of the current user. * + * + * - Note that these keys are deprecated: + * - + * - - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the + * instance. + * - - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the + * instance. + * - + * - 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. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async setPreference(parameters: Parameters.SetPreference, callback: Callback): Promise; - /** - * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, - * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the - * following keys define system preferences that can be set or created: - * - * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. - * - _user.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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async setPreference(parameters: Parameters.SetPreference, callback?: never): Promise; - async setPreference(parameters: Parameters.SetPreference): Promise { - const config: Request = { + async getPreference(parameters: GetPreferenceParameters) { + const request: Request = { url: '/rest/api/2/mypreferences', - method: 'PUT', - headers: { - 'Content-Type': typeof parameters.value === 'string' ? 'text/plain' : 'application/json', - }, + method: 'GET', query: { key: parameters.key, }, - body: parameters.value, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a preference of the user, which restores the default value of system defined settings. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. - * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async removePreference(parameters: Parameters.RemovePreference, callback: Callback): Promise; - /** - * Deletes a preference of the user, which restores the default value of system defined settings. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. - * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * 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.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. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async removePreference(parameters: Parameters.RemovePreference, callback?: never): Promise; - async removePreference(parameters: Parameters.RemovePreference): Promise { - const config: Request = { + async setPreference(parameters: SetPreferenceParameters) { + const request: Request = { url: '/rest/api/2/mypreferences', - method: 'DELETE', + method: 'PUT', query: { key: parameters.key, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the locale for the user. - * - * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, - * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header - * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getLocale(callback: Callback): Promise; - /** - * Returns the locale for the user. - * - * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, - * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header - * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * Returns the locale for the user. * + * + * - If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, + * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ + * header in the request. However, if this doesn't match a locale available Jira, the site default locale is + * returned. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getLocale(callback?: never): Promise; - async getLocale(): Promise { - const config: Request = { + async getLocale() { + const request: Request = { url: '/rest/api/2/mypreferences/locale', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns details for the current user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getCurrentUser( - parameters: Parameters.GetCurrentUser | undefined, - callback: Callback, - ): Promise; - /** - * Returns details for the current user. + * Returns details for the current user. * * - * **[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:** + * Permission to access Jira. */ - async getCurrentUser(parameters?: Parameters.GetCurrentUser, callback?: never): Promise; - async getCurrentUser(parameters?: Parameters.GetCurrentUser): Promise { - const config: Request = { + async getCurrentUser(parameters: GetCurrentUserParameters) { + const request: Request = { url: '/rest/api/2/myself', method: 'GET', query: { - expand: parameters?.expand, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/parameters/addActorUsers.ts b/src/version2/parameters/addActorUsers.ts deleted file mode 100644 index b2498216ef..0000000000 --- a/src/version2/parameters/addActorUsers.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ActorsMap } from '../models'; - -export interface AddActorUsers extends ActorsMap { - /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string | number; - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version2/parameters/addActorUsersParameters.ts b/src/version2/parameters/addActorUsersParameters.ts new file mode 100644 index 0000000000..92a2d40a84 --- /dev/null +++ b/src/version2/parameters/addActorUsersParameters.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; + +export const AddActorUsersParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: z.number().int(), + /** + * The name of the group to add. This parameter cannot be used with the `groupId` parameter. As a group's name can + * change, use of `groupId` is recommended. + */ + group: z.array(z.string()).optional(), + /** The ID of the group to add. This parameter cannot be used with the `group` parameter. */ + groupId: z.array(z.string()).optional(), + /** The user account ID of the user to add. */ + user: z.array(z.string()).optional(), +}); + +export type AddActorUsersParameters = z.infer; diff --git a/src/version2/parameters/addAtlassianTeam.ts b/src/version2/parameters/addAtlassianTeam.ts deleted file mode 100644 index 21287620b8..0000000000 --- a/src/version2/parameters/addAtlassianTeam.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AddAtlassianTeamRequest } from '../models'; - -export interface AddAtlassianTeam extends AddAtlassianTeamRequest { - /** The ID of the plan. */ - planId: number; -} diff --git a/src/version2/parameters/addAtlassianTeamParameters.ts b/src/version2/parameters/addAtlassianTeamParameters.ts new file mode 100644 index 0000000000..8bdfdff20d --- /dev/null +++ b/src/version2/parameters/addAtlassianTeamParameters.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +export const AddAtlassianTeamParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), + /** The capacity for the Atlassian team. */ + capacity: z.number().optional(), + /** The Atlassian team ID. */ + id: z.string(), + /** The ID of the issue source for the Atlassian team. */ + issueSourceId: z.number().int().optional(), + /** The planning style for the Atlassian team. This must be "Scrum" or "Kanban". */ + planningStyle: z.enum(['Scrum', 'Kanban']), + /** The sprint length for the Atlassian team. */ + sprintLength: z.number().int().optional(), +}); + +export type AddAtlassianTeamParameters = z.infer; diff --git a/src/version2/parameters/addAttachment.ts b/src/version2/parameters/addAttachment.ts deleted file mode 100644 index 7a0682f58b..0000000000 --- a/src/version2/parameters/addAttachment.ts +++ /dev/null @@ -1,103 +0,0 @@ -import type { Readable } from 'node:stream'; - -/** - * Represents an attachment to be added to an issue. - * - * @example - * ```typescript - * const attachment: Attachment = { - * filename: 'example.txt', - * file: Buffer.from('Hello, world!'), - * mimeType: 'text/plain', - * }; - * ``` - */ -export interface Attachment { - /** - * The name of the attachment file. - * - * @example - * ```typescript - * const filename = 'document.pdf'; - * ``` - */ - filename: string; - - /** - * The content of the attachment. Can be one of the following: - * - * - `Buffer`: For binary data. - * - `ReadableStream`: For streaming large files. - * - `string`: For text-based content. - * - `Blob`: For browser-like blob objects. - * - `File`: For file objects with metadata (e.g., in web environments). - * - * @example - * ```typescript - * const fileContent = fs.readFileSync('./document.pdf'); - * ``` - */ - file: Buffer | ReadableStream | Readable | string | Blob | File; - - /** - * Optional MIME type of the attachment. Example values include: - * - * - 'application/pdf' - * - 'image/png' - * - * If not provided, the MIME type will be automatically detected based on the filename. - * - * @example - * ```typescript - * const mimeType = 'application/pdf'; - * ``` - */ - mimeType?: string; -} - -/** - * Parameters for adding attachments to an issue. - * - * @example - * ```typescript - * const addAttachmentParams: AddAttachment = { - * issueIdOrKey: 'PROJECT-123', - * attachment: { - * filename: 'example.txt', - * file: 'Hello, world!', - * mimeType: 'text/plain', - * }, - * }; - * ``` - */ -export interface AddAttachment { - /** - * The ID or key of the issue to which the attachments will be added. - * - * @example - * ```typescript - * const issueIdOrKey = 'PROJECT-123'; - * ``` - */ - issueIdOrKey: string; - - /** - * The attachment(s) to be added. Can be a single `Attachment` object or an array of `Attachment` objects. - * - * @example - * ```typescript - * const attachments = [ - * { - * filename: 'file1.txt', - * file: Buffer.from('File 1 content'), - * mimeType: 'text/plain', - * }, - * { - * filename: 'proof image.png', - * file: fs.readFileSync('./image.png'), // Reads the image file into a Buffer - * }, - * ]; - * ``` - */ - attachment: Attachment | Attachment[]; -} diff --git a/src/version2/parameters/addAttachmentParameters.ts b/src/version2/parameters/addAttachmentParameters.ts new file mode 100644 index 0000000000..3ce8808f55 --- /dev/null +++ b/src/version2/parameters/addAttachmentParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const AddAttachmentParametersSchema = z.object({ + /** The ID or key of the issue that attachments are added to. */ + issueIdOrKey: z.string(), +}); + +export type AddAttachmentParameters = z.infer; diff --git a/src/version2/parameters/addComment.ts b/src/version2/parameters/addComment.ts deleted file mode 100644 index 634cf6303d..0000000000 --- a/src/version2/parameters/addComment.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Comment } from '../models'; - -export interface AddComment extends Comment { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body - * rendered in HTML. - */ - expand?: string; -} diff --git a/src/version2/parameters/addCommentParameters.ts b/src/version2/parameters/addCommentParameters.ts new file mode 100644 index 0000000000..cb04c6f3b2 --- /dev/null +++ b/src/version2/parameters/addCommentParameters.ts @@ -0,0 +1,51 @@ +import { z } from 'zod'; +import { EntityPropertySchema } from './entityProperty'; + +export const AddCommentParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body + * rendered in HTML. + */ + expand: z.string().optional(), + /** The ID of the user who created the comment. */ + author: z.unknown().optional(), + /** The comment text. */ + body: z.string().optional(), + /** The date and time at which the comment was created. */ + created: z.string().datetime().optional(), + /** The ID of the comment. */ + id: z.string().optional(), + /** + * Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external + * emails to be added as comments on + * issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for + * information on setting up this feature. + */ + jsdAuthorCanSeeRequest: z.boolean().optional(), + /** + * Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud + * Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk + * project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its + * visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request + * comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) + * operation. + */ + jsdPublic: z.boolean().optional(), + /** A list of comment properties. Optional on create and update. */ + properties: z.array(EntityPropertySchema).optional(), + /** The rendered version of the comment. */ + renderedBody: z.string().optional(), + /** The URL of the comment. */ + self: z.string().optional(), + /** The ID of the user who updated the comment last. */ + updateAuthor: z.unknown().optional(), + /** The date and time at which the comment was updated last. */ + updated: z.string().datetime().optional(), + /** The group or role to which this comment is visible. Optional on create and update. */ + visibility: z.unknown().optional(), +}); + +export type AddCommentParameters = z.infer; diff --git a/src/version2/parameters/addFieldToDefaultScreen.ts b/src/version2/parameters/addFieldToDefaultScreen.ts deleted file mode 100644 index 20ea2c9186..0000000000 --- a/src/version2/parameters/addFieldToDefaultScreen.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface AddFieldToDefaultScreen { - /** The ID of the field. */ - fieldId: string; -} diff --git a/src/version2/parameters/addFieldToDefaultScreenParameters.ts b/src/version2/parameters/addFieldToDefaultScreenParameters.ts new file mode 100644 index 0000000000..03c0412634 --- /dev/null +++ b/src/version2/parameters/addFieldToDefaultScreenParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const AddFieldToDefaultScreenParametersSchema = z.object({ + /** The ID of the field. */ + fieldId: z.string(), +}); + +export type AddFieldToDefaultScreenParameters = z.infer; diff --git a/src/version2/parameters/addGadget.ts b/src/version2/parameters/addGadget.ts deleted file mode 100644 index eea5d91a00..0000000000 --- a/src/version2/parameters/addGadget.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DashboardGadgetSettings } from '../models'; - -export interface AddGadget extends DashboardGadgetSettings { - /** The ID of the dashboard. */ - dashboardId: number; -} diff --git a/src/version2/parameters/addGadgetParameters.ts b/src/version2/parameters/addGadgetParameters.ts new file mode 100644 index 0000000000..3c078d3a2b --- /dev/null +++ b/src/version2/parameters/addGadgetParameters.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; + +export const AddGadgetParametersSchema = z.object({ + /** The ID of the dashboard. */ + dashboardId: z.number().int(), + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color: z.string().optional(), + /** + * Whether to ignore the validation of module key and URI. For example, when a gadget is created that is a part of an + * application that isn't installed. + */ + ignoreUriAndModuleKeyValidation: z.boolean().optional(), + /** The module key of the gadget type. Can't be provided with `uri`. */ + moduleKey: z.string().optional(), + /** + * The position of the gadget. When the gadget is placed into the position, other gadgets in the same column are moved + * down to accommodate it. + */ + position: z.unknown().optional(), + /** The title of the gadget. */ + title: z.string().optional(), + /** The URI of the gadget type. Can't be provided with `moduleKey`. */ + uri: z.string().optional(), +}); + +export type AddGadgetParameters = z.infer; diff --git a/src/version2/parameters/addIssueTypesToContext.ts b/src/version2/parameters/addIssueTypesToContext.ts deleted file mode 100644 index b42923403e..0000000000 --- a/src/version2/parameters/addIssueTypesToContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypeIds } from '../models'; - -export interface AddIssueTypesToContext extends IssueTypeIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/addIssueTypesToContextParameters.ts b/src/version2/parameters/addIssueTypesToContextParameters.ts new file mode 100644 index 0000000000..42f95b4d4e --- /dev/null +++ b/src/version2/parameters/addIssueTypesToContextParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const AddIssueTypesToContextParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The ID of the context. */ + contextId: z.number().int(), + /** The list of issue type IDs. */ + issueTypeIds: z.array(z.string()), +}); + +export type AddIssueTypesToContextParameters = z.infer; diff --git a/src/version2/parameters/addIssueTypesToIssueTypeScheme.ts b/src/version2/parameters/addIssueTypesToIssueTypeScheme.ts deleted file mode 100644 index bcad674fe8..0000000000 --- a/src/version2/parameters/addIssueTypesToIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeIds } from '../models'; - -export interface AddIssueTypesToIssueTypeScheme extends IssueTypeIds { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version2/parameters/addIssueTypesToIssueTypeSchemeParameters.ts b/src/version2/parameters/addIssueTypesToIssueTypeSchemeParameters.ts new file mode 100644 index 0000000000..3d6b3d394a --- /dev/null +++ b/src/version2/parameters/addIssueTypesToIssueTypeSchemeParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const AddIssueTypesToIssueTypeSchemeParametersSchema = z.object({ + /** The ID of the issue type scheme. */ + issueTypeSchemeId: z.number().int(), + /** The list of issue type IDs. */ + issueTypeIds: z.array(z.string()), +}); + +export type AddIssueTypesToIssueTypeSchemeParameters = z.infer; diff --git a/src/version2/parameters/addNotifications.ts b/src/version2/parameters/addNotifications.ts deleted file mode 100644 index 30fd7a9e30..0000000000 --- a/src/version2/parameters/addNotifications.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AddNotificationsDetails } from '../models'; - -export interface AddNotifications extends AddNotificationsDetails { - /** The ID of the notification scheme. */ - id: string; -} diff --git a/src/version2/parameters/addNotificationsParameters.ts b/src/version2/parameters/addNotificationsParameters.ts new file mode 100644 index 0000000000..367f70cf8a --- /dev/null +++ b/src/version2/parameters/addNotificationsParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { NotificationSchemeEventDetailsSchema } from './notificationSchemeEventDetails'; + +export const AddNotificationsParametersSchema = z.object({ + /** The ID of the notification scheme. */ + id: z.string(), + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents: z.array(NotificationSchemeEventDetailsSchema), +}); + +export type AddNotificationsParameters = z.infer; diff --git a/src/version2/parameters/addProjectRoleActorsToRole.ts b/src/version2/parameters/addProjectRoleActorsToRole.ts deleted file mode 100644 index 3c0b98bf42..0000000000 --- a/src/version2/parameters/addProjectRoleActorsToRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ActorInput } from '../models'; - -export interface AddProjectRoleActorsToRole extends ActorInput { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version2/parameters/addProjectRoleActorsToRoleParameters.ts b/src/version2/parameters/addProjectRoleActorsToRoleParameters.ts new file mode 100644 index 0000000000..98d30fe96a --- /dev/null +++ b/src/version2/parameters/addProjectRoleActorsToRoleParameters.ts @@ -0,0 +1,28 @@ +import { z } from 'zod'; + +export const AddProjectRoleActorsToRoleParametersSchema = z.object({ + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: z.number().int(), + /** + * The name of the group to add as a default actor. This parameter cannot be used with the `groupId` parameter. As a + * group's name can change,use of `groupId` is recommended. This parameter accepts a comma-separated list. For + * example, `"group":["project-admin", "jira-developers"]`. + */ + group: z.array(z.string()).optional(), + /** + * The ID of the group to add as a default actor. This parameter cannot be used with the `group` parameter This + * parameter accepts a comma-separated list. For example, `"groupId":["77f6ab39-e755-4570-a6ae-2d7a8df0bcb8", + * "0c011f85-69ed-49c4-a801-3b18d0f771bc"]`. + */ + groupId: z.array(z.string()).optional(), + /** + * The account IDs of the users to add as default actors. This parameter accepts a comma-separated list. For example, + * `"user":["5b10a2844c20165700ede21g", "5b109f2e9729b51b54dc274d"]`. + */ + user: z.array(z.string()).optional(), +}); + +export type AddProjectRoleActorsToRoleParameters = z.infer; diff --git a/src/version2/parameters/addScreenTab.ts b/src/version2/parameters/addScreenTab.ts deleted file mode 100644 index 9cd14d1c35..0000000000 --- a/src/version2/parameters/addScreenTab.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ScreenableTab } from '../models'; - -export interface AddScreenTab extends ScreenableTab { - /** The ID of the screen. */ - screenId: number; -} diff --git a/src/version2/parameters/addScreenTabField.ts b/src/version2/parameters/addScreenTabField.ts deleted file mode 100644 index 9cc7e63378..0000000000 --- a/src/version2/parameters/addScreenTabField.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AddField } from '../models'; - -export interface AddScreenTabField extends AddField { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; -} diff --git a/src/version2/parameters/addScreenTabFieldParameters.ts b/src/version2/parameters/addScreenTabFieldParameters.ts new file mode 100644 index 0000000000..9813343b9c --- /dev/null +++ b/src/version2/parameters/addScreenTabFieldParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const AddScreenTabFieldParametersSchema = z.object({ + /** The ID of the screen. */ + screenId: z.number().int(), + /** The ID of the screen tab. */ + tabId: z.number().int(), + /** The ID of the field to add. */ + fieldId: z.string(), +}); + +export type AddScreenTabFieldParameters = z.infer; diff --git a/src/version2/parameters/addScreenTabParameters.ts b/src/version2/parameters/addScreenTabParameters.ts new file mode 100644 index 0000000000..68c0ab2cc4 --- /dev/null +++ b/src/version2/parameters/addScreenTabParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const AddScreenTabParametersSchema = z.object({ + /** The ID of the screen. */ + screenId: z.number().int(), + /** The ID of the screen tab. */ + id: z.number().int().optional(), + /** The name of the screen tab. The maximum length is 255 characters. */ + name: z.string(), +}); + +export type AddScreenTabParameters = z.infer; diff --git a/src/version2/parameters/addSecurityLevel.ts b/src/version2/parameters/addSecurityLevel.ts deleted file mode 100644 index 9397d07983..0000000000 --- a/src/version2/parameters/addSecurityLevel.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AddSecuritySchemeLevelsRequest } from '../models'; - -export interface AddSecurityLevel extends AddSecuritySchemeLevelsRequest { - /** The ID of the issue security scheme. */ - schemeId: string; -} diff --git a/src/version2/parameters/addSecurityLevelMembers.ts b/src/version2/parameters/addSecurityLevelMembers.ts deleted file mode 100644 index ea1bfeadc6..0000000000 --- a/src/version2/parameters/addSecurityLevelMembers.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { SecuritySchemeMembersRequest } from '../models'; - -export interface AddSecurityLevelMembers extends SecuritySchemeMembersRequest { - /** The ID of the issue security scheme. */ - schemeId: string; - /** The ID of the issue security level. */ - levelId: string; -} diff --git a/src/version2/parameters/addSecurityLevelMembersParameters.ts b/src/version2/parameters/addSecurityLevelMembersParameters.ts new file mode 100644 index 0000000000..34a9c0b909 --- /dev/null +++ b/src/version2/parameters/addSecurityLevelMembersParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { SecuritySchemeLevelMemberBeanSchema } from './securitySchemeLevelMemberBean'; + +export const AddSecurityLevelMembersParametersSchema = z.object({ + /** The ID of the issue security scheme. */ + schemeId: z.string(), + /** The ID of the issue security level. */ + levelId: z.string(), + /** The list of level members which should be added to the issue security scheme level. */ + members: z.array(SecuritySchemeLevelMemberBeanSchema).optional(), +}); + +export type AddSecurityLevelMembersParameters = z.infer; diff --git a/src/version2/parameters/addSecurityLevelParameters.ts b/src/version2/parameters/addSecurityLevelParameters.ts new file mode 100644 index 0000000000..df1919cdd5 --- /dev/null +++ b/src/version2/parameters/addSecurityLevelParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { SecuritySchemeLevelSchema } from './securitySchemeLevel'; + +export const AddSecurityLevelParametersSchema = z.object({ + /** The ID of the issue security scheme. */ + schemeId: z.string(), + /** The list of scheme levels which should be added to the security scheme. */ + levels: z.array(SecuritySchemeLevelSchema).optional(), +}); + +export type AddSecurityLevelParameters = z.infer; diff --git a/src/version2/parameters/addSharePermission.ts b/src/version2/parameters/addSharePermission.ts deleted file mode 100644 index 2f30726561..0000000000 --- a/src/version2/parameters/addSharePermission.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SharePermissionInput } from '../models'; - -export interface AddSharePermission extends SharePermissionInput { - /** The ID of the filter. */ - id: number; -} diff --git a/src/version2/parameters/addSharePermissionParameters.ts b/src/version2/parameters/addSharePermissionParameters.ts new file mode 100644 index 0000000000..4b71a4055b --- /dev/null +++ b/src/version2/parameters/addSharePermissionParameters.ts @@ -0,0 +1,42 @@ +import { z } from 'zod'; + +export const AddSharePermissionParametersSchema = z.object({ + /** The ID of the filter. */ + id: z.number().int(), + /** The user account ID that the filter is shared with. For a request, specify the `accountId` property for the user. */ + accountId: z.string().optional(), + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products.For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. Cannot be provided with `groupname`. + */ + groupId: z.string().optional(), + /** + * The name of the group to share the filter with. Set `type` to `group`. Please note that the name of a group is + * mutable, to reliably identify a group use `groupId`. + */ + groupname: z.string().optional(), + /** The ID of the project to share the filter with. Set `type` to `project`. */ + projectId: z.string().optional(), + /** + * The ID of the project role to share the filter with. Set `type` to `projectRole` and the `projectId` for the + * project that the role is in. + */ + projectRoleId: z.string().optional(), + /** The rights for the share permission. */ + rights: z.number().int().optional(), + /** + * The type of the share permission.Specify the type as follows: + * + * - `user` Share with a user. + * - `group` Share with a group. Specify `groupname` as well. + * - `project` Share with a project. Specify `projectId` as well. + * - `projectRole` Share with a project role in a project. Specify `projectId` and `projectRoleId` as well. + * - `global` Share globally, including anonymous users. If set, this type overrides all existing share permissions and + * must be deleted before any non-global share permissions is set. + * - `authenticated` Share with all logged-in users. This shows as `loggedin` in the response. If set, this type + * overrides all existing share permissions and must be deleted before any non-global share permissions is set. + */ + type: z.enum(['user', 'project', 'group', 'projectRole', 'global', 'authenticated']), +}); + +export type AddSharePermissionParameters = z.infer; diff --git a/src/version2/parameters/addUserToGroup.ts b/src/version2/parameters/addUserToGroup.ts deleted file mode 100644 index 5610e87f19..0000000000 --- a/src/version2/parameters/addUserToGroup.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { UpdateUserToGroup } from '../models'; - -export interface AddUserToGroup extends UpdateUserToGroup { - /** - * As a group's name can change, use of `groupId` is recommended to identify a group. The name of the group. This - * parameter cannot be used with the `groupId` parameter. - */ - groupName?: string; - /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ - groupId?: string; -} diff --git a/src/version2/parameters/addUserToGroupParameters.ts b/src/version2/parameters/addUserToGroupParameters.ts new file mode 100644 index 0000000000..f39096e6c1 --- /dev/null +++ b/src/version2/parameters/addUserToGroupParameters.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; + +export const AddUserToGroupParametersSchema = z.object({ + /** + * 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: z.string().optional(), + /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ + groupId: z.string().optional(), + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** + * This property is no longer available. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name: z.string().optional(), +}); + +export type AddUserToGroupParameters = z.infer; diff --git a/src/version2/parameters/addVote.ts b/src/version2/parameters/addVote.ts deleted file mode 100644 index a24a96d11b..0000000000 --- a/src/version2/parameters/addVote.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface AddVote { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/addVoteParameters.ts b/src/version2/parameters/addVoteParameters.ts new file mode 100644 index 0000000000..52d9067ffa --- /dev/null +++ b/src/version2/parameters/addVoteParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const AddVoteParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), +}); + +export type AddVoteParameters = z.infer; diff --git a/src/version2/parameters/addWatcher.ts b/src/version2/parameters/addWatcher.ts deleted file mode 100644 index 7460fd54ef..0000000000 --- a/src/version2/parameters/addWatcher.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface AddWatcher { - /** The ID or key of the issue. */ - issueIdOrKey: string; - - /** Account id for specific user. */ - accountId?: string; -} diff --git a/src/version2/parameters/addWatcherParameters.ts b/src/version2/parameters/addWatcherParameters.ts new file mode 100644 index 0000000000..7be6eda646 --- /dev/null +++ b/src/version2/parameters/addWatcherParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const AddWatcherParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), +}); + +export type AddWatcherParameters = z.infer; diff --git a/src/version2/parameters/addWorklog.ts b/src/version2/parameters/addWorklog.ts deleted file mode 100644 index 8dd6ef9913..0000000000 --- a/src/version2/parameters/addWorklog.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { Worklog } from '../models'; - -export interface AddWorklog extends Worklog { - /** The ID or key the issue. */ - issueIdOrKey: string; - /** Whether users watching the issue are notified by email. */ - notifyUsers?: boolean; - /** - * Defines how to update the issue's time estimate, the options are: - * - * - `new` Sets the estimate to a specific value, defined in `newEstimate`. - * - `leave` Leaves the estimate unchanged. - * - `manual` Reduces the estimate by amount specified in `reduceBy`. - * - `auto` Reduces the estimate by the value of `timeSpent` in the worklog. - */ - adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; - /** - * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For - * example, _2d_. Required when `adjustEstimate` is `new`. - */ - newEstimate?: string; - /** - * The amount to reduce the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m). For example, - * _2d_. Required when `adjustEstimate` is `manual`. - */ - reduceBy?: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about work logs in the response. This parameter accepts `properties`, which returns worklog - * properties. - */ - expand?: string; - /** - * Whether the worklog entry should be added to the issue even if the issue is not editable, because - * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version2/parameters/addWorklogParameters.ts b/src/version2/parameters/addWorklogParameters.ts new file mode 100644 index 0000000000..75aba739bd --- /dev/null +++ b/src/version2/parameters/addWorklogParameters.ts @@ -0,0 +1,78 @@ +import { z } from 'zod'; +import { EntityPropertySchema } from './entityProperty'; + +export const AddWorklogParametersSchema = z.object({ + /** The ID or key the issue. */ + issueIdOrKey: z.string(), + /** Whether users watching the issue are notified by email. */ + notifyUsers: z.boolean().optional(), + /** + * Defines how to update the issue's time estimate, the options are: + * + * - `new` Sets the estimate to a specific value, defined in `newEstimate`. + * - `leave` Leaves the estimate unchanged. + * - `manual` Reduces the estimate by amount specified in `reduceBy`. + * - `auto` Reduces the estimate by the value of `timeSpent` in the worklog. + */ + adjustEstimate: z.enum(['new', 'leave', 'manual', 'auto']).optional(), + /** + * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For + * example, _2d_. Required when `adjustEstimate` is `new`. + */ + newEstimate: z.string().optional(), + /** + * The amount to reduce the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m). For example, + * _2d_. Required when `adjustEstimate` is `manual`. + */ + reduceBy: z.string().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about work logs in the response. This parameter accepts `properties`, which returns worklog + * properties. + */ + expand: z.string().optional(), + /** + * Whether the worklog entry should be added to the issue even if the issue is not editable, because + * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag: z.boolean().optional(), + /** Details of the user who created the worklog. */ + author: z.unknown().optional(), + /** A comment about the worklog. Optional when creating or updating a worklog. */ + comment: z.string().optional(), + /** The datetime on which the worklog was created. */ + created: z.string().datetime().optional(), + /** The ID of the worklog record. */ + id: z.string().optional(), + /** The ID of the issue this worklog is for. */ + issueId: z.string().optional(), + /** Details of properties for the worklog. Optional when creating or updating a worklog. */ + properties: z.array(EntityPropertySchema).optional(), + /** The URL of the worklog item. */ + self: z.string().optional(), + /** + * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a + * worklog. + */ + started: z.string().datetime().optional(), + /** + * The time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a + * worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if + * `timeSpentSecond` is provided. + */ + timeSpent: z.string().optional(), + /** + * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. + * Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. + */ + timeSpentSeconds: z.number().int().optional(), + /** Details of the user who last updated the worklog. */ + updateAuthor: z.unknown().optional(), + /** The datetime on which the worklog was last updated. */ + updated: z.string().datetime().optional(), + /** Details about any restrictions in the visibility of the worklog. Optional when creating or updating a worklog. */ + visibility: z.unknown().optional(), +}); + +export type AddWorklogParameters = z.infer; diff --git a/src/version2/parameters/analyseExpression.ts b/src/version2/parameters/analyseExpression.ts deleted file mode 100644 index 6a87eb755d..0000000000 --- a/src/version2/parameters/analyseExpression.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { JiraExpressionForAnalysis } from '../models'; - -export interface AnalyseExpression extends JiraExpressionForAnalysis { - /** - * The check to perform: - * - * - `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are - * validated. For example, the expression's length. - * - `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors - * that would result in the expression failure at runtime are reported. For example, accessing properties that don't - * exist or passing the wrong number of arguments to functions. Also performs the syntax check. - * - `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive - * operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each - * expression may execute. - */ - check?: 'syntax' | 'type' | 'complexity' | string; -} diff --git a/src/version2/parameters/analyseExpressionParameters.ts b/src/version2/parameters/analyseExpressionParameters.ts new file mode 100644 index 0000000000..78ee0fe362 --- /dev/null +++ b/src/version2/parameters/analyseExpressionParameters.ts @@ -0,0 +1,28 @@ +import { z } from 'zod'; + +export const AnalyseExpressionParametersSchema = z.object({ + /** + * The check to perform: + * + * - `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are + * validated. For example, the expression's length. + * - `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors + * that would result in the expression failure at runtime are reported. For example, accessing properties that don't + * exist or passing the wrong number of arguments to functions. Also performs the syntax check. + * - `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive + * operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each + * expression may execute. + */ + check: z.enum(['syntax', 'type', 'complexity']).optional(), + /** + * Context variables and their types. The type checker assumes that [common context + * variables](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables), such as + * `issue` or `project`, are available in context and sets their type. Use this property to override the default types + * or provide details of new variables. + */ + contextVariables: z.object({}).optional(), + /** The list of Jira expressions to analyse. */ + expressions: z.array(z.string()), +}); + +export type AnalyseExpressionParameters = z.infer; diff --git a/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.ts b/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.ts deleted file mode 100644 index ce6c58d1ea..0000000000 --- a/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeScreenSchemeMappingDetails } from '../models'; - -export interface AppendMappingsForIssueTypeScreenScheme extends IssueTypeScreenSchemeMappingDetails { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version2/parameters/appendMappingsForIssueTypeScreenSchemeParameters.ts b/src/version2/parameters/appendMappingsForIssueTypeScreenSchemeParameters.ts new file mode 100644 index 0000000000..58f367baf1 --- /dev/null +++ b/src/version2/parameters/appendMappingsForIssueTypeScreenSchemeParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { IssueTypeScreenSchemeMappingSchema } from './issueTypeScreenSchemeMapping'; + +export const AppendMappingsForIssueTypeScreenSchemeParametersSchema = z.object({ + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: z.string(), + /** + * The list of issue type to screen scheme mappings. A _default_ entry cannot be specified because a default entry is + * added when an issue type screen scheme is created. + */ + issueTypeMappings: z.array(IssueTypeScreenSchemeMappingSchema), +}); + +export type AppendMappingsForIssueTypeScreenSchemeParameters = z.infer< + typeof AppendMappingsForIssueTypeScreenSchemeParametersSchema +>; diff --git a/src/version2/parameters/archiveIssues.ts b/src/version2/parameters/archiveIssues.ts deleted file mode 100644 index abaee418c3..0000000000 --- a/src/version2/parameters/archiveIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ArchiveIssues { - issueIdsOrKeys?: string[]; -} diff --git a/src/version2/parameters/archiveIssuesAsync.ts b/src/version2/parameters/archiveIssuesAsync.ts deleted file mode 100644 index 74a43a0704..0000000000 --- a/src/version2/parameters/archiveIssuesAsync.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ArchiveIssuesAsync { - jql?: string; -} diff --git a/src/version2/parameters/archiveIssuesAsyncParameters.ts b/src/version2/parameters/archiveIssuesAsyncParameters.ts new file mode 100644 index 0000000000..49c27254cd --- /dev/null +++ b/src/version2/parameters/archiveIssuesAsyncParameters.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const ArchiveIssuesAsyncParametersSchema = z.object({ + jql: z.string().optional(), +}); + +export type ArchiveIssuesAsyncParameters = z.infer; diff --git a/src/version2/parameters/archiveIssuesParameters.ts b/src/version2/parameters/archiveIssuesParameters.ts new file mode 100644 index 0000000000..106a53e923 --- /dev/null +++ b/src/version2/parameters/archiveIssuesParameters.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const ArchiveIssuesParametersSchema = z.object({ + issueIdsOrKeys: z.array(z.string()).optional(), +}); + +export type ArchiveIssuesParameters = z.infer; diff --git a/src/version2/parameters/archivePlan.ts b/src/version2/parameters/archivePlan.ts deleted file mode 100644 index 250cc9759f..0000000000 --- a/src/version2/parameters/archivePlan.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface ArchivePlan { - /** The ID of the plan. */ - planId: number; -} diff --git a/src/version2/parameters/archivePlanParameters.ts b/src/version2/parameters/archivePlanParameters.ts new file mode 100644 index 0000000000..ef2a5dcfec --- /dev/null +++ b/src/version2/parameters/archivePlanParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const ArchivePlanParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), +}); + +export type ArchivePlanParameters = z.infer; diff --git a/src/version2/parameters/archiveProject.ts b/src/version2/parameters/archiveProject.ts deleted file mode 100644 index 21f2d1c389..0000000000 --- a/src/version2/parameters/archiveProject.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface ArchiveProject { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; -} diff --git a/src/version2/parameters/archiveProjectParameters.ts b/src/version2/parameters/archiveProjectParameters.ts new file mode 100644 index 0000000000..14addc07b7 --- /dev/null +++ b/src/version2/parameters/archiveProjectParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const ArchiveProjectParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), +}); + +export type ArchiveProjectParameters = z.infer; diff --git a/src/version2/parameters/assignFieldConfigurationSchemeToProject.ts b/src/version2/parameters/assignFieldConfigurationSchemeToProject.ts deleted file mode 100644 index b64ced20ca..0000000000 --- a/src/version2/parameters/assignFieldConfigurationSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FieldConfigurationSchemeProjectAssociation } from '../models'; - -export interface AssignFieldConfigurationSchemeToProject extends FieldConfigurationSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignFieldConfigurationSchemeToProjectParameters.ts b/src/version2/parameters/assignFieldConfigurationSchemeToProjectParameters.ts new file mode 100644 index 0000000000..d0459c6de7 --- /dev/null +++ b/src/version2/parameters/assignFieldConfigurationSchemeToProjectParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const AssignFieldConfigurationSchemeToProjectParametersSchema = z.object({ + /** + * The ID of the field configuration scheme. If the field configuration scheme ID is `null`, the operation assigns the + * default field configuration scheme. + */ + fieldConfigurationSchemeId: z.string().optional(), + /** The ID of the project. */ + projectId: z.string(), +}); + +export type AssignFieldConfigurationSchemeToProjectParameters = z.infer< + typeof AssignFieldConfigurationSchemeToProjectParametersSchema +>; diff --git a/src/version2/parameters/assignIssue.ts b/src/version2/parameters/assignIssue.ts deleted file mode 100644 index 5b35880e10..0000000000 --- a/src/version2/parameters/assignIssue.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { User } from '../models'; - -export interface AssignIssue extends Omit { - /** The ID or key of the issue to be assigned. */ - issueIdOrKey: string; - - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. If passed `null` it will unassigned issue. - */ - accountId: string | null; - - /** Whether the user is active. */ - active?: boolean; -} diff --git a/src/version2/parameters/assignIssueParameters.ts b/src/version2/parameters/assignIssueParameters.ts new file mode 100644 index 0000000000..1d5d6e89f9 --- /dev/null +++ b/src/version2/parameters/assignIssueParameters.ts @@ -0,0 +1,56 @@ +import { z } from 'zod'; + +export const AssignIssueParametersSchema = z.object({ + /** The ID or key of the issue to be assigned. */ + issueIdOrKey: z.string(), + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. Required in requests. + */ + accountId: z.string().optional(), + /** + * The user account type. Can take the following values: + * + * - `atlassian` regular Atlassian user account + * - `app` system account used for Connect applications and OAuth to represent external systems + * - `customer` Jira Service Desk account representing an external service desk + */ + accountType: z.enum(['atlassian', 'app', 'customer', 'unknown']).optional(), + /** Whether the user is active. */ + active: z.boolean().optional(), + /** The application roles the user is assigned to. */ + applicationRoles: z.unknown().optional(), + /** The avatars of the user. */ + avatarUrls: z.unknown().optional(), + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName: z.string().optional(), + /** The email address of the user. Depending on the user’s privacy setting, this may be returned as null. */ + emailAddress: z.string().optional(), + /** Expand options that include additional user details in the response. */ + expand: z.string().optional(), + /** The groups that the user belongs to. */ + groups: z.unknown().optional(), + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + key: z.string().optional(), + /** The locale of the user. Depending on the user’s privacy setting, this may be returned as null. */ + locale: z.string().optional(), + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name: z.string().optional(), + /** The URL of the user. */ + self: z.string().optional(), + /** + * The time zone specified in the user's profile. If the user's time zone is not visible to the current user (due to + * user's profile setting), or if a time zone has not been set, the instance's default time zone will be returned. + */ + timeZone: z.string().optional(), +}); + +export type AssignIssueParameters = z.infer; diff --git a/src/version2/parameters/assignIssueTypeSchemeToProject.ts b/src/version2/parameters/assignIssueTypeSchemeToProject.ts deleted file mode 100644 index 9ee13ca164..0000000000 --- a/src/version2/parameters/assignIssueTypeSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeSchemeProjectAssociation } from '../models'; - -export interface AssignIssueTypeSchemeToProject extends IssueTypeSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignIssueTypeSchemeToProjectParameters.ts b/src/version2/parameters/assignIssueTypeSchemeToProjectParameters.ts new file mode 100644 index 0000000000..f62cc78a90 --- /dev/null +++ b/src/version2/parameters/assignIssueTypeSchemeToProjectParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const AssignIssueTypeSchemeToProjectParametersSchema = z.object({ + /** The ID of the issue type scheme. */ + issueTypeSchemeId: z.string(), + /** The ID of the project. */ + projectId: z.string(), +}); + +export type AssignIssueTypeSchemeToProjectParameters = z.infer; diff --git a/src/version2/parameters/assignIssueTypeScreenSchemeToProject.ts b/src/version2/parameters/assignIssueTypeScreenSchemeToProject.ts deleted file mode 100644 index a3e696ec18..0000000000 --- a/src/version2/parameters/assignIssueTypeScreenSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeScreenSchemeProjectAssociation } from '../models'; - -export interface AssignIssueTypeScreenSchemeToProject extends IssueTypeScreenSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignIssueTypeScreenSchemeToProjectParameters.ts b/src/version2/parameters/assignIssueTypeScreenSchemeToProjectParameters.ts new file mode 100644 index 0000000000..838003fa9c --- /dev/null +++ b/src/version2/parameters/assignIssueTypeScreenSchemeToProjectParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const AssignIssueTypeScreenSchemeToProjectParametersSchema = z.object({ + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: z.string().optional(), + /** The ID of the project. */ + projectId: z.string().optional(), +}); + +export type AssignIssueTypeScreenSchemeToProjectParameters = z.infer< + typeof AssignIssueTypeScreenSchemeToProjectParametersSchema +>; diff --git a/src/version2/parameters/assignPermissionScheme.ts b/src/version2/parameters/assignPermissionScheme.ts deleted file mode 100644 index 9ea8f0e5e6..0000000000 --- a/src/version2/parameters/assignPermissionScheme.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { Id } from '../models'; - -export interface AssignPermissionScheme extends Id { - /** The project ID or project key (case sensitive). */ - projectKeyOrId: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Note that permissions are included when - * you specify any value. Expand options include: - * - * - `all` Returns all expandable information. - * - `field` Returns information about the custom field granted the permission. - * - `group` Returns information about the group that is granted the permission. - * - `permissions` Returns all permission grants for each permission scheme. - * - `projectRole` Returns information about the project role granted the permission. - * - `user` Returns information about the user who is granted the permission. - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'permissions' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] - | string; -} diff --git a/src/version2/parameters/assignPermissionSchemeParameters.ts b/src/version2/parameters/assignPermissionSchemeParameters.ts new file mode 100644 index 0000000000..266ef344dc --- /dev/null +++ b/src/version2/parameters/assignPermissionSchemeParameters.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; + +export const AssignPermissionSchemeParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectKeyOrId: z.string(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Note that permissions are included when + * you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand: z.string().optional(), + /** + * The ID of the permission scheme to associate with the project. Use the [Get all permission + * schemes](#api-rest-api-2-permissionscheme-get) resource to get a list of permission scheme IDs. + */ + id: z.number().int(), +}); + +export type AssignPermissionSchemeParameters = z.infer; diff --git a/src/version2/parameters/assignProjectsToCustomFieldContext.ts b/src/version2/parameters/assignProjectsToCustomFieldContext.ts deleted file mode 100644 index 99c312c471..0000000000 --- a/src/version2/parameters/assignProjectsToCustomFieldContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectIds } from '../models'; - -export interface AssignProjectsToCustomFieldContext extends ProjectIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/assignProjectsToCustomFieldContextParameters.ts b/src/version2/parameters/assignProjectsToCustomFieldContextParameters.ts new file mode 100644 index 0000000000..3f977ddb7a --- /dev/null +++ b/src/version2/parameters/assignProjectsToCustomFieldContextParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const AssignProjectsToCustomFieldContextParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The ID of the context. */ + contextId: z.number().int(), + /** The IDs of projects. */ + projectIds: z.array(z.string()), +}); + +export type AssignProjectsToCustomFieldContextParameters = z.infer< + typeof AssignProjectsToCustomFieldContextParametersSchema +>; diff --git a/src/version2/parameters/assignSchemeToProject.ts b/src/version2/parameters/assignSchemeToProject.ts deleted file mode 100644 index 1319d7739f..0000000000 --- a/src/version2/parameters/assignSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowSchemeProjectAssociation } from '../models'; - -export interface AssignSchemeToProject extends WorkflowSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignSchemeToProjectParameters.ts b/src/version2/parameters/assignSchemeToProjectParameters.ts new file mode 100644 index 0000000000..a3603576bc --- /dev/null +++ b/src/version2/parameters/assignSchemeToProjectParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const AssignSchemeToProjectParametersSchema = z.object({ + /** The ID of the project. */ + projectId: z.string(), + /** + * The ID of the workflow scheme. If the workflow scheme ID is `null`, the operation assigns the default workflow + * scheme. + */ + workflowSchemeId: z.string().optional(), +}); + +export type AssignSchemeToProjectParameters = z.infer; diff --git a/src/version2/parameters/associateSchemesToProjects.ts b/src/version2/parameters/associateSchemesToProjects.ts deleted file mode 100644 index 384f5a207c..0000000000 --- a/src/version2/parameters/associateSchemesToProjects.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { OldToNewSecurityLevelMappings } from '../models'; - -/** Issue security scheme, project, and remapping details. */ -export interface AssociateSchemesToProjects { - /** The list of scheme levels which should be remapped to new levels of the issue security scheme. */ - oldToNewSecurityLevelMappings: OldToNewSecurityLevelMappings[]; - /** The ID of the project. */ - projectId: string; - /** The ID of the issue security scheme. Providing null will clear the association with the issue security scheme. */ - schemeId: string; -} diff --git a/src/version2/parameters/associateSchemesToProjectsParameters.ts b/src/version2/parameters/associateSchemesToProjectsParameters.ts new file mode 100644 index 0000000000..5ee968238d --- /dev/null +++ b/src/version2/parameters/associateSchemesToProjectsParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { OldToNewSecurityLevelMappingsBeanSchema } from './oldToNewSecurityLevelMappingsBean'; + +export const AssociateSchemesToProjectsParametersSchema = z.object({ + /** The list of scheme levels which should be remapped to new levels of the issue security scheme. */ + oldToNewSecurityLevelMappings: z.array(OldToNewSecurityLevelMappingsBeanSchema).optional(), + /** The ID of the project. */ + projectId: z.string(), + /** The ID of the issue security scheme. Providing null will clear the association with the issue security scheme. */ + schemeId: z.string(), +}); + +export type AssociateSchemesToProjectsParameters = z.infer; diff --git a/src/version2/parameters/bulkDeleteIssueProperty.ts b/src/version2/parameters/bulkDeleteIssueProperty.ts deleted file mode 100644 index 6ed97181b6..0000000000 --- a/src/version2/parameters/bulkDeleteIssueProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueFilterForBulkPropertyDelete } from '../models'; - -export interface BulkDeleteIssueProperty extends IssueFilterForBulkPropertyDelete { - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/bulkDeleteIssuePropertyParameters.ts b/src/version2/parameters/bulkDeleteIssuePropertyParameters.ts new file mode 100644 index 0000000000..966598e2de --- /dev/null +++ b/src/version2/parameters/bulkDeleteIssuePropertyParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const BulkDeleteIssuePropertyParametersSchema = z.object({ + /** The key of the property. */ + propertyKey: z.string(), + /** The value of properties to perform the bulk operation on. */ + currentValue: z.unknown().optional(), + /** List of issues to perform the bulk delete operation on. */ + entityIds: z.array(z.number().int()).optional(), +}); + +export type BulkDeleteIssuePropertyParameters = z.infer; diff --git a/src/version2/parameters/bulkDeleteWorklogs.ts b/src/version2/parameters/bulkDeleteWorklogs.ts deleted file mode 100644 index c2e139aaec..0000000000 --- a/src/version2/parameters/bulkDeleteWorklogs.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { WorklogIdsRequest } from '../models'; - -export interface BulkDeleteWorklogs extends WorklogIdsRequest { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Defines how to update the issue's time estimate, the options are: - * - * `leave` Leaves the estimate unchanged. `auto` Reduces the estimate by the aggregate value of `timeSpent` across all - * worklogs being deleted. - */ - adjustEstimate?: 'leave' | 'auto' | string; - /** - * Whether the work log entries should be removed to the issue even if the issue is not editable, because - * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with - * admin permission can use this flag. - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version2/parameters/bulkDeleteWorklogsParameters.ts b/src/version2/parameters/bulkDeleteWorklogsParameters.ts new file mode 100644 index 0000000000..69a8d638d7 --- /dev/null +++ b/src/version2/parameters/bulkDeleteWorklogsParameters.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const BulkDeleteWorklogsParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.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: z.enum(['leave', 'auto']).optional(), + /** + * 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: z.boolean().optional(), + /** A list of worklog IDs. */ + ids: z.array(z.number().int()), +}); + +export type BulkDeleteWorklogsParameters = z.infer; diff --git a/src/version2/parameters/bulkEditDashboards.ts b/src/version2/parameters/bulkEditDashboards.ts deleted file mode 100644 index 034b107fa5..0000000000 --- a/src/version2/parameters/bulkEditDashboards.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { BulkChangeOwnerDetails, PermissionDetails } from '../models'; - -/** Details of a request to bulk edit shareable entity. */ -export interface BulkEditDashboards { - /** Allowed action for bulk edit shareable entity */ - action: string; - changeOwnerDetails?: BulkChangeOwnerDetails; - /** The id list of shareable entities to be changed. */ - entityIds: number[]; - /** Whether the actions are executed by users with Administer Jira global permission. */ - extendAdminPermissions?: boolean; - permissionDetails?: PermissionDetails; -} diff --git a/src/version2/parameters/bulkEditDashboardsParameters.ts b/src/version2/parameters/bulkEditDashboardsParameters.ts new file mode 100644 index 0000000000..d3cbd6ace1 --- /dev/null +++ b/src/version2/parameters/bulkEditDashboardsParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const BulkEditDashboardsParametersSchema = z.object({ + /** Allowed action for bulk edit shareable entity */ + action: z.enum(['changeOwner', 'changePermission', 'addPermission', 'removePermission']), + /** The details of change owner action. */ + changeOwnerDetails: z.unknown().optional(), + /** The id list of shareable entities to be changed. */ + entityIds: z.array(z.number().int()), + /** Whether the actions are executed by users with Administer Jira global permission. */ + extendAdminPermissions: z.boolean().optional(), + /** The permission details to be changed. */ + permissionDetails: z.unknown().optional(), +}); + +export type BulkEditDashboardsParameters = z.infer; diff --git a/src/version2/parameters/bulkFetchIssues.ts b/src/version2/parameters/bulkFetchIssues.ts deleted file mode 100644 index 124f62b0e5..0000000000 --- a/src/version2/parameters/bulkFetchIssues.ts +++ /dev/null @@ -1,66 +0,0 @@ -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/bulkFetchIssuesParameters.ts b/src/version2/parameters/bulkFetchIssuesParameters.ts new file mode 100644 index 0000000000..a5d34f0b2e --- /dev/null +++ b/src/version2/parameters/bulkFetchIssuesParameters.ts @@ -0,0 +1,53 @@ +import { z } from 'zod'; + +export const BulkFetchIssuesParametersSchema = z.object({ + /** + * 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: z.array(z.string()).optional(), + /** + * 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: z.array(z.string()).optional(), + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys: z.boolean().optional(), + /** An array of issue IDs or issue keys to fetch. You can mix issue IDs and keys in the same query. */ + issueIdsOrKeys: z.array(z.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: z.array(z.string()).optional(), +}); + +export type BulkFetchIssuesParameters = z.infer; diff --git a/src/version2/parameters/bulkGetGroups.ts b/src/version2/parameters/bulkGetGroups.ts deleted file mode 100644 index 3cd0fe3257..0000000000 --- a/src/version2/parameters/bulkGetGroups.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface BulkGetGroups { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The ID of a group. To specify multiple IDs, pass multiple `groupId` parameters. For example, - * `groupId=5b10a2844c20165700ede21g&groupId=5b10ac8d82e05b22cc7d4ef5`. - */ - groupId?: string[]; - /** - * The name of a group. To specify multiple names, pass multiple `groupName` parameters. For example, - * `groupName=administrators&groupName=jira-software-users`. - */ - groupName?: string[]; - /** The access level of a group. Valid values: 'site-admin', 'admin', 'user'. */ - accessType?: 'site-admin' | 'admin' | 'user' | string; - /** - * The application key of the product user groups to search for. Valid values: 'jira-servicedesk', 'jira-software', - * 'jira-product-discovery', 'jira-core'. - */ - applicationKey?: 'jira-servicedesk' | 'jira-software' | 'jira-product-discovery' | 'jira-core' | string; -} diff --git a/src/version2/parameters/bulkGetGroupsParameters.ts b/src/version2/parameters/bulkGetGroupsParameters.ts new file mode 100644 index 0000000000..40e7d61bc9 --- /dev/null +++ b/src/version2/parameters/bulkGetGroupsParameters.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +export const BulkGetGroupsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The ID of a group. To specify multiple IDs, pass multiple `groupId` parameters. For example, + * `groupId=5b10a2844c20165700ede21g&groupId=5b10ac8d82e05b22cc7d4ef5`. + */ + groupId: z.array(z.string()).optional(), + /** + * The name of a group. To specify multiple names, pass multiple `groupName` parameters. For example, + * `groupName=administrators&groupName=jira-software-users`. + */ + groupName: z.array(z.string()).optional(), + /** The access level of a group. Valid values: 'site-admin', 'admin', 'user'. */ + accessType: z.string().optional(), + /** + * The application key of the product user groups to search for. Valid values: 'jira-servicedesk', 'jira-software', + * 'jira-product-discovery', 'jira-core'. + */ + applicationKey: z.string().optional(), +}); + +export type BulkGetGroupsParameters = z.infer; diff --git a/src/version2/parameters/bulkGetUsers.ts b/src/version2/parameters/bulkGetUsers.ts deleted file mode 100644 index ed71bb1261..0000000000 --- a/src/version2/parameters/bulkGetUsers.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface BulkGetUsers { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The account ID of a user. To specify multiple users, pass multiple `accountId` parameters. For example, - * `accountId=5b10a2844c20165700ede21g&accountId=5b10ac8d82e05b22cc7d4ef5`. - */ - accountId: string[]; -} diff --git a/src/version2/parameters/bulkGetUsersMigration.ts b/src/version2/parameters/bulkGetUsersMigration.ts deleted file mode 100644 index adbb1d0d09..0000000000 --- a/src/version2/parameters/bulkGetUsersMigration.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface BulkGetUsersMigration { - /** 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; - /** - * Username of a user. To specify multiple users, pass multiple copies of this parameter. For example, - * `username=fred&username=barney`. Required if `key` isn't provided. Cannot be provided if `key` is present. - */ - username?: string[]; - /** - * Key of a user. To specify multiple users, pass multiple copies of this parameter. For example, - * `key=fred&key=barney`. Required if `username` isn't provided. Cannot be provided if `username` is present. - */ - key?: string[]; -} diff --git a/src/version2/parameters/bulkGetUsersMigrationParameters.ts b/src/version2/parameters/bulkGetUsersMigrationParameters.ts new file mode 100644 index 0000000000..929e940eca --- /dev/null +++ b/src/version2/parameters/bulkGetUsersMigrationParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const BulkGetUsersMigrationParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * Username of a user. To specify multiple users, pass multiple copies of this parameter. For example, + * `username=fred&username=barney`. Required if `key` isn't provided. Cannot be provided if `key` is present. + */ + username: z.array(z.string()).optional(), + /** + * Key of a user. To specify multiple users, pass multiple copies of this parameter. For example, + * `key=fred&key=barney`. Required if `username` isn't provided. Cannot be provided if `username` is present. + */ + key: z.array(z.string()).optional(), +}); + +export type BulkGetUsersMigrationParameters = z.infer; diff --git a/src/version2/parameters/bulkGetUsersParameters.ts b/src/version2/parameters/bulkGetUsersParameters.ts new file mode 100644 index 0000000000..62b3332298 --- /dev/null +++ b/src/version2/parameters/bulkGetUsersParameters.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +export const BulkGetUsersParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * This parameter 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. + */ + username: z.array(z.string()).optional(), + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + key: z.array(z.string()).optional(), + /** + * The account ID of a user. To specify multiple users, pass multiple `accountId` parameters. For example, + * `accountId=5b10a2844c20165700ede21g&accountId=5b10ac8d82e05b22cc7d4ef5`. + */ + accountId: z.array(z.string()), +}); + +export type BulkGetUsersParameters = z.infer; diff --git a/src/version2/parameters/bulkMoveWorklogs.ts b/src/version2/parameters/bulkMoveWorklogs.ts deleted file mode 100644 index 8675736232..0000000000 --- a/src/version2/parameters/bulkMoveWorklogs.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { WorklogsMoveRequest } from '../models'; - -export interface BulkMoveWorklogs { - issueIdOrKey: string; - /** - * Defines how to update the issues' time estimate, the options are: - * - * - `leave` Leaves the estimate unchanged. - * - `auto` Reduces the estimate by the aggregate value of `timeSpent` across all worklogs being moved in the source - * issue, and increases it in the destination issue. - */ - adjustEstimate?: 'leave' | 'auto' | string; - /** - * Whether the work log entry should be moved to and from the issues even if the issues are not editable, because - * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with - * admin permission can use this flag. - */ - overrideEditableFlag?: boolean; - worklogs: WorklogsMoveRequest; -} diff --git a/src/version2/parameters/bulkMoveWorklogsParameters.ts b/src/version2/parameters/bulkMoveWorklogsParameters.ts new file mode 100644 index 0000000000..3502edbd4d --- /dev/null +++ b/src/version2/parameters/bulkMoveWorklogsParameters.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; + +export const BulkMoveWorklogsParametersSchema = z.object({ + issueIdOrKey: z.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: z.enum(['leave', 'auto']).optional(), + /** + * 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: z.boolean().optional(), + /** A list of worklog IDs. */ + ids: z.array(z.number().int()).optional(), + /** The issue id or key of the destination issue */ + issueIdOrKey: z.string().optional(), +}); + +export type BulkMoveWorklogsParameters = z.infer; diff --git a/src/version2/parameters/bulkSetIssuePropertiesByIssue.ts b/src/version2/parameters/bulkSetIssuePropertiesByIssue.ts deleted file mode 100644 index a607fe5591..0000000000 --- a/src/version2/parameters/bulkSetIssuePropertiesByIssue.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { MultiIssueEntityProperties } from '../models'; - -export interface BulkSetIssuePropertiesByIssue extends MultiIssueEntityProperties {} diff --git a/src/version2/parameters/bulkSetIssuePropertiesByIssueParameters.ts b/src/version2/parameters/bulkSetIssuePropertiesByIssueParameters.ts new file mode 100644 index 0000000000..a0c6df1b61 --- /dev/null +++ b/src/version2/parameters/bulkSetIssuePropertiesByIssueParameters.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { IssueEntityPropertiesForMultiUpdateSchema } from './issueEntityPropertiesForMultiUpdate'; + +export const BulkSetIssuePropertiesByIssueParametersSchema = z.object({ + /** A list of issue IDs and their respective properties. */ + issues: z.array(IssueEntityPropertiesForMultiUpdateSchema).optional(), +}); + +export type BulkSetIssuePropertiesByIssueParameters = z.infer; diff --git a/src/version2/parameters/bulkSetIssueProperty.ts b/src/version2/parameters/bulkSetIssueProperty.ts deleted file mode 100644 index a1bb3273fc..0000000000 --- a/src/version2/parameters/bulkSetIssueProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { BulkIssuePropertyUpdateRequest } from '../models'; - -export interface BulkSetIssueProperty extends BulkIssuePropertyUpdateRequest { - /** The key of the property. The maximum length is 255 characters. */ - propertyKey: string; -} diff --git a/src/version2/parameters/bulkSetIssuePropertyParameters.ts b/src/version2/parameters/bulkSetIssuePropertyParameters.ts new file mode 100644 index 0000000000..596ea46370 --- /dev/null +++ b/src/version2/parameters/bulkSetIssuePropertyParameters.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; + +export const BulkSetIssuePropertyParametersSchema = z.object({ + /** The key of the property. The maximum length is 255 characters. */ + propertyKey: z.string(), + /** + * EXPERIMENTAL. The Jira expression to calculate the value of the property. The value of the expression must be an + * object that can be converted to JSON, such as a number, boolean, string, list, or map. The context variables + * available to the expression are `issue` and `user`. Issues for which the expression returns a value whose JSON + * representation is longer than 32768 characters are ignored. + */ + expression: z.string().optional(), + /** The bulk operation filter. */ + filter: z.unknown().optional(), + /** + * The value of the property. The value must be a [valid](https://tools.ietf.org/html/rfc4627), non-empty JSON blob. + * The maximum length is 32768 characters. + */ + value: z.unknown().optional(), +}); + +export type BulkSetIssuePropertyParameters = z.infer; diff --git a/src/version2/parameters/bulkSetIssuesProperties.ts b/src/version2/parameters/bulkSetIssuesProperties.ts deleted file mode 100644 index b57f0283fc..0000000000 --- a/src/version2/parameters/bulkSetIssuesProperties.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueEntityProperties } from '../models'; - -export interface BulkSetIssuesProperties extends IssueEntityProperties {} diff --git a/src/version2/parameters/bulkSetIssuesPropertiesListParameters.ts b/src/version2/parameters/bulkSetIssuesPropertiesListParameters.ts new file mode 100644 index 0000000000..b5ef284895 --- /dev/null +++ b/src/version2/parameters/bulkSetIssuesPropertiesListParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const BulkSetIssuesPropertiesListParametersSchema = z.object({ + /** A list of entity property IDs. */ + entitiesIds: z.array(z.number().int()).optional(), + /** A list of entity property keys and values. */ + properties: z.object({}).optional(), +}); + +export type BulkSetIssuesPropertiesListParameters = z.infer; diff --git a/src/version2/parameters/cancelTask.ts b/src/version2/parameters/cancelTask.ts deleted file mode 100644 index 61792ae3dd..0000000000 --- a/src/version2/parameters/cancelTask.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface CancelTask { - /** The ID of the task. */ - taskId: string; -} diff --git a/src/version2/parameters/cancelTaskParameters.ts b/src/version2/parameters/cancelTaskParameters.ts new file mode 100644 index 0000000000..c54c4fae32 --- /dev/null +++ b/src/version2/parameters/cancelTaskParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const CancelTaskParametersSchema = z.object({ + /** The ID of the task. */ + taskId: z.string(), +}); + +export type CancelTaskParameters = z.infer; diff --git a/src/version2/parameters/changeFilterOwner.ts b/src/version2/parameters/changeFilterOwner.ts deleted file mode 100644 index 4194edfb58..0000000000 --- a/src/version2/parameters/changeFilterOwner.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface ChangeFilterOwner { - /** The ID of the filter to update. */ - id: number; - accountId: string; -} diff --git a/src/version2/parameters/changeFilterOwnerParameters.ts b/src/version2/parameters/changeFilterOwnerParameters.ts new file mode 100644 index 0000000000..4cfb514cb5 --- /dev/null +++ b/src/version2/parameters/changeFilterOwnerParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const ChangeFilterOwnerParametersSchema = z.object({ + /** The ID of the filter to update. */ + id: z.number().int(), + /** The account ID of the new owner. */ + accountId: z.string(), +}); + +export type ChangeFilterOwnerParameters = z.infer; diff --git a/src/version2/parameters/copyDashboard.ts b/src/version2/parameters/copyDashboard.ts deleted file mode 100644 index 2ccc415c2a..0000000000 --- a/src/version2/parameters/copyDashboard.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { 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/copyDashboardParameters.ts b/src/version2/parameters/copyDashboardParameters.ts new file mode 100644 index 0000000000..7e27b8ea50 --- /dev/null +++ b/src/version2/parameters/copyDashboardParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; +import { SharePermissionSchema } from './sharePermission'; + +export const CopyDashboardParametersSchema = z.object({ + id: z.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: z.boolean().optional(), + /** The description of the dashboard. */ + description: z.string().optional(), + /** The edit permissions for the dashboard. */ + editPermissions: z.array(SharePermissionSchema), + /** The name of the dashboard. */ + name: z.string(), + /** The share permissions for the dashboard. */ + sharePermissions: z.array(SharePermissionSchema), +}); + +export type CopyDashboardParameters = z.infer; diff --git a/src/version2/parameters/countIssues.ts b/src/version2/parameters/countIssues.ts deleted file mode 100644 index 081663fe98..0000000000 --- a/src/version2/parameters/countIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { JQLCountRequest } from '../models'; - -export interface CountIssues extends JQLCountRequest {} diff --git a/src/version2/parameters/countIssuesParameters.ts b/src/version2/parameters/countIssuesParameters.ts new file mode 100644 index 0000000000..3235c1bb3a --- /dev/null +++ b/src/version2/parameters/countIssuesParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const CountIssuesParametersSchema = z.object({ + /** + * 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: z.string().optional(), +}); + +export type CountIssuesParameters = z.infer; diff --git a/src/version2/parameters/createAssociations.ts b/src/version2/parameters/createAssociations.ts deleted file mode 100644 index c63f25bb1e..0000000000 --- a/src/version2/parameters/createAssociations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FieldAssociationsRequest } from '../models'; - -export interface CreateAssociations extends FieldAssociationsRequest {} diff --git a/src/version2/parameters/createAssociationsParameters.ts b/src/version2/parameters/createAssociationsParameters.ts new file mode 100644 index 0000000000..27b6536d34 --- /dev/null +++ b/src/version2/parameters/createAssociationsParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { AssociationContextObjectSchema } from './associationContextObject'; +import { FieldIdentifierObjectSchema } from './fieldIdentifierObject'; + +export const CreateAssociationsParametersSchema = z.object({ + /** Contexts to associate/unassociate the fields with. */ + associationContexts: z.array(AssociationContextObjectSchema), + /** Fields to associate/unassociate with projects. */ + fields: z.array(FieldIdentifierObjectSchema), +}); + +export type CreateAssociationsParameters = z.infer; diff --git a/src/version2/parameters/createComponent.ts b/src/version2/parameters/createComponent.ts deleted file mode 100644 index 274c939690..0000000000 --- a/src/version2/parameters/createComponent.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ProjectComponent } from '../models'; - -export interface CreateComponent extends ProjectComponent {} diff --git a/src/version2/parameters/createComponentParameters.ts b/src/version2/parameters/createComponentParameters.ts new file mode 100644 index 0000000000..5fa87af93e --- /dev/null +++ b/src/version2/parameters/createComponentParameters.ts @@ -0,0 +1,78 @@ +import { z } from 'zod'; + +export const CreateComponentParametersSchema = z.object({ + /** Compass component's ID. Can't be updated. Not required for creating a Project Component. */ + ari: z.string().optional(), + /** + * The details of the user associated with `assigneeType`, if any. See `realAssignee` for details of the user assigned + * to issues created with this component. + */ + assignee: z.unknown().optional(), + /** + * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` + * for details on how the type of the user, and hence the user, assigned to issues is determined. Can take the + * following values: + * + * - `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the + * component is in. + * - `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for the component. + * - `UNASSIGNED` an assignee is not set for issues created with this component. + * - `PROJECT_DEFAULT` the assignee to any issues created with this component is nominally the default assignee for the + * project that the component is in. + * + * Default value: `PROJECT_DEFAULT`. Optional when creating or updating a component. + */ + assigneeType: z.enum(['PROJECT_DEFAULT', 'COMPONENT_LEAD', 'PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** The description for the component. Optional when creating or updating a component. */ + description: z.string().optional(), + /** The unique identifier for the component. */ + id: z.string().optional(), + /** + * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but + * the component lead is not set, then `false` is returned. + */ + isAssigneeTypeValid: z.boolean().optional(), + /** The user details for the component's lead user. */ + lead: z.unknown().optional(), + /** + * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian + * products. For example, _5b10ac8d82e05b22cc7d4ef5_. + */ + leadAccountId: z.string().optional(), + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + leadUserName: z.string().optional(), + /** Compass component's metadata. Can't be updated. Not required for creating a Project Component. */ + metadata: z.object({}).optional(), + /** + * The unique name for the component in the project. Required when creating a component. Optional when updating a + * component. The maximum length is 255 characters. + */ + name: z.string().optional(), + /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ + project: z.string().optional(), + /** The ID of the project the component is assigned to. */ + projectId: z.number().int().optional(), + /** The user assigned to issues created with this component, when `assigneeType` does not identify a valid assignee. */ + realAssignee: z.unknown().optional(), + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set + * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This + * property is set to one of the following values: + * + * - `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in + * the project that the component is in. + * - `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component lead has permission to be assigned + * issues in the project that the component is in. + * - `UNASSIGNED` when `assigneeType` is `UNASSIGNED` and Jira is configured to allow unassigned issues. + * - `PROJECT_DEFAULT` when none of the preceding cases are true. + */ + realAssigneeType: z.enum(['PROJECT_DEFAULT', 'COMPONENT_LEAD', 'PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** The URL of the component. */ + self: z.string().optional(), +}); + +export type CreateComponentParameters = z.infer; diff --git a/src/version2/parameters/createCustomField.ts b/src/version2/parameters/createCustomField.ts deleted file mode 100644 index 4897ec2229..0000000000 --- a/src/version2/parameters/createCustomField.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CustomFieldDefinitionJson } from '../models'; - -export interface CreateCustomField extends CustomFieldDefinitionJson {} diff --git a/src/version2/parameters/createCustomFieldContext.ts b/src/version2/parameters/createCustomFieldContext.ts deleted file mode 100644 index 0a0e6b1e50..0000000000 --- a/src/version2/parameters/createCustomFieldContext.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface CreateCustomFieldContext { - id: string; - - /** The ID of the custom field. */ - fieldId: string; - - /** The name of the context. */ - name: string; - - /** The description of the context. */ - description?: string; - - /** The list of project IDs associated with the context. If the list is empty, the context is global. */ - projectIds?: string[]; - - /** The list of issue types IDs for the context. If the list is empty, the context refers to all issue types. */ - issueTypeIds?: string[]; -} diff --git a/src/version2/parameters/createCustomFieldContextParameters.ts b/src/version2/parameters/createCustomFieldContextParameters.ts new file mode 100644 index 0000000000..c924e229b0 --- /dev/null +++ b/src/version2/parameters/createCustomFieldContextParameters.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +export const CreateCustomFieldContextParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The description of the context. */ + description: z.string().optional(), + /** The ID of the context. */ + id: z.string().optional(), + /** The list of issue types IDs for the context. If the list is empty, the context refers to all issue types. */ + issueTypeIds: z.array(z.string()).optional(), + /** The name of the context. */ + name: z.string(), + /** The list of project IDs associated with the context. If the list is empty, the context is global. */ + projectIds: z.array(z.string()).optional(), +}); + +export type CreateCustomFieldContextParameters = z.infer; diff --git a/src/version2/parameters/createCustomFieldOption.ts b/src/version2/parameters/createCustomFieldOption.ts deleted file mode 100644 index c7746850c8..0000000000 --- a/src/version2/parameters/createCustomFieldOption.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BulkCustomFieldOptionCreateRequest } from '../models'; - -export interface CreateCustomFieldOption extends BulkCustomFieldOptionCreateRequest { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/createCustomFieldOptionParameters.ts b/src/version2/parameters/createCustomFieldOptionParameters.ts new file mode 100644 index 0000000000..3641b5b489 --- /dev/null +++ b/src/version2/parameters/createCustomFieldOptionParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { CustomFieldOptionCreateSchema } from './customFieldOptionCreate'; + +export const CreateCustomFieldOptionParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The ID of the context. */ + contextId: z.number().int(), + /** Details of options to create. */ + options: z.array(CustomFieldOptionCreateSchema).optional(), +}); + +export type CreateCustomFieldOptionParameters = z.infer; diff --git a/src/version2/parameters/createCustomFieldParameters.ts b/src/version2/parameters/createCustomFieldParameters.ts new file mode 100644 index 0000000000..e8ee2451e6 --- /dev/null +++ b/src/version2/parameters/createCustomFieldParameters.ts @@ -0,0 +1,107 @@ +import { z } from 'zod'; + +export const CreateCustomFieldParametersSchema = z.object({ + /** The description of the custom field, which is displayed in Jira. */ + description: z.string().optional(), + /** The name of the custom field, which is displayed in Jira. This is not the unique identifier. */ + name: z.string(), + /** + * The searcher defines the way the field is searched in Jira. For example, + * _com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher_. The search UI (basic search and JQL + * search) will display different operations and values for the field, based on the field searcher. You must specify a + * searcher that is valid for the field type, as listed below (abbreviated values shown): + * + * - `cascadingselect`: `cascadingselectsearcher` + * - `datepicker`: `daterange` + * - `datetime`: `datetimerange` + * - `float`: `exactnumber` or `numberrange` + * - `grouppicker`: `grouppickersearcher` + * - `importid`: `exactnumber` or `numberrange` + * - `labels`: `labelsearcher` + * - `multicheckboxes`: `multiselectsearcher` + * - `multigrouppicker`: `multiselectsearcher` + * - `multiselect`: `multiselectsearcher` + * - `multiuserpicker`: `userpickergroupsearcher` + * - `multiversion`: `versionsearcher` + * - `project`: `projectsearcher` + * - `radiobuttons`: `multiselectsearcher` + * - `readonlyfield`: `textsearcher` + * - `select`: `multiselectsearcher` + * - `textarea`: `textsearcher` + * - `textfield`: `textsearcher` + * - `url`: `exacttextsearcher` + * - `userpicker`: `userpickergroupsearcher` + * - `version`: `versionsearcher` + * + * If no searcher is provided, the field isn't searchable. However, [Forge custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-) + * have a searcher set automatically, so are always searchable. + */ + searcherKey: z + .enum([ + 'com.atlassian.jira.plugin.system.customfieldtypes:cascadingselectsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:daterange', + 'com.atlassian.jira.plugin.system.customfieldtypes:datetimerange', + 'com.atlassian.jira.plugin.system.customfieldtypes:exactnumber', + 'com.atlassian.jira.plugin.system.customfieldtypes:exacttextsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:numberrange', + 'com.atlassian.jira.plugin.system.customfieldtypes:projectsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:textsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:versionsearcher', + ]) + .optional(), + /** + * The type of the custom field. These built-in custom field types are available: + * + * - `cascadingselect`: Enables values to be selected from two levels of select lists (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect`) + * - `datepicker`: Stores a date using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:datepicker`) + * - `datetime`: Stores a date with a time component (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:datetime`) + * - `float`: Stores and validates a numeric (floating point) input (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:float`) + * - `grouppicker`: Stores a user group using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker`) + * - `importid`: A read-only field that stores the ID the issue had in the system it was imported from (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:importid`) + * - `labels`: Stores labels (value: `com.atlassian.jira.plugin.system.customfieldtypes:labels`) + * - `multicheckboxes`: Stores multiple values using checkboxes (value: ``) + * - `multigrouppicker`: Stores multiple user groups using a picker control (value: ``) + * - `multiselect`: Stores multiple values using a select list (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes`) + * - `multiuserpicker`: Stores multiple users using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker`) + * - `multiversion`: Stores multiple versions from the versions available in a project using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multiversion`) + * - `project`: Stores a project from a list of projects that the user is permitted to view (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:project`) + * - `radiobuttons`: Stores a value using radio buttons (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons`) + * - `readonlyfield`: Stores a read-only text value, which can only be populated via the API (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield`) + * - `select`: Stores a value from a configurable list of options (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:select`) + * - `textarea`: Stores a long text string using a multiline text area (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:textarea`) + * - `textfield`: Stores a text string using a single-line text box (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:textfield`) + * - `url`: Stores a URL (value: `com.atlassian.jira.plugin.system.customfieldtypes:url`) + * - `userpicker`: Stores a user using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:userpicker`) + * - `version`: Stores a version using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:version`) + * + * To create a field based on a [Forge custom field + * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-), + * use the ID of the Forge custom field type as the value. For example, + * `ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key`. + */ + type: z.string(), +}); + +export type CreateCustomFieldParameters = z.infer; diff --git a/src/version2/parameters/createDashboard.ts b/src/version2/parameters/createDashboard.ts deleted file mode 100644 index 290b83d90d..0000000000 --- a/src/version2/parameters/createDashboard.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { 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/createDashboardParameters.ts b/src/version2/parameters/createDashboardParameters.ts new file mode 100644 index 0000000000..0abbe62cc8 --- /dev/null +++ b/src/version2/parameters/createDashboardParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; +import { SharePermissionSchema } from './sharePermission'; + +export const CreateDashboardParametersSchema = z.object({ + /** + * 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: z.boolean().optional(), + /** The description of the dashboard. */ + description: z.string().optional(), + /** The edit permissions for the dashboard. */ + editPermissions: z.array(SharePermissionSchema), + /** The name of the dashboard. */ + name: z.string(), + /** The share permissions for the dashboard. */ + sharePermissions: z.array(SharePermissionSchema), +}); + +export type CreateDashboardParameters = z.infer; diff --git a/src/version2/parameters/createFieldConfiguration.ts b/src/version2/parameters/createFieldConfiguration.ts deleted file mode 100644 index 667932d875..0000000000 --- a/src/version2/parameters/createFieldConfiguration.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FieldConfigurationDetails } from '../models'; - -export interface CreateFieldConfiguration extends FieldConfigurationDetails {} diff --git a/src/version2/parameters/createFieldConfigurationParameters.ts b/src/version2/parameters/createFieldConfigurationParameters.ts new file mode 100644 index 0000000000..75e62b9ec5 --- /dev/null +++ b/src/version2/parameters/createFieldConfigurationParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const CreateFieldConfigurationParametersSchema = z.object({ + /** The description of the field configuration. */ + description: z.string().optional(), + /** The name of the field configuration. Must be unique. */ + name: z.string(), +}); + +export type CreateFieldConfigurationParameters = z.infer; diff --git a/src/version2/parameters/createFieldConfigurationScheme.ts b/src/version2/parameters/createFieldConfigurationScheme.ts deleted file mode 100644 index 2e10ebd2e3..0000000000 --- a/src/version2/parameters/createFieldConfigurationScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { UpdateFieldConfigurationSchemeDetails } from '../models'; - -export interface CreateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails {} diff --git a/src/version2/parameters/createFieldConfigurationSchemeParameters.ts b/src/version2/parameters/createFieldConfigurationSchemeParameters.ts new file mode 100644 index 0000000000..b79305137b --- /dev/null +++ b/src/version2/parameters/createFieldConfigurationSchemeParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const CreateFieldConfigurationSchemeParametersSchema = z.object({ + /** The description of the field configuration scheme. */ + description: z.string().optional(), + /** The name of the field configuration scheme. The name must be unique. */ + name: z.string(), +}); + +export type CreateFieldConfigurationSchemeParameters = z.infer; diff --git a/src/version2/parameters/createFilter.ts b/src/version2/parameters/createFilter.ts deleted file mode 100644 index 132fb96823..0000000000 --- a/src/version2/parameters/createFilter.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Filter } from '../models'; - -export interface CreateFilter extends Filter { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't - * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of - * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to - * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: string; - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version2/parameters/createFilterParameters.ts b/src/version2/parameters/createFilterParameters.ts new file mode 100644 index 0000000000..6e0c35e747 --- /dev/null +++ b/src/version2/parameters/createFilterParameters.ts @@ -0,0 +1,74 @@ +import { z } from 'zod'; +import { SharePermissionSchema } from './sharePermission'; + +export const CreateFilterParametersSchema = z.object({ + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. + * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the + * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is + * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For + * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand: z.string().optional(), + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions: z.boolean().optional(), + /** + * [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: z.string().datetime().optional(), + /** A description of the filter. */ + description: z.string().optional(), + /** The groups and projects that can edit the filter. */ + editPermissions: z.array(SharePermissionSchema).optional(), + /** Whether the filter is selected as a favorite. */ + favourite: z.boolean().optional(), + /** The count of how many users have selected this filter as a favorite, including the filter owner. */ + favouritedCount: z.number().int().optional(), + /** The unique identifier for the filter. */ + id: z.string().optional(), + /** The JQL query for the filter. For example, _project = SSP AND issuetype = Bug_. */ + jql: z.string().optional(), + /** The name of the filter. Must be unique. */ + name: z.string(), + /** + * The user who owns the filter. This is defaulted to the creator of the filter, however Jira administrators can + * change the owner of a shared filter in the admin settings. + */ + owner: z.unknown().optional(), + /** + * A URL to view the filter results in Jira, using the [Search for issues using + * JQL](#api-rest-api-2-filter-search-get) operation with the filter's JQL string to return the filter results. For + * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. + */ + searchUrl: z.string().optional(), + /** The URL of the filter. */ + self: z.string().optional(), + /** The groups and projects that the filter is shared with. */ + sharePermissions: z.array(SharePermissionSchema).optional(), + /** + * A paginated list of the users that the filter is shared with. This includes users that are members of the groups or + * can browse the projects that the filter is shared with. + */ + sharedUsers: z.unknown().optional(), + /** A paginated list of the users that are subscribed to the filter. */ + subscriptions: z.unknown().optional(), + /** + * A URL to view the filter results in Jira, using the ID of the filter. For example, + * _https://your-domain.atlassian.net/issues/?filter=10100_. + */ + viewUrl: z.string().optional(), +}); + +export type CreateFilterParameters = z.infer; diff --git a/src/version2/parameters/createGroup.ts b/src/version2/parameters/createGroup.ts deleted file mode 100644 index 57ff4b8187..0000000000 --- a/src/version2/parameters/createGroup.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { AddGroup } from '../models'; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type CreateGroup = AddGroup & Record; diff --git a/src/version2/parameters/createGroupParameters.ts b/src/version2/parameters/createGroupParameters.ts new file mode 100644 index 0000000000..5d16cf6759 --- /dev/null +++ b/src/version2/parameters/createGroupParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const CreateGroupParametersSchema = z.object({ + /** The name of the group. */ + name: z.string(), +}); + +export type CreateGroupParameters = z.infer; diff --git a/src/version2/parameters/createIssue.ts b/src/version2/parameters/createIssue.ts deleted file mode 100644 index 4faf80acc8..0000000000 --- a/src/version2/parameters/createIssue.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import type { IssueUpdateDetails, Project, TimeTrackingDetails } from '../models'; - -export interface CreateIssue extends Omit { - /** - * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown - * under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a - * project. These values are then used to provide defaults on the issue create screen. - */ - updateHistory?: boolean; - - /** - * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field - * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are - * required, use `update`. Fields included in here cannot be included in `update`. - */ - fields: { - [key: string]: any; - summary: string; - project: Partial; - issuetype: { - id?: string | number; - name?: string; - }; - parent?: { - [key: string]: any; - key?: string; - }; - components?: Array<{ - [key: string]: any; - id?: string | number; - }>; - description?: string; - reporter?: { - [key: string]: any; - id?: string | number; - }; - fixVersions?: Array<{ - [key: string]: any; - id?: string | number; - }>; - priority?: { - [key: string]: any; - id?: string | number; - }; - labels?: string[]; - timetracking?: TimeTrackingDetails; - security?: { - [key: string]: any; - id?: string | number; - }; - environment?: any; - versions?: Array<{ - [key: string]: any; - id?: string | number; - }>; - duedate?: string; - assignee?: { - [key: string]: any; - id?: string | number; - }; - }; -} diff --git a/src/version2/parameters/createIssueFieldOption.ts b/src/version2/parameters/createIssueFieldOption.ts deleted file mode 100644 index d129cc02d5..0000000000 --- a/src/version2/parameters/createIssueFieldOption.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { IssueFieldOptionCreate } from '../models'; - -export interface CreateIssueFieldOption extends IssueFieldOptionCreate { - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; -} diff --git a/src/version2/parameters/createIssueFieldOptionParameters.ts b/src/version2/parameters/createIssueFieldOptionParameters.ts new file mode 100644 index 0000000000..f304818db7 --- /dev/null +++ b/src/version2/parameters/createIssueFieldOptionParameters.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; +import { IssueFieldOptionConfigurationSchema } from './issueFieldOptionConfiguration'; + +export const CreateIssueFieldOptionParametersSchema = z.object({ + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * - Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. + * - Run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For example, + * `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: z.string(), + config: IssueFieldOptionConfigurationSchema.optional(), + /** + * The properties of the option as arbitrary key-value pairs. These properties can be searched using JQL, if the + * extractions (see https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/) + * are defined in the descriptor for the issue field module. + */ + properties: z.object({}).optional(), + /** The option's name, which is displayed in Jira. */ + value: z.string(), +}); + +export type CreateIssueFieldOptionParameters = z.infer; diff --git a/src/version2/parameters/createIssueLinkType.ts b/src/version2/parameters/createIssueLinkType.ts deleted file mode 100644 index 016ec5d7ae..0000000000 --- a/src/version2/parameters/createIssueLinkType.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueLinkType } from '../models'; - -export interface CreateIssueLinkType extends IssueLinkType {} diff --git a/src/version2/parameters/createIssueLinkTypeParameters.ts b/src/version2/parameters/createIssueLinkTypeParameters.ts new file mode 100644 index 0000000000..91c2d9fae6 --- /dev/null +++ b/src/version2/parameters/createIssueLinkTypeParameters.ts @@ -0,0 +1,41 @@ +import { z } from 'zod'; + +export const CreateIssueLinkTypeParametersSchema = z.object({ + /** + * The ID of the issue link type and is used as follows: + * + * - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it is the type of issue link. Required on create when + * `name` isn't provided. Otherwise, read only. + * - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is read only. + */ + id: z.string().optional(), + /** + * The description of the issue link type inward link and is used as follows: + * + * - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it is read only. + * - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is required on create and optional on + * update. Otherwise, read only. + */ + inward: z.string().optional(), + /** + * The name of the issue link type and is used as follows: + * + * - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it is the type of issue link. Required on create when + * `id` isn't provided. Otherwise, read only. + * - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is required on create and optional on + * update. Otherwise, read only. + */ + name: z.string().optional(), + /** + * The description of the issue link type outward link and is used as follows: + * + * - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it is read only. + * - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is required on create and optional on + * update. Otherwise, read only. + */ + outward: z.string().optional(), + /** The URL of the issue link type. Read only. */ + self: z.string().optional(), +}); + +export type CreateIssueLinkTypeParameters = z.infer; diff --git a/src/version2/parameters/createIssueParameters.ts b/src/version2/parameters/createIssueParameters.ts new file mode 100644 index 0000000000..f42bb69782 --- /dev/null +++ b/src/version2/parameters/createIssueParameters.ts @@ -0,0 +1,30 @@ +import { z } from 'zod'; +import { EntityPropertySchema } from './entityProperty'; + +export const CreateIssueParametersSchema = z.object({ + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown + * under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a + * project. These values are then used to provide defaults on the issue create screen. + */ + updateHistory: z.boolean().optional(), + /** + * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field + * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are + * required, use `update`. Fields included in here cannot be included in `update`. + */ + fields: z.object({}).optional(), + /** Additional issue history details. */ + historyMetadata: z.unknown().optional(), + /** Details of issue properties to be add or update. */ + properties: z.array(EntityPropertySchema).optional(), + /** Details of a transition. Required when performing a transition, optional when creating or editing an issue. */ + transition: z.unknown().optional(), + /** + * A Map containing the field field name and a list of operations to perform on the issue screen field. Note that + * fields included in here cannot be included in `fields`. + */ + update: z.object({}).optional(), +}); + +export type CreateIssueParameters = z.infer; diff --git a/src/version2/parameters/createIssueSecurityScheme.ts b/src/version2/parameters/createIssueSecurityScheme.ts deleted file mode 100644 index bd5006096d..0000000000 --- a/src/version2/parameters/createIssueSecurityScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateIssueSecuritySchemeDetails } from '../models'; - -export interface CreateIssueSecurityScheme extends CreateIssueSecuritySchemeDetails {} diff --git a/src/version2/parameters/createIssueSecuritySchemeParameters.ts b/src/version2/parameters/createIssueSecuritySchemeParameters.ts new file mode 100644 index 0000000000..3155f5357c --- /dev/null +++ b/src/version2/parameters/createIssueSecuritySchemeParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { SecuritySchemeLevelSchema } from './securitySchemeLevel'; + +export const CreateIssueSecuritySchemeParametersSchema = z.object({ + /** The description of the issue security scheme. */ + description: z.string().optional(), + /** The list of scheme levels which should be added to the security scheme. */ + levels: z.array(SecuritySchemeLevelSchema).optional(), + /** The name of the issue security scheme. Must be unique (case-insensitive). */ + name: z.string(), +}); + +export type CreateIssueSecuritySchemeParameters = z.infer; diff --git a/src/version2/parameters/createIssueType.ts b/src/version2/parameters/createIssueType.ts deleted file mode 100644 index 42df382490..0000000000 --- a/src/version2/parameters/createIssueType.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeCreate } from '../models'; - -export interface CreateIssueType extends IssueTypeCreate {} diff --git a/src/version2/parameters/createIssueTypeAvatar.ts b/src/version2/parameters/createIssueTypeAvatar.ts deleted file mode 100644 index b463b3f791..0000000000 --- a/src/version2/parameters/createIssueTypeAvatar.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface CreateIssueTypeAvatar { - /** The ID of the issue type. */ - id: string; - /** The X coordinate of the top-left corner of the crop region. */ - x?: number; - /** The Y coordinate of the top-left corner of the crop region. */ - y?: number; - /** - * The length of each side of the crop region. - * - * @default 0 - */ - size?: number; - mimeType: string; - avatar: Buffer | ArrayBuffer | Uint8Array; -} diff --git a/src/version2/parameters/createIssueTypeAvatarParameters.ts b/src/version2/parameters/createIssueTypeAvatarParameters.ts new file mode 100644 index 0000000000..1cdc6d7e31 --- /dev/null +++ b/src/version2/parameters/createIssueTypeAvatarParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const CreateIssueTypeAvatarParametersSchema = z.object({ + /** The ID of the issue type. */ + id: z.string(), + /** The X coordinate of the top-left corner of the crop region. */ + x: z.number().int().optional(), + /** The Y coordinate of the top-left corner of the crop region. */ + y: z.number().int().optional(), + /** The length of each side of the crop region. */ + size: z.number().int(), +}); + +export type CreateIssueTypeAvatarParameters = z.infer; diff --git a/src/version2/parameters/createIssueTypeParameters.ts b/src/version2/parameters/createIssueTypeParameters.ts new file mode 100644 index 0000000000..f688ae22ad --- /dev/null +++ b/src/version2/parameters/createIssueTypeParameters.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +export const CreateIssueTypeParametersSchema = z.object({ + /** The description of the issue type. */ + description: z.string().optional(), + /** + * The hierarchy level of the issue type. Use: + * + * - `-1` for Subtask. + * - `0` for Base. + * + * Defaults to `0`. + */ + hierarchyLevel: z.number().int().optional(), + /** The unique name for the issue type. The maximum length is 60 characters. */ + name: z.string(), + /** + * Deprecated. Use `hierarchyLevel` instead. See the [deprecation + * notice](https://community.developer.atlassian.com/t/deprecation-of-the-epic-link-parent-link-and-other-related-fields-in-rest-apis-and-webhooks/54048) + * for details. + * + * Whether the issue type is `subtype` or `standard`. Defaults to `standard`. + */ + type: z.enum(['subtask', 'standard']).optional(), +}); + +export type CreateIssueTypeParameters = z.infer; diff --git a/src/version2/parameters/createIssueTypeScheme.ts b/src/version2/parameters/createIssueTypeScheme.ts deleted file mode 100644 index f118557497..0000000000 --- a/src/version2/parameters/createIssueTypeScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeSchemeDetails } from '../models'; - -export interface CreateIssueTypeScheme extends IssueTypeSchemeDetails {} diff --git a/src/version2/parameters/createIssueTypeSchemeParameters.ts b/src/version2/parameters/createIssueTypeSchemeParameters.ts new file mode 100644 index 0000000000..87f6bdb5f9 --- /dev/null +++ b/src/version2/parameters/createIssueTypeSchemeParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const CreateIssueTypeSchemeParametersSchema = z.object({ + /** The ID of the default issue type of the issue type scheme. This ID must be included in `issueTypeIds`. */ + defaultIssueTypeId: z.string().optional(), + /** The description of the issue type scheme. The maximum length is 4000 characters. */ + description: z.string().optional(), + /** The list of issue types IDs of the issue type scheme. At least one standard issue type ID is required. */ + issueTypeIds: z.array(z.string()), + /** The name of the issue type scheme. The name must be unique. The maximum length is 255 characters. */ + name: z.string(), +}); + +export type CreateIssueTypeSchemeParameters = z.infer; diff --git a/src/version2/parameters/createIssueTypeScreenScheme.ts b/src/version2/parameters/createIssueTypeScreenScheme.ts deleted file mode 100644 index 5e5733468c..0000000000 --- a/src/version2/parameters/createIssueTypeScreenScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeScreenSchemeDetails } from '../models'; - -export interface CreateIssueTypeScreenScheme extends IssueTypeScreenSchemeDetails {} diff --git a/src/version2/parameters/createIssueTypeScreenSchemeParameters.ts b/src/version2/parameters/createIssueTypeScreenSchemeParameters.ts new file mode 100644 index 0000000000..81b19a8451 --- /dev/null +++ b/src/version2/parameters/createIssueTypeScreenSchemeParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { IssueTypeScreenSchemeMappingSchema } from './issueTypeScreenSchemeMapping'; + +export const CreateIssueTypeScreenSchemeParametersSchema = z.object({ + /** The description of the issue type screen scheme. The maximum length is 255 characters. */ + description: z.string().optional(), + /** + * The IDs of the screen schemes for the issue type IDs and _default_. A _default_ entry is required to create an + * issue type screen scheme, it defines the mapping for all issue types without a screen scheme. + */ + issueTypeMappings: z.array(IssueTypeScreenSchemeMappingSchema), + /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: z.string(), +}); + +export type CreateIssueTypeScreenSchemeParameters = z.infer; diff --git a/src/version2/parameters/createIssues.ts b/src/version2/parameters/createIssues.ts deleted file mode 100644 index 42f3f036bc..0000000000 --- a/src/version2/parameters/createIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssuesUpdate } from '../models'; - -export interface CreateIssues extends IssuesUpdate {} diff --git a/src/version2/parameters/createIssuesParameters.ts b/src/version2/parameters/createIssuesParameters.ts new file mode 100644 index 0000000000..3e7b751aba --- /dev/null +++ b/src/version2/parameters/createIssuesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; +import { IssueUpdateDetailsSchema } from './issueUpdateDetails'; + +export const CreateIssuesParametersSchema = z.object({ + issueUpdates: z.array(IssueUpdateDetailsSchema).optional(), +}); + +export type CreateIssuesParameters = z.infer; diff --git a/src/version2/parameters/createNotificationScheme.ts b/src/version2/parameters/createNotificationScheme.ts deleted file mode 100644 index 1dcc75834a..0000000000 --- a/src/version2/parameters/createNotificationScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateNotificationSchemeDetails } from '../models'; - -export interface CreateNotificationScheme extends CreateNotificationSchemeDetails {} diff --git a/src/version2/parameters/createNotificationSchemeParameters.ts b/src/version2/parameters/createNotificationSchemeParameters.ts new file mode 100644 index 0000000000..6ebf4809e2 --- /dev/null +++ b/src/version2/parameters/createNotificationSchemeParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { NotificationSchemeEventDetailsSchema } from './notificationSchemeEventDetails'; + +export const CreateNotificationSchemeParametersSchema = z.object({ + /** The description of the notification scheme. */ + description: z.string().optional(), + /** The name of the notification scheme. Must be unique (case-insensitive). */ + name: z.string(), + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents: z.array(NotificationSchemeEventDetailsSchema).optional(), +}); + +export type CreateNotificationSchemeParameters = z.infer; diff --git a/src/version2/parameters/createOrUpdateRemoteIssueLink.ts b/src/version2/parameters/createOrUpdateRemoteIssueLink.ts deleted file mode 100644 index 02886cb1d7..0000000000 --- a/src/version2/parameters/createOrUpdateRemoteIssueLink.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { RemoteIssueLinkRequest } from '../models'; - -export interface CreateOrUpdateRemoteIssueLink extends RemoteIssueLinkRequest { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/createOrUpdateRemoteIssueLinkParameters.ts b/src/version2/parameters/createOrUpdateRemoteIssueLinkParameters.ts new file mode 100644 index 0000000000..3c2fc1cf09 --- /dev/null +++ b/src/version2/parameters/createOrUpdateRemoteIssueLinkParameters.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +export const CreateOrUpdateRemoteIssueLinkParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** Details of the remote application the linked item is in. For example, trello. */ + application: z.unknown().optional(), + /** + * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence + * would consist of the app ID and page ID, like this: `appId=456&pageId=123`. + * + * Setting this field enables the remote issue link details to be updated or deleted using remote system and item + * details as the record identifier, rather than using the record's Jira ID. + * + * The maximum length is 255 characters. + */ + globalId: z.string().optional(), + /** Details of the item linked to. */ + object: z.unknown(), + /** + * Description of the relationship between the issue and the linked item. If not set, the relationship description + * "links to" is used in Jira. + */ + relationship: z.string().optional(), +}); + +export type CreateOrUpdateRemoteIssueLinkParameters = z.infer; diff --git a/src/version2/parameters/createPermissionGrant.ts b/src/version2/parameters/createPermissionGrant.ts deleted file mode 100644 index b949820357..0000000000 --- a/src/version2/parameters/createPermissionGrant.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PermissionGrant } from '../models'; - -export interface CreatePermissionGrant extends PermissionGrant { - /** The ID of the permission scheme in which to create a new permission grant. */ - schemeId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `permissions` Returns all permission grants for each permission scheme. `user` Returns information about the user - * who is granted the permission. `group` Returns information about the group that is granted the permission. - * `projectRole` Returns information about the project role granted the permission. `field` Returns information about - * the custom field granted the permission. `all` Returns all expandable information. - */ - expand?: string; -} diff --git a/src/version2/parameters/createPermissionGrantParameters.ts b/src/version2/parameters/createPermissionGrantParameters.ts new file mode 100644 index 0000000000..c9a1a3b99f --- /dev/null +++ b/src/version2/parameters/createPermissionGrantParameters.ts @@ -0,0 +1,39 @@ +import { z } from 'zod'; + +export const CreatePermissionGrantParametersSchema = z.object({ + /** The ID of the permission scheme in which to create a new permission grant. */ + schemeId: z.number().int(), + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * - `permissions` Returns all permission grants for each permission scheme. + * - `user` Returns information about the user who is granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `projectRole` Returns information about the project role granted the permission. + * - `field` Returns information about the custom field granted the permission. + * - `all` Returns all expandable information. + */ + expand: z.string().optional(), + /** + * The user or group being granted the permission. It consists of a `type`, a type-dependent `parameter` and a + * type-dependent `value`. See [Holder object](../api-group-permission-schemes/#holder-object) in _Get all permission + * schemes_ for more information. + */ + holder: z.unknown().optional(), + /** The ID of the permission granted details. */ + id: z.number().int().optional(), + /** + * The permission to grant. This permission can be one of the built-in permissions or a custom permission added by an + * app. See [Built-in permissions](../api-group-permission-schemes/#built-in-permissions) in _Get all permission + * schemes_ for more information about the built-in permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information about custom permissions. + */ + permission: z.string().optional(), + /** The URL of the permission granted details. */ + self: z.string().optional(), +}); + +export type CreatePermissionGrantParameters = z.infer; diff --git a/src/version2/parameters/createPermissionScheme.ts b/src/version2/parameters/createPermissionScheme.ts deleted file mode 100644 index c047c774d9..0000000000 --- a/src/version2/parameters/createPermissionScheme.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { PermissionScheme } from '../models'; - -export interface CreatePermissionScheme extends Omit { - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * - `all` Returns all expandable information. - * - `field` Returns information about the custom field granted the permission. - * - `group` Returns information about the group that is granted the permission. - * - `permissions` Returns all permission grants for each permission scheme. - * - `projectRole` Returns information about the project role granted the permission. - * - `user` Returns information about the user who is granted the permission. - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'permissions' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] - | string - | string[]; -} diff --git a/src/version2/parameters/createPermissionSchemeParameters.ts b/src/version2/parameters/createPermissionSchemeParameters.ts new file mode 100644 index 0000000000..6b8c9a780e --- /dev/null +++ b/src/version2/parameters/createPermissionSchemeParameters.ts @@ -0,0 +1,36 @@ +import { z } from 'zod'; +import { PermissionGrantSchema } from './permissionGrant'; + +export const CreatePermissionSchemeParametersSchema = z.object({ + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand: z.string().optional(), + /** A description for the permission scheme. */ + description: z.string().optional(), + /** The expand options available for the permission scheme. */ + expand: z.string().optional(), + /** The ID of the permission scheme. */ + id: z.number().int().optional(), + /** The name of the permission scheme. Must be unique. */ + name: z.string(), + /** + * The permission scheme to create or update. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. + */ + permissions: z.array(PermissionGrantSchema).optional(), + /** The scope of the permission scheme. */ + scope: z.unknown().optional(), + /** The URL of the permission scheme. */ + self: z.string().optional(), +}); + +export type CreatePermissionSchemeParameters = z.infer; diff --git a/src/version2/parameters/createPlan.ts b/src/version2/parameters/createPlan.ts deleted file mode 100644 index 200d69b841..0000000000 --- a/src/version2/parameters/createPlan.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { 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 deleted file mode 100644 index 090f6a9fd3..0000000000 --- a/src/version2/parameters/createPlanOnlyTeam.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CreatePlanOnlyTeamRequest } from '../models'; - -export interface CreatePlanOnlyTeam extends CreatePlanOnlyTeamRequest { - /** The ID of the plan. */ - planId: number; -} diff --git a/src/version2/parameters/createPlanOnlyTeamParameters.ts b/src/version2/parameters/createPlanOnlyTeamParameters.ts new file mode 100644 index 0000000000..2a7e1a6a74 --- /dev/null +++ b/src/version2/parameters/createPlanOnlyTeamParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const CreatePlanOnlyTeamParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), + /** The capacity for the plan-only team. */ + capacity: z.number().optional(), + /** The ID of the issue source for the plan-only team. */ + issueSourceId: z.number().int().optional(), + /** The account IDs of the plan-only team members. */ + memberAccountIds: z.array(z.string()).optional(), + /** The plan-only team name. */ + name: z.string(), + /** The planning style for the plan-only team. This must be "Scrum" or "Kanban". */ + planningStyle: z.enum(['Scrum', 'Kanban']), + /** The sprint length for the plan-only team. */ + sprintLength: z.number().int().optional(), +}); + +export type CreatePlanOnlyTeamParameters = z.infer; diff --git a/src/version2/parameters/createPlanParameters.ts b/src/version2/parameters/createPlanParameters.ts new file mode 100644 index 0000000000..5d9b7712e1 --- /dev/null +++ b/src/version2/parameters/createPlanParameters.ts @@ -0,0 +1,28 @@ +import { z } from 'zod'; +import { CreateCrossProjectReleaseRequestSchema } from './createCrossProjectReleaseRequest'; +import { CreateCustomFieldRequestSchema } from './createCustomFieldRequest'; +import { CreateIssueSourceRequestSchema } from './createIssueSourceRequest'; +import { CreatePermissionRequestSchema } from './createPermissionRequest'; + +export const CreatePlanParametersSchema = z.object({ + /** Whether to accept group IDs instead of group names. Group names are deprecated. */ + useGroupId: z.boolean().optional(), + /** The cross-project releases to include in the plan. */ + crossProjectReleases: z.array(CreateCrossProjectReleaseRequestSchema).optional(), + /** The custom fields for the plan. */ + customFields: z.array(CreateCustomFieldRequestSchema).optional(), + /** The exclusion rules for the plan. */ + exclusionRules: z.unknown().optional(), + /** The issue sources to include in the plan. */ + issueSources: z.array(CreateIssueSourceRequestSchema), + /** The account ID of the plan lead. */ + leadAccountId: z.string().optional(), + /** The plan name. */ + name: z.string(), + /** The permissions for the plan. */ + permissions: z.array(CreatePermissionRequestSchema).optional(), + /** The scheduling settings for the plan. */ + scheduling: z.unknown(), +}); + +export type CreatePlanParameters = z.infer; diff --git a/src/version2/parameters/createPriority.ts b/src/version2/parameters/createPriority.ts deleted file mode 100644 index 9723b4a29a..0000000000 --- a/src/version2/parameters/createPriority.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreatePriorityDetails } from '../models'; - -export interface CreatePriority extends CreatePriorityDetails {} diff --git a/src/version2/parameters/createPriorityScheme.ts b/src/version2/parameters/createPriorityScheme.ts deleted file mode 100644 index ab14ef99a5..0000000000 --- a/src/version2/parameters/createPriorityScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreatePrioritySchemeDetails } from '../models'; - -export interface CreatePriorityScheme extends CreatePrioritySchemeDetails {} diff --git a/src/version2/parameters/createPrioritySchemeParameters.ts b/src/version2/parameters/createPrioritySchemeParameters.ts new file mode 100644 index 0000000000..98cf7e6cc3 --- /dev/null +++ b/src/version2/parameters/createPrioritySchemeParameters.ts @@ -0,0 +1,39 @@ +import { z } from 'zod'; + +export const CreatePrioritySchemeParametersSchema = z.object({ + /** The ID of the default priority for the priority scheme. */ + defaultPriorityId: z.number().int(), + /** The description of the priority scheme. */ + description: z.string().optional(), + /** + * Instructions to migrate the priorities of issues. + * + * `in` mappings are used to migrate the priorities of issues to priorities used within the priority scheme. + * + * `out` mappings are used to migrate the priorities of issues to priorities not used within the priority scheme. + * + * - When **priorities** are **added** to the new priority scheme, no mapping needs to be provided as the new priorities + * are not used by any issues. + * - When **priorities** are **removed** from the new priority scheme, no mapping needs to be provided as the removed + * priorities are not used by any issues. + * - When **projects** are **added** to the priority scheme, the priorities of issues in those projects might need to be + * migrated to new priorities used by the priority scheme. This can occur when the current scheme does not use all + * the priorities in the project(s)' priority scheme(s). + * + * - An `in` mapping must be provided for each of these priorities. + * - When **projects** are **removed** from the priority scheme, no mapping needs to be provided as the removed projects + * are not using the priorities of the new priority scheme. + * + * For more information on `in` and `out` mappings, see the child properties documentation for the `PriorityMapping` + * object below. + */ + mappings: z.unknown().optional(), + /** The name of the priority scheme. Must be unique. */ + name: z.string(), + /** The IDs of priorities in the scheme. */ + priorityIds: z.array(z.number().int()), + /** The IDs of projects that will use the priority scheme. */ + projectIds: z.array(z.number().int()).optional(), +}); + +export type CreatePrioritySchemeParameters = z.infer; diff --git a/src/version2/parameters/createProject.ts b/src/version2/parameters/createProject.ts deleted file mode 100644 index 3ed36d7a9a..0000000000 --- a/src/version2/parameters/createProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateProjectDetails } from '../models'; - -export interface CreateProject extends CreateProjectDetails {} diff --git a/src/version2/parameters/createProjectAvatar.ts b/src/version2/parameters/createProjectAvatar.ts deleted file mode 100644 index db9f3f45a8..0000000000 --- a/src/version2/parameters/createProjectAvatar.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface CreateProjectAvatar { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string | number; - /** The X coordinate of the top-left corner of the crop region. */ - x?: number; - /** The Y coordinate of the top-left corner of the crop region. */ - y?: number; - /** - * The length of each side of the crop region. - * - * @default 0 - */ - size?: number; - mimeType: string; - avatar: Buffer | ArrayBuffer | Uint8Array; -} diff --git a/src/version2/parameters/createProjectAvatarParameters.ts b/src/version2/parameters/createProjectAvatarParameters.ts new file mode 100644 index 0000000000..bcf63f046f --- /dev/null +++ b/src/version2/parameters/createProjectAvatarParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const CreateProjectAvatarParametersSchema = z.object({ + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: z.string(), + /** The X coordinate of the top-left corner of the crop region. */ + x: z.number().int().optional(), + /** The Y coordinate of the top-left corner of the crop region. */ + y: z.number().int().optional(), + /** The length of each side of the crop region. */ + size: z.number().int().optional(), +}); + +export type CreateProjectAvatarParameters = z.infer; diff --git a/src/version2/parameters/createProjectCategory.ts b/src/version2/parameters/createProjectCategory.ts deleted file mode 100644 index e7cd6a2628..0000000000 --- a/src/version2/parameters/createProjectCategory.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ProjectCategory } from '../models'; - -export interface CreateProjectCategory extends ProjectCategory {} diff --git a/src/version2/parameters/createProjectCategoryParameters.ts b/src/version2/parameters/createProjectCategoryParameters.ts new file mode 100644 index 0000000000..bc9f76c673 --- /dev/null +++ b/src/version2/parameters/createProjectCategoryParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const CreateProjectCategoryParametersSchema = z.object({ + /** The description of the project category. */ + description: z.string().optional(), + /** The ID of the project category. */ + id: z.string().optional(), + /** The name of the project category. Required on create, optional on update. */ + name: z.string().optional(), + /** The URL of the project category. */ + self: z.string().optional(), +}); + +export type CreateProjectCategoryParameters = z.infer; diff --git a/src/version2/parameters/createProjectParameters.ts b/src/version2/parameters/createProjectParameters.ts new file mode 100644 index 0000000000..e090ced25d --- /dev/null +++ b/src/version2/parameters/createProjectParameters.ts @@ -0,0 +1,139 @@ +import { z } from 'zod'; + +export const CreateProjectParametersSchema = z.object({ + /** The default assignee when creating issues for this project. */ + assigneeType: z.enum(['PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** An integer value for the project's avatar. */ + avatarId: z.number().int().optional(), + /** + * 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. + */ + categoryId: z.number().int().optional(), + /** A brief description of the project. */ + description: z.string().optional(), + /** + * The ID of the field configuration scheme for the project. Use the [Get all field configuration + * schemes](#api-rest-api-2-fieldconfigurationscheme-get) operation to get a list of field configuration scheme IDs. + * If you specify the field configuration scheme you cannot specify the project template key. + */ + fieldConfigurationScheme: z.number().int().optional(), + /** + * 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 + * scheme IDs. + */ + issueSecurityScheme: z.number().int().optional(), + /** + * The ID of the issue type scheme for the project. Use the [Get all issue type + * schemes](#api-rest-api-2-issuetypescheme-get) operation to get a list of issue type scheme IDs. If you specify the + * issue type scheme you cannot specify the project template key. + */ + issueTypeScheme: z.number().int().optional(), + /** + * The ID of the issue type screen scheme for the project. Use the [Get all issue type screen + * schemes](#api-rest-api-2-issuetypescreenscheme-get) operation to get a list of issue type screen scheme IDs. If you + * specify the issue type screen scheme you cannot specify the project template key. + */ + issueTypeScreenScheme: z.number().int().optional(), + /** + * 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. + */ + key: z.string(), + /** + * This parameter is deprecated because of privacy changes. Use `leadAccountId` instead. See the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. The user name of the project lead. Either `lead` or `leadAccountId` must be set when creating a + * project. Cannot be provided with `leadAccountId`. + */ + lead: z.string().optional(), + /** + * The account ID of the project lead. Either `lead` or `leadAccountId` must be set when creating a project. Cannot be + * provided with `lead`. + */ + leadAccountId: z.string().optional(), + /** The name of the project. */ + name: z.string(), + /** + * 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: z.number().int().optional(), + /** + * 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. + */ + permissionScheme: z.number().int().optional(), + /** + * A predefined configuration for a project. The type of the `projectTemplateKey` must match with the type of the + * `projectTypeKey`. + */ + projectTemplateKey: z + .enum([ + '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', + 'com.pyxis.greenhopper.jira:gh-cross-team-template', + 'com.pyxis.greenhopper.jira:gh-cross-team-planning-template', + 'com.atlassian.servicedesk:simplified-it-service-management', + 'com.atlassian.servicedesk:simplified-it-service-management-basic', + 'com.atlassian.servicedesk:simplified-it-service-management-operations', + 'com.atlassian.servicedesk:simplified-general-service-desk', + 'com.atlassian.servicedesk:simplified-general-service-desk-it', + 'com.atlassian.servicedesk:simplified-general-service-desk-business', + 'com.atlassian.servicedesk:simplified-internal-service-desk', + 'com.atlassian.servicedesk:simplified-external-service-desk', + 'com.atlassian.servicedesk:simplified-hr-service-desk', + 'com.atlassian.servicedesk:simplified-facilities-service-desk', + 'com.atlassian.servicedesk:simplified-legal-service-desk', + 'com.atlassian.servicedesk:simplified-marketing-service-desk', + 'com.atlassian.servicedesk:simplified-finance-service-desk', + 'com.atlassian.servicedesk:simplified-analytics-service-desk', + 'com.atlassian.servicedesk:simplified-design-service-desk', + 'com.atlassian.servicedesk:simplified-sales-service-desk', + 'com.atlassian.servicedesk:simplified-halp-service-desk', + 'com.atlassian.servicedesk:simplified-blank-project-it', + 'com.atlassian.servicedesk:simplified-blank-project-business', + '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', + '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-', + ]) + .optional(), + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes), which + * defines the application-specific feature set. If you don't specify the project template you have to specify the + * project type. + */ + projectTypeKey: z.enum(['software', 'service_desk', 'business']).optional(), + /** A link to information about this project, such as project documentation */ + url: z.string().optional(), + /** + * The ID of the workflow scheme for the project. Use the [Get all workflow + * schemes](#api-rest-api-2-workflowscheme-get) operation to get a list of workflow scheme IDs. If you specify the + * workflow scheme you cannot specify the project template key. + */ + workflowScheme: z.number().int().optional(), +}); + +export type CreateProjectParameters = z.infer; diff --git a/src/version2/parameters/createProjectRole.ts b/src/version2/parameters/createProjectRole.ts deleted file mode 100644 index 3950f7c3d0..0000000000 --- a/src/version2/parameters/createProjectRole.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateUpdateRoleRequest } from '../models'; - -export interface CreateProjectRole extends CreateUpdateRoleRequest {} diff --git a/src/version2/parameters/createProjectRoleParameters.ts b/src/version2/parameters/createProjectRoleParameters.ts new file mode 100644 index 0000000000..f95a08391c --- /dev/null +++ b/src/version2/parameters/createProjectRoleParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const CreateProjectRoleParametersSchema = z.object({ + /** + * A description of the project role. Required when fully updating a project role. Optional when creating or partially + * updating a project role. + */ + description: z.string().optional(), + /** + * The name of the project role. Must be unique. Cannot begin or end with whitespace. The maximum length is 255 + * characters. Required when creating a project role. Optional when partially updating a project role. + */ + name: z.string().optional(), +}); + +export type CreateProjectRoleParameters = z.infer; diff --git a/src/version2/parameters/createProjectWithCustomTemplate.ts b/src/version2/parameters/createProjectWithCustomTemplate.ts deleted file mode 100644 index 32b4a99891..0000000000 --- a/src/version2/parameters/createProjectWithCustomTemplate.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ProjectCustomTemplateCreateRequest } from '../models'; - -export interface CreateProjectWithCustomTemplate extends ProjectCustomTemplateCreateRequest {} diff --git a/src/version2/parameters/createProjectWithCustomTemplateParameters.ts b/src/version2/parameters/createProjectWithCustomTemplateParameters.ts new file mode 100644 index 0000000000..eade3dd157 --- /dev/null +++ b/src/version2/parameters/createProjectWithCustomTemplateParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { CustomTemplatesProjectDetailsSchema } from './customTemplatesProjectDetails'; +import { CustomTemplateRequestDTOSchema } from './customTemplateRequestDTO'; + +export const CreateProjectWithCustomTemplateParametersSchema = z.object({ + details: CustomTemplatesProjectDetailsSchema.optional(), + template: CustomTemplateRequestDTOSchema.optional(), +}); + +export type CreateProjectWithCustomTemplateParameters = z.infer; diff --git a/src/version2/parameters/createRelatedWork.ts b/src/version2/parameters/createRelatedWork.ts deleted file mode 100644 index d3c9cd561d..0000000000 --- a/src/version2/parameters/createRelatedWork.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { VersionRelatedWork } from '../models'; - -export interface CreateRelatedWork extends VersionRelatedWork { - id: string; -} diff --git a/src/version2/parameters/createRelatedWorkParameters.ts b/src/version2/parameters/createRelatedWorkParameters.ts new file mode 100644 index 0000000000..6b056383fa --- /dev/null +++ b/src/version2/parameters/createRelatedWorkParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const CreateRelatedWorkParametersSchema = z.object({ + id: z.string(), + /** The category of the related work */ + category: z.string(), + /** The ID of the issue associated with the related work (if there is one). Cannot be updated via the Rest API. */ + issueId: z.number().int().optional(), + /** + * 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: z.string().optional(), + /** The title of the related work */ + title: z.string().optional(), + /** The URL of the related work. Will be null for the native release note related work item, but is otherwise required. */ + url: z.string().optional(), +}); + +export type CreateRelatedWorkParameters = z.infer; diff --git a/src/version2/parameters/createResolution.ts b/src/version2/parameters/createResolution.ts deleted file mode 100644 index 3e14cdd4bc..0000000000 --- a/src/version2/parameters/createResolution.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CreateResolutionDetails } from '../models'; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type CreateResolution = CreateResolutionDetails & Record; diff --git a/src/version2/parameters/createResolutionParameters.ts b/src/version2/parameters/createResolutionParameters.ts new file mode 100644 index 0000000000..6d1870593e --- /dev/null +++ b/src/version2/parameters/createResolutionParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const CreateResolutionParametersSchema = z.object({ + /** The description of the resolution. */ + description: z.string().optional(), + /** The name of the resolution. Must be unique (case-insensitive). */ + name: z.string(), +}); + +export type CreateResolutionParameters = z.infer; diff --git a/src/version2/parameters/createScreen.ts b/src/version2/parameters/createScreen.ts deleted file mode 100644 index 943eff7859..0000000000 --- a/src/version2/parameters/createScreen.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ScreenDetails } from '../models'; - -export interface CreateScreen extends ScreenDetails {} diff --git a/src/version2/parameters/createScreenParameters.ts b/src/version2/parameters/createScreenParameters.ts new file mode 100644 index 0000000000..6ce88e766f --- /dev/null +++ b/src/version2/parameters/createScreenParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const CreateScreenParametersSchema = z.object({ + /** The description of the screen. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the screen. The name must be unique. The maximum length is 255 characters. */ + name: z.string(), +}); + +export type CreateScreenParameters = z.infer; diff --git a/src/version2/parameters/createScreenScheme.ts b/src/version2/parameters/createScreenScheme.ts deleted file mode 100644 index f1a962caed..0000000000 --- a/src/version2/parameters/createScreenScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ScreenSchemeDetails } from '../models'; - -export interface CreateScreenScheme extends ScreenSchemeDetails {} diff --git a/src/version2/parameters/createScreenSchemeParameters.ts b/src/version2/parameters/createScreenSchemeParameters.ts new file mode 100644 index 0000000000..fb4c4913a5 --- /dev/null +++ b/src/version2/parameters/createScreenSchemeParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const CreateScreenSchemeParametersSchema = z.object({ + /** The description of the screen scheme. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: z.string(), + /** + * The IDs of the screens for the screen types of the screen scheme. Only screens used in classic projects are + * accepted. + */ + screens: z.unknown(), +}); + +export type CreateScreenSchemeParameters = z.infer; diff --git a/src/version2/parameters/createStatuses.ts b/src/version2/parameters/createStatuses.ts deleted file mode 100644 index 5581e81d61..0000000000 --- a/src/version2/parameters/createStatuses.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { StatusCreateRequest } from '../models'; - -export interface CreateStatuses extends StatusCreateRequest {} diff --git a/src/version2/parameters/createStatusesParameters.ts b/src/version2/parameters/createStatusesParameters.ts new file mode 100644 index 0000000000..e66c2d1cfe --- /dev/null +++ b/src/version2/parameters/createStatusesParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { StatusScopeSchema } from './statusScope'; +import { StatusCreateSchema } from './statusCreate'; + +export const CreateStatusesParametersSchema = z.object({ + scope: StatusScopeSchema, + /** Details of the statuses being created. */ + statuses: z.array(StatusCreateSchema), +}); + +export type CreateStatusesParameters = z.infer; diff --git a/src/version2/parameters/createUiModification.ts b/src/version2/parameters/createUiModification.ts deleted file mode 100644 index ba8e19fb4c..0000000000 --- a/src/version2/parameters/createUiModification.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateUiModificationDetails } from '../models'; - -export interface CreateUiModification extends CreateUiModificationDetails {} diff --git a/src/version2/parameters/createUiModificationParameters.ts b/src/version2/parameters/createUiModificationParameters.ts new file mode 100644 index 0000000000..f85eedb60b --- /dev/null +++ b/src/version2/parameters/createUiModificationParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { UiModificationContextDetailsSchema } from './uiModificationContextDetails'; + +export const CreateUiModificationParametersSchema = z.object({ + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts: z.array(UiModificationContextDetailsSchema).optional(), + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data: z.string().optional(), + /** The description of the UI modification. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the UI modification. The maximum length is 255 characters. */ + name: z.string(), +}); + +export type CreateUiModificationParameters = z.infer; diff --git a/src/version2/parameters/createUser.ts b/src/version2/parameters/createUser.ts deleted file mode 100644 index aa0af39ca1..0000000000 --- a/src/version2/parameters/createUser.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { NewUserDetails } from '../models'; - -export interface CreateUser extends NewUserDetails {} diff --git a/src/version2/parameters/createUserParameters.ts b/src/version2/parameters/createUserParameters.ts new file mode 100644 index 0000000000..332846448a --- /dev/null +++ b/src/version2/parameters/createUserParameters.ts @@ -0,0 +1,39 @@ +import { z } from 'zod'; + +export const CreateUserParametersSchema = z.object({ + /** Deprecated, do not use. */ + applicationKeys: z.array(z.string()).optional(), + /** + * This property is no longer available. If the user has an Atlassian account, their display name is not changed. If + * the user does not have an Atlassian account, they are sent an email asking them set up an account. + */ + displayName: z.string().optional(), + /** The email address for the user. */ + emailAddress: z.string(), + /** + * This property is no longer available. See the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + key: z.string().optional(), + /** + * This property is no longer available. See the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name: z.string().optional(), + /** + * This property is no longer available. If the user has an Atlassian account, their password is not changed. If the + * user does not have an Atlassian account, they are sent an email asking them set up an account. + */ + password: z.string().optional(), + /** + * Products the new user has access to. Valid products are: jira-core, jira-servicedesk, jira-product-discovery, + * jira-software. To create a user without product access, set this field to be an empty array. + */ + products: z.array(z.string()), + /** The URL of the user. */ + self: z.string().optional(), +}); + +export type CreateUserParameters = z.infer; diff --git a/src/version2/parameters/createVersion.ts b/src/version2/parameters/createVersion.ts deleted file mode 100644 index 2e77c3a5a8..0000000000 --- a/src/version2/parameters/createVersion.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Version } from '../models'; - -export interface CreateVersion extends Version {} diff --git a/src/version2/parameters/createVersionParameters.ts b/src/version2/parameters/createVersionParameters.ts new file mode 100644 index 0000000000..3ff42b9d90 --- /dev/null +++ b/src/version2/parameters/createVersionParameters.ts @@ -0,0 +1,86 @@ +import { z } from 'zod'; +import { VersionApproverSchema } from './versionApprover'; +import { SimpleLinkSchema } from './simpleLink'; + +export const CreateVersionParametersSchema = z.object({ + /** If the expand option `approvers` is used, returns a list containing the approvers for this version. */ + approvers: z.array(VersionApproverSchema).optional(), + /** Indicates that the version is archived. Optional when creating or updating a version. */ + archived: z.boolean().optional(), + /** The description of the version. Optional when creating or updating a version. The maximum size is 16,384 bytes. */ + description: z.string().optional(), + /** If the expand option `driver` is used, returns the Atlassian account ID of the driver. */ + driver: z.string().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about version in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `operations` Returns the list of operations available for this version. + * - `issuesstatus` Returns the count of issues in this version for each of the status categories _to do_, _in + * progress_, _done_, and _unmapped_. The _unmapped_ property contains a count of issues with a status other than + * _to do_, _in progress_, and _done_. + * - `driver` Returns the Atlassian account ID of the version driver. + * - `approvers` Returns a list containing approvers for this version. + * + * Optional for create and update. + */ + expand: z.string().optional(), + /** The ID of the version. */ + id: z.string().optional(), + /** + * If the expand option `issuesstatus` is used, returns the count of issues in this version for each of the status + * categories _to do_, _in progress_, _done_, and _unmapped_. The _unmapped_ property contains a count of issues with + * a status other than _to do_, _in progress_, and _done_. + */ + issuesStatusForFixVersion: z.unknown().optional(), + /** + * The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not + * applicable when creating a version. Optional when updating a version. + */ + moveUnfixedIssuesTo: z.string().optional(), + /** + * The unique name of the version. Required when creating a version. Optional when updating a version. The maximum + * length is 255 characters. + */ + name: z.string().optional(), + /** If the expand option `operations` is used, returns the list of operations available for this version. */ + operations: z.array(SimpleLinkSchema).optional(), + /** Indicates that the version is overdue. */ + overdue: z.boolean().optional(), + /** Deprecated. Use `projectId`. */ + project: z.string().optional(), + /** + * The ID of the project to which this version is attached. Required when creating a version. Not applicable when + * updating a version. + */ + projectId: z.number().int().optional(), + /** + * The release date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a + * version. + */ + releaseDate: z.string().datetime().optional(), + /** + * Indicates that the version is released. If the version is released a request to release again is ignored. Not + * applicable when creating a version. Optional when updating a version. + */ + released: z.boolean().optional(), + /** The URL of the version. */ + self: z.string().optional(), + /** + * The start date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a + * version. + */ + startDate: z.string().datetime().optional(), + /** + * The date on which work on this version is expected to finish, expressed in the instance's _Day/Month/Year Format_ + * date format. + */ + userReleaseDate: z.string().optional(), + /** + * The date on which work on this version is expected to start, expressed in the instance's _Day/Month/Year Format_ + * date format. + */ + userStartDate: z.string().optional(), +}); + +export type CreateVersionParameters = z.infer; diff --git a/src/version2/parameters/createWorkflow.ts b/src/version2/parameters/createWorkflow.ts deleted file mode 100644 index add55bbde7..0000000000 --- a/src/version2/parameters/createWorkflow.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateWorkflowDetails } from '../models'; - -export interface CreateWorkflow extends CreateWorkflowDetails {} diff --git a/src/version2/parameters/createWorkflowScheme.ts b/src/version2/parameters/createWorkflowScheme.ts deleted file mode 100644 index 7f4983fcd2..0000000000 --- a/src/version2/parameters/createWorkflowScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowScheme } from '../models'; - -export interface CreateWorkflowScheme extends WorkflowScheme {} diff --git a/src/version2/parameters/createWorkflowSchemeDraftFromParent.ts b/src/version2/parameters/createWorkflowSchemeDraftFromParent.ts deleted file mode 100644 index 1b183510af..0000000000 --- a/src/version2/parameters/createWorkflowSchemeDraftFromParent.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface CreateWorkflowSchemeDraftFromParent { - /** The ID of the active workflow scheme that the draft is created from. */ - id: number; -} diff --git a/src/version2/parameters/createWorkflowSchemeDraftFromParentParameters.ts b/src/version2/parameters/createWorkflowSchemeDraftFromParentParameters.ts new file mode 100644 index 0000000000..cf5f79e600 --- /dev/null +++ b/src/version2/parameters/createWorkflowSchemeDraftFromParentParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const CreateWorkflowSchemeDraftFromParentParametersSchema = z.object({ + /** The ID of the active workflow scheme that the draft is created from. */ + id: z.number().int(), +}); + +export type CreateWorkflowSchemeDraftFromParentParameters = z.infer< + typeof CreateWorkflowSchemeDraftFromParentParametersSchema +>; diff --git a/src/version2/parameters/createWorkflowSchemeParameters.ts b/src/version2/parameters/createWorkflowSchemeParameters.ts new file mode 100644 index 0000000000..3873956964 --- /dev/null +++ b/src/version2/parameters/createWorkflowSchemeParameters.ts @@ -0,0 +1,67 @@ +import { z } from 'zod'; + +export const CreateWorkflowSchemeParametersSchema = z.object({ + /** + * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ + * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira + * Workflow (jira)_. + */ + defaultWorkflow: z.string().optional(), + /** The description of the workflow scheme. */ + description: z.string().optional(), + /** Whether the workflow scheme is a draft or not. */ + draft: z.boolean().optional(), + /** The ID of the workflow scheme. */ + id: z.number().int().optional(), + /** + * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an + * issue type can only be mapped to one workflow in a workflow scheme. + */ + issueTypeMappings: z.object({}).optional(), + /** The issue types available in Jira. */ + issueTypes: z.object({}).optional(), + /** + * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue + * type-project mappings only. This property does not apply to non-draft workflows. + */ + lastModified: z.string().optional(), + /** + * The user that last modified the draft workflow scheme. A modification is a change to the issue type-project + * mappings only. This property does not apply to non-draft workflows. + */ + lastModifiedUser: z.unknown().optional(), + /** + * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when + * creating a workflow scheme. + */ + name: z.string().optional(), + /** + * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The + * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. + */ + originalDefaultWorkflow: z.string().optional(), + /** + * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, + * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one + * workflow in a workflow scheme. + */ + originalIssueTypeMappings: z.object({}).optional(), + self: z.string().optional(), + /** + * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow + * scheme is a workflow scheme that is used by at least one project. The following examples show how this property + * works: + * + * - Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is + * updated. Otherwise, a draft workflow scheme is created. + * - Update an active workflow scheme with `updateDraftIfNeeded` set to `false`: An error is returned, as active + * workflow schemes cannot be updated. + * - Update an inactive workflow scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as + * inactive workflow schemes do not require drafts to update. + * + * Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), +}); + +export type CreateWorkflowSchemeParameters = z.infer; diff --git a/src/version2/parameters/createWorkflowTransitionProperty.ts b/src/version2/parameters/createWorkflowTransitionProperty.ts deleted file mode 100644 index 075ac42407..0000000000 --- a/src/version2/parameters/createWorkflowTransitionProperty.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { WorkflowTransitionProperty } from '../models'; - -export interface CreateWorkflowTransitionProperty extends WorkflowTransitionProperty { - /** - * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown - * next to the transition. - */ - transitionId: number; - /** - * The key of the property being added, also known as the name of the property. Set this to the same value as the - * `key` defined in the request body. - */ - key: string; - /** The name of the workflow that the transition belongs to. */ - workflowName: string; - /** - * The workflow status. Set to _live_ for inactive workflows or _draft_ for draft workflows. Active workflows cannot - * be edited. - */ - workflowMode?: 'live' | 'draft' | string; -} diff --git a/src/version2/parameters/createWorkflows.ts b/src/version2/parameters/createWorkflows.ts deleted file mode 100644 index 21afee4686..0000000000 --- a/src/version2/parameters/createWorkflows.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowCreateRequest } from '../models'; - -export interface CreateWorkflows extends WorkflowCreateRequest {} diff --git a/src/version2/parameters/createWorkflowsParameters.ts b/src/version2/parameters/createWorkflowsParameters.ts new file mode 100644 index 0000000000..f83309df25 --- /dev/null +++ b/src/version2/parameters/createWorkflowsParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { WorkflowScopeSchema } from './workflowScope'; +import { WorkflowStatusUpdateSchema } from './workflowStatusUpdate'; +import { WorkflowCreateSchema } from './workflowCreate'; + +export const CreateWorkflowsParametersSchema = z.object({ + scope: WorkflowScopeSchema.optional(), + /** The statuses to associate with the workflows. */ + statuses: z.array(WorkflowStatusUpdateSchema).optional(), + /** The details of the workflows to create. */ + workflows: z.array(WorkflowCreateSchema).optional(), +}); + +export type CreateWorkflowsParameters = z.infer; diff --git a/src/version2/parameters/deleteActor.ts b/src/version2/parameters/deleteActor.ts deleted file mode 100644 index d2afd2b430..0000000000 --- a/src/version2/parameters/deleteActor.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface DeleteActor { - /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string | number; - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; - /** The user account ID of the user to remove from the project role. */ - user?: string; - /** - * The name of the group to remove from the project role. This parameter cannot be used with the `groupId` parameter. - * As a group's name can change, use of `groupId` is recommended. - */ - group?: string; - /** The ID of the group to remove from the project role. This parameter cannot be used with the `group` parameter. */ - groupId?: string; -} diff --git a/src/version2/parameters/deleteActorParameters.ts b/src/version2/parameters/deleteActorParameters.ts new file mode 100644 index 0000000000..41c919621f --- /dev/null +++ b/src/version2/parameters/deleteActorParameters.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; + +export const DeleteActorParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: z.number().int(), + /** The user account ID of the user to remove from the project role. */ + user: z.string().optional(), + /** + * The name of the group to remove from the project role. This parameter cannot be used with the `groupId` parameter. + * As a group's name can change, use of `groupId` is recommended. + */ + group: z.string().optional(), + /** The ID of the group to remove from the project role. This parameter cannot be used with the `group` parameter. */ + groupId: z.string().optional(), +}); + +export type DeleteActorParameters = z.infer; diff --git a/src/version2/parameters/deleteAddonProperty.ts b/src/version2/parameters/deleteAddonProperty.ts deleted file mode 100644 index 6bc5d3829b..0000000000 --- a/src/version2/parameters/deleteAddonProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteAddonProperty { - /** The key of the app, as defined in its descriptor. */ - addonKey: string; - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/deleteAddonPropertyParameters.ts b/src/version2/parameters/deleteAddonPropertyParameters.ts new file mode 100644 index 0000000000..840756ea6c --- /dev/null +++ b/src/version2/parameters/deleteAddonPropertyParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteAddonPropertyParametersSchema = z.object({ + /** The key of the app, as defined in its descriptor. */ + addonKey: z.string(), + /** The key of the property. */ + propertyKey: z.string(), +}); + +export type DeleteAddonPropertyParameters = z.infer; diff --git a/src/version2/parameters/deleteAndReplaceVersion.ts b/src/version2/parameters/deleteAndReplaceVersion.ts deleted file mode 100644 index e9e256bd3e..0000000000 --- a/src/version2/parameters/deleteAndReplaceVersion.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { CustomFieldReplacement } from '../models'; - -export interface DeleteAndReplaceVersion { - /** The ID of the version. */ - id: string; - /** The ID of the version to update `fixVersion` to when the field contains the deleted version. */ - moveFixIssuesTo?: number; - /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. */ - moveAffectedIssuesTo?: number; - /** - * An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the - * deleted version. - */ - customFieldReplacementList?: CustomFieldReplacement[]; -} diff --git a/src/version2/parameters/deleteAndReplaceVersionParameters.ts b/src/version2/parameters/deleteAndReplaceVersionParameters.ts new file mode 100644 index 0000000000..2afa3105af --- /dev/null +++ b/src/version2/parameters/deleteAndReplaceVersionParameters.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { CustomFieldReplacementSchema } from './customFieldReplacement'; + +export const DeleteAndReplaceVersionParametersSchema = z.object({ + /** The ID of the version. */ + id: z.string(), + /** + * An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the + * deleted version. + */ + customFieldReplacementList: z.array(CustomFieldReplacementSchema).optional(), + /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. */ + moveAffectedIssuesTo: z.number().int().optional(), + /** The ID of the version to update `fixVersion` to when the field contains the deleted version. */ + moveFixIssuesTo: z.number().int().optional(), +}); + +export type DeleteAndReplaceVersionParameters = z.infer; diff --git a/src/version2/parameters/deleteAppProperty.ts b/src/version2/parameters/deleteAppProperty.ts deleted file mode 100644 index 91efe84b73..0000000000 --- a/src/version2/parameters/deleteAppProperty.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteAppProperty { - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/deleteAvatar.ts b/src/version2/parameters/deleteAvatar.ts deleted file mode 100644 index bdbdffd6a8..0000000000 --- a/src/version2/parameters/deleteAvatar.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface DeleteAvatar { - /** The avatar type. */ - type: 'project' | 'issuetype' | string; - /** The ID of the item the avatar is associated with. */ - owningObjectId: string; - /** The ID of the avatar. */ - id: number; -} diff --git a/src/version2/parameters/deleteAvatarParameters.ts b/src/version2/parameters/deleteAvatarParameters.ts new file mode 100644 index 0000000000..65952669a1 --- /dev/null +++ b/src/version2/parameters/deleteAvatarParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const DeleteAvatarParametersSchema = z.object({ + /** The avatar type. */ + type: z.enum(['project', 'issuetype', 'priority']), + /** The ID of the item the avatar is associated with. */ + owningObjectId: z.string(), + /** The ID of the avatar. */ + id: z.number().int(), +}); + +export type DeleteAvatarParameters = z.infer; diff --git a/src/version2/parameters/deleteComment.ts b/src/version2/parameters/deleteComment.ts deleted file mode 100644 index 5050950ed1..0000000000 --- a/src/version2/parameters/deleteComment.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface DeleteComment { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the comment. */ - id: string; - parentId?: string; -} diff --git a/src/version2/parameters/deleteCommentParameters.ts b/src/version2/parameters/deleteCommentParameters.ts new file mode 100644 index 0000000000..89ce18da1c --- /dev/null +++ b/src/version2/parameters/deleteCommentParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteCommentParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The ID of the comment. */ + id: z.string(), +}); + +export type DeleteCommentParameters = z.infer; diff --git a/src/version2/parameters/deleteCommentProperty.ts b/src/version2/parameters/deleteCommentProperty.ts deleted file mode 100644 index 6958dc894f..0000000000 --- a/src/version2/parameters/deleteCommentProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteCommentProperty { - /** The ID of the comment. */ - commentId: string; - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/deleteCommentPropertyParameters.ts b/src/version2/parameters/deleteCommentPropertyParameters.ts new file mode 100644 index 0000000000..3492e6366b --- /dev/null +++ b/src/version2/parameters/deleteCommentPropertyParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteCommentPropertyParametersSchema = z.object({ + /** The ID of the comment. */ + commentId: z.string(), + /** The key of the property. */ + propertyKey: z.string(), +}); + +export type DeleteCommentPropertyParameters = z.infer; diff --git a/src/version2/parameters/deleteComponent.ts b/src/version2/parameters/deleteComponent.ts deleted file mode 100644 index fbe63094fa..0000000000 --- a/src/version2/parameters/deleteComponent.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteComponent { - /** The ID of the component. */ - id: string; - /** The ID of the component to replace the deleted component. If this value is null no replacement is made. */ - moveIssuesTo?: string; -} diff --git a/src/version2/parameters/deleteComponentParameters.ts b/src/version2/parameters/deleteComponentParameters.ts new file mode 100644 index 0000000000..ddddf12df9 --- /dev/null +++ b/src/version2/parameters/deleteComponentParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteComponentParametersSchema = z.object({ + /** The ID of the component. */ + id: z.string(), + /** The ID of the component to replace the deleted component. If this value is null no replacement is made. */ + moveIssuesTo: z.string().optional(), +}); + +export type DeleteComponentParameters = z.infer; diff --git a/src/version2/parameters/deleteCustomField.ts b/src/version2/parameters/deleteCustomField.ts deleted file mode 100644 index e27e9c2ad2..0000000000 --- a/src/version2/parameters/deleteCustomField.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteCustomField { - /** The ID of a custom field. */ - id: string; -} diff --git a/src/version2/parameters/deleteCustomFieldContext.ts b/src/version2/parameters/deleteCustomFieldContext.ts deleted file mode 100644 index c741103fba..0000000000 --- a/src/version2/parameters/deleteCustomFieldContext.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteCustomFieldContext { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/deleteCustomFieldContextParameters.ts b/src/version2/parameters/deleteCustomFieldContextParameters.ts new file mode 100644 index 0000000000..4782368974 --- /dev/null +++ b/src/version2/parameters/deleteCustomFieldContextParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteCustomFieldContextParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The ID of the context. */ + contextId: z.number().int(), +}); + +export type DeleteCustomFieldContextParameters = z.infer; diff --git a/src/version2/parameters/deleteCustomFieldOption.ts b/src/version2/parameters/deleteCustomFieldOption.ts deleted file mode 100644 index 9a6888e7db..0000000000 --- a/src/version2/parameters/deleteCustomFieldOption.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface DeleteCustomFieldOption { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context from which an option should be deleted. */ - contextId: number; - /** The ID of the option to delete. */ - optionId: number; -} diff --git a/src/version2/parameters/deleteCustomFieldOptionParameters.ts b/src/version2/parameters/deleteCustomFieldOptionParameters.ts new file mode 100644 index 0000000000..378b8116fa --- /dev/null +++ b/src/version2/parameters/deleteCustomFieldOptionParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const DeleteCustomFieldOptionParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The ID of the context from which an option should be deleted. */ + contextId: z.number().int(), + /** The ID of the option to delete. */ + optionId: z.number().int(), +}); + +export type DeleteCustomFieldOptionParameters = z.infer; diff --git a/src/version2/parameters/deleteCustomFieldParameters.ts b/src/version2/parameters/deleteCustomFieldParameters.ts new file mode 100644 index 0000000000..36b5da20ad --- /dev/null +++ b/src/version2/parameters/deleteCustomFieldParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteCustomFieldParametersSchema = z.object({ + /** The ID of a custom field. */ + id: z.string(), +}); + +export type DeleteCustomFieldParameters = z.infer; diff --git a/src/version2/parameters/deleteDashboard.ts b/src/version2/parameters/deleteDashboard.ts deleted file mode 100644 index c1f6e8c687..0000000000 --- a/src/version2/parameters/deleteDashboard.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteDashboard { - /** The ID of the dashboard. */ - id: string; -} diff --git a/src/version2/parameters/deleteDashboardItemProperty.ts b/src/version2/parameters/deleteDashboardItemProperty.ts deleted file mode 100644 index 27a16fa4e4..0000000000 --- a/src/version2/parameters/deleteDashboardItemProperty.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface DeleteDashboardItemProperty { - /** The ID of the dashboard. */ - dashboardId: string; - /** The ID of the dashboard item. */ - itemId: string; - /** The key of the dashboard item property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/deleteDashboardItemPropertyParameters.ts b/src/version2/parameters/deleteDashboardItemPropertyParameters.ts new file mode 100644 index 0000000000..8564be8eec --- /dev/null +++ b/src/version2/parameters/deleteDashboardItemPropertyParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const DeleteDashboardItemPropertyParametersSchema = z.object({ + /** The ID of the dashboard. */ + dashboardId: z.string(), + /** The ID of the dashboard item. */ + itemId: z.string(), + /** The key of the dashboard item property. */ + propertyKey: z.string(), +}); + +export type DeleteDashboardItemPropertyParameters = z.infer; diff --git a/src/version2/parameters/deleteDashboardParameters.ts b/src/version2/parameters/deleteDashboardParameters.ts new file mode 100644 index 0000000000..8a02457c5f --- /dev/null +++ b/src/version2/parameters/deleteDashboardParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteDashboardParametersSchema = z.object({ + /** The ID of the dashboard. */ + id: z.string(), +}); + +export type DeleteDashboardParameters = z.infer; diff --git a/src/version2/parameters/deleteDefaultWorkflow.ts b/src/version2/parameters/deleteDefaultWorkflow.ts deleted file mode 100644 index c1a4db8af3..0000000000 --- a/src/version2/parameters/deleteDefaultWorkflow.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface DeleteDefaultWorkflow { - /** The ID of the workflow scheme. */ - id: number; - /** - * Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. - */ - updateDraftIfNeeded?: boolean; -} diff --git a/src/version2/parameters/deleteDefaultWorkflowParameters.ts b/src/version2/parameters/deleteDefaultWorkflowParameters.ts new file mode 100644 index 0000000000..59c26dd657 --- /dev/null +++ b/src/version2/parameters/deleteDefaultWorkflowParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const DeleteDefaultWorkflowParametersSchema = z.object({ + /** The ID of the workflow scheme. */ + id: z.number().int(), + /** + * Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), +}); + +export type DeleteDefaultWorkflowParameters = z.infer; diff --git a/src/version2/parameters/deleteDraftDefaultWorkflow.ts b/src/version2/parameters/deleteDraftDefaultWorkflow.ts deleted file mode 100644 index a2ddf486fc..0000000000 --- a/src/version2/parameters/deleteDraftDefaultWorkflow.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteDraftDefaultWorkflow { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; -} diff --git a/src/version2/parameters/deleteDraftDefaultWorkflowParameters.ts b/src/version2/parameters/deleteDraftDefaultWorkflowParameters.ts new file mode 100644 index 0000000000..1bd6b3407c --- /dev/null +++ b/src/version2/parameters/deleteDraftDefaultWorkflowParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteDraftDefaultWorkflowParametersSchema = z.object({ + /** The ID of the workflow scheme that the draft belongs to. */ + id: z.number().int(), +}); + +export type DeleteDraftDefaultWorkflowParameters = z.infer; diff --git a/src/version2/parameters/deleteDraftWorkflowMapping.ts b/src/version2/parameters/deleteDraftWorkflowMapping.ts deleted file mode 100644 index 4fdc9500de..0000000000 --- a/src/version2/parameters/deleteDraftWorkflowMapping.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteDraftWorkflowMapping { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The name of the workflow. */ - workflowName: string; -} diff --git a/src/version2/parameters/deleteDraftWorkflowMappingParameters.ts b/src/version2/parameters/deleteDraftWorkflowMappingParameters.ts new file mode 100644 index 0000000000..95dee2138c --- /dev/null +++ b/src/version2/parameters/deleteDraftWorkflowMappingParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteDraftWorkflowMappingParametersSchema = z.object({ + /** The ID of the workflow scheme that the draft belongs to. */ + id: z.number().int(), + /** The name of the workflow. */ + workflowName: z.string(), +}); + +export type DeleteDraftWorkflowMappingParameters = z.infer; diff --git a/src/version2/parameters/deleteFavouriteForFilter.ts b/src/version2/parameters/deleteFavouriteForFilter.ts deleted file mode 100644 index b28aef79da..0000000000 --- a/src/version2/parameters/deleteFavouriteForFilter.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface DeleteFavouriteForFilter { - /** The ID of the filter. */ - id: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't - * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of - * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to - * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: string; -} diff --git a/src/version2/parameters/deleteFavouriteForFilterParameters.ts b/src/version2/parameters/deleteFavouriteForFilterParameters.ts new file mode 100644 index 0000000000..003a5db6ce --- /dev/null +++ b/src/version2/parameters/deleteFavouriteForFilterParameters.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const DeleteFavouriteForFilterParametersSchema = z.object({ + /** The ID of the filter. */ + id: z.number().int(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. + * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the + * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is + * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For + * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand: z.string().optional(), +}); + +export type DeleteFavouriteForFilterParameters = z.infer; diff --git a/src/version2/parameters/deleteFieldConfiguration.ts b/src/version2/parameters/deleteFieldConfiguration.ts deleted file mode 100644 index 692e9bb614..0000000000 --- a/src/version2/parameters/deleteFieldConfiguration.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteFieldConfiguration { - /** The ID of the field configuration. */ - id: number; -} diff --git a/src/version2/parameters/deleteFieldConfigurationParameters.ts b/src/version2/parameters/deleteFieldConfigurationParameters.ts new file mode 100644 index 0000000000..56a8923590 --- /dev/null +++ b/src/version2/parameters/deleteFieldConfigurationParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteFieldConfigurationParametersSchema = z.object({ + /** The ID of the field configuration. */ + id: z.number().int(), +}); + +export type DeleteFieldConfigurationParameters = z.infer; diff --git a/src/version2/parameters/deleteFieldConfigurationScheme.ts b/src/version2/parameters/deleteFieldConfigurationScheme.ts deleted file mode 100644 index 9e1af8e27c..0000000000 --- a/src/version2/parameters/deleteFieldConfigurationScheme.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteFieldConfigurationScheme { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version2/parameters/deleteFieldConfigurationSchemeParameters.ts b/src/version2/parameters/deleteFieldConfigurationSchemeParameters.ts new file mode 100644 index 0000000000..fc04e6c8fa --- /dev/null +++ b/src/version2/parameters/deleteFieldConfigurationSchemeParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteFieldConfigurationSchemeParametersSchema = z.object({ + /** The ID of the field configuration scheme. */ + id: z.number().int(), +}); + +export type DeleteFieldConfigurationSchemeParameters = z.infer; diff --git a/src/version2/parameters/deleteFilter.ts b/src/version2/parameters/deleteFilter.ts deleted file mode 100644 index 2791e1749b..0000000000 --- a/src/version2/parameters/deleteFilter.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteFilter { - /** The ID of the filter to delete. */ - id: number; -} diff --git a/src/version2/parameters/deleteFilterParameters.ts b/src/version2/parameters/deleteFilterParameters.ts new file mode 100644 index 0000000000..3058e489b9 --- /dev/null +++ b/src/version2/parameters/deleteFilterParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteFilterParametersSchema = z.object({ + /** The ID of the filter to delete. */ + id: z.number().int(), +}); + +export type DeleteFilterParameters = z.infer; diff --git a/src/version2/parameters/deleteForgeAppPropertyParameters.ts b/src/version2/parameters/deleteForgeAppPropertyParameters.ts new file mode 100644 index 0000000000..7b03fc5dac --- /dev/null +++ b/src/version2/parameters/deleteForgeAppPropertyParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteForgeAppPropertyParametersSchema = z.object({ + /** The key of the property. */ + propertyKey: z.string(), +}); + +export type DeleteForgeAppPropertyParameters = z.infer; diff --git a/src/version2/parameters/deleteInactiveWorkflow.ts b/src/version2/parameters/deleteInactiveWorkflow.ts deleted file mode 100644 index b4211ab808..0000000000 --- a/src/version2/parameters/deleteInactiveWorkflow.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteInactiveWorkflow { - /** The entity ID of the workflow. */ - entityId: string; -} diff --git a/src/version2/parameters/deleteInactiveWorkflowParameters.ts b/src/version2/parameters/deleteInactiveWorkflowParameters.ts new file mode 100644 index 0000000000..a8954f9951 --- /dev/null +++ b/src/version2/parameters/deleteInactiveWorkflowParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteInactiveWorkflowParametersSchema = z.object({ + /** The entity ID of the workflow. */ + entityId: z.string(), +}); + +export type DeleteInactiveWorkflowParameters = z.infer; diff --git a/src/version2/parameters/deleteIssue.ts b/src/version2/parameters/deleteIssue.ts deleted file mode 100644 index 643ebff999..0000000000 --- a/src/version2/parameters/deleteIssue.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteIssue { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** Whether the issue's subtasks are deleted when the issue is deleted. */ - deleteSubtasks?: boolean; -} diff --git a/src/version2/parameters/deleteIssueFieldOption.ts b/src/version2/parameters/deleteIssueFieldOption.ts deleted file mode 100644 index c4b9ffd0ad..0000000000 --- a/src/version2/parameters/deleteIssueFieldOption.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface DeleteIssueFieldOption { - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; - /** The ID of the option to be deleted. */ - optionId: number; -} diff --git a/src/version2/parameters/deleteIssueFieldOptionParameters.ts b/src/version2/parameters/deleteIssueFieldOptionParameters.ts new file mode 100644 index 0000000000..d29433c566 --- /dev/null +++ b/src/version2/parameters/deleteIssueFieldOptionParameters.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +export const DeleteIssueFieldOptionParametersSchema = z.object({ + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * - Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. + * - Run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For example, + * `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: z.string(), + /** The ID of the option to be deleted. */ + optionId: z.number().int(), +}); + +export type DeleteIssueFieldOptionParameters = z.infer; diff --git a/src/version2/parameters/deleteIssueLink.ts b/src/version2/parameters/deleteIssueLink.ts deleted file mode 100644 index b909359ef7..0000000000 --- a/src/version2/parameters/deleteIssueLink.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteIssueLink { - /** The ID of the issue link. */ - linkId: string; -} diff --git a/src/version2/parameters/deleteIssueLinkParameters.ts b/src/version2/parameters/deleteIssueLinkParameters.ts new file mode 100644 index 0000000000..96bcdd398e --- /dev/null +++ b/src/version2/parameters/deleteIssueLinkParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteIssueLinkParametersSchema = z.object({ + /** The ID of the issue link. */ + linkId: z.string(), +}); + +export type DeleteIssueLinkParameters = z.infer; diff --git a/src/version2/parameters/deleteIssueLinkType.ts b/src/version2/parameters/deleteIssueLinkType.ts deleted file mode 100644 index 512820b0d0..0000000000 --- a/src/version2/parameters/deleteIssueLinkType.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteIssueLinkType { - /** The ID of the issue link type. */ - issueLinkTypeId: string; -} diff --git a/src/version2/parameters/deleteIssueLinkTypeParameters.ts b/src/version2/parameters/deleteIssueLinkTypeParameters.ts new file mode 100644 index 0000000000..edb62c66a5 --- /dev/null +++ b/src/version2/parameters/deleteIssueLinkTypeParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteIssueLinkTypeParametersSchema = z.object({ + /** The ID of the issue link type. */ + issueLinkTypeId: z.string(), +}); + +export type DeleteIssueLinkTypeParameters = z.infer; diff --git a/src/version2/parameters/deleteIssueParameters.ts b/src/version2/parameters/deleteIssueParameters.ts new file mode 100644 index 0000000000..c402a3a042 --- /dev/null +++ b/src/version2/parameters/deleteIssueParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteIssueParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** Whether the issue's subtasks are deleted when the issue is deleted. */ + deleteSubtasks: z.enum(['true', 'false']).optional(), +}); + +export type DeleteIssueParameters = z.infer; diff --git a/src/version2/parameters/deleteIssueProperty.ts b/src/version2/parameters/deleteIssueProperty.ts deleted file mode 100644 index b88751a99a..0000000000 --- a/src/version2/parameters/deleteIssueProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteIssueProperty { - /** The key or ID of the issue. */ - issueIdOrKey: string; - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/deleteIssuePropertyParameters.ts b/src/version2/parameters/deleteIssuePropertyParameters.ts new file mode 100644 index 0000000000..faf1b02d53 --- /dev/null +++ b/src/version2/parameters/deleteIssuePropertyParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteIssuePropertyParametersSchema = z.object({ + /** The key or ID of the issue. */ + issueIdOrKey: z.string(), + /** The key of the property. */ + propertyKey: z.string(), +}); + +export type DeleteIssuePropertyParameters = z.infer; diff --git a/src/version2/parameters/deleteIssueType.ts b/src/version2/parameters/deleteIssueType.ts deleted file mode 100644 index c5b8140666..0000000000 --- a/src/version2/parameters/deleteIssueType.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteIssueType { - /** The ID of the issue type. */ - id: string; - /** The ID of the replacement issue type. */ - alternativeIssueTypeId?: string; -} diff --git a/src/version2/parameters/deleteIssueTypeParameters.ts b/src/version2/parameters/deleteIssueTypeParameters.ts new file mode 100644 index 0000000000..d16d98634b --- /dev/null +++ b/src/version2/parameters/deleteIssueTypeParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteIssueTypeParametersSchema = z.object({ + /** The ID of the issue type. */ + id: z.string(), + /** The ID of the replacement issue type. */ + alternativeIssueTypeId: z.string().optional(), +}); + +export type DeleteIssueTypeParameters = z.infer; diff --git a/src/version2/parameters/deleteIssueTypeProperty.ts b/src/version2/parameters/deleteIssueTypeProperty.ts deleted file mode 100644 index 42c9f1052a..0000000000 --- a/src/version2/parameters/deleteIssueTypeProperty.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface DeleteIssueTypeProperty { - /** The ID of the issue type. */ - issueTypeId: string; - /** - * The key of the property. Use [Get issue type property keys](#api-rest-api-2-issuetype-issueTypeId-properties-get) - * to get a list of all issue type property keys. - */ - propertyKey: string; -} diff --git a/src/version2/parameters/deleteIssueTypePropertyParameters.ts b/src/version2/parameters/deleteIssueTypePropertyParameters.ts new file mode 100644 index 0000000000..c0a14fc475 --- /dev/null +++ b/src/version2/parameters/deleteIssueTypePropertyParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const DeleteIssueTypePropertyParametersSchema = z.object({ + /** The ID of the issue type. */ + issueTypeId: z.string(), + /** + * The key of the property. Use [Get issue type property keys](#api-rest-api-2-issuetype-issueTypeId-properties-get) + * to get a list of all issue type property keys. + */ + propertyKey: z.string(), +}); + +export type DeleteIssueTypePropertyParameters = z.infer; diff --git a/src/version2/parameters/deleteIssueTypeScheme.ts b/src/version2/parameters/deleteIssueTypeScheme.ts deleted file mode 100644 index 38c7e6da63..0000000000 --- a/src/version2/parameters/deleteIssueTypeScheme.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteIssueTypeScheme { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version2/parameters/deleteIssueTypeSchemeParameters.ts b/src/version2/parameters/deleteIssueTypeSchemeParameters.ts new file mode 100644 index 0000000000..8ac368d561 --- /dev/null +++ b/src/version2/parameters/deleteIssueTypeSchemeParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteIssueTypeSchemeParametersSchema = z.object({ + /** The ID of the issue type scheme. */ + issueTypeSchemeId: z.number().int(), +}); + +export type DeleteIssueTypeSchemeParameters = z.infer; diff --git a/src/version2/parameters/deleteIssueTypeScreenScheme.ts b/src/version2/parameters/deleteIssueTypeScreenScheme.ts deleted file mode 100644 index 174ad3eb83..0000000000 --- a/src/version2/parameters/deleteIssueTypeScreenScheme.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteIssueTypeScreenScheme { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version2/parameters/deleteIssueTypeScreenSchemeParameters.ts b/src/version2/parameters/deleteIssueTypeScreenSchemeParameters.ts new file mode 100644 index 0000000000..5a91bd578f --- /dev/null +++ b/src/version2/parameters/deleteIssueTypeScreenSchemeParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteIssueTypeScreenSchemeParametersSchema = z.object({ + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: z.string(), +}); + +export type DeleteIssueTypeScreenSchemeParameters = z.infer; diff --git a/src/version2/parameters/deleteNotificationScheme.ts b/src/version2/parameters/deleteNotificationScheme.ts deleted file mode 100644 index f39dc9e1f1..0000000000 --- a/src/version2/parameters/deleteNotificationScheme.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteNotificationScheme { - /** The ID of the notification scheme. */ - notificationSchemeId: string; -} diff --git a/src/version2/parameters/deleteNotificationSchemeParameters.ts b/src/version2/parameters/deleteNotificationSchemeParameters.ts new file mode 100644 index 0000000000..b66699bfb8 --- /dev/null +++ b/src/version2/parameters/deleteNotificationSchemeParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteNotificationSchemeParametersSchema = z.object({ + /** The ID of the notification scheme. */ + notificationSchemeId: z.string(), +}); + +export type DeleteNotificationSchemeParameters = z.infer; diff --git a/src/version2/parameters/deletePermissionScheme.ts b/src/version2/parameters/deletePermissionScheme.ts deleted file mode 100644 index 4b04c0ded6..0000000000 --- a/src/version2/parameters/deletePermissionScheme.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeletePermissionScheme { - /** The ID of the permission scheme being deleted. */ - schemeId: number; -} diff --git a/src/version2/parameters/deletePermissionSchemeEntity.ts b/src/version2/parameters/deletePermissionSchemeEntity.ts deleted file mode 100644 index d714306507..0000000000 --- a/src/version2/parameters/deletePermissionSchemeEntity.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeletePermissionSchemeEntity { - /** The ID of the permission scheme to delete the permission grant from. */ - schemeId: number; - /** The ID of the permission grant to delete. */ - permissionId: number; -} diff --git a/src/version2/parameters/deletePermissionSchemeEntityParameters.ts b/src/version2/parameters/deletePermissionSchemeEntityParameters.ts new file mode 100644 index 0000000000..87793dd3b1 --- /dev/null +++ b/src/version2/parameters/deletePermissionSchemeEntityParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeletePermissionSchemeEntityParametersSchema = z.object({ + /** The ID of the permission scheme to delete the permission grant from. */ + schemeId: z.number().int(), + /** The ID of the permission grant to delete. */ + permissionId: z.number().int(), +}); + +export type DeletePermissionSchemeEntityParameters = z.infer; diff --git a/src/version2/parameters/deletePermissionSchemeParameters.ts b/src/version2/parameters/deletePermissionSchemeParameters.ts new file mode 100644 index 0000000000..4daa7a620c --- /dev/null +++ b/src/version2/parameters/deletePermissionSchemeParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeletePermissionSchemeParametersSchema = z.object({ + /** The ID of the permission scheme being deleted. */ + schemeId: z.number().int(), +}); + +export type DeletePermissionSchemeParameters = z.infer; diff --git a/src/version2/parameters/deletePlanOnlyTeam.ts b/src/version2/parameters/deletePlanOnlyTeam.ts deleted file mode 100644 index d87ea6bd4b..0000000000 --- a/src/version2/parameters/deletePlanOnlyTeam.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/deletePlanOnlyTeamParameters.ts b/src/version2/parameters/deletePlanOnlyTeamParameters.ts new file mode 100644 index 0000000000..88e7adb606 --- /dev/null +++ b/src/version2/parameters/deletePlanOnlyTeamParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeletePlanOnlyTeamParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), + /** The ID of the plan-only team. */ + planOnlyTeamId: z.number().int(), +}); + +export type DeletePlanOnlyTeamParameters = z.infer; diff --git a/src/version2/parameters/deletePriority.ts b/src/version2/parameters/deletePriority.ts deleted file mode 100644 index 224cd5fc3d..0000000000 --- a/src/version2/parameters/deletePriority.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeletePriority { - /** The ID of the issue priority. */ - id: string; -} diff --git a/src/version2/parameters/deletePriorityParameters.ts b/src/version2/parameters/deletePriorityParameters.ts new file mode 100644 index 0000000000..8f113bae3a --- /dev/null +++ b/src/version2/parameters/deletePriorityParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeletePriorityParametersSchema = z.object({ + /** The ID of the issue priority. */ + id: z.string(), +}); + +export type DeletePriorityParameters = z.infer; diff --git a/src/version2/parameters/deletePriorityScheme.ts b/src/version2/parameters/deletePriorityScheme.ts deleted file mode 100644 index 3ac3ff970c..0000000000 --- a/src/version2/parameters/deletePriorityScheme.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeletePriorityScheme { - /** The priority scheme ID. */ - schemeId: number; -} diff --git a/src/version2/parameters/deletePrioritySchemeParameters.ts b/src/version2/parameters/deletePrioritySchemeParameters.ts new file mode 100644 index 0000000000..4abba4d1e0 --- /dev/null +++ b/src/version2/parameters/deletePrioritySchemeParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeletePrioritySchemeParametersSchema = z.object({ + /** The priority scheme ID. */ + schemeId: z.number().int(), +}); + +export type DeletePrioritySchemeParameters = z.infer; diff --git a/src/version2/parameters/deleteProject.ts b/src/version2/parameters/deleteProject.ts deleted file mode 100644 index 41bb57bb4c..0000000000 --- a/src/version2/parameters/deleteProject.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteProject { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; - /** Whether this project is placed in the Jira recycle bin where it will be available for restoration. */ - enableUndo?: boolean; -} diff --git a/src/version2/parameters/deleteProjectAsynchronously.ts b/src/version2/parameters/deleteProjectAsynchronously.ts deleted file mode 100644 index 713570ef41..0000000000 --- a/src/version2/parameters/deleteProjectAsynchronously.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteProjectAsynchronously { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; -} diff --git a/src/version2/parameters/deleteProjectAsynchronouslyParameters.ts b/src/version2/parameters/deleteProjectAsynchronouslyParameters.ts new file mode 100644 index 0000000000..37b13a3fb7 --- /dev/null +++ b/src/version2/parameters/deleteProjectAsynchronouslyParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteProjectAsynchronouslyParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), +}); + +export type DeleteProjectAsynchronouslyParameters = z.infer; diff --git a/src/version2/parameters/deleteProjectAvatar.ts b/src/version2/parameters/deleteProjectAvatar.ts deleted file mode 100644 index 78d2ed7859..0000000000 --- a/src/version2/parameters/deleteProjectAvatar.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteProjectAvatar { - /** The project ID or (case-sensitive) key. */ - projectIdOrKey: string | number; - /** The ID of the avatar. */ - id: number; -} diff --git a/src/version2/parameters/deleteProjectAvatarParameters.ts b/src/version2/parameters/deleteProjectAvatarParameters.ts new file mode 100644 index 0000000000..77cddc1973 --- /dev/null +++ b/src/version2/parameters/deleteProjectAvatarParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteProjectAvatarParametersSchema = z.object({ + /** The project ID or (case-sensitive) key. */ + projectIdOrKey: z.string(), + /** The ID of the avatar. */ + id: z.number().int(), +}); + +export type DeleteProjectAvatarParameters = z.infer; diff --git a/src/version2/parameters/deleteProjectParameters.ts b/src/version2/parameters/deleteProjectParameters.ts new file mode 100644 index 0000000000..a8d32d893c --- /dev/null +++ b/src/version2/parameters/deleteProjectParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteProjectParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** Whether this project is placed in the Jira recycle bin where it will be available for restoration. */ + enableUndo: z.boolean().optional(), +}); + +export type DeleteProjectParameters = z.infer; diff --git a/src/version2/parameters/deleteProjectProperty.ts b/src/version2/parameters/deleteProjectProperty.ts deleted file mode 100644 index 981906bfc3..0000000000 --- a/src/version2/parameters/deleteProjectProperty.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface DeleteProjectProperty { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; - /** - * The project property key. Use [Get project property keys](#api-rest-api-2-project-projectIdOrKey-properties-get) to - * get a list of all project property keys. - */ - propertyKey: string; -} diff --git a/src/version2/parameters/deleteProjectPropertyParameters.ts b/src/version2/parameters/deleteProjectPropertyParameters.ts new file mode 100644 index 0000000000..e30521943e --- /dev/null +++ b/src/version2/parameters/deleteProjectPropertyParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const DeleteProjectPropertyParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** + * The project property key. Use [Get project property keys](#api-rest-api-2-project-projectIdOrKey-properties-get) to + * get a list of all project property keys. + */ + propertyKey: z.string(), +}); + +export type DeleteProjectPropertyParameters = z.infer; diff --git a/src/version2/parameters/deleteProjectRole.ts b/src/version2/parameters/deleteProjectRole.ts deleted file mode 100644 index 1fb9e07106..0000000000 --- a/src/version2/parameters/deleteProjectRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface DeleteProjectRole { - /** - * The ID of the project role to delete. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of - * project role IDs. - */ - id: number; - /** The ID of the project role that will replace the one being deleted. */ - swap?: number; -} diff --git a/src/version2/parameters/deleteProjectRoleActorsFromRole.ts b/src/version2/parameters/deleteProjectRoleActorsFromRole.ts deleted file mode 100644 index f877ee4528..0000000000 --- a/src/version2/parameters/deleteProjectRoleActorsFromRole.ts +++ /dev/null @@ -1,19 +0,0 @@ -export interface DeleteProjectRoleActorsFromRole { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; - /** The user account ID of the user to remove as a default actor. */ - user?: string; - /** - * The group ID of the group to be removed as a default actor. This parameter cannot be used with the `group` - * parameter. - */ - groupId?: string; - /** - * The group name of the group to be removed as a default actor.This parameter cannot be used with the `groupId` - * parameter. As a group's name can change, use of `groupId` is recommended. - */ - group?: string; -} diff --git a/src/version2/parameters/deleteProjectRoleActorsFromRoleParameters.ts b/src/version2/parameters/deleteProjectRoleActorsFromRoleParameters.ts new file mode 100644 index 0000000000..c0a4a59ce1 --- /dev/null +++ b/src/version2/parameters/deleteProjectRoleActorsFromRoleParameters.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const DeleteProjectRoleActorsFromRoleParametersSchema = z.object({ + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: z.number().int(), + /** The user account ID of the user to remove as a default actor. */ + user: z.string().optional(), + /** + * The group ID of the group to be removed as a default actor. This parameter cannot be used with the `group` + * parameter. + */ + groupId: z.string().optional(), + /** + * The group name of the group to be removed as a default actor.This parameter cannot be used with the `groupId` + * parameter. As a group's name can change, use of `groupId` is recommended. + */ + group: z.string().optional(), +}); + +export type DeleteProjectRoleActorsFromRoleParameters = z.infer; diff --git a/src/version2/parameters/deleteProjectRoleParameters.ts b/src/version2/parameters/deleteProjectRoleParameters.ts new file mode 100644 index 0000000000..bdb139c70b --- /dev/null +++ b/src/version2/parameters/deleteProjectRoleParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const DeleteProjectRoleParametersSchema = z.object({ + /** + * The ID of the project role to delete. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of + * project role IDs. + */ + id: z.number().int(), + /** + * The ID of the project role that will replace the one being deleted. The swap will attempt to swap the role in + * schemes (notifications, permissions, issue security), workflows, worklogs and comments. + */ + swap: z.number().int().optional(), +}); + +export type DeleteProjectRoleParameters = z.infer; diff --git a/src/version2/parameters/deleteRelatedWork.ts b/src/version2/parameters/deleteRelatedWork.ts deleted file mode 100644 index 2980e8f2e5..0000000000 --- a/src/version2/parameters/deleteRelatedWork.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/deleteRelatedWorkParameters.ts b/src/version2/parameters/deleteRelatedWorkParameters.ts new file mode 100644 index 0000000000..36858509fe --- /dev/null +++ b/src/version2/parameters/deleteRelatedWorkParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteRelatedWorkParametersSchema = z.object({ + /** The ID of the version that the target related work belongs to. */ + versionId: z.string(), + /** The ID of the related work to delete. */ + relatedWorkId: z.string(), +}); + +export type DeleteRelatedWorkParameters = z.infer; diff --git a/src/version2/parameters/deleteRemoteIssueLinkByGlobalId.ts b/src/version2/parameters/deleteRemoteIssueLinkByGlobalId.ts deleted file mode 100644 index f8c7afdd4d..0000000000 --- a/src/version2/parameters/deleteRemoteIssueLinkByGlobalId.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteRemoteIssueLinkByGlobalId { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The global ID of a remote issue link. */ - globalId: string; -} diff --git a/src/version2/parameters/deleteRemoteIssueLinkByGlobalIdParameters.ts b/src/version2/parameters/deleteRemoteIssueLinkByGlobalIdParameters.ts new file mode 100644 index 0000000000..270d472eb9 --- /dev/null +++ b/src/version2/parameters/deleteRemoteIssueLinkByGlobalIdParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteRemoteIssueLinkByGlobalIdParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The global ID of a remote issue link. */ + globalId: z.string(), +}); + +export type DeleteRemoteIssueLinkByGlobalIdParameters = z.infer; diff --git a/src/version2/parameters/deleteRemoteIssueLinkById.ts b/src/version2/parameters/deleteRemoteIssueLinkById.ts deleted file mode 100644 index e8128d3919..0000000000 --- a/src/version2/parameters/deleteRemoteIssueLinkById.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteRemoteIssueLinkById { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of a remote issue link. */ - linkId: string; -} diff --git a/src/version2/parameters/deleteRemoteIssueLinkByIdParameters.ts b/src/version2/parameters/deleteRemoteIssueLinkByIdParameters.ts new file mode 100644 index 0000000000..336167a212 --- /dev/null +++ b/src/version2/parameters/deleteRemoteIssueLinkByIdParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteRemoteIssueLinkByIdParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The ID of a remote issue link. */ + linkId: z.string(), +}); + +export type DeleteRemoteIssueLinkByIdParameters = z.infer; diff --git a/src/version2/parameters/deleteResolution.ts b/src/version2/parameters/deleteResolution.ts deleted file mode 100644 index cbb5c5e486..0000000000 --- a/src/version2/parameters/deleteResolution.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteResolution { - /** The ID of the issue resolution. */ - id: string; - /** The ID of the issue resolution that will replace the currently selected resolution. */ - replaceWith: string; -} diff --git a/src/version2/parameters/deleteResolutionParameters.ts b/src/version2/parameters/deleteResolutionParameters.ts new file mode 100644 index 0000000000..90e95043a3 --- /dev/null +++ b/src/version2/parameters/deleteResolutionParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteResolutionParametersSchema = z.object({ + /** The ID of the issue resolution. */ + id: z.string(), + /** The ID of the issue resolution that will replace the currently selected resolution. */ + replaceWith: z.string(), +}); + +export type DeleteResolutionParameters = z.infer; diff --git a/src/version2/parameters/deleteScreen.ts b/src/version2/parameters/deleteScreen.ts deleted file mode 100644 index cd41616c86..0000000000 --- a/src/version2/parameters/deleteScreen.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteScreen { - /** The ID of the screen. */ - screenId: number; -} diff --git a/src/version2/parameters/deleteScreenParameters.ts b/src/version2/parameters/deleteScreenParameters.ts new file mode 100644 index 0000000000..07a0c41d71 --- /dev/null +++ b/src/version2/parameters/deleteScreenParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteScreenParametersSchema = z.object({ + /** The ID of the screen. */ + screenId: z.number().int(), +}); + +export type DeleteScreenParameters = z.infer; diff --git a/src/version2/parameters/deleteScreenScheme.ts b/src/version2/parameters/deleteScreenScheme.ts deleted file mode 100644 index 3943076c43..0000000000 --- a/src/version2/parameters/deleteScreenScheme.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteScreenScheme { - /** The ID of the screen scheme. */ - screenSchemeId: string; -} diff --git a/src/version2/parameters/deleteScreenSchemeParameters.ts b/src/version2/parameters/deleteScreenSchemeParameters.ts new file mode 100644 index 0000000000..4c72a7f37c --- /dev/null +++ b/src/version2/parameters/deleteScreenSchemeParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteScreenSchemeParametersSchema = z.object({ + /** The ID of the screen scheme. */ + screenSchemeId: z.string(), +}); + +export type DeleteScreenSchemeParameters = z.infer; diff --git a/src/version2/parameters/deleteScreenTab.ts b/src/version2/parameters/deleteScreenTab.ts deleted file mode 100644 index 80839fce2f..0000000000 --- a/src/version2/parameters/deleteScreenTab.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteScreenTab { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; -} diff --git a/src/version2/parameters/deleteScreenTabParameters.ts b/src/version2/parameters/deleteScreenTabParameters.ts new file mode 100644 index 0000000000..f33ef06e8f --- /dev/null +++ b/src/version2/parameters/deleteScreenTabParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteScreenTabParametersSchema = z.object({ + /** The ID of the screen. */ + screenId: z.number().int(), + /** The ID of the screen tab. */ + tabId: z.number().int(), +}); + +export type DeleteScreenTabParameters = z.infer; diff --git a/src/version2/parameters/deleteSecurityScheme.ts b/src/version2/parameters/deleteSecurityScheme.ts deleted file mode 100644 index 6951711e73..0000000000 --- a/src/version2/parameters/deleteSecurityScheme.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteSecurityScheme { - /** The ID of the issue security scheme. */ - schemeId: string; -} diff --git a/src/version2/parameters/deleteSecuritySchemeParameters.ts b/src/version2/parameters/deleteSecuritySchemeParameters.ts new file mode 100644 index 0000000000..f3d734248d --- /dev/null +++ b/src/version2/parameters/deleteSecuritySchemeParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteSecuritySchemeParametersSchema = z.object({ + /** The ID of the issue security scheme. */ + schemeId: z.string(), +}); + +export type DeleteSecuritySchemeParameters = z.infer; diff --git a/src/version2/parameters/deleteSharePermission.ts b/src/version2/parameters/deleteSharePermission.ts deleted file mode 100644 index 8fba180a9b..0000000000 --- a/src/version2/parameters/deleteSharePermission.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteSharePermission { - /** The ID of the filter. */ - id: number; - /** The ID of the share permission. */ - permissionId: number; -} diff --git a/src/version2/parameters/deleteSharePermissionParameters.ts b/src/version2/parameters/deleteSharePermissionParameters.ts new file mode 100644 index 0000000000..b956c2c5c1 --- /dev/null +++ b/src/version2/parameters/deleteSharePermissionParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DeleteSharePermissionParametersSchema = z.object({ + /** The ID of the filter. */ + id: z.number().int(), + /** The ID of the share permission. */ + permissionId: z.number().int(), +}); + +export type DeleteSharePermissionParameters = z.infer; diff --git a/src/version2/parameters/deleteStatusesById.ts b/src/version2/parameters/deleteStatusesById.ts deleted file mode 100644 index 7e46e04d3d..0000000000 --- a/src/version2/parameters/deleteStatusesById.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface DeleteStatusesById { - /** - * The list of status IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * id=10000&id=10001. - * - * Min items `1`, Max items `50` - */ - id?: string[]; -} diff --git a/src/version2/parameters/deleteStatusesByIdParameters.ts b/src/version2/parameters/deleteStatusesByIdParameters.ts new file mode 100644 index 0000000000..158e1aca63 --- /dev/null +++ b/src/version2/parameters/deleteStatusesByIdParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const DeleteStatusesByIdParametersSchema = z.object({ + /** + * The list of status IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * id=10000&id=10001. + * + * Min items `1`, Max items `50` + */ + id: z.array(z.string()), +}); + +export type DeleteStatusesByIdParameters = z.infer; diff --git a/src/version2/parameters/deleteUiModification.ts b/src/version2/parameters/deleteUiModification.ts deleted file mode 100644 index 00cc6fa0cf..0000000000 --- a/src/version2/parameters/deleteUiModification.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteUiModification { - /** The ID of the UI modification. */ - uiModificationId: string; -} diff --git a/src/version2/parameters/deleteUiModificationParameters.ts b/src/version2/parameters/deleteUiModificationParameters.ts new file mode 100644 index 0000000000..9409ad7fe4 --- /dev/null +++ b/src/version2/parameters/deleteUiModificationParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteUiModificationParametersSchema = z.object({ + /** The ID of the UI modification. */ + uiModificationId: z.string(), +}); + +export type DeleteUiModificationParameters = z.infer; diff --git a/src/version2/parameters/deleteUserProperty.ts b/src/version2/parameters/deleteUserProperty.ts deleted file mode 100644 index 44eef1dd50..0000000000 --- a/src/version2/parameters/deleteUserProperty.ts +++ /dev/null @@ -1,21 +0,0 @@ -export interface DeleteUserProperty { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** - * This parameter 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. - */ - userKey?: string; - /** - * This parameter 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. - */ - username?: string; - /** The key of the user's property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/deleteUserPropertyParameters.ts b/src/version2/parameters/deleteUserPropertyParameters.ts new file mode 100644 index 0000000000..1b98345482 --- /dev/null +++ b/src/version2/parameters/deleteUserPropertyParameters.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; + +export const DeleteUserPropertyParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** + * This parameter 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. + */ + userKey: z.string().optional(), + /** + * This parameter 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. + */ + username: z.string().optional(), + /** The key of the user's property. */ + propertyKey: z.string(), +}); + +export type DeleteUserPropertyParameters = z.infer; diff --git a/src/version2/parameters/deleteWebhookById.ts b/src/version2/parameters/deleteWebhookById.ts deleted file mode 100644 index 6500a30dd8..0000000000 --- a/src/version2/parameters/deleteWebhookById.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ContainerForWebhookIDs } from '../models'; - -export interface DeleteWebhookById extends ContainerForWebhookIDs {} diff --git a/src/version2/parameters/deleteWebhookByIdParameters.ts b/src/version2/parameters/deleteWebhookByIdParameters.ts new file mode 100644 index 0000000000..b9fff71ba7 --- /dev/null +++ b/src/version2/parameters/deleteWebhookByIdParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteWebhookByIdParametersSchema = z.object({ + /** A list of webhook IDs. */ + webhookIds: z.array(z.number().int()), +}); + +export type DeleteWebhookByIdParameters = z.infer; diff --git a/src/version2/parameters/deleteWorkflowMapping.ts b/src/version2/parameters/deleteWorkflowMapping.ts deleted file mode 100644 index ea50e4949a..0000000000 --- a/src/version2/parameters/deleteWorkflowMapping.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface DeleteWorkflowMapping { - /** The ID of the workflow scheme. */ - id: number; - /** The name of the workflow. */ - workflowName: string; - /** - * Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. - */ - updateDraftIfNeeded?: boolean; -} diff --git a/src/version2/parameters/deleteWorkflowMappingParameters.ts b/src/version2/parameters/deleteWorkflowMappingParameters.ts new file mode 100644 index 0000000000..047bdf0479 --- /dev/null +++ b/src/version2/parameters/deleteWorkflowMappingParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const DeleteWorkflowMappingParametersSchema = z.object({ + /** The ID of the workflow scheme. */ + id: z.number().int(), + /** The name of the workflow. */ + workflowName: z.string(), + /** + * Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), +}); + +export type DeleteWorkflowMappingParameters = z.infer; diff --git a/src/version2/parameters/deleteWorkflowScheme.ts b/src/version2/parameters/deleteWorkflowScheme.ts deleted file mode 100644 index 68580c44a6..0000000000 --- a/src/version2/parameters/deleteWorkflowScheme.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface DeleteWorkflowScheme { - /** - * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the - * URL as `schemeId`. For example, _schemeId=10301_. - */ - id: number; -} diff --git a/src/version2/parameters/deleteWorkflowSchemeDraft.ts b/src/version2/parameters/deleteWorkflowSchemeDraft.ts deleted file mode 100644 index 9324c36a74..0000000000 --- a/src/version2/parameters/deleteWorkflowSchemeDraft.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface DeleteWorkflowSchemeDraft { - /** The ID of the active workflow scheme that the draft was created from. */ - id: number; -} diff --git a/src/version2/parameters/deleteWorkflowSchemeDraftIssueType.ts b/src/version2/parameters/deleteWorkflowSchemeDraftIssueType.ts deleted file mode 100644 index 800467c993..0000000000 --- a/src/version2/parameters/deleteWorkflowSchemeDraftIssueType.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface DeleteWorkflowSchemeDraftIssueType { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The ID of the issue type. */ - issueType: string; -} diff --git a/src/version2/parameters/deleteWorkflowSchemeDraftIssueTypeParameters.ts b/src/version2/parameters/deleteWorkflowSchemeDraftIssueTypeParameters.ts new file mode 100644 index 0000000000..fd8b6a120f --- /dev/null +++ b/src/version2/parameters/deleteWorkflowSchemeDraftIssueTypeParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const DeleteWorkflowSchemeDraftIssueTypeParametersSchema = z.object({ + /** The ID of the workflow scheme that the draft belongs to. */ + id: z.number().int(), + /** The ID of the issue type. */ + issueType: z.string(), +}); + +export type DeleteWorkflowSchemeDraftIssueTypeParameters = z.infer< + typeof DeleteWorkflowSchemeDraftIssueTypeParametersSchema +>; diff --git a/src/version2/parameters/deleteWorkflowSchemeDraftParameters.ts b/src/version2/parameters/deleteWorkflowSchemeDraftParameters.ts new file mode 100644 index 0000000000..cc4ae5ef01 --- /dev/null +++ b/src/version2/parameters/deleteWorkflowSchemeDraftParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DeleteWorkflowSchemeDraftParametersSchema = z.object({ + /** The ID of the active workflow scheme that the draft was created from. */ + id: z.number().int(), +}); + +export type DeleteWorkflowSchemeDraftParameters = z.infer; diff --git a/src/version2/parameters/deleteWorkflowSchemeIssueType.ts b/src/version2/parameters/deleteWorkflowSchemeIssueType.ts deleted file mode 100644 index f56348511b..0000000000 --- a/src/version2/parameters/deleteWorkflowSchemeIssueType.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface DeleteWorkflowSchemeIssueType { - /** The ID of the workflow scheme. */ - id: number; - /** The ID of the issue type. */ - issueType: string; - /** - * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. - */ - updateDraftIfNeeded?: boolean; -} diff --git a/src/version2/parameters/deleteWorkflowSchemeIssueTypeParameters.ts b/src/version2/parameters/deleteWorkflowSchemeIssueTypeParameters.ts new file mode 100644 index 0000000000..7f37e5a511 --- /dev/null +++ b/src/version2/parameters/deleteWorkflowSchemeIssueTypeParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const DeleteWorkflowSchemeIssueTypeParametersSchema = z.object({ + /** The ID of the workflow scheme. */ + id: z.number().int(), + /** The ID of the issue type. */ + issueType: z.string(), + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), +}); + +export type DeleteWorkflowSchemeIssueTypeParameters = z.infer; diff --git a/src/version2/parameters/deleteWorkflowSchemeParameters.ts b/src/version2/parameters/deleteWorkflowSchemeParameters.ts new file mode 100644 index 0000000000..d6342f5190 --- /dev/null +++ b/src/version2/parameters/deleteWorkflowSchemeParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const DeleteWorkflowSchemeParametersSchema = z.object({ + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the + * URL as `schemeId`. For example, _schemeId=10301_. + */ + id: z.number().int(), +}); + +export type DeleteWorkflowSchemeParameters = z.infer; diff --git a/src/version2/parameters/deleteWorkflowTransitionProperty.ts b/src/version2/parameters/deleteWorkflowTransitionProperty.ts deleted file mode 100644 index c54f5a4082..0000000000 --- a/src/version2/parameters/deleteWorkflowTransitionProperty.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface DeleteWorkflowTransitionProperty { - /** - * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown - * next to the transition. - */ - transitionId: number; - /** The name of the transition property to delete, also known as the name of the property. */ - key: string; - /** The name of the workflow that the transition belongs to. */ - workflowName: string; - /** - * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot - * be edited. - */ - workflowMode?: 'live' | 'draft' | string; -} diff --git a/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.ts b/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.ts deleted file mode 100644 index 567fcda035..0000000000 --- a/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowsWithTransitionRulesDetails } from '../models'; - -export interface DeleteWorkflowTransitionRuleConfigurations extends WorkflowsWithTransitionRulesDetails {} diff --git a/src/version2/parameters/deleteWorkflowTransitionRuleConfigurationsParameters.ts b/src/version2/parameters/deleteWorkflowTransitionRuleConfigurationsParameters.ts new file mode 100644 index 0000000000..fae6a153c2 --- /dev/null +++ b/src/version2/parameters/deleteWorkflowTransitionRuleConfigurationsParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { WorkflowTransitionRulesDetailsSchema } from './workflowTransitionRulesDetails'; + +export const DeleteWorkflowTransitionRuleConfigurationsParametersSchema = z.object({ + /** The list of workflows with transition rules to delete. */ + workflows: z.array(WorkflowTransitionRulesDetailsSchema), +}); + +export type DeleteWorkflowTransitionRuleConfigurationsParameters = z.infer< + typeof DeleteWorkflowTransitionRuleConfigurationsParametersSchema +>; diff --git a/src/version2/parameters/deleteWorklog.ts b/src/version2/parameters/deleteWorklog.ts deleted file mode 100644 index cfdfb5186e..0000000000 --- a/src/version2/parameters/deleteWorklog.ts +++ /dev/null @@ -1,33 +0,0 @@ -export interface DeleteWorklog { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the worklog. */ - id: string; - /** Whether users watching the issue are notified by email. */ - notifyUsers?: boolean; - /** - * Defines how to update the issue's time estimate, the options are: - * - * - `new` Sets the estimate to a specific value, defined in `newEstimate`. - * - `leave` Leaves the estimate unchanged. - * - `manual` Increases the estimate by amount specified in `increaseBy`. - * - `auto` Reduces the estimate by the value of `timeSpent` in the worklog. - */ - adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; - /** - * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For - * example, _2d_. Required when `adjustEstimate` is `new`. - */ - newEstimate?: string; - /** - * The amount to increase the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m or #). For - * example, _2d_. Required when `adjustEstimate` is `manual`. - */ - increaseBy?: string; - /** - * Whether the work log entry should be added to the issue even if the issue is not editable, because - * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with - * admin permission can use this flag. - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version2/parameters/deleteWorklogParameters.ts b/src/version2/parameters/deleteWorklogParameters.ts new file mode 100644 index 0000000000..0c77b07bbf --- /dev/null +++ b/src/version2/parameters/deleteWorklogParameters.ts @@ -0,0 +1,37 @@ +import { z } from 'zod'; + +export const DeleteWorklogParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The ID of the worklog. */ + id: z.string(), + /** Whether users watching the issue are notified by email. */ + notifyUsers: z.boolean().optional(), + /** + * Defines how to update the issue's time estimate, the options are: + * + * - `new` Sets the estimate to a specific value, defined in `newEstimate`. + * - `leave` Leaves the estimate unchanged. + * - `manual` Increases the estimate by amount specified in `increaseBy`. + * - `auto` Reduces the estimate by the value of `timeSpent` in the worklog. + */ + adjustEstimate: z.enum(['new', 'leave', 'manual', 'auto']).optional(), + /** + * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For + * example, _2d_. Required when `adjustEstimate` is `new`. + */ + newEstimate: z.string().optional(), + /** + * The amount to increase the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m or #). For + * example, _2d_. Required when `adjustEstimate` is `manual`. + */ + increaseBy: z.string().optional(), + /** + * Whether the work log entry should be added to the issue even if the issue is not editable, because + * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with + * admin permission can use this flag. + */ + overrideEditableFlag: z.boolean().optional(), +}); + +export type DeleteWorklogParameters = z.infer; diff --git a/src/version2/parameters/deleteWorklogProperty.ts b/src/version2/parameters/deleteWorklogProperty.ts deleted file mode 100644 index c1aa2238bc..0000000000 --- a/src/version2/parameters/deleteWorklogProperty.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface DeleteWorklogProperty { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the worklog. */ - worklogId: string; - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/deleteWorklogPropertyParameters.ts b/src/version2/parameters/deleteWorklogPropertyParameters.ts new file mode 100644 index 0000000000..86e4a619f9 --- /dev/null +++ b/src/version2/parameters/deleteWorklogPropertyParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const DeleteWorklogPropertyParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The ID of the worklog. */ + worklogId: z.string(), + /** The key of the property. */ + propertyKey: z.string(), +}); + +export type DeleteWorklogPropertyParameters = z.infer; diff --git a/src/version2/parameters/doTransition.ts b/src/version2/parameters/doTransition.ts deleted file mode 100644 index b6256aafb1..0000000000 --- a/src/version2/parameters/doTransition.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueUpdateDetails } from '../models'; - -export interface DoTransition extends IssueUpdateDetails { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/doTransitionParameters.ts b/src/version2/parameters/doTransitionParameters.ts new file mode 100644 index 0000000000..8ce1ee021c --- /dev/null +++ b/src/version2/parameters/doTransitionParameters.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; +import { EntityPropertySchema } from './entityProperty'; + +export const DoTransitionParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** + * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field + * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are + * required, use `update`. Fields included in here cannot be included in `update`. + */ + fields: z.object({}).optional(), + /** Additional issue history details. */ + historyMetadata: z.unknown().optional(), + /** Details of issue properties to be add or update. */ + properties: z.array(EntityPropertySchema).optional(), + /** Details of a transition. Required when performing a transition, optional when creating or editing an issue. */ + transition: z.unknown().optional(), + /** + * A Map containing the field field name and a list of operations to perform on the issue screen field. Note that + * fields included in here cannot be included in `fields`. + */ + update: z.object({}).optional(), +}); + +export type DoTransitionParameters = z.infer; diff --git a/src/version2/parameters/duplicatePlan.ts b/src/version2/parameters/duplicatePlan.ts deleted file mode 100644 index 9a28a1e428..0000000000 --- a/src/version2/parameters/duplicatePlan.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DuplicatePlanRequest } from '../models'; - -export interface DuplicatePlan extends DuplicatePlanRequest { - /** The ID of the plan. */ - planId: number; -} diff --git a/src/version2/parameters/duplicatePlanParameters.ts b/src/version2/parameters/duplicatePlanParameters.ts new file mode 100644 index 0000000000..9324488ae6 --- /dev/null +++ b/src/version2/parameters/duplicatePlanParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const DuplicatePlanParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), + /** The plan name. */ + name: z.string(), +}); + +export type DuplicatePlanParameters = z.infer; diff --git a/src/version2/parameters/editIssue.ts b/src/version2/parameters/editIssue.ts deleted file mode 100644 index e04419242b..0000000000 --- a/src/version2/parameters/editIssue.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { IssueUpdateDetails } from '../models'; - -export interface EditIssue extends IssueUpdateDetails { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Whether a notification email about the issue update is sent to all watchers. To disable the notification, - * administer Jira or administer project permissions are required. If the user doesn't have the necessary permission - * the request is ignored. - */ - notifyUsers?: boolean; - /** - * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideScreenSecurity?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * Whether the response should contain the issue with fields edited in this request. The returned issue will have the - * same format as in the [Get issue API](#api-rest-api-2-issue-issueidorkey-get). - */ - returnIssue?: boolean; - /** The Get issue API expand parameter to use in the response if the `returnIssue` parameter is `true`. */ - expand?: string; -} diff --git a/src/version2/parameters/editIssueParameters.ts b/src/version2/parameters/editIssueParameters.ts new file mode 100644 index 0000000000..b6c2875e18 --- /dev/null +++ b/src/version2/parameters/editIssueParameters.ts @@ -0,0 +1,51 @@ +import { z } from 'zod'; +import { EntityPropertySchema } from './entityProperty'; + +export const EditIssueParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** + * Whether a notification email about the issue update is sent to all watchers. To disable the notification, + * administer Jira or administer project permissions are required. If the user doesn't have the necessary permission + * the request is ignored. + */ + notifyUsers: z.boolean().optional(), + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideScreenSecurity: z.boolean().optional(), + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag: z.boolean().optional(), + /** + * Whether the response should contain the issue with fields edited in this request. The returned issue will have the + * same format as in the [Get issue API](#api-rest-api-3-issue-issueidorkey-get). + */ + returnIssue: z.boolean().optional(), + /** The Get issue API expand parameter to use in the response if the `returnIssue` parameter is `true`. */ + expand: z.string().optional(), + /** + * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field + * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are + * required, use `update`. Fields included in here cannot be included in `update`. + */ + fields: z.object({}).optional(), + /** Additional issue history details. */ + historyMetadata: z.unknown().optional(), + /** Details of issue properties to be add or update. */ + properties: z.array(EntityPropertySchema).optional(), + /** Details of a transition. Required when performing a transition, optional when creating or editing an issue. */ + transition: z.unknown().optional(), + /** + * A Map containing the field field name and a list of operations to perform on the issue screen field. Note that + * fields included in here cannot be included in `fields`. + */ + update: z.object({}).optional(), +}); + +export type EditIssueParameters = z.infer; diff --git a/src/version2/parameters/editTemplateParameters.ts b/src/version2/parameters/editTemplateParameters.ts new file mode 100644 index 0000000000..86011de977 --- /dev/null +++ b/src/version2/parameters/editTemplateParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { CustomTemplateOptionsSchema } from './customTemplateOptions'; + +export const EditTemplateParametersSchema = z.object({ + /** The description of the template */ + templateDescription: z.string().optional(), + templateGenerationOptions: CustomTemplateOptionsSchema.optional(), + /** The unique identifier of the template */ + templateKey: z.string().optional(), + /** The name of the template */ + templateName: z.string().optional(), +}); + +export type EditTemplateParameters = z.infer; diff --git a/src/version2/parameters/evaluateJSISJiraExpressionParameters.ts b/src/version2/parameters/evaluateJSISJiraExpressionParameters.ts new file mode 100644 index 0000000000..5383b319f7 --- /dev/null +++ b/src/version2/parameters/evaluateJSISJiraExpressionParameters.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +export const EvaluateJSISJiraExpressionParametersSchema = z.object({ + /** + * 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: z.string().optional(), + /** The context in which the Jira expression is evaluated. */ + context: z.unknown().optional(), + /** The Jira expression to evaluate. */ + expression: z.string(), +}); + +export type EvaluateJSISJiraExpressionParameters = z.infer; diff --git a/src/version2/parameters/evaluateJiraExpression.ts b/src/version2/parameters/evaluateJiraExpression.ts deleted file mode 100644 index faeceeb7b4..0000000000 --- a/src/version2/parameters/evaluateJiraExpression.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { JiraExpressionEvalRequest } from '../models'; - -export interface EvaluateJiraExpression extends JiraExpressionEvalRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts `meta.complexity` that returns information about the expression - * complexity. For example, the number of expensive operations used by the expression and how close the expression is - * to reaching the [complexity - * limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing - * and debugging your expressions. - */ - expand?: string; -} diff --git a/src/version2/parameters/evaluateJiraExpressionUsingEnhancedSearch.ts b/src/version2/parameters/evaluateJiraExpressionUsingEnhancedSearch.ts deleted file mode 100644 index b6cfc38638..0000000000 --- a/src/version2/parameters/evaluateJiraExpressionUsingEnhancedSearch.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { JiraExpressionEvalUsingEnhancedSearchRequest } from '../models'; - -export interface EvaluateJiraExpressionUsingEnhancedSearch extends JiraExpressionEvalUsingEnhancedSearchRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts `meta.complexity` that returns information about the expression - * complexity. For example, the number of expensive operations used by the expression and how close the expression is - * to reaching the [complexity - * limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing - * and debugging your expressions. - */ - expand?: string; -} diff --git a/src/version2/parameters/expandAttachmentForHumans.ts b/src/version2/parameters/expandAttachmentForHumans.ts deleted file mode 100644 index 697deb82b3..0000000000 --- a/src/version2/parameters/expandAttachmentForHumans.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface ExpandAttachmentForHumans { - /** The ID of the attachment. */ - id: string; -} diff --git a/src/version2/parameters/expandAttachmentForHumansParameters.ts b/src/version2/parameters/expandAttachmentForHumansParameters.ts new file mode 100644 index 0000000000..6472815359 --- /dev/null +++ b/src/version2/parameters/expandAttachmentForHumansParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const ExpandAttachmentForHumansParametersSchema = z.object({ + /** The ID of the attachment. */ + id: z.string(), +}); + +export type ExpandAttachmentForHumansParameters = z.infer; diff --git a/src/version2/parameters/expandAttachmentForMachines.ts b/src/version2/parameters/expandAttachmentForMachines.ts deleted file mode 100644 index 5d977e0df2..0000000000 --- a/src/version2/parameters/expandAttachmentForMachines.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface ExpandAttachmentForMachines { - /** The ID of the attachment. */ - id: string; -} diff --git a/src/version2/parameters/expandAttachmentForMachinesParameters.ts b/src/version2/parameters/expandAttachmentForMachinesParameters.ts new file mode 100644 index 0000000000..b28b8a6b5e --- /dev/null +++ b/src/version2/parameters/expandAttachmentForMachinesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const ExpandAttachmentForMachinesParametersSchema = z.object({ + /** The ID of the attachment. */ + id: z.string(), +}); + +export type ExpandAttachmentForMachinesParameters = z.infer; diff --git a/src/version2/parameters/exportArchivedIssues.ts b/src/version2/parameters/exportArchivedIssues.ts deleted file mode 100644 index a07a10dab6..0000000000 --- a/src/version2/parameters/exportArchivedIssues.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { DateRangeFilter } from '../models'; - -/** Details of a filter for exporting archived issues. */ -export interface ExportArchivedIssues { - /** List archived issues archived by a specified account ID. */ - archivedBy?: string[]; - archivedDateRange?: DateRangeFilter; - /** List archived issues with a specified issue type ID. */ - issueTypes?: string[]; - /** List archived issues with a specified project key. */ - projects?: string[]; - /** List archived issues where the reporter is a specified account ID. */ - reporters?: string[]; -} diff --git a/src/version2/parameters/exportArchivedIssuesParameters.ts b/src/version2/parameters/exportArchivedIssuesParameters.ts new file mode 100644 index 0000000000..69008ca00c --- /dev/null +++ b/src/version2/parameters/exportArchivedIssuesParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { DateRangeFilterRequestSchema } from './dateRangeFilterRequest'; + +export const ExportArchivedIssuesParametersSchema = z.object({ + /** List archived issues archived by a specified account ID. */ + archivedBy: z.array(z.string()).optional(), + archivedDateRange: DateRangeFilterRequestSchema.optional(), + /** List archived issues with a specified issue type ID. */ + issueTypes: z.array(z.string()).optional(), + /** List archived issues with a specified project key. */ + projects: z.array(z.string()).optional(), + /** List archived issues where the reporter is a specified account ID. */ + reporters: z.array(z.string()).optional(), +}); + +export type ExportArchivedIssuesParameters = z.infer; diff --git a/src/version2/parameters/findAssignableUsers.ts b/src/version2/parameters/findAssignableUsers.ts deleted file mode 100644 index 78bb7397f6..0000000000 --- a/src/version2/parameters/findAssignableUsers.ts +++ /dev/null @@ -1,36 +0,0 @@ -export interface FindAssignableUsers { - /** - * A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant - * users. The string can match the prefix of the attribute's value. For example, _query=john_ matches a user with a - * `displayName` of _John Smith_ and a user with an `emailAddress` of _johnson@example.com_. Required, unless - * `username` or `accountId` is specified. - */ - query?: string; - /** The sessionId of this request. SessionId is the same until the assignee is set. */ - sessionId?: 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. - */ - username?: string; - /** A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. */ - accountId?: string; - /** The project ID or project key (case sensitive). Required, unless `issueKey` is specified. */ - 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; - /** - * The maximum number of items to return. This operation may return less than the maximum number of items even if more - * are available. The operation fetches users up to the maximum and then, from the fetched users, returns only the - * users that can be assigned to the issue. - */ - maxResults?: number; - /** The ID of the transition. */ - actionDescriptorId?: number; - recommend?: boolean; -} diff --git a/src/version2/parameters/findAssignableUsersParameters.ts b/src/version2/parameters/findAssignableUsersParameters.ts new file mode 100644 index 0000000000..7c5f8288e0 --- /dev/null +++ b/src/version2/parameters/findAssignableUsersParameters.ts @@ -0,0 +1,40 @@ +import { z } from 'zod'; + +export const FindAssignableUsersParametersSchema = z.object({ + /** + * A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant + * users. The string can match the prefix of the attribute's value. For example, _query=john_ matches a user with a + * `displayName` of _John Smith_ and a user with an `emailAddress` of _johnson@example.com_. Required, unless + * `username` or `accountId` is specified. + */ + query: z.string().optional(), + /** The sessionId of this request. SessionId is the same until the assignee is set. */ + sessionId: z.string().optional(), + /** + * 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: z.string().optional(), + /** A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. */ + accountId: z.string().optional(), + /** The project ID or project key (case sensitive). Required, unless `issueKey` or `issueId` is specified. */ + project: z.string().optional(), + /** The key of the issue. Required, unless `issueId` or `project` is specified. */ + issueKey: z.string().optional(), + /** The ID of the issue. Required, unless `issueKey` or `project` is specified. */ + issueId: z.string().optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** + * The maximum number of items to return. This operation may return less than the maximum number of items even if more + * are available. The operation fetches users up to the maximum and then, from the fetched users, returns only the + * users that can be assigned to the issue. + */ + maxResults: z.number().int().optional(), + /** The ID of the transition. */ + actionDescriptorId: z.number().int().optional(), + recommend: z.boolean().optional(), +}); + +export type FindAssignableUsersParameters = z.infer; diff --git a/src/version2/parameters/findBulkAssignableUsers.ts b/src/version2/parameters/findBulkAssignableUsers.ts deleted file mode 100644 index e85cfa3c46..0000000000 --- a/src/version2/parameters/findBulkAssignableUsers.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface FindBulkAssignableUsers { - /** - * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant - * users. The string can match the prefix of the attribute's value. For example, _query=john_ matches a user with a - * `displayName` of _John Smith_ and a user with an `emailAddress` of _johnson@example.com_. Required, unless - * `accountId` is specified. - */ - query?: 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. - */ - username?: string; - /** A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. */ - accountId?: string; - /** A list of project keys (case sensitive). This parameter accepts a comma-separated list. */ - projectKeys: 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/findBulkAssignableUsersParameters.ts b/src/version2/parameters/findBulkAssignableUsersParameters.ts new file mode 100644 index 0000000000..ebb142b067 --- /dev/null +++ b/src/version2/parameters/findBulkAssignableUsersParameters.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +export const FindBulkAssignableUsersParametersSchema = z.object({ + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant + * users. The string can match the prefix of the attribute's value. For example, _query=john_ matches a user with a + * `displayName` of _John Smith_ and a user with an `emailAddress` of _johnson@example.com_. Required, unless + * `accountId` is specified. + */ + query: z.string().optional(), + /** + * 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: z.string().optional(), + /** A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. */ + accountId: z.string().optional(), + /** A list of project keys (case sensitive). This parameter accepts a comma-separated list. */ + projectKeys: z.string(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type FindBulkAssignableUsersParameters = z.infer; diff --git a/src/version2/parameters/findComponentsForProjects.ts b/src/version2/parameters/findComponentsForProjects.ts deleted file mode 100644 index 018417db88..0000000000 --- a/src/version2/parameters/findComponentsForProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -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/findComponentsForProjectsParameters.ts b/src/version2/parameters/findComponentsForProjectsParameters.ts new file mode 100644 index 0000000000..be755e7582 --- /dev/null +++ b/src/version2/parameters/findComponentsForProjectsParameters.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; + +export const FindComponentsForProjectsParametersSchema = z.object({ + /** The project IDs and/or project keys (case sensitive). */ + projectIdsOrKeys: z.array(z.string()).optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * [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: z.enum(['description', '-description', '+description', 'name', '-name', '+name']).optional(), + /** + * Filter the results using a literal string. Components with a matching `name` or `description` are returned (case + * insensitive). + */ + query: z.string().optional(), +}); + +export type FindComponentsForProjectsParameters = z.infer; diff --git a/src/version2/parameters/findGroups.ts b/src/version2/parameters/findGroups.ts deleted file mode 100644 index af6e2ff3eb..0000000000 --- a/src/version2/parameters/findGroups.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface FindGroups { - /** The string to find in group names. */ - query?: string; - /** - * As a group's name can change, use of `excludeGroupIds` is recommended to identify a group. A group to exclude from - * the result. To exclude multiple groups, provide an ampersand-separated list. For example, - * `exclude=group1&exclude=group2`. This parameter cannot be used with the `excludeGroupIds` parameter. - */ - exclude?: string | string[]; - /** - * A group ID to exclude from the result. To exclude multiple groups, provide an ampersand-separated list. For - * example, `excludeId=group1-id&excludeId=group2-id`. This parameter cannot be used with the `excludeGroups` - * parameter. - */ - excludeId?: string[]; - /** - * The maximum number of groups to return. The maximum number of groups that can be returned is limited by the system - * property `jira.ajax.autocomplete.limit`. - */ - maxResults?: number; - /** Whether the search for groups should be case insensitive. */ - caseInsensitive?: boolean; -} diff --git a/src/version2/parameters/findGroupsParameters.ts b/src/version2/parameters/findGroupsParameters.ts new file mode 100644 index 0000000000..93786608be --- /dev/null +++ b/src/version2/parameters/findGroupsParameters.ts @@ -0,0 +1,39 @@ +import { z } from 'zod'; + +export const FindGroupsParametersSchema = z.object({ + /** + * This parameter is deprecated, setting it does not affect the results. To find groups containing a particular user, + * use [Get user groups](#api-rest-api-2-user-groups-get). + */ + accountId: z.string().optional(), + /** The string to find in group names. */ + query: z.string().optional(), + /** + * As a group's name can change, use of `excludeGroupIds` is recommended to identify a group. A group to exclude from + * the result. To exclude multiple groups, provide an ampersand-separated list. For example, + * `exclude=group1&exclude=group2`. This parameter cannot be used with the `excludeGroupIds` parameter. + */ + exclude: z.array(z.string()).optional(), + /** + * A group ID to exclude from the result. To exclude multiple groups, provide an ampersand-separated list. For + * example, `excludeId=group1-id&excludeId=group2-id`. This parameter cannot be used with the `excludeGroups` + * parameter. + */ + excludeId: z.array(z.string()).optional(), + /** + * The maximum number of groups to return. The maximum number of groups that can be returned is limited by the system + * property `jira.ajax.autocomplete.limit`. + */ + maxResults: z.number().int().optional(), + /** Whether the search for groups should be case insensitive. */ + caseInsensitive: z.boolean().optional(), + /** + * 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: z.string().optional(), + includeTeams: z.boolean().optional(), +}); + +export type FindGroupsParameters = z.infer; diff --git a/src/version2/parameters/findUserKeysByQuery.ts b/src/version2/parameters/findUserKeysByQuery.ts deleted file mode 100644 index b6c92aef83..0000000000 --- a/src/version2/parameters/findUserKeysByQuery.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface FindUserKeysByQuery { - /** The search query. */ - 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. - * - * @deprecated Use `maxResult` instead. - */ - maxResults?: number; - /** The maximum number of items to return per page. */ - maxResult?: number; -} diff --git a/src/version2/parameters/findUserKeysByQueryParameters.ts b/src/version2/parameters/findUserKeysByQueryParameters.ts new file mode 100644 index 0000000000..e302295a22 --- /dev/null +++ b/src/version2/parameters/findUserKeysByQueryParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const FindUserKeysByQueryParametersSchema = z.object({ + /** The search query. */ + query: z.string(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResult: z.number().int().optional(), +}); + +export type FindUserKeysByQueryParameters = z.infer; diff --git a/src/version2/parameters/findUsers.ts b/src/version2/parameters/findUsers.ts deleted file mode 100644 index e2a8a40ac2..0000000000 --- a/src/version2/parameters/findUsers.ts +++ /dev/null @@ -1,26 +0,0 @@ -export interface FindUsers { - /** - * A query string that is matched against user attributes ( `displayName`, and `emailAddress`) to find relevant users. - * The string can match the prefix of the attribute's value. For example, _query=john_ matches a user with a - * `displayName` of _John Smith_ and a user with an `emailAddress` of _johnson@example.com_. Required, unless - * `accountId` or `property` is specified. - */ - query?: string; - username?: string; - /** - * A query string that is matched exactly against a user `accountId`. Required, unless `query` or `property` is - * specified. - */ - accountId?: string; - /** The index of the first item to return in a page of filtered results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * A query string used to search properties. Property keys are specified by path, so property keys containing dot (.) - * or equals (=) characters cannot be used. The query string cannot be specified using a JSON object. Example: To - * search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use - * `thepropertykey.something.nested=1`. Required, unless `accountId` or `query` is specified. - */ - property?: string; -} diff --git a/src/version2/parameters/findUsersAndGroups.ts b/src/version2/parameters/findUsersAndGroups.ts deleted file mode 100644 index a4885157c1..0000000000 --- a/src/version2/parameters/findUsersAndGroups.ts +++ /dev/null @@ -1,54 +0,0 @@ -export interface FindUsersAndGroups { - /** The search string. */ - query: string; - /** The maximum number of items to return in each list. */ - maxResults?: number; - /** Whether the user avatar should be returned. If an invalid value is provided, the default value is used. */ - showAvatar?: boolean; - /** The custom field ID of the field this request is for. */ - fieldId?: string; - /** - * The ID of a project that returned users and groups must have permission to view. To include multiple projects, - * provide an ampersand-separated list. For example, `projectId=10000&projectId=10001`. This parameter is only used - * when `fieldId` is present. - */ - projectId?: string[]; - /** - * The ID of an issue type that returned users and groups must have permission to view. To include multiple issue - * types, provide an ampersand-separated list. For example, `issueTypeId=10000&issueTypeId=10001`. Special values, - * such as `-1` (all standard issue types) and `-2` (all subtask issue types), are supported. This parameter is only - * used when `fieldId` is present. - */ - issueTypeId?: string[]; - /** The size of the avatar to return. If an invalid value is provided, the default value is used. */ - avatarSize?: - | 'xsmall' - | 'xsmall@2x' - | 'xsmall@3x' - | 'small' - | 'small@2x' - | 'small@3x' - | 'medium' - | 'medium@2x' - | 'medium@3x' - | 'large' - | 'large@2x' - | 'large@3x' - | 'xlarge' - | 'xlarge@2x' - | 'xlarge@3x' - | 'xxlarge' - | 'xxlarge@2x' - | 'xxlarge@3x' - | 'xxxlarge' - | 'xxxlarge@2x' - | 'xxxlarge@3x' - | string; - /** Whether the search for groups should be case insensitive. */ - caseInsensitive?: boolean; - /** - * Whether Connect app users and groups should be excluded from the search results. If an invalid value is provided, - * the default value is used. - */ - excludeConnectAddons?: boolean; -} diff --git a/src/version2/parameters/findUsersAndGroupsParameters.ts b/src/version2/parameters/findUsersAndGroupsParameters.ts new file mode 100644 index 0000000000..6ae6a8f24a --- /dev/null +++ b/src/version2/parameters/findUsersAndGroupsParameters.ts @@ -0,0 +1,60 @@ +import { z } from 'zod'; + +export const FindUsersAndGroupsParametersSchema = z.object({ + /** The search string. */ + query: z.string(), + /** The maximum number of items to return in each list. */ + maxResults: z.number().int().optional(), + /** Whether the user avatar should be returned. If an invalid value is provided, the default value is used. */ + showAvatar: z.boolean().optional(), + /** The custom field ID of the field this request is for. */ + fieldId: z.string().optional(), + /** + * The ID of a project that returned users and groups must have permission to view. To include multiple projects, + * provide an ampersand-separated list. For example, `projectId=10000&projectId=10001`. This parameter is only used + * when `fieldId` is present. + */ + projectId: z.array(z.string()).optional(), + /** + * The ID of an issue type that returned users and groups must have permission to view. To include multiple issue + * types, provide an ampersand-separated list. For example, `issueTypeId=10000&issueTypeId=10001`. Special values, + * such as `-1` (all standard issue types) and `-2` (all subtask issue types), are supported. This parameter is only + * used when `fieldId` is present. + */ + issueTypeId: z.array(z.string()).optional(), + /** The size of the avatar to return. If an invalid value is provided, the default value is used. */ + avatarSize: z + .enum([ + 'xsmall', + 'xsmall@2x', + 'xsmall@3x', + 'small', + 'small@2x', + 'small@3x', + 'medium', + 'medium@2x', + 'medium@3x', + 'large', + 'large@2x', + 'large@3x', + 'xlarge', + 'xlarge@2x', + 'xlarge@3x', + 'xxlarge', + 'xxlarge@2x', + 'xxlarge@3x', + 'xxxlarge', + 'xxxlarge@2x', + 'xxxlarge@3x', + ]) + .optional(), + /** Whether the search for groups should be case insensitive. */ + caseInsensitive: z.boolean().optional(), + /** + * Whether Connect app users and groups should be excluded from the search results. If an invalid value is provided, + * the default value is used. + */ + excludeConnectAddons: z.boolean().optional(), +}); + +export type FindUsersAndGroupsParameters = z.infer; diff --git a/src/version2/parameters/findUsersByQuery.ts b/src/version2/parameters/findUsersByQuery.ts deleted file mode 100644 index b31ad52692..0000000000 --- a/src/version2/parameters/findUsersByQuery.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface FindUsersByQuery { - /** The search query. */ - 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. */ - maxResults?: number; -} diff --git a/src/version2/parameters/findUsersByQueryParameters.ts b/src/version2/parameters/findUsersByQueryParameters.ts new file mode 100644 index 0000000000..564baf1e9b --- /dev/null +++ b/src/version2/parameters/findUsersByQueryParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const FindUsersByQueryParametersSchema = z.object({ + /** The search query. */ + query: z.string(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type FindUsersByQueryParameters = z.infer; diff --git a/src/version2/parameters/findUsersForPicker.ts b/src/version2/parameters/findUsersForPicker.ts deleted file mode 100644 index b5eb7749a2..0000000000 --- a/src/version2/parameters/findUsersForPicker.ts +++ /dev/null @@ -1,21 +0,0 @@ -export interface FindUsersForPicker { - /** - * A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant - * users. The string can match the prefix of the attribute's value. For example, _query=john_ matches a user with a - * `displayName` of _John Smith_ and a user with an `emailAddress` of _johnson@example.com_. - */ - query: string; - /** The maximum number of items to return. The total number of matched users is returned in `total`. */ - maxResults?: number; - /** Include the URI to the user's avatar. */ - showAvatar?: boolean; - /** - * A list of account IDs to exclude from the search results. This parameter accepts a comma-separated list. Multiple - * account IDs can also be provided using an ampersand-separated list. For example, - * `excludeAccountIds=5b10a2844c20165700ede21g,5b10a0effa615349cb016cd8&excludeAccountIds=5b10ac8d82e05b22cc7d4ef5`. - * Cannot be provided with `exclude`. - */ - excludeAccountIds?: string[]; - avatarSize?: string; - excludeConnectUsers?: boolean; -} diff --git a/src/version2/parameters/findUsersForPickerParameters.ts b/src/version2/parameters/findUsersForPickerParameters.ts new file mode 100644 index 0000000000..dd9d558e09 --- /dev/null +++ b/src/version2/parameters/findUsersForPickerParameters.ts @@ -0,0 +1,31 @@ +import { z } from 'zod'; + +export const FindUsersForPickerParametersSchema = z.object({ + /** + * A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant + * users. The string can match the prefix of the attribute's value. For example, _query=john_ matches a user with a + * `displayName` of _John Smith_ and a user with an `emailAddress` of _johnson@example.com_. + */ + query: z.string(), + /** The maximum number of items to return. The total number of matched users is returned in `total`. */ + maxResults: z.number().int().optional(), + /** Include the URI to the user's avatar. */ + showAvatar: z.boolean().optional(), + /** + * 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. + */ + exclude: z.array(z.string()).optional(), + /** + * A list of account IDs to exclude from the search results. This parameter accepts a comma-separated list. Multiple + * account IDs can also be provided using an ampersand-separated list. For example, + * `excludeAccountIds=5b10a2844c20165700ede21g,5b10a0effa615349cb016cd8&excludeAccountIds=5b10ac8d82e05b22cc7d4ef5`. + * Cannot be provided with `exclude`. + */ + excludeAccountIds: z.array(z.string()).optional(), + avatarSize: z.string().optional(), + excludeConnectUsers: z.boolean().optional(), +}); + +export type FindUsersForPickerParameters = z.infer; diff --git a/src/version2/parameters/findUsersParameters.ts b/src/version2/parameters/findUsersParameters.ts new file mode 100644 index 0000000000..b6d916222d --- /dev/null +++ b/src/version2/parameters/findUsersParameters.ts @@ -0,0 +1,30 @@ +import { z } from 'zod'; + +export const FindUsersParametersSchema = z.object({ + /** + * A query string that is matched against user attributes ( `displayName`, and `emailAddress`) to find relevant users. + * The string can match the prefix of the attribute's value. For example, _query=john_ matches a user with a + * `displayName` of _John Smith_ and a user with an `emailAddress` of _johnson@example.com_. Required, unless + * `accountId` or `property` is specified. + */ + query: z.string().optional(), + username: z.string().optional(), + /** + * A query string that is matched exactly against a user `accountId`. Required, unless `query` or `property` is + * specified. + */ + accountId: z.string().optional(), + /** The index of the first item to return in a page of filtered results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * A query string used to search properties. Property keys are specified by path, so property keys containing dot (.) + * or equals (=) characters cannot be used. The query string cannot be specified using a JSON object. Example: To + * search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use + * `thepropertykey.something.nested=1`. Required, unless `accountId` or `query` is specified. + */ + property: z.string().optional(), +}); + +export type FindUsersParameters = z.infer; diff --git a/src/version2/parameters/findUsersWithAllPermissions.ts b/src/version2/parameters/findUsersWithAllPermissions.ts deleted file mode 100644 index decc173245..0000000000 --- a/src/version2/parameters/findUsersWithAllPermissions.ts +++ /dev/null @@ -1,38 +0,0 @@ -export interface FindUsersWithAllPermissions { - /** - * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant - * users. The string can match the prefix of the attribute's value. For example, _query=john_ matches a user with a - * `displayName` of _John Smith_ and a user with an `emailAddress` of _johnson@example.com_. Required, unless - * `accountId` is specified. - */ - query?: 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. - */ - username?: string; - /** A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. */ - accountId?: string; - /** - * A comma separated list of permissions. Permissions can be specified as any: - * - * Permission returned by [Get all permissions](#api-rest-api-2-permissions-get). custom project permission added by - * Connect apps. (deprecated) one of the following: - * - * ASSIGNABLE_USER ASSIGN_ISSUE ATTACHMENT_DELETE_ALL ATTACHMENT_DELETE_OWN BROWSE CLOSE_ISSUE COMMENT_DELETE_ALL - * COMMENT_DELETE_OWN COMMENT_EDIT_ALL COMMENT_EDIT_OWN COMMENT_ISSUE CREATE_ATTACHMENT CREATE_ISSUE DELETE_ISSUE - * EDIT_ISSUE LINK_ISSUE MANAGE_WATCHER_LIST MODIFY_REPORTER MOVE_ISSUE PROJECT_ADMIN RESOLVE_ISSUE SCHEDULE_ISSUE - * SET_ISSUE_SECURITY TRANSITION_ISSUE VIEW_VERSION_CONTROL VIEW_VOTERS_AND_WATCHERS VIEW_WORKFLOW_READONLY - * WORKLOG_DELETE_ALL WORKLOG_DELETE_OWN WORKLOG_EDIT_ALL WORKLOG_EDIT_OWN WORK_ISSUE - */ - permissions: string; - /** The issue key for the issue. */ - issueKey?: string; - /** The project key for the project (case sensitive). */ - projectKey?: 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/findUsersWithAllPermissionsParameters.ts b/src/version2/parameters/findUsersWithAllPermissionsParameters.ts new file mode 100644 index 0000000000..184a55b599 --- /dev/null +++ b/src/version2/parameters/findUsersWithAllPermissionsParameters.ts @@ -0,0 +1,70 @@ +import { z } from 'zod'; + +export const FindUsersWithAllPermissionsParametersSchema = z.object({ + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant + * users. The string can match the prefix of the attribute's value. For example, _query=john_ matches a user with a + * `displayName` of _John Smith_ and a user with an `emailAddress` of _johnson@example.com_. Required, unless + * `accountId` is specified. + */ + query: z.string().optional(), + /** + * 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: z.string().optional(), + /** A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. */ + accountId: z.string().optional(), + /** + * A comma separated list of permissions. Permissions can be specified as any: + * + * - Permission returned by [Get all permissions](#api-rest-api-2-permissions-get). + * - Custom project permission added by Connect apps. + * - (deprecated) one of the following: + * + * - ASSIGNABLE_USER + * - ASSIGN_ISSUE + * - ATTACHMENT_DELETE_ALL + * - ATTACHMENT_DELETE_OWN + * - BROWSE + * - CLOSE_ISSUE + * - COMMENT_DELETE_ALL + * - COMMENT_DELETE_OWN + * - COMMENT_EDIT_ALL + * - COMMENT_EDIT_OWN + * - COMMENT_ISSUE + * - CREATE_ATTACHMENT + * - CREATE_ISSUE + * - DELETE_ISSUE + * - EDIT_ISSUE + * - LINK_ISSUE + * - MANAGE_WATCHER_LIST + * - MODIFY_REPORTER + * - MOVE_ISSUE + * - PROJECT_ADMIN + * - RESOLVE_ISSUE + * - SCHEDULE_ISSUE + * - SET_ISSUE_SECURITY + * - TRANSITION_ISSUE + * - VIEW_VERSION_CONTROL + * - VIEW_VOTERS_AND_WATCHERS + * - VIEW_WORKFLOW_READONLY + * - WORKLOG_DELETE_ALL + * - WORKLOG_DELETE_OWN + * - WORKLOG_EDIT_ALL + * - WORKLOG_EDIT_OWN + * - WORK_ISSUE + */ + permissions: z.string(), + /** The issue key for the issue. */ + issueKey: z.string().optional(), + /** The project key for the project (case sensitive). */ + projectKey: z.string().optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type FindUsersWithAllPermissionsParameters = z.infer; diff --git a/src/version2/parameters/findUsersWithBrowsePermission.ts b/src/version2/parameters/findUsersWithBrowsePermission.ts deleted file mode 100644 index d085f18c2a..0000000000 --- a/src/version2/parameters/findUsersWithBrowsePermission.ts +++ /dev/null @@ -1,25 +0,0 @@ -export interface FindUsersWithBrowsePermission { - /** - * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant - * users. The string can match the prefix of the attribute's value. For example, _query=john_ matches a user with a - * `displayName` of _John Smith_ and a user with an `emailAddress` of _johnson@example.com_. Required, unless - * `accountId` is specified. - */ - query?: 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. - */ - username?: string; - /** A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. */ - accountId?: string; - /** The issue key for the issue. Required, unless `projectKey` is specified. */ - issueKey?: string; - /** The project key for the project (case sensitive). Required, unless `issueKey` is specified. */ - projectKey?: 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/findUsersWithBrowsePermissionParameters.ts b/src/version2/parameters/findUsersWithBrowsePermissionParameters.ts new file mode 100644 index 0000000000..3b11446f9c --- /dev/null +++ b/src/version2/parameters/findUsersWithBrowsePermissionParameters.ts @@ -0,0 +1,29 @@ +import { z } from 'zod'; + +export const FindUsersWithBrowsePermissionParametersSchema = z.object({ + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant + * users. The string can match the prefix of the attribute's value. For example, _query=john_ matches a user with a + * `displayName` of _John Smith_ and a user with an `emailAddress` of _johnson@example.com_. Required, unless + * `accountId` is specified. + */ + query: z.string().optional(), + /** + * 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: z.string().optional(), + /** A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. */ + accountId: z.string().optional(), + /** The issue key for the issue. Required, unless `projectKey` is specified. */ + issueKey: z.string().optional(), + /** The project key for the project (case sensitive). Required, unless `issueKey` is specified. */ + projectKey: z.string().optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type FindUsersWithBrowsePermissionParameters = z.infer; diff --git a/src/version2/parameters/fullyUpdateProjectRole.ts b/src/version2/parameters/fullyUpdateProjectRole.ts deleted file mode 100644 index 9aa8248e35..0000000000 --- a/src/version2/parameters/fullyUpdateProjectRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { CreateUpdateRoleRequest } from '../models'; - -export interface FullyUpdateProjectRole extends CreateUpdateRoleRequest { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version2/parameters/fullyUpdateProjectRoleParameters.ts b/src/version2/parameters/fullyUpdateProjectRoleParameters.ts new file mode 100644 index 0000000000..d045b4cc7c --- /dev/null +++ b/src/version2/parameters/fullyUpdateProjectRoleParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const FullyUpdateProjectRoleParametersSchema = z.object({ + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: z.number().int(), + /** + * A description of the project role. Required when fully updating a project role. Optional when creating or partially + * updating a project role. + */ + description: z.string().optional(), + /** + * The name of the project role. Must be unique. Cannot begin or end with whitespace. The maximum length is 255 + * characters. Required when creating a project role. Optional when partially updating a project role. + */ + name: z.string().optional(), +}); + +export type FullyUpdateProjectRoleParameters = z.infer; diff --git a/src/version2/parameters/getAccessibleProjectTypeByKey.ts b/src/version2/parameters/getAccessibleProjectTypeByKey.ts deleted file mode 100644 index b0b2a0c8bb..0000000000 --- a/src/version2/parameters/getAccessibleProjectTypeByKey.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetAccessibleProjectTypeByKey { - /** The key of the project type. */ - projectTypeKey: 'software' | 'service_desk' | 'business' | 'product_discovery' | string; -} diff --git a/src/version2/parameters/getAccessibleProjectTypeByKeyParameters.ts b/src/version2/parameters/getAccessibleProjectTypeByKeyParameters.ts new file mode 100644 index 0000000000..2ac2ed2b7e --- /dev/null +++ b/src/version2/parameters/getAccessibleProjectTypeByKeyParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetAccessibleProjectTypeByKeyParametersSchema = z.object({ + /** The key of the project type. */ + projectTypeKey: z.enum(['software', 'service_desk', 'business', 'product_discovery']), +}); + +export type GetAccessibleProjectTypeByKeyParameters = z.infer; diff --git a/src/version2/parameters/getAddonProperties.ts b/src/version2/parameters/getAddonProperties.ts deleted file mode 100644 index 438a2a3add..0000000000 --- a/src/version2/parameters/getAddonProperties.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetAddonProperties { - /** The key of the app, as defined in its descriptor. */ - addonKey: string; -} diff --git a/src/version2/parameters/getAddonPropertiesParameters.ts b/src/version2/parameters/getAddonPropertiesParameters.ts new file mode 100644 index 0000000000..3cf70bcfb3 --- /dev/null +++ b/src/version2/parameters/getAddonPropertiesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetAddonPropertiesParametersSchema = z.object({ + /** The key of the app, as defined in its descriptor. */ + addonKey: z.string(), +}); + +export type GetAddonPropertiesParameters = z.infer; diff --git a/src/version2/parameters/getAddonProperty.ts b/src/version2/parameters/getAddonProperty.ts deleted file mode 100644 index 93f5f2397f..0000000000 --- a/src/version2/parameters/getAddonProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetAddonProperty { - /** The key of the app, as defined in its descriptor. */ - addonKey: string; - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/getAddonPropertyParameters.ts b/src/version2/parameters/getAddonPropertyParameters.ts new file mode 100644 index 0000000000..8965d5c3e8 --- /dev/null +++ b/src/version2/parameters/getAddonPropertyParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetAddonPropertyParametersSchema = z.object({ + /** The key of the app, as defined in its descriptor. */ + addonKey: z.string(), + /** The key of the property. */ + propertyKey: z.string(), +}); + +export type GetAddonPropertyParameters = z.infer; diff --git a/src/version2/parameters/getAdvancedSettingsParameters.ts b/src/version2/parameters/getAdvancedSettingsParameters.ts new file mode 100644 index 0000000000..74bfa71c14 --- /dev/null +++ b/src/version2/parameters/getAdvancedSettingsParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetAdvancedSettingsParametersSchema = z.object({}); + +export type GetAdvancedSettingsParameters = z.infer; diff --git a/src/version2/parameters/getAllAccessibleProjectTypesParameters.ts b/src/version2/parameters/getAllAccessibleProjectTypesParameters.ts new file mode 100644 index 0000000000..8fc468d5f0 --- /dev/null +++ b/src/version2/parameters/getAllAccessibleProjectTypesParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetAllAccessibleProjectTypesParametersSchema = z.object({}); + +export type GetAllAccessibleProjectTypesParameters = z.infer; diff --git a/src/version2/parameters/getAllApplicationRolesParameters.ts b/src/version2/parameters/getAllApplicationRolesParameters.ts new file mode 100644 index 0000000000..18bd794191 --- /dev/null +++ b/src/version2/parameters/getAllApplicationRolesParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetAllApplicationRolesParametersSchema = z.object({}); + +export type GetAllApplicationRolesParameters = z.infer; diff --git a/src/version2/parameters/getAllAvailableDashboardGadgetsParameters.ts b/src/version2/parameters/getAllAvailableDashboardGadgetsParameters.ts new file mode 100644 index 0000000000..06cb18b5e0 --- /dev/null +++ b/src/version2/parameters/getAllAvailableDashboardGadgetsParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetAllAvailableDashboardGadgetsParametersSchema = z.object({}); + +export type GetAllAvailableDashboardGadgetsParameters = z.infer; diff --git a/src/version2/parameters/getAllDashboards.ts b/src/version2/parameters/getAllDashboards.ts deleted file mode 100644 index 00cdb506bc..0000000000 --- a/src/version2/parameters/getAllDashboards.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface GetAllDashboards { - /** - * The filter applied to the list of dashboards. Valid values are: - * - * - `favourite` Returns dashboards the user has marked as favorite. - * - `my` Returns dashboards owned by the user. - */ - filter?: 'my' | 'favourite' | 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/getAllDashboardsParameters.ts b/src/version2/parameters/getAllDashboardsParameters.ts new file mode 100644 index 0000000000..636267a775 --- /dev/null +++ b/src/version2/parameters/getAllDashboardsParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const GetAllDashboardsParametersSchema = z.object({ + /** + * The filter applied to the list of dashboards. Valid values are: + * + * - `favourite` Returns dashboards the user has marked as favorite. + * - `my` Returns dashboards owned by the user. + */ + filter: z.enum(['my', 'favourite']).optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetAllDashboardsParameters = z.infer; diff --git a/src/version2/parameters/getAllFieldConfigurationSchemes.ts b/src/version2/parameters/getAllFieldConfigurationSchemes.ts deleted file mode 100644 index 3a9ae21dff..0000000000 --- a/src/version2/parameters/getAllFieldConfigurationSchemes.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface GetAllFieldConfigurationSchemes { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of field configuration scheme IDs. To include multiple IDs, provide an ampersand-separated list. For - * example, `id=10000&id=10001`. - */ - id?: number[]; -} diff --git a/src/version2/parameters/getAllFieldConfigurationSchemesParameters.ts b/src/version2/parameters/getAllFieldConfigurationSchemesParameters.ts new file mode 100644 index 0000000000..41b784e067 --- /dev/null +++ b/src/version2/parameters/getAllFieldConfigurationSchemesParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const GetAllFieldConfigurationSchemesParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of field configuration scheme IDs. To include multiple IDs, provide an ampersand-separated list. For + * example, `id=10000&id=10001`. + */ + id: z.array(z.number().int()).optional(), +}); + +export type GetAllFieldConfigurationSchemesParameters = z.infer; diff --git a/src/version2/parameters/getAllFieldConfigurations.ts b/src/version2/parameters/getAllFieldConfigurations.ts deleted file mode 100644 index ebbfb319ef..0000000000 --- a/src/version2/parameters/getAllFieldConfigurations.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface GetAllFieldConfigurations { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of field configuration IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * `id=10000&id=10001`. - */ - id?: number[]; - /** If _true_ returns default field configurations only. */ - isDefault?: boolean; - /** The query string used to match against field configuration names and descriptions. */ - query?: string; -} diff --git a/src/version2/parameters/getAllFieldConfigurationsParameters.ts b/src/version2/parameters/getAllFieldConfigurationsParameters.ts new file mode 100644 index 0000000000..5c24edf3c9 --- /dev/null +++ b/src/version2/parameters/getAllFieldConfigurationsParameters.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +export const GetAllFieldConfigurationsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of field configuration IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `id=10000&id=10001`. + */ + id: z.array(z.number().int()).optional(), + /** If _true_ returns default field configurations only. */ + isDefault: z.boolean().optional(), + /** The query string used to match against field configuration names and descriptions. */ + query: z.string().optional(), +}); + +export type GetAllFieldConfigurationsParameters = z.infer; diff --git a/src/version2/parameters/getAllGadgets.ts b/src/version2/parameters/getAllGadgets.ts deleted file mode 100644 index cdfbf0a2b6..0000000000 --- a/src/version2/parameters/getAllGadgets.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface GetAllGadgets { - /** The ID of the dashboard. */ - dashboardId: number; - /** - * The list of gadgets module keys. To include multiple module keys, separate module keys with ampersand: - * `moduleKey=key:one&moduleKey=key:two`. - */ - moduleKey?: string[]; - /** - * The list of gadgets URIs. To include multiple URIs, separate URIs with ampersand: - * `uri=/rest/example/uri/1&uri=/rest/example/uri/2`. - */ - uri?: string[]; - /** The list of gadgets IDs. To include multiple IDs, separate IDs with ampersand: `gadgetId=10000&gadgetId=10001`. */ - gadgetId?: number[]; -} diff --git a/src/version2/parameters/getAllGadgetsParameters.ts b/src/version2/parameters/getAllGadgetsParameters.ts new file mode 100644 index 0000000000..caa0ec4e30 --- /dev/null +++ b/src/version2/parameters/getAllGadgetsParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const GetAllGadgetsParametersSchema = z.object({ + /** The ID of the dashboard. */ + dashboardId: z.number().int(), + /** + * The list of gadgets module keys. To include multiple module keys, separate module keys with ampersand: + * `moduleKey=key:one&moduleKey=key:two`. + */ + moduleKey: z.array(z.string()).optional(), + /** + * The list of gadgets URIs. To include multiple URIs, separate URIs with ampersand: + * `uri=/rest/example/uri/1&uri=/rest/example/uri/2`. + */ + uri: z.array(z.string()).optional(), + /** The list of gadgets IDs. To include multiple IDs, separate IDs with ampersand: `gadgetId=10000&gadgetId=10001`. */ + gadgetId: z.array(z.number().int()).optional(), +}); + +export type GetAllGadgetsParameters = z.infer; diff --git a/src/version2/parameters/getAllIssueFieldOptions.ts b/src/version2/parameters/getAllIssueFieldOptions.ts deleted file mode 100644 index c9e88d33c3..0000000000 --- a/src/version2/parameters/getAllIssueFieldOptions.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface GetAllIssueFieldOptions { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; -} diff --git a/src/version2/parameters/getAllIssueFieldOptionsParameters.ts b/src/version2/parameters/getAllIssueFieldOptionsParameters.ts new file mode 100644 index 0000000000..b49c7dcd68 --- /dev/null +++ b/src/version2/parameters/getAllIssueFieldOptionsParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const GetAllIssueFieldOptionsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * - Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. + * - Run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For example, + * `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: z.string(), +}); + +export type GetAllIssueFieldOptionsParameters = z.infer; diff --git a/src/version2/parameters/getAllIssueTypeSchemes.ts b/src/version2/parameters/getAllIssueTypeSchemes.ts deleted file mode 100644 index 9c030524e2..0000000000 --- a/src/version2/parameters/getAllIssueTypeSchemes.ts +++ /dev/null @@ -1,29 +0,0 @@ -export interface GetAllIssueTypeSchemes { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of issue type schemes IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * `id=10000&id=10001`. - */ - id?: number[]; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: - * - * - `name` Sorts by issue type scheme name. - * - `id` Sorts by issue type scheme ID. - */ - orderBy?: 'name' | '-name' | '+name' | 'id' | '-id' | '+id' | 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: - * - * - `projects` For each issue type schemes, returns information about the projects the issue type scheme is assigned - * to. - * - `issueTypes` For each issue type schemes, returns information about the issueTypes the issue type scheme have. - */ - expand?: 'projects' | 'issueTypes' | ('projects' | 'issueTypes')[] | string | string[]; - /** String used to perform a case-insensitive partial match with issue type scheme name. */ - queryString?: string; -} diff --git a/src/version2/parameters/getAllIssueTypeSchemesParameters.ts b/src/version2/parameters/getAllIssueTypeSchemesParameters.ts new file mode 100644 index 0000000000..ef77d78aca --- /dev/null +++ b/src/version2/parameters/getAllIssueTypeSchemesParameters.ts @@ -0,0 +1,33 @@ +import { z } from 'zod'; + +export const GetAllIssueTypeSchemesParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of issue type schemes IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `id=10000&id=10001`. + */ + id: z.array(z.number().int()).optional(), + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `name` Sorts by issue type scheme name. + * - `id` Sorts by issue type scheme ID. + */ + orderBy: z.enum(['name', '-name', '+name', 'id', '-id', '+id']).optional(), + /** + * 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: + * + * - `projects` For each issue type schemes, returns information about the projects the issue type scheme is assigned + * to. + * - `issueTypes` For each issue type schemes, returns information about the issueTypes the issue type scheme have. + */ + expand: z.string().optional(), + /** String used to perform a case-insensitive partial match with issue type scheme name. */ + queryString: z.string().optional(), +}); + +export type GetAllIssueTypeSchemesParameters = z.infer; diff --git a/src/version2/parameters/getAllLabels.ts b/src/version2/parameters/getAllLabels.ts deleted file mode 100644 index 6eccb91453..0000000000 --- a/src/version2/parameters/getAllLabels.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetAllLabels { - /** 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/getAllLabelsParameters.ts b/src/version2/parameters/getAllLabelsParameters.ts new file mode 100644 index 0000000000..bef08d7c20 --- /dev/null +++ b/src/version2/parameters/getAllLabelsParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetAllLabelsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetAllLabelsParameters = z.infer; diff --git a/src/version2/parameters/getAllPermissionSchemes.ts b/src/version2/parameters/getAllPermissionSchemes.ts deleted file mode 100644 index 011053c4f6..0000000000 --- a/src/version2/parameters/getAllPermissionSchemes.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface GetAllPermissionSchemes { - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are included when you specify any value. Expand options include: - * - * - `all` Returns all expandable information. - * - `field` Returns information about the custom field granted the permission. - * - `group` Returns information about the group that is granted the permission. - * - `permissions` Returns all permission grants for each permission scheme. - * - `projectRole` Returns information about the project role granted the permission. - * - `user` Returns information about the user who is granted the permission. - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'permissions' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] - | string - | string[]; -} diff --git a/src/version2/parameters/getAllPermissionSchemesParameters.ts b/src/version2/parameters/getAllPermissionSchemesParameters.ts new file mode 100644 index 0000000000..2cd074f704 --- /dev/null +++ b/src/version2/parameters/getAllPermissionSchemesParameters.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +export const GetAllPermissionSchemesParametersSchema = z.object({ + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are included when you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand: z.string().optional(), +}); + +export type GetAllPermissionSchemesParameters = z.infer; diff --git a/src/version2/parameters/getAllPermissionsParameters.ts b/src/version2/parameters/getAllPermissionsParameters.ts new file mode 100644 index 0000000000..6ebe9a34b0 --- /dev/null +++ b/src/version2/parameters/getAllPermissionsParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetAllPermissionsParametersSchema = z.object({}); + +export type GetAllPermissionsParameters = z.infer; diff --git a/src/version2/parameters/getAllProjectAvatars.ts b/src/version2/parameters/getAllProjectAvatars.ts deleted file mode 100644 index ed47d2ffff..0000000000 --- a/src/version2/parameters/getAllProjectAvatars.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetAllProjectAvatars { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string | number; -} diff --git a/src/version2/parameters/getAllProjectAvatarsParameters.ts b/src/version2/parameters/getAllProjectAvatarsParameters.ts new file mode 100644 index 0000000000..623caa9f99 --- /dev/null +++ b/src/version2/parameters/getAllProjectAvatarsParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetAllProjectAvatarsParametersSchema = z.object({ + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: z.string(), +}); + +export type GetAllProjectAvatarsParameters = z.infer; diff --git a/src/version2/parameters/getAllProjectCategoriesParameters.ts b/src/version2/parameters/getAllProjectCategoriesParameters.ts new file mode 100644 index 0000000000..91aa9d437f --- /dev/null +++ b/src/version2/parameters/getAllProjectCategoriesParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetAllProjectCategoriesParametersSchema = z.object({}); + +export type GetAllProjectCategoriesParameters = z.infer; diff --git a/src/version2/parameters/getAllProjectRolesParameters.ts b/src/version2/parameters/getAllProjectRolesParameters.ts new file mode 100644 index 0000000000..37830a2acc --- /dev/null +++ b/src/version2/parameters/getAllProjectRolesParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetAllProjectRolesParametersSchema = z.object({}); + +export type GetAllProjectRolesParameters = z.infer; diff --git a/src/version2/parameters/getAllProjectTypesParameters.ts b/src/version2/parameters/getAllProjectTypesParameters.ts new file mode 100644 index 0000000000..e94607e069 --- /dev/null +++ b/src/version2/parameters/getAllProjectTypesParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetAllProjectTypesParametersSchema = z.object({}); + +export type GetAllProjectTypesParameters = z.infer; diff --git a/src/version2/parameters/getAllScreenTabFields.ts b/src/version2/parameters/getAllScreenTabFields.ts deleted file mode 100644 index 102c3ceca2..0000000000 --- a/src/version2/parameters/getAllScreenTabFields.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface GetAllScreenTabFields { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; - /** The key of the project. */ - projectKey?: string; -} diff --git a/src/version2/parameters/getAllScreenTabFieldsParameters.ts b/src/version2/parameters/getAllScreenTabFieldsParameters.ts new file mode 100644 index 0000000000..024d570996 --- /dev/null +++ b/src/version2/parameters/getAllScreenTabFieldsParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetAllScreenTabFieldsParametersSchema = z.object({ + /** The ID of the screen. */ + screenId: z.number().int(), + /** The ID of the screen tab. */ + tabId: z.number().int(), + /** The key of the project. */ + projectKey: z.string().optional(), +}); + +export type GetAllScreenTabFieldsParameters = z.infer; diff --git a/src/version2/parameters/getAllScreenTabs.ts b/src/version2/parameters/getAllScreenTabs.ts deleted file mode 100644 index 992c77a6f1..0000000000 --- a/src/version2/parameters/getAllScreenTabs.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetAllScreenTabs { - /** The ID of the screen. */ - screenId: number; - /** The key of the project. */ - projectKey?: string; -} diff --git a/src/version2/parameters/getAllScreenTabsParameters.ts b/src/version2/parameters/getAllScreenTabsParameters.ts new file mode 100644 index 0000000000..c05d860f42 --- /dev/null +++ b/src/version2/parameters/getAllScreenTabsParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetAllScreenTabsParametersSchema = z.object({ + /** The ID of the screen. */ + screenId: z.number().int(), + /** The key of the project. */ + projectKey: z.string().optional(), +}); + +export type GetAllScreenTabsParameters = z.infer; diff --git a/src/version2/parameters/getAllStatuses.ts b/src/version2/parameters/getAllStatuses.ts deleted file mode 100644 index c10d765625..0000000000 --- a/src/version2/parameters/getAllStatuses.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetAllStatuses { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; -} diff --git a/src/version2/parameters/getAllStatusesParameters.ts b/src/version2/parameters/getAllStatusesParameters.ts new file mode 100644 index 0000000000..cc3a41bac8 --- /dev/null +++ b/src/version2/parameters/getAllStatusesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetAllStatusesParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), +}); + +export type GetAllStatusesParameters = z.infer; diff --git a/src/version2/parameters/getAllSystemAvatars.ts b/src/version2/parameters/getAllSystemAvatars.ts deleted file mode 100644 index c1d371e2df..0000000000 --- a/src/version2/parameters/getAllSystemAvatars.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetAllSystemAvatars { - /** The avatar type. */ - type: 'issuetype' | 'project' | 'user' | string; -} diff --git a/src/version2/parameters/getAllSystemAvatarsParameters.ts b/src/version2/parameters/getAllSystemAvatarsParameters.ts new file mode 100644 index 0000000000..a29e17773e --- /dev/null +++ b/src/version2/parameters/getAllSystemAvatarsParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetAllSystemAvatarsParametersSchema = z.object({ + /** The avatar type. */ + type: z.enum(['issuetype', 'project', 'user', 'priority']), +}); + +export type GetAllSystemAvatarsParameters = z.infer; diff --git a/src/version2/parameters/getAllUserDataClassificationLevels.ts b/src/version2/parameters/getAllUserDataClassificationLevels.ts deleted file mode 100644 index eb477fbdde..0000000000 --- a/src/version2/parameters/getAllUserDataClassificationLevels.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/getAllUserDataClassificationLevelsParameters.ts b/src/version2/parameters/getAllUserDataClassificationLevelsParameters.ts new file mode 100644 index 0000000000..f2070dd832 --- /dev/null +++ b/src/version2/parameters/getAllUserDataClassificationLevelsParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetAllUserDataClassificationLevelsParametersSchema = z.object({ + /** Optional set of statuses to filter by. */ + status: z.array(z.enum(['PUBLISHED', 'ARCHIVED', 'DRAFT'])).optional(), + /** Ordering of the results by a given field. If not provided, values will not be sorted. */ + orderBy: z.enum(['rank', '-rank', '+rank']).optional(), +}); + +export type GetAllUserDataClassificationLevelsParameters = z.infer< + typeof GetAllUserDataClassificationLevelsParametersSchema +>; diff --git a/src/version2/parameters/getAllUsers.ts b/src/version2/parameters/getAllUsers.ts deleted file mode 100644 index ac53e3ba0c..0000000000 --- a/src/version2/parameters/getAllUsers.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetAllUsers { - /** The index of the first item to return. */ - startAt?: number; - /** The maximum number of items to return. */ - maxResults?: number; -} diff --git a/src/version2/parameters/getAllUsersDefault.ts b/src/version2/parameters/getAllUsersDefault.ts deleted file mode 100644 index e187b3d322..0000000000 --- a/src/version2/parameters/getAllUsersDefault.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetAllUsersDefault { - /** The index of the first item to return. */ - startAt?: number; - /** The maximum number of items to return. */ - maxResults?: number; -} diff --git a/src/version2/parameters/getAllUsersDefaultParameters.ts b/src/version2/parameters/getAllUsersDefaultParameters.ts new file mode 100644 index 0000000000..850d324fa5 --- /dev/null +++ b/src/version2/parameters/getAllUsersDefaultParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetAllUsersDefaultParametersSchema = z.object({ + /** The index of the first item to return. */ + startAt: z.number().int().optional(), + /** The maximum number of items to return (limited to 1000). */ + maxResults: z.number().int().optional(), +}); + +export type GetAllUsersDefaultParameters = z.infer; diff --git a/src/version2/parameters/getAllUsersParameters.ts b/src/version2/parameters/getAllUsersParameters.ts new file mode 100644 index 0000000000..ed07389908 --- /dev/null +++ b/src/version2/parameters/getAllUsersParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetAllUsersParametersSchema = z.object({ + /** The index of the first item to return. */ + startAt: z.number().int().optional(), + /** The maximum number of items to return (limited to 1000). */ + maxResults: z.number().int().optional(), +}); + +export type GetAllUsersParameters = z.infer; diff --git a/src/version2/parameters/getAllWorkflowSchemes.ts b/src/version2/parameters/getAllWorkflowSchemes.ts deleted file mode 100644 index 7caedc2472..0000000000 --- a/src/version2/parameters/getAllWorkflowSchemes.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetAllWorkflowSchemes { - /** 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/getAllWorkflowSchemesParameters.ts b/src/version2/parameters/getAllWorkflowSchemesParameters.ts new file mode 100644 index 0000000000..90c682a681 --- /dev/null +++ b/src/version2/parameters/getAllWorkflowSchemesParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetAllWorkflowSchemesParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetAllWorkflowSchemesParameters = z.infer; diff --git a/src/version2/parameters/getAlternativeIssueTypes.ts b/src/version2/parameters/getAlternativeIssueTypes.ts deleted file mode 100644 index 7e36b11a12..0000000000 --- a/src/version2/parameters/getAlternativeIssueTypes.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetAlternativeIssueTypes { - /** The ID of the issue type. */ - id: string; -} diff --git a/src/version2/parameters/getAlternativeIssueTypesParameters.ts b/src/version2/parameters/getAlternativeIssueTypesParameters.ts new file mode 100644 index 0000000000..f8958171c2 --- /dev/null +++ b/src/version2/parameters/getAlternativeIssueTypesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetAlternativeIssueTypesParametersSchema = z.object({ + /** The ID of the issue type. */ + id: z.string(), +}); + +export type GetAlternativeIssueTypesParameters = z.infer; diff --git a/src/version2/parameters/getApplicationProperty.ts b/src/version2/parameters/getApplicationProperty.ts deleted file mode 100644 index 8a0c79bfe9..0000000000 --- a/src/version2/parameters/getApplicationProperty.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface GetApplicationProperty { - /** The key of the application property. */ - key?: string; - /** The permission level of all items being returned in the list. */ - permissionLevel?: string; - /** - * When a `key` isn't provided, this filters the list of results by the application property `key` using a regular - * expression. For example, using `jira.lf.*` will return all application properties with keys that start with - * _jira.lf._. - */ - keyFilter?: string; -} diff --git a/src/version2/parameters/getApplicationPropertyParameters.ts b/src/version2/parameters/getApplicationPropertyParameters.ts new file mode 100644 index 0000000000..a659568633 --- /dev/null +++ b/src/version2/parameters/getApplicationPropertyParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const GetApplicationPropertyParametersSchema = z.object({ + /** The key of the application property. */ + key: z.string().optional(), + /** The permission level of all items being returned in the list. */ + permissionLevel: z.string().optional(), + /** + * When a `key` isn't provided, this filters the list of results by the application property `key` using a regular + * expression. For example, using `jira.lf.*` will return all application properties with keys that start with + * _jira.lf._. + */ + keyFilter: z.string().optional(), +}); + +export type GetApplicationPropertyParameters = z.infer; diff --git a/src/version2/parameters/getApplicationRole.ts b/src/version2/parameters/getApplicationRole.ts deleted file mode 100644 index afa71490b5..0000000000 --- a/src/version2/parameters/getApplicationRole.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface GetApplicationRole { - /** - * The key of the application role. Use the [Get all application roles](#api-rest-api-2-applicationrole-get) operation - * to get the key for each application role. - */ - key: string; -} diff --git a/src/version2/parameters/getApplicationRoleParameters.ts b/src/version2/parameters/getApplicationRoleParameters.ts new file mode 100644 index 0000000000..297b5bb16a --- /dev/null +++ b/src/version2/parameters/getApplicationRoleParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const GetApplicationRoleParametersSchema = z.object({ + /** + * The key of the application role. Use the [Get all application roles](#api-rest-api-2-applicationrole-get) operation + * to get the key for each application role. + */ + key: z.string(), +}); + +export type GetApplicationRoleParameters = z.infer; diff --git a/src/version2/parameters/getApproximateApplicationLicenseCountParameters.ts b/src/version2/parameters/getApproximateApplicationLicenseCountParameters.ts new file mode 100644 index 0000000000..cc3bf2d3a0 --- /dev/null +++ b/src/version2/parameters/getApproximateApplicationLicenseCountParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetApproximateApplicationLicenseCountParametersSchema = z.object({ + /** The ID of the application, represents a specific version of Jira. */ + applicationKey: z.enum(['jira-core', 'jira-product-discovery', 'jira-software', 'jira-servicedesk']), +}); + +export type GetApproximateApplicationLicenseCountParameters = z.infer< + typeof GetApproximateApplicationLicenseCountParametersSchema +>; diff --git a/src/version2/parameters/getApproximateLicenseCountParameters.ts b/src/version2/parameters/getApproximateLicenseCountParameters.ts new file mode 100644 index 0000000000..020c4fa628 --- /dev/null +++ b/src/version2/parameters/getApproximateLicenseCountParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetApproximateLicenseCountParametersSchema = z.object({}); + +export type GetApproximateLicenseCountParameters = z.infer; diff --git a/src/version2/parameters/getAssignedPermissionScheme.ts b/src/version2/parameters/getAssignedPermissionScheme.ts deleted file mode 100644 index 9e2ad9e8e5..0000000000 --- a/src/version2/parameters/getAssignedPermissionScheme.ts +++ /dev/null @@ -1,26 +0,0 @@ -export interface GetAssignedPermissionScheme { - /** The project ID or project key (case-sensitive). */ - projectKeyOrId: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Note that permissions are included when - * you specify any value. Expand options include: - * - * - `all` Returns all expandable information. - * - `field` Returns information about the custom field granted the permission. - * - `group` Returns information about the group that is granted the permission. - * - `permissions` Returns all permission grants for each permission scheme. - * - `projectRole` Returns information about the project role granted the permission. - * - `user` Returns information about the user who is granted the permission. - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'permissions' - | 'projectRole' - | 'user' - | ('field' | 'group' | 'permissions' | 'projectRole' | 'user')[] - | string - | string[]; -} diff --git a/src/version2/parameters/getAssignedPermissionSchemeParameters.ts b/src/version2/parameters/getAssignedPermissionSchemeParameters.ts new file mode 100644 index 0000000000..0c844c336e --- /dev/null +++ b/src/version2/parameters/getAssignedPermissionSchemeParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const GetAssignedPermissionSchemeParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectKeyOrId: z.string(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Note that permissions are included when + * you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand: z.string().optional(), +}); + +export type GetAssignedPermissionSchemeParameters = z.infer; diff --git a/src/version2/parameters/getAtlassianTeam.ts b/src/version2/parameters/getAtlassianTeam.ts deleted file mode 100644 index b3bc42a2b5..0000000000 --- a/src/version2/parameters/getAtlassianTeam.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetAtlassianTeam { - /** The ID of the plan. */ - planId: number; - /** The ID of the Atlassian team. */ - atlassianTeamId: string; -} diff --git a/src/version2/parameters/getAtlassianTeamParameters.ts b/src/version2/parameters/getAtlassianTeamParameters.ts new file mode 100644 index 0000000000..3187b00ad4 --- /dev/null +++ b/src/version2/parameters/getAtlassianTeamParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetAtlassianTeamParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), + /** The ID of the Atlassian team. */ + atlassianTeamId: z.string(), +}); + +export type GetAtlassianTeamParameters = z.infer; diff --git a/src/version2/parameters/getAttachment.ts b/src/version2/parameters/getAttachment.ts deleted file mode 100644 index ee854faa27..0000000000 --- a/src/version2/parameters/getAttachment.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetAttachment { - /** The ID of the attachment. */ - id: string; -} diff --git a/src/version2/parameters/getAttachmentContent.ts b/src/version2/parameters/getAttachmentContent.ts deleted file mode 100644 index c3a54c5f1b..0000000000 --- a/src/version2/parameters/getAttachmentContent.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface GetAttachmentContent { - /** The ID of the attachment. */ - id: string; - /** - * Whether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can - * set this to `false` to avoid making multiple requests to download the attachment. - */ - redirect?: boolean; -} diff --git a/src/version2/parameters/getAttachmentContentParameters.ts b/src/version2/parameters/getAttachmentContentParameters.ts new file mode 100644 index 0000000000..8f2b314c6b --- /dev/null +++ b/src/version2/parameters/getAttachmentContentParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const GetAttachmentContentParametersSchema = z.object({ + /** The ID of the attachment. */ + id: z.string(), + /** + * Whether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can + * set this to `false` to avoid making multiple requests to download the attachment. + */ + redirect: z.boolean().optional(), +}); + +export type GetAttachmentContentParameters = z.infer; diff --git a/src/version2/parameters/getAttachmentMetaParameters.ts b/src/version2/parameters/getAttachmentMetaParameters.ts new file mode 100644 index 0000000000..3a0d96d39d --- /dev/null +++ b/src/version2/parameters/getAttachmentMetaParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetAttachmentMetaParametersSchema = z.object({}); + +export type GetAttachmentMetaParameters = z.infer; diff --git a/src/version2/parameters/getAttachmentParameters.ts b/src/version2/parameters/getAttachmentParameters.ts new file mode 100644 index 0000000000..df181bcb82 --- /dev/null +++ b/src/version2/parameters/getAttachmentParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetAttachmentParametersSchema = z.object({ + /** The ID of the attachment. */ + id: z.string(), +}); + +export type GetAttachmentParameters = z.infer; diff --git a/src/version2/parameters/getAttachmentThumbnail.ts b/src/version2/parameters/getAttachmentThumbnail.ts deleted file mode 100644 index 3368e1b6b2..0000000000 --- a/src/version2/parameters/getAttachmentThumbnail.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface GetAttachmentThumbnail { - /** The ID of the attachment. */ - id: string; - /** - * Whether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can - * set this to `false` to avoid making multiple requests to download the attachment. - */ - redirect?: boolean; - /** Whether a default thumbnail is returned when the requested thumbnail is not found. */ - fallbackToDefault?: boolean; - /** The maximum width to scale the thumbnail to. */ - width?: number; - /** The maximum height to scale the thumbnail to. */ - height?: number; -} diff --git a/src/version2/parameters/getAttachmentThumbnailParameters.ts b/src/version2/parameters/getAttachmentThumbnailParameters.ts new file mode 100644 index 0000000000..b6c034c99f --- /dev/null +++ b/src/version2/parameters/getAttachmentThumbnailParameters.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +export const GetAttachmentThumbnailParametersSchema = z.object({ + /** The ID of the attachment. */ + id: z.string(), + /** + * Whether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can + * set this to `false` to avoid making multiple requests to download the attachment. + */ + redirect: z.boolean().optional(), + /** Whether a default thumbnail is returned when the requested thumbnail is not found. */ + fallbackToDefault: z.boolean().optional(), + /** The maximum width to scale the thumbnail to. */ + width: z.number().int().optional(), + /** The maximum height to scale the thumbnail to. */ + height: z.number().int().optional(), +}); + +export type GetAttachmentThumbnailParameters = z.infer; diff --git a/src/version2/parameters/getAuditRecords.ts b/src/version2/parameters/getAuditRecords.ts deleted file mode 100644 index 41c5bbc9ee..0000000000 --- a/src/version2/parameters/getAuditRecords.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface GetAuditRecords { - /** The number of records to skip before returning the first result. */ - offset?: number; - /** The maximum number of results to return. */ - limit?: number; - /** The strings to match with audit field content, space separated. */ - filter?: string; - /** - * The date and time on or after which returned audit records must have been created. If `to` is provided `from` must - * be before `to` or no audit records are returned. - */ - from?: string; - /** - * The date and time on or before which returned audit results must have been created. If `from` is provided `to` must - * be after `from` or no audit records are returned. - */ - to?: string; -} diff --git a/src/version2/parameters/getAuditRecordsParameters.ts b/src/version2/parameters/getAuditRecordsParameters.ts new file mode 100644 index 0000000000..4be6758138 --- /dev/null +++ b/src/version2/parameters/getAuditRecordsParameters.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; + +export const GetAuditRecordsParametersSchema = z.object({ + /** The number of records to skip before returning the first result. */ + offset: z.number().int().optional(), + /** The maximum number of results to return. */ + limit: z.number().int().optional(), + /** The strings to match with audit field content, space separated. */ + filter: z.string().optional(), + /** + * The date and time on or after which returned audit records must have been created. If `to` is provided `from` must + * be before `to` or no audit records are returned. + */ + from: z.string().optional(), + /** + * The date and time on or before which returned audit results must have been created. If `from` is provided `to` must + * be after `from` or no audit records are returned. + */ + to: z.string().optional(), +}); + +export type GetAuditRecordsParameters = z.infer; diff --git a/src/version2/parameters/getAutoCompleteParameters.ts b/src/version2/parameters/getAutoCompleteParameters.ts new file mode 100644 index 0000000000..c9fb1a752e --- /dev/null +++ b/src/version2/parameters/getAutoCompleteParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetAutoCompleteParametersSchema = z.object({}); + +export type GetAutoCompleteParameters = z.infer; diff --git a/src/version2/parameters/getAutoCompletePost.ts b/src/version2/parameters/getAutoCompletePost.ts deleted file mode 100644 index 4c3f3c0dc1..0000000000 --- a/src/version2/parameters/getAutoCompletePost.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SearchAutoComplete } from '../models'; - -export interface GetAutoCompletePost extends SearchAutoComplete {} diff --git a/src/version2/parameters/getAutoCompletePostParameters.ts b/src/version2/parameters/getAutoCompletePostParameters.ts new file mode 100644 index 0000000000..ad170ee7b6 --- /dev/null +++ b/src/version2/parameters/getAutoCompletePostParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetAutoCompletePostParametersSchema = z.object({ + /** Include collapsed fields for fields that have non-unique names. */ + includeCollapsedFields: z.boolean().optional(), + /** List of project IDs used to filter the visible field details returned. */ + projectIds: z.array(z.number().int()).optional(), +}); + +export type GetAutoCompletePostParameters = z.infer; diff --git a/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts b/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts deleted file mode 100644 index da7ba318f6..0000000000 --- a/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface GetAvailablePrioritiesByPriorityScheme { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** The string to query priorities on by name. */ - query?: string; - /** The priority scheme ID. */ - schemeId: string; - /** A list of priority IDs to exclude from the results. */ - exclude?: string[]; -} diff --git a/src/version2/parameters/getAvailablePrioritiesByPrioritySchemeParameters.ts b/src/version2/parameters/getAvailablePrioritiesByPrioritySchemeParameters.ts new file mode 100644 index 0000000000..eecc35c0e9 --- /dev/null +++ b/src/version2/parameters/getAvailablePrioritiesByPrioritySchemeParameters.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +export const GetAvailablePrioritiesByPrioritySchemeParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.string().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.string().optional(), + /** The string to query priorities on by name. */ + query: z.string().optional(), + /** The priority scheme ID. */ + schemeId: z.string(), + /** A list of priority IDs to exclude from the results. */ + exclude: z.array(z.string()).optional(), +}); + +export type GetAvailablePrioritiesByPrioritySchemeParameters = z.infer< + typeof GetAvailablePrioritiesByPrioritySchemeParametersSchema +>; diff --git a/src/version2/parameters/getAvailableScreenFields.ts b/src/version2/parameters/getAvailableScreenFields.ts deleted file mode 100644 index 49c945c44f..0000000000 --- a/src/version2/parameters/getAvailableScreenFields.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetAvailableScreenFields { - /** The ID of the screen. */ - screenId: number; -} diff --git a/src/version2/parameters/getAvailableScreenFieldsParameters.ts b/src/version2/parameters/getAvailableScreenFieldsParameters.ts new file mode 100644 index 0000000000..265b171356 --- /dev/null +++ b/src/version2/parameters/getAvailableScreenFieldsParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetAvailableScreenFieldsParametersSchema = z.object({ + /** The ID of the screen. */ + screenId: z.number().int(), +}); + +export type GetAvailableScreenFieldsParameters = z.infer; diff --git a/src/version2/parameters/getAvailableTimeTrackingImplementationsParameters.ts b/src/version2/parameters/getAvailableTimeTrackingImplementationsParameters.ts new file mode 100644 index 0000000000..4858447fe5 --- /dev/null +++ b/src/version2/parameters/getAvailableTimeTrackingImplementationsParameters.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const GetAvailableTimeTrackingImplementationsParametersSchema = z.object({}); + +export type GetAvailableTimeTrackingImplementationsParameters = z.infer< + typeof GetAvailableTimeTrackingImplementationsParametersSchema +>; diff --git a/src/version2/parameters/getAvatarImageByID.ts b/src/version2/parameters/getAvatarImageByID.ts deleted file mode 100644 index c8556f01dd..0000000000 --- a/src/version2/parameters/getAvatarImageByID.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface GetAvatarImageByID { - /** The icon type of the avatar. */ - type: 'issuetype' | 'project' | string; - /** The ID of the avatar. */ - id: number | string; - /** The size of the avatar image. If not provided the default size is returned. */ - size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | string; - /** The format to return the avatar image in. If not provided the original content format is returned. */ - format?: 'png' | 'svg' | string; -} diff --git a/src/version2/parameters/getAvatarImageByIDParameters.ts b/src/version2/parameters/getAvatarImageByIDParameters.ts new file mode 100644 index 0000000000..c146ba90e8 --- /dev/null +++ b/src/version2/parameters/getAvatarImageByIDParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetAvatarImageByIDParametersSchema = z.object({ + /** The icon type of the avatar. */ + type: z.enum(['issuetype', 'project', 'priority']), + /** The ID of the avatar. */ + id: z.number().int(), + /** The size of the avatar image. If not provided the default size is returned. */ + size: z.enum(['xsmall', 'small', 'medium', 'large', 'xlarge']).optional(), + /** The format to return the avatar image in. If not provided the original content format is returned. */ + format: z.enum(['png', 'svg']).optional(), +}); + +export type GetAvatarImageByIDParameters = z.infer; diff --git a/src/version2/parameters/getAvatarImageByOwner.ts b/src/version2/parameters/getAvatarImageByOwner.ts deleted file mode 100644 index 0726f004d3..0000000000 --- a/src/version2/parameters/getAvatarImageByOwner.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface GetAvatarImageByOwner { - /** The icon type of the avatar. */ - type: 'issuetype' | 'project' | string; - /** The ID of the project or issue type the avatar belongs to. */ - entityId: string; - /** The size of the avatar image. If not provided the default size is returned. */ - size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | string; - /** The format to return the avatar image in. If not provided the original content format is returned. */ - format?: 'png' | 'svg' | string; -} diff --git a/src/version2/parameters/getAvatarImageByOwnerParameters.ts b/src/version2/parameters/getAvatarImageByOwnerParameters.ts new file mode 100644 index 0000000000..450eedb617 --- /dev/null +++ b/src/version2/parameters/getAvatarImageByOwnerParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetAvatarImageByOwnerParametersSchema = z.object({ + /** The icon type of the avatar. */ + type: z.enum(['issuetype', 'project', 'priority']), + /** The ID of the project or issue type the avatar belongs to. */ + entityId: z.string(), + /** The size of the avatar image. If not provided the default size is returned. */ + size: z.enum(['xsmall', 'small', 'medium', 'large', 'xlarge']).optional(), + /** The format to return the avatar image in. If not provided the original content format is returned. */ + format: z.enum(['png', 'svg']).optional(), +}); + +export type GetAvatarImageByOwnerParameters = z.infer; diff --git a/src/version2/parameters/getAvatarImageByType.ts b/src/version2/parameters/getAvatarImageByType.ts deleted file mode 100644 index de3317275d..0000000000 --- a/src/version2/parameters/getAvatarImageByType.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface GetAvatarImageByType { - /** The icon type of the avatar. */ - type: 'issuetype' | 'project' | string; - /** The size of the avatar image. If not provided the default size is returned. */ - size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | string; - /** The format to return the avatar image in. If not provided the original content format is returned. */ - format?: 'png' | 'svg' | string; -} diff --git a/src/version2/parameters/getAvatarImageByTypeParameters.ts b/src/version2/parameters/getAvatarImageByTypeParameters.ts new file mode 100644 index 0000000000..e8efa4fc1d --- /dev/null +++ b/src/version2/parameters/getAvatarImageByTypeParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetAvatarImageByTypeParametersSchema = z.object({ + /** The icon type of the avatar. */ + type: z.enum(['issuetype', 'project', 'priority']), + /** The size of the avatar image. If not provided the default size is returned. */ + size: z.enum(['xsmall', 'small', 'medium', 'large', 'xlarge']).optional(), + /** The format to return the avatar image in. If not provided the original content format is returned. */ + format: z.enum(['png', 'svg']).optional(), +}); + +export type GetAvatarImageByTypeParameters = z.infer; diff --git a/src/version2/parameters/getAvatars.ts b/src/version2/parameters/getAvatars.ts deleted file mode 100644 index aa4d2b86be..0000000000 --- a/src/version2/parameters/getAvatars.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetAvatars { - /** The avatar type. */ - type: 'project' | 'issuetype' | string; - /** The ID of the item the avatar is associated with. */ - entityId: number | string; -} diff --git a/src/version2/parameters/getAvatarsParameters.ts b/src/version2/parameters/getAvatarsParameters.ts new file mode 100644 index 0000000000..26d2cba632 --- /dev/null +++ b/src/version2/parameters/getAvatarsParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetAvatarsParametersSchema = z.object({ + /** The avatar type. */ + type: z.enum(['project', 'issuetype', 'priority']), + /** The ID of the item the avatar is associated with. */ + entityId: z.string(), +}); + +export type GetAvatarsParameters = z.infer; diff --git a/src/version2/parameters/getBannerParameters.ts b/src/version2/parameters/getBannerParameters.ts new file mode 100644 index 0000000000..fc267865be --- /dev/null +++ b/src/version2/parameters/getBannerParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetBannerParametersSchema = z.object({}); + +export type GetBannerParameters = z.infer; diff --git a/src/version2/parameters/getBulkChangelogs.ts b/src/version2/parameters/getBulkChangelogs.ts deleted file mode 100644 index aff3a4b194..0000000000 --- a/src/version2/parameters/getBulkChangelogs.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { BulkChangelogRequest } from '../models'; - -export interface GetBulkChangelogs extends BulkChangelogRequest {} diff --git a/src/version2/parameters/getBulkChangelogsParameters.ts b/src/version2/parameters/getBulkChangelogsParameters.ts new file mode 100644 index 0000000000..dc3be65954 --- /dev/null +++ b/src/version2/parameters/getBulkChangelogsParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetBulkChangelogsParametersSchema = z.object({ + /** List of field IDs to filter changelogs */ + fieldIds: z.array(z.string()).optional(), + /** List of issue IDs/keys to fetch changelogs for */ + issueIdsOrKeys: z.array(z.string()), + /** The maximum number of items to return per page */ + maxResults: z.number().int().optional(), + /** The cursor for pagination */ + nextPageToken: z.string().optional(), +}); + +export type GetBulkChangelogsParameters = z.infer; diff --git a/src/version2/parameters/getBulkPermissions.ts b/src/version2/parameters/getBulkPermissions.ts deleted file mode 100644 index 1123223a1e..0000000000 --- a/src/version2/parameters/getBulkPermissions.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { BulkPermissionsRequest } from '../models'; - -export interface GetBulkPermissions extends BulkPermissionsRequest {} diff --git a/src/version2/parameters/getBulkPermissionsParameters.ts b/src/version2/parameters/getBulkPermissionsParameters.ts new file mode 100644 index 0000000000..6b0b89d652 --- /dev/null +++ b/src/version2/parameters/getBulkPermissionsParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { BulkProjectPermissionsSchema } from './bulkProjectPermissions'; + +export const GetBulkPermissionsParametersSchema = z.object({ + /** The account ID of a user. */ + accountId: z.string().optional(), + /** Global permissions to look up. */ + globalPermissions: z.array(z.string()).optional(), + /** Project permissions with associated projects and issues to look up. */ + projectPermissions: z.array(BulkProjectPermissionsSchema).optional(), +}); + +export type GetBulkPermissionsParameters = z.infer; diff --git a/src/version2/parameters/getBulkScreenTabs.ts b/src/version2/parameters/getBulkScreenTabs.ts deleted file mode 100644 index 6f8227f85a..0000000000 --- a/src/version2/parameters/getBulkScreenTabs.ts +++ /dev/null @@ -1,16 +0,0 @@ -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/getBulkScreenTabsParameters.ts b/src/version2/parameters/getBulkScreenTabsParameters.ts new file mode 100644 index 0000000000..98f6161959 --- /dev/null +++ b/src/version2/parameters/getBulkScreenTabsParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const GetBulkScreenTabsParametersSchema = z.object({ + /** + * The list of screen IDs. To include multiple screen IDs, provide an ampersand-separated list. For example, + * `screenId=10000&screenId=10001`. + */ + screenId: z.array(z.number().int()).optional(), + /** + * The list of tab IDs. To include multiple tab IDs, provide an ampersand-separated list. For example, + * `tabId=10000&tabId=10001`. + */ + tabId: z.array(z.number().int()).optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. The maximum number is 100, */ + maxResult: z.number().int().optional(), +}); + +export type GetBulkScreenTabsParameters = z.infer; diff --git a/src/version2/parameters/getChangeLogs.ts b/src/version2/parameters/getChangeLogs.ts deleted file mode 100644 index 0089e133a4..0000000000 --- a/src/version2/parameters/getChangeLogs.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface GetChangeLogs { - /** The ID or key of the issue. */ - issueIdOrKey: 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/getChangeLogsByIds.ts b/src/version2/parameters/getChangeLogsByIds.ts deleted file mode 100644 index b799d41f61..0000000000 --- a/src/version2/parameters/getChangeLogsByIds.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueChangelogIds } from '../models'; - -export interface GetChangeLogsByIds extends IssueChangelogIds { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/getChangeLogsByIdsParameters.ts b/src/version2/parameters/getChangeLogsByIdsParameters.ts new file mode 100644 index 0000000000..73374677ec --- /dev/null +++ b/src/version2/parameters/getChangeLogsByIdsParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetChangeLogsByIdsParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The list of changelog IDs. */ + changelogIds: z.array(z.number().int()), +}); + +export type GetChangeLogsByIdsParameters = z.infer; diff --git a/src/version2/parameters/getChangeLogsParameters.ts b/src/version2/parameters/getChangeLogsParameters.ts new file mode 100644 index 0000000000..bdd0ca85aa --- /dev/null +++ b/src/version2/parameters/getChangeLogsParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetChangeLogsParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetChangeLogsParameters = z.infer; diff --git a/src/version2/parameters/getColumns.ts b/src/version2/parameters/getColumns.ts deleted file mode 100644 index 93307e6887..0000000000 --- a/src/version2/parameters/getColumns.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetColumns { - /** The ID of the filter. */ - id: number; -} diff --git a/src/version2/parameters/getColumnsParameters.ts b/src/version2/parameters/getColumnsParameters.ts new file mode 100644 index 0000000000..ba8843a7ab --- /dev/null +++ b/src/version2/parameters/getColumnsParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetColumnsParametersSchema = z.object({ + /** The ID of the filter. */ + id: z.number().int(), +}); + +export type GetColumnsParameters = z.infer; diff --git a/src/version2/parameters/getComment.ts b/src/version2/parameters/getComment.ts deleted file mode 100644 index 854049ec0d..0000000000 --- a/src/version2/parameters/getComment.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface GetComment { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the comment. */ - id: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body - * rendered in HTML. - */ - expand?: string; -} diff --git a/src/version2/parameters/getCommentParameters.ts b/src/version2/parameters/getCommentParameters.ts new file mode 100644 index 0000000000..7174820693 --- /dev/null +++ b/src/version2/parameters/getCommentParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const GetCommentParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The ID of the comment. */ + id: z.string(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body + * rendered in HTML. + */ + expand: z.string().optional(), +}); + +export type GetCommentParameters = z.infer; diff --git a/src/version2/parameters/getCommentProperty.ts b/src/version2/parameters/getCommentProperty.ts deleted file mode 100644 index cad54a1fd0..0000000000 --- a/src/version2/parameters/getCommentProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetCommentProperty { - /** The ID of the comment. */ - commentId: string; - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/getCommentPropertyKeys.ts b/src/version2/parameters/getCommentPropertyKeys.ts deleted file mode 100644 index f243b07a0d..0000000000 --- a/src/version2/parameters/getCommentPropertyKeys.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetCommentPropertyKeys { - /** The ID of the comment. */ - commentId: string; -} diff --git a/src/version2/parameters/getCommentPropertyKeysParameters.ts b/src/version2/parameters/getCommentPropertyKeysParameters.ts new file mode 100644 index 0000000000..f75798deb3 --- /dev/null +++ b/src/version2/parameters/getCommentPropertyKeysParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetCommentPropertyKeysParametersSchema = z.object({ + /** The ID of the comment. */ + commentId: z.string(), +}); + +export type GetCommentPropertyKeysParameters = z.infer; diff --git a/src/version2/parameters/getCommentPropertyParameters.ts b/src/version2/parameters/getCommentPropertyParameters.ts new file mode 100644 index 0000000000..b203e760c1 --- /dev/null +++ b/src/version2/parameters/getCommentPropertyParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetCommentPropertyParametersSchema = z.object({ + /** The ID of the comment. */ + commentId: z.string(), + /** The key of the property. */ + propertyKey: z.string(), +}); + +export type GetCommentPropertyParameters = z.infer; diff --git a/src/version2/parameters/getComments.ts b/src/version2/parameters/getComments.ts deleted file mode 100644 index 5ddcbdec60..0000000000 --- a/src/version2/parameters/getComments.ts +++ /dev/null @@ -1,19 +0,0 @@ -export interface GetComments { - /** The ID or key of the issue. */ - issueIdOrKey: 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. - * Accepts _created_ to sort comments by their created date. - */ - orderBy?: 'created' | '-created' | '+created' | string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body - * rendered in HTML. - */ - expand?: string; -} diff --git a/src/version2/parameters/getCommentsByIds.ts b/src/version2/parameters/getCommentsByIds.ts deleted file mode 100644 index c53da487a9..0000000000 --- a/src/version2/parameters/getCommentsByIds.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { IssueCommentListRequest } from '../models'; - -export interface GetCommentsByIds extends IssueCommentListRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `renderedBody` Returns the comment body rendered in HTML. `properties` Returns the comment's properties. - */ - expand?: string; -} diff --git a/src/version2/parameters/getCommentsByIdsParameters.ts b/src/version2/parameters/getCommentsByIdsParameters.ts new file mode 100644 index 0000000000..ff9303973c --- /dev/null +++ b/src/version2/parameters/getCommentsByIdsParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const GetCommentsByIdsParametersSchema = z.object({ + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `renderedBody` Returns the comment body rendered in HTML. + * - `properties` Returns the comment's properties. + */ + expand: z.string().optional(), + /** The list of comment IDs. A maximum of 1000 IDs can be specified. */ + ids: z.array(z.number().int()), +}); + +export type GetCommentsByIdsParameters = z.infer; diff --git a/src/version2/parameters/getCommentsParameters.ts b/src/version2/parameters/getCommentsParameters.ts new file mode 100644 index 0000000000..5d45bc0b2e --- /dev/null +++ b/src/version2/parameters/getCommentsParameters.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const GetCommentsParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field. + * Accepts _created_ to sort comments by their created date. + */ + orderBy: z.enum(['created', '-created', '+created']).optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body + * rendered in HTML. + */ + expand: z.string().optional(), +}); + +export type GetCommentsParameters = z.infer; diff --git a/src/version2/parameters/getComponent.ts b/src/version2/parameters/getComponent.ts deleted file mode 100644 index a01db99a06..0000000000 --- a/src/version2/parameters/getComponent.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetComponent { - /** The ID of the component. */ - id: string; -} diff --git a/src/version2/parameters/getComponentParameters.ts b/src/version2/parameters/getComponentParameters.ts new file mode 100644 index 0000000000..bf5769b772 --- /dev/null +++ b/src/version2/parameters/getComponentParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetComponentParametersSchema = z.object({ + /** The ID of the component. */ + id: z.string(), +}); + +export type GetComponentParameters = z.infer; diff --git a/src/version2/parameters/getComponentRelatedIssues.ts b/src/version2/parameters/getComponentRelatedIssues.ts deleted file mode 100644 index 6c1b9ceedd..0000000000 --- a/src/version2/parameters/getComponentRelatedIssues.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetComponentRelatedIssues { - /** The ID of the component. */ - id: string; -} diff --git a/src/version2/parameters/getComponentRelatedIssuesParameters.ts b/src/version2/parameters/getComponentRelatedIssuesParameters.ts new file mode 100644 index 0000000000..15037a132a --- /dev/null +++ b/src/version2/parameters/getComponentRelatedIssuesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetComponentRelatedIssuesParametersSchema = z.object({ + /** The ID of the component. */ + id: z.string(), +}); + +export type GetComponentRelatedIssuesParameters = z.infer; diff --git a/src/version2/parameters/getConfigurationParameters.ts b/src/version2/parameters/getConfigurationParameters.ts new file mode 100644 index 0000000000..5c654302cb --- /dev/null +++ b/src/version2/parameters/getConfigurationParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetConfigurationParametersSchema = z.object({}); + +export type GetConfigurationParameters = z.infer; diff --git a/src/version2/parameters/getContextsForField.ts b/src/version2/parameters/getContextsForField.ts deleted file mode 100644 index caa0693b7e..0000000000 --- a/src/version2/parameters/getContextsForField.ts +++ /dev/null @@ -1,17 +0,0 @@ -export interface GetContextsForField { - /** The ID of the custom field. */ - fieldId: string; - /** Whether to return contexts that apply to all issue types. */ - isAnyIssueType?: boolean; - /** Whether to return contexts that apply to all projects. */ - isGlobalContext?: boolean; - /** - * The list of context IDs. To include multiple contexts, separate IDs with ampersand: - * `contextId=10000&contextId=10001`. - */ - contextId?: 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. */ - maxResults?: number; -} diff --git a/src/version2/parameters/getContextsForFieldParameters.ts b/src/version2/parameters/getContextsForFieldParameters.ts new file mode 100644 index 0000000000..7901d46d21 --- /dev/null +++ b/src/version2/parameters/getContextsForFieldParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const GetContextsForFieldParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** Whether to return contexts that apply to all issue types. */ + isAnyIssueType: z.boolean().optional(), + /** Whether to return contexts that apply to all projects. */ + isGlobalContext: z.boolean().optional(), + /** + * The list of context IDs. To include multiple contexts, separate IDs with ampersand: + * `contextId=10000&contextId=10001`. + */ + contextId: z.array(z.number().int()).optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetContextsForFieldParameters = z.infer; diff --git a/src/version2/parameters/getCreateIssueMeta.ts b/src/version2/parameters/getCreateIssueMeta.ts deleted file mode 100644 index 1529d649ed..0000000000 --- a/src/version2/parameters/getCreateIssueMeta.ts +++ /dev/null @@ -1,34 +0,0 @@ -export interface GetCreateIssueMeta { - /** - * List of project IDs. This parameter accepts a comma-separated list. Multiple project IDs can also be provided using - * an ampersand-separated list. For example, `projectIds=10000,10001&projectIds=10020,10021`. This parameter may be - * provided with `projectKeys`. - */ - projectIds?: string[]; - /** - * List of project keys. This parameter accepts a comma-separated list. Multiple project keys can also be provided - * using an ampersand-separated list. For example, `projectKeys=proj1,proj2&projectKeys=proj3`. This parameter may be - * provided with `projectIds`. - */ - projectKeys?: string[]; - /** - * List of issue type IDs. This parameter accepts a comma-separated list. Multiple issue type IDs can also be provided - * using an ampersand-separated list. For example, `issuetypeIds=10000,10001&issuetypeIds=10020,10021`. This parameter - * may be provided with `issuetypeNames`. - */ - issuetypeIds?: string[]; - /** - * List of issue type names. This parameter accepts a comma-separated list. Multiple issue type names can also be - * provided using an ampersand-separated list. For example, `issuetypeNames=name1,name2&issuetypeNames=name3`. This - * parameter may be provided with `issuetypeIds`. - */ - issuetypeNames?: string[]; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about issue metadata in the response. This parameter accepts `projects.issuetypes.fields`, which - * returns information about the fields in the issue creation screen for each issue type. Fields hidden from the - * screen are not returned. Use the information to populate the `fields` and `update` fields in [Create - * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). - */ - expand?: string; -} diff --git a/src/version2/parameters/getCreateIssueMetaIssueTypeId.ts b/src/version2/parameters/getCreateIssueMetaIssueTypeId.ts deleted file mode 100644 index 6195fc1f49..0000000000 --- a/src/version2/parameters/getCreateIssueMetaIssueTypeId.ts +++ /dev/null @@ -1,10 +0,0 @@ -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/getCreateIssueMetaIssueTypeIdParameters.ts b/src/version2/parameters/getCreateIssueMetaIssueTypeIdParameters.ts new file mode 100644 index 0000000000..95663351be --- /dev/null +++ b/src/version2/parameters/getCreateIssueMetaIssueTypeIdParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetCreateIssueMetaIssueTypeIdParametersSchema = z.object({ + /** The ID or key of the project. */ + projectIdOrKey: z.string(), + /** The issuetype ID. */ + issueTypeId: z.string(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetCreateIssueMetaIssueTypeIdParameters = z.infer; diff --git a/src/version2/parameters/getCreateIssueMetaIssueTypes.ts b/src/version2/parameters/getCreateIssueMetaIssueTypes.ts deleted file mode 100644 index dc20e141b5..0000000000 --- a/src/version2/parameters/getCreateIssueMetaIssueTypes.ts +++ /dev/null @@ -1,8 +0,0 @@ -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/getCreateIssueMetaIssueTypesParameters.ts b/src/version2/parameters/getCreateIssueMetaIssueTypesParameters.ts new file mode 100644 index 0000000000..ffc465f145 --- /dev/null +++ b/src/version2/parameters/getCreateIssueMetaIssueTypesParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetCreateIssueMetaIssueTypesParametersSchema = z.object({ + /** The ID or key of the project. */ + projectIdOrKey: z.string(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetCreateIssueMetaIssueTypesParameters = z.infer; diff --git a/src/version2/parameters/getCurrentUser.ts b/src/version2/parameters/getCurrentUser.ts deleted file mode 100644 index fd7e039e8c..0000000000 --- a/src/version2/parameters/getCurrentUser.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface GetCurrentUser { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about user in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `groups` Returns all groups, including nested groups, the user belongs to. - * - `applicationRoles` Returns the application roles the user is assigned to. - */ - expand?: 'groups' | 'applicationRoles' | ('groups' | 'applicationRoles')[] | string | string[]; -} diff --git a/src/version2/parameters/getCurrentUserParameters.ts b/src/version2/parameters/getCurrentUserParameters.ts new file mode 100644 index 0000000000..393164a5de --- /dev/null +++ b/src/version2/parameters/getCurrentUserParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetCurrentUserParametersSchema = z.object({ + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about user in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `groups` Returns all groups, including nested groups, the user belongs to. + * - `applicationRoles` Returns the application roles the user is assigned to. + */ + expand: z.string().optional(), +}); + +export type GetCurrentUserParameters = z.infer; diff --git a/src/version2/parameters/getCustomFieldConfiguration.ts b/src/version2/parameters/getCustomFieldConfiguration.ts deleted file mode 100644 index b6d4fdd269..0000000000 --- a/src/version2/parameters/getCustomFieldConfiguration.ts +++ /dev/null @@ -1,34 +0,0 @@ -export interface GetCustomFieldConfiguration { - /** The ID or key of the custom field, for example `customfield_10000`. */ - fieldIdOrKey: string; - /** - * 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/getCustomFieldConfigurationParameters.ts b/src/version2/parameters/getCustomFieldConfigurationParameters.ts new file mode 100644 index 0000000000..b24134cbce --- /dev/null +++ b/src/version2/parameters/getCustomFieldConfigurationParameters.ts @@ -0,0 +1,38 @@ +import { z } from 'zod'; + +export const GetCustomFieldConfigurationParametersSchema = z.object({ + /** The ID or key of the custom field, for example `customfield_10000`. */ + fieldIdOrKey: z.string(), + /** + * 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: z.array(z.number().int()).optional(), + /** + * 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: z.array(z.number().int()).optional(), + /** + * 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: z.number().int().optional(), + /** + * The ID or key of the project to filter results by. Must be provided with `issueTypeId`. Can't be provided with + * `issueId`. + */ + projectKeyOrId: z.string().optional(), + /** + * The ID of the issue type to filter results by. Must be provided with `projectKeyOrId`. Can't be provided with + * `issueId`. + */ + issueTypeId: z.string().optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetCustomFieldConfigurationParameters = z.infer; diff --git a/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts b/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts deleted file mode 100644 index 55ffb6dbfb..0000000000 --- a/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ProjectIssueTypeMappings } from '../models'; - -export interface GetCustomFieldContextsForProjectsAndIssueTypes extends ProjectIssueTypeMappings { - /** The ID of the custom field. */ - fieldId: string; - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; -} diff --git a/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypesParameters.ts b/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypesParameters.ts new file mode 100644 index 0000000000..bd0d370c9e --- /dev/null +++ b/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypesParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; +import { ProjectIssueTypeMappingSchema } from './projectIssueTypeMapping'; + +export const GetCustomFieldContextsForProjectsAndIssueTypesParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** The project and issue type mappings. */ + mappings: z.array(ProjectIssueTypeMappingSchema), +}); + +export type GetCustomFieldContextsForProjectsAndIssueTypesParameters = z.infer< + typeof GetCustomFieldContextsForProjectsAndIssueTypesParametersSchema +>; diff --git a/src/version2/parameters/getCustomFieldOption.ts b/src/version2/parameters/getCustomFieldOption.ts deleted file mode 100644 index eb4c0ed254..0000000000 --- a/src/version2/parameters/getCustomFieldOption.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetCustomFieldOption { - /** The ID of the custom field option. */ - id: string; -} diff --git a/src/version2/parameters/getCustomFieldOptionParameters.ts b/src/version2/parameters/getCustomFieldOptionParameters.ts new file mode 100644 index 0000000000..64d461c6e3 --- /dev/null +++ b/src/version2/parameters/getCustomFieldOptionParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetCustomFieldOptionParametersSchema = z.object({ + /** The ID of the custom field option. */ + id: z.string(), +}); + +export type GetCustomFieldOptionParameters = z.infer; diff --git a/src/version2/parameters/getCustomFieldsConfigurations.ts b/src/version2/parameters/getCustomFieldsConfigurations.ts deleted file mode 100644 index d1a753926b..0000000000 --- a/src/version2/parameters/getCustomFieldsConfigurations.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { 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/getCustomFieldsConfigurationsParameters.ts b/src/version2/parameters/getCustomFieldsConfigurationsParameters.ts new file mode 100644 index 0000000000..c5cc11a2cf --- /dev/null +++ b/src/version2/parameters/getCustomFieldsConfigurationsParameters.ts @@ -0,0 +1,38 @@ +import { z } from 'zod'; + +export const GetCustomFieldsConfigurationsParametersSchema = z.object({ + /** + * 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: z.array(z.number().int()).optional(), + /** + * 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: z.array(z.number().int()).optional(), + /** + * 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: z.number().int().optional(), + /** + * The ID or key of the project to filter results by. Must be provided with `issueTypeId`. Can't be provided with + * `issueId`. + */ + projectKeyOrId: z.string().optional(), + /** + * The ID of the issue type to filter results by. Must be provided with `projectKeyOrId`. Can't be provided with + * `issueId`. + */ + issueTypeId: z.string().optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** List of IDs or keys of the custom fields. It can be a mix of IDs and keys in the same query. */ + fieldIdsOrKeys: z.array(z.string()), +}); + +export type GetCustomFieldsConfigurationsParameters = z.infer; diff --git a/src/version2/parameters/getDashboard.ts b/src/version2/parameters/getDashboard.ts deleted file mode 100644 index 8e391a6776..0000000000 --- a/src/version2/parameters/getDashboard.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetDashboard { - /** The ID of the dashboard. */ - id: string; -} diff --git a/src/version2/parameters/getDashboardItemProperty.ts b/src/version2/parameters/getDashboardItemProperty.ts deleted file mode 100644 index 9f879e536a..0000000000 --- a/src/version2/parameters/getDashboardItemProperty.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface GetDashboardItemProperty { - /** The ID of the dashboard. */ - dashboardId: string; - /** The ID of the dashboard item. */ - itemId: string; - /** The key of the dashboard item property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/getDashboardItemPropertyKeys.ts b/src/version2/parameters/getDashboardItemPropertyKeys.ts deleted file mode 100644 index 15ee401b26..0000000000 --- a/src/version2/parameters/getDashboardItemPropertyKeys.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetDashboardItemPropertyKeys { - /** The ID of the dashboard. */ - dashboardId: string; - /** The ID of the dashboard item. */ - itemId: string; -} diff --git a/src/version2/parameters/getDashboardItemPropertyKeysParameters.ts b/src/version2/parameters/getDashboardItemPropertyKeysParameters.ts new file mode 100644 index 0000000000..7a01d31347 --- /dev/null +++ b/src/version2/parameters/getDashboardItemPropertyKeysParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetDashboardItemPropertyKeysParametersSchema = z.object({ + /** The ID of the dashboard. */ + dashboardId: z.string(), + /** The ID of the dashboard item. */ + itemId: z.string(), +}); + +export type GetDashboardItemPropertyKeysParameters = z.infer; diff --git a/src/version2/parameters/getDashboardItemPropertyParameters.ts b/src/version2/parameters/getDashboardItemPropertyParameters.ts new file mode 100644 index 0000000000..ead03d8c80 --- /dev/null +++ b/src/version2/parameters/getDashboardItemPropertyParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetDashboardItemPropertyParametersSchema = z.object({ + /** The ID of the dashboard. */ + dashboardId: z.string(), + /** The ID of the dashboard item. */ + itemId: z.string(), + /** The key of the dashboard item property. */ + propertyKey: z.string(), +}); + +export type GetDashboardItemPropertyParameters = z.infer; diff --git a/src/version2/parameters/getDashboardParameters.ts b/src/version2/parameters/getDashboardParameters.ts new file mode 100644 index 0000000000..245611a692 --- /dev/null +++ b/src/version2/parameters/getDashboardParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetDashboardParametersSchema = z.object({ + /** The ID of the dashboard. */ + id: z.string(), +}); + +export type GetDashboardParameters = z.infer; diff --git a/src/version2/parameters/getDashboardsPaginated.ts b/src/version2/parameters/getDashboardsPaginated.ts deleted file mode 100644 index 513a57ec80..0000000000 --- a/src/version2/parameters/getDashboardsPaginated.ts +++ /dev/null @@ -1,94 +0,0 @@ -export interface GetDashboardsPaginated { - /** String used to perform a case-insensitive partial match with `name`. */ - dashboardName?: string; - /** - * User account ID used to return dashboards with the matching `owner.accountId`. This parameter cannot be used with - * the `owner` parameter. - */ - accountId?: string; - /** - * As a group's name can change, use of `groupId` is recommended. Group name used to return dashboards that are shared - * with a group that matches `sharePermissions.group.name`. This parameter cannot be used with the `groupId` - * parameter. - */ - groupname?: string; - /** - * Group ID used to return dashboards that are shared with a group that matches `sharePermissions.group.groupId`. This - * parameter cannot be used with the `groupname` parameter. - */ - groupId?: string; - /** Project ID used to returns dashboards that are shared with a project that matches `sharePermissions.project.id`. */ - projectId?: number; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: - * - * - `description` Sorts by dashboard description. Note that this sort works independently of whether the expand to - * display the description field is in use. - * - `favourite_count` Sorts by dashboard popularity. - * - `id` Sorts by dashboard ID. - * - `is_favourite` Sorts by whether the dashboard is marked as a favorite. - * - `name` Sorts by dashboard name. - * - `owner` Sorts by dashboard owner name. - */ - orderBy?: - | 'description' - | '-description' - | '+description' - | 'favorite_count' - | '-favorite_count' - | '+favorite_count' - | 'id' - | '-id' - | '+id' - | 'is_favorite' - | '-is_favorite' - | '+is_favorite' - | 'name' - | '-name' - | '+name' - | 'owner' - | '-owner' - | '+owner' - | 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; - /** The status to filter by. It may be active, archived or deleted. */ - status?: 'active' | 'archived' | 'deleted' | string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about dashboard in the response. This parameter accepts a comma-separated list. Expand options - * include: - * - * - `description` Returns the description of the dashboard. - * - `owner` Returns the owner of the dashboard. - * - `viewUrl` Returns the URL that is used to view the dashboard. - * - `favourite` Returns `isFavourite`, an indicator of whether the user has set the dashboard as a favorite. - * - `favouritedCount` Returns `popularity`, a count of how many users have set this dashboard as a favorite. - * - `sharePermissions` Returns details of the share permissions defined for the dashboard. - * - `editPermissions` Returns details of the edit permissions defined for the dashboard. - * - `isWritable` Returns whether the current user has permission to edit the dashboard. - */ - expand?: - | 'description' - | 'owner' - | 'viewUrl' - | 'favourite' - | 'favouritedCount' - | 'sharePermissions' - | 'editPermissions' - | 'isWritable' - | ( - | 'description' - | 'owner' - | 'viewUrl' - | 'favourite' - | 'favouritedCount' - | 'sharePermissions' - | 'editPermissions' - | 'isWritable' - )[] - | string - | string[]; -} diff --git a/src/version2/parameters/getDashboardsPaginatedParameters.ts b/src/version2/parameters/getDashboardsPaginatedParameters.ts new file mode 100644 index 0000000000..cac2a9fe7a --- /dev/null +++ b/src/version2/parameters/getDashboardsPaginatedParameters.ts @@ -0,0 +1,87 @@ +import { z } from 'zod'; + +export const GetDashboardsPaginatedParametersSchema = z.object({ + /** String used to perform a case-insensitive partial match with `name`. */ + dashboardName: z.string().optional(), + /** + * User account ID used to return dashboards with the matching `owner.accountId`. This parameter cannot be used with + * the `owner` parameter. + */ + accountId: z.string().optional(), + /** + * This parameter is deprecated because of privacy changes. Use `accountId` instead. See the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. User name used to return dashboards with the matching `owner.name`. This parameter cannot be used with + * the `accountId` parameter. + */ + owner: z.string().optional(), + /** + * As a group's name can change, use of `groupId` is recommended. Group name used to return dashboards that are shared + * with a group that matches `sharePermissions.group.name`. This parameter cannot be used with the `groupId` + * parameter. + */ + groupname: z.string().optional(), + /** + * Group ID used to return dashboards that are shared with a group that matches `sharePermissions.group.groupId`. This + * parameter cannot be used with the `groupname` parameter. + */ + groupId: z.string().optional(), + /** Project ID used to returns dashboards that are shared with a project that matches `sharePermissions.project.id`. */ + projectId: z.number().int().optional(), + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `description` Sorts by dashboard description. Note that this sort works independently of whether the expand to + * display the description field is in use. + * - `favourite_count` Sorts by dashboard popularity. + * - `id` Sorts by dashboard ID. + * - `is_favourite` Sorts by whether the dashboard is marked as a favorite. + * - `name` Sorts by dashboard name. + * - `owner` Sorts by dashboard owner name. + */ + orderBy: z + .enum([ + 'description', + '-description', + '+description', + 'favorite_count', + '-favorite_count', + '+favorite_count', + 'id', + '-id', + '+id', + 'is_favorite', + '-is_favorite', + '+is_favorite', + 'name', + '-name', + '+name', + 'owner', + '-owner', + '+owner', + ]) + .optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** The status to filter by. It may be active, archived or deleted. */ + status: z.enum(['active', 'archived', 'deleted']).optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about dashboard in the response. This parameter accepts a comma-separated list. Expand options + * include: + * + * - `description` Returns the description of the dashboard. + * - `owner` Returns the owner of the dashboard. + * - `viewUrl` Returns the URL that is used to view the dashboard. + * - `favourite` Returns `isFavourite`, an indicator of whether the user has set the dashboard as a favorite. + * - `favouritedCount` Returns `popularity`, a count of how many users have set this dashboard as a favorite. + * - `sharePermissions` Returns details of the share permissions defined for the dashboard. + * - `editPermissions` Returns details of the edit permissions defined for the dashboard. + * - `isWritable` Returns whether the current user has permission to edit the dashboard. + */ + expand: z.string().optional(), +}); + +export type GetDashboardsPaginatedParameters = z.infer; diff --git a/src/version2/parameters/getDefaultEditorParameters.ts b/src/version2/parameters/getDefaultEditorParameters.ts new file mode 100644 index 0000000000..a3ff659c44 --- /dev/null +++ b/src/version2/parameters/getDefaultEditorParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetDefaultEditorParametersSchema = z.object({}); + +export type GetDefaultEditorParameters = z.infer; diff --git a/src/version2/parameters/getDefaultProjectClassification.ts b/src/version2/parameters/getDefaultProjectClassification.ts deleted file mode 100644 index cf8683da7a..0000000000 --- a/src/version2/parameters/getDefaultProjectClassification.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetDefaultProjectClassification { - /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string; -} diff --git a/src/version2/parameters/getDefaultProjectClassificationParameters.ts b/src/version2/parameters/getDefaultProjectClassificationParameters.ts new file mode 100644 index 0000000000..e08c4bd789 --- /dev/null +++ b/src/version2/parameters/getDefaultProjectClassificationParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetDefaultProjectClassificationParametersSchema = z.object({ + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: z.string(), +}); + +export type GetDefaultProjectClassificationParameters = z.infer; diff --git a/src/version2/parameters/getDefaultShareScopeParameters.ts b/src/version2/parameters/getDefaultShareScopeParameters.ts new file mode 100644 index 0000000000..c1c4fb3e0b --- /dev/null +++ b/src/version2/parameters/getDefaultShareScopeParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetDefaultShareScopeParametersSchema = z.object({}); + +export type GetDefaultShareScopeParameters = z.infer; diff --git a/src/version2/parameters/getDefaultValues.ts b/src/version2/parameters/getDefaultValues.ts deleted file mode 100644 index f423c4a201..0000000000 --- a/src/version2/parameters/getDefaultValues.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface GetDefaultValues { - /** The ID of the custom field, for example `customfield\_10000`. */ - fieldId: string; - /** The IDs of the contexts. */ - contextId?: 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. */ - maxResults?: number; -} diff --git a/src/version2/parameters/getDefaultValuesParameters.ts b/src/version2/parameters/getDefaultValuesParameters.ts new file mode 100644 index 0000000000..08a04e8c79 --- /dev/null +++ b/src/version2/parameters/getDefaultValuesParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetDefaultValuesParametersSchema = z.object({ + /** The ID of the custom field, for example `customfield\_10000`. */ + fieldId: z.string(), + /** The IDs of the contexts. */ + contextId: z.array(z.number().int()).optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetDefaultValuesParameters = z.infer; diff --git a/src/version2/parameters/getDefaultWorkflow.ts b/src/version2/parameters/getDefaultWorkflow.ts deleted file mode 100644 index a55798c91f..0000000000 --- a/src/version2/parameters/getDefaultWorkflow.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface GetDefaultWorkflow { - /** The ID of the workflow scheme. */ - id: number; - /** - * Set to `true` to return the default workflow for the workflow scheme's draft rather than scheme itself. If the - * workflow scheme does not have a draft, then the default workflow for the workflow scheme is returned. - */ - returnDraftIfExists?: boolean; -} diff --git a/src/version2/parameters/getDefaultWorkflowParameters.ts b/src/version2/parameters/getDefaultWorkflowParameters.ts new file mode 100644 index 0000000000..9bdcdfe1b7 --- /dev/null +++ b/src/version2/parameters/getDefaultWorkflowParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const GetDefaultWorkflowParametersSchema = z.object({ + /** The ID of the workflow scheme. */ + id: z.number().int(), + /** + * Set to `true` to return the default workflow for the workflow scheme's draft rather than scheme itself. If the + * workflow scheme does not have a draft, then the default workflow for the workflow scheme is returned. + */ + returnDraftIfExists: z.boolean().optional(), +}); + +export type GetDefaultWorkflowParameters = z.infer; diff --git a/src/version2/parameters/getDraftDefaultWorkflow.ts b/src/version2/parameters/getDraftDefaultWorkflow.ts deleted file mode 100644 index 7d6302cfed..0000000000 --- a/src/version2/parameters/getDraftDefaultWorkflow.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetDraftDefaultWorkflow { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; -} diff --git a/src/version2/parameters/getDraftDefaultWorkflowParameters.ts b/src/version2/parameters/getDraftDefaultWorkflowParameters.ts new file mode 100644 index 0000000000..48667982f3 --- /dev/null +++ b/src/version2/parameters/getDraftDefaultWorkflowParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetDraftDefaultWorkflowParametersSchema = z.object({ + /** The ID of the workflow scheme that the draft belongs to. */ + id: z.number().int(), +}); + +export type GetDraftDefaultWorkflowParameters = z.infer; diff --git a/src/version2/parameters/getDraftWorkflow.ts b/src/version2/parameters/getDraftWorkflow.ts deleted file mode 100644 index 9f1e0926c1..0000000000 --- a/src/version2/parameters/getDraftWorkflow.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface GetDraftWorkflow { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** - * The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified - * workflow. - */ - workflowName?: string; -} diff --git a/src/version2/parameters/getDraftWorkflowParameters.ts b/src/version2/parameters/getDraftWorkflowParameters.ts new file mode 100644 index 0000000000..9dda539949 --- /dev/null +++ b/src/version2/parameters/getDraftWorkflowParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const GetDraftWorkflowParametersSchema = z.object({ + /** The ID of the workflow scheme that the draft belongs to. */ + id: z.number().int(), + /** + * The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified + * workflow. + */ + workflowName: z.string().optional(), +}); + +export type GetDraftWorkflowParameters = z.infer; diff --git a/src/version2/parameters/getDynamicWebhooksForApp.ts b/src/version2/parameters/getDynamicWebhooksForApp.ts deleted file mode 100644 index 965c6fe2d7..0000000000 --- a/src/version2/parameters/getDynamicWebhooksForApp.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetDynamicWebhooksForApp { - /** 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/getDynamicWebhooksForAppParameters.ts b/src/version2/parameters/getDynamicWebhooksForAppParameters.ts new file mode 100644 index 0000000000..1e2ad33fa2 --- /dev/null +++ b/src/version2/parameters/getDynamicWebhooksForAppParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetDynamicWebhooksForAppParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetDynamicWebhooksForAppParameters = z.infer; diff --git a/src/version2/parameters/getEditIssueMeta.ts b/src/version2/parameters/getEditIssueMeta.ts deleted file mode 100644 index 2ddae2fb4a..0000000000 --- a/src/version2/parameters/getEditIssueMeta.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface GetEditIssueMeta { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Whether hidden fields are returned. Available to Connect app users with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideScreenSecurity?: boolean; - /** - * Whether non-editable fields are returned. Available to Connect app users with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version2/parameters/getEditIssueMetaParameters.ts b/src/version2/parameters/getEditIssueMetaParameters.ts new file mode 100644 index 0000000000..cba5dc244b --- /dev/null +++ b/src/version2/parameters/getEditIssueMetaParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const GetEditIssueMetaParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** + * Whether hidden fields are returned. Available to Connect app users with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideScreenSecurity: z.boolean().optional(), + /** + * Whether non-editable fields are returned. Available to Connect app users with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag: z.boolean().optional(), +}); + +export type GetEditIssueMetaParameters = z.infer; diff --git a/src/version2/parameters/getEventsParameters.ts b/src/version2/parameters/getEventsParameters.ts new file mode 100644 index 0000000000..6f24824b56 --- /dev/null +++ b/src/version2/parameters/getEventsParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetEventsParametersSchema = z.object({}); + +export type GetEventsParameters = z.infer; diff --git a/src/version2/parameters/getFailedWebhooks.ts b/src/version2/parameters/getFailedWebhooks.ts deleted file mode 100644 index af022e23ed..0000000000 --- a/src/version2/parameters/getFailedWebhooks.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface GetFailedWebhooks { - /** - * The maximum number of webhooks to return per page. If obeying the maxResults directive would result in records with - * the same failure time being split across pages, the directive is ignored and all records with the same failure time - * included on the page. - */ - maxResults?: number; - /** - * The time after which any webhook failure must have occurred for the record to be returned, expressed as - * milliseconds since the UNIX epoch. - */ - after?: number; -} diff --git a/src/version2/parameters/getFailedWebhooksParameters.ts b/src/version2/parameters/getFailedWebhooksParameters.ts new file mode 100644 index 0000000000..932647650b --- /dev/null +++ b/src/version2/parameters/getFailedWebhooksParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const GetFailedWebhooksParametersSchema = z.object({ + /** + * The maximum number of webhooks to return per page. If obeying the maxResults directive would result in records with + * the same failure time being split across pages, the directive is ignored and all records with the same failure time + * included on the page. + */ + maxResults: z.number().int().optional(), + /** + * The time after which any webhook failure must have occurred for the record to be returned, expressed as + * milliseconds since the UNIX epoch. + */ + after: z.number().int().optional(), +}); + +export type GetFailedWebhooksParameters = z.infer; diff --git a/src/version2/parameters/getFavouriteFilters.ts b/src/version2/parameters/getFavouriteFilters.ts deleted file mode 100644 index b95adeb438..0000000000 --- a/src/version2/parameters/getFavouriteFilters.ts +++ /dev/null @@ -1,17 +0,0 @@ -export interface GetFavouriteFilters { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. - * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the - * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is - * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For - * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: 'sharedUsers' | 'subscriptions' | ('sharedUsers' | 'subscriptions')[] | string | string[]; -} diff --git a/src/version2/parameters/getFavouriteFiltersParameters.ts b/src/version2/parameters/getFavouriteFiltersParameters.ts new file mode 100644 index 0000000000..89a6c60a1a --- /dev/null +++ b/src/version2/parameters/getFavouriteFiltersParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const GetFavouriteFiltersParametersSchema = z.object({ + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. + * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the + * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is + * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For + * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand: z.string().optional(), +}); + +export type GetFavouriteFiltersParameters = z.infer; diff --git a/src/version2/parameters/getFeaturesForProject.ts b/src/version2/parameters/getFeaturesForProject.ts deleted file mode 100644 index 0e1567cd84..0000000000 --- a/src/version2/parameters/getFeaturesForProject.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetFeaturesForProject { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string | number; -} diff --git a/src/version2/parameters/getFeaturesForProjectParameters.ts b/src/version2/parameters/getFeaturesForProjectParameters.ts new file mode 100644 index 0000000000..992cf446e5 --- /dev/null +++ b/src/version2/parameters/getFeaturesForProjectParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetFeaturesForProjectParametersSchema = z.object({ + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: z.string(), +}); + +export type GetFeaturesForProjectParameters = z.infer; diff --git a/src/version2/parameters/getFieldAutoCompleteForQueryString.ts b/src/version2/parameters/getFieldAutoCompleteForQueryString.ts deleted file mode 100644 index 6e621a0ff3..0000000000 --- a/src/version2/parameters/getFieldAutoCompleteForQueryString.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface GetFieldAutoCompleteForQueryString { - /** The name of the field. */ - fieldName?: string; - /** The partial field item name entered by the user. */ - fieldValue?: string; - /** - * The name of the [ CHANGED operator - * predicate](https://confluence.atlassian.com/x/hQORLQ#Advancedsearching-operatorsreference-CHANGEDCHANGED) for which - * the suggestions are generated. The valid predicate operators are _by_, _from_, and _to_. - */ - predicateName?: string; - /** The partial predicate item name entered by the user. */ - predicateValue?: string; -} diff --git a/src/version2/parameters/getFieldAutoCompleteForQueryStringParameters.ts b/src/version2/parameters/getFieldAutoCompleteForQueryStringParameters.ts new file mode 100644 index 0000000000..54ee56cb68 --- /dev/null +++ b/src/version2/parameters/getFieldAutoCompleteForQueryStringParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const GetFieldAutoCompleteForQueryStringParametersSchema = z.object({ + /** The name of the field. */ + fieldName: z.string().optional(), + /** The partial field item name entered by the user. */ + fieldValue: z.string().optional(), + /** + * The name of the [ CHANGED operator + * predicate](https://confluence.atlassian.com/x/hQORLQ#Advancedsearching-operatorsreference-CHANGEDCHANGED) for which + * the suggestions are generated. The valid predicate operators are _by_, _from_, and _to_. + */ + predicateName: z.string().optional(), + /** The partial predicate item name entered by the user. */ + predicateValue: z.string().optional(), +}); + +export type GetFieldAutoCompleteForQueryStringParameters = z.infer< + typeof GetFieldAutoCompleteForQueryStringParametersSchema +>; diff --git a/src/version2/parameters/getFieldConfigurationItems.ts b/src/version2/parameters/getFieldConfigurationItems.ts deleted file mode 100644 index 3736755103..0000000000 --- a/src/version2/parameters/getFieldConfigurationItems.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface GetFieldConfigurationItems { - /** The ID of the field configuration. */ - id: 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. */ - maxResults?: number; -} diff --git a/src/version2/parameters/getFieldConfigurationItemsParameters.ts b/src/version2/parameters/getFieldConfigurationItemsParameters.ts new file mode 100644 index 0000000000..ed29e8c23f --- /dev/null +++ b/src/version2/parameters/getFieldConfigurationItemsParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetFieldConfigurationItemsParametersSchema = z.object({ + /** The ID of the field configuration. */ + id: z.number().int(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetFieldConfigurationItemsParameters = z.infer; diff --git a/src/version2/parameters/getFieldConfigurationSchemeMappings.ts b/src/version2/parameters/getFieldConfigurationSchemeMappings.ts deleted file mode 100644 index daf345acbe..0000000000 --- a/src/version2/parameters/getFieldConfigurationSchemeMappings.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface GetFieldConfigurationSchemeMappings { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of field configuration scheme IDs. To include multiple field configuration schemes separate IDs with - * ampersand: `fieldConfigurationSchemeId=10000&fieldConfigurationSchemeId=10001`. - */ - fieldConfigurationSchemeId?: number[]; -} diff --git a/src/version2/parameters/getFieldConfigurationSchemeMappingsParameters.ts b/src/version2/parameters/getFieldConfigurationSchemeMappingsParameters.ts new file mode 100644 index 0000000000..b2213dc97d --- /dev/null +++ b/src/version2/parameters/getFieldConfigurationSchemeMappingsParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const GetFieldConfigurationSchemeMappingsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of field configuration scheme IDs. To include multiple field configuration schemes separate IDs with + * ampersand: `fieldConfigurationSchemeId=10000&fieldConfigurationSchemeId=10001`. + */ + fieldConfigurationSchemeId: z.array(z.number().int()).optional(), +}); + +export type GetFieldConfigurationSchemeMappingsParameters = z.infer< + typeof GetFieldConfigurationSchemeMappingsParametersSchema +>; diff --git a/src/version2/parameters/getFieldConfigurationSchemeProjectMapping.ts b/src/version2/parameters/getFieldConfigurationSchemeProjectMapping.ts deleted file mode 100644 index 2bbc23e7ab..0000000000 --- a/src/version2/parameters/getFieldConfigurationSchemeProjectMapping.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface GetFieldConfigurationSchemeProjectMapping { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of project IDs. To include multiple projects, separate IDs with ampersand: - * `projectId=10000&projectId=10001`. - */ - projectId: (string | number)[]; -} diff --git a/src/version2/parameters/getFieldConfigurationSchemeProjectMappingParameters.ts b/src/version2/parameters/getFieldConfigurationSchemeProjectMappingParameters.ts new file mode 100644 index 0000000000..bd1d72f34d --- /dev/null +++ b/src/version2/parameters/getFieldConfigurationSchemeProjectMappingParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const GetFieldConfigurationSchemeProjectMappingParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of project IDs. To include multiple projects, separate IDs with ampersand: + * `projectId=10000&projectId=10001`. + */ + projectId: z.array(z.number().int()), +}); + +export type GetFieldConfigurationSchemeProjectMappingParameters = z.infer< + typeof GetFieldConfigurationSchemeProjectMappingParametersSchema +>; diff --git a/src/version2/parameters/getFieldsPaginated.ts b/src/version2/parameters/getFieldsPaginated.ts deleted file mode 100644 index ba4ac373c3..0000000000 --- a/src/version2/parameters/getFieldsPaginated.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { OneOrMany } from '../../interfaces'; - -export interface GetFieldsPaginated { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** The type of fields to search. */ - type?: ('custom' | 'system' | string)[]; - /** The IDs of the custom fields to return or, where `query` is specified, filter. */ - id?: string[]; - /** String used to perform a case-insensitive partial match with field names or descriptions. */ - query?: string; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: - * - * - `contextsCount` sorts by the number of contexts related to a field - * - `lastUsed` sorts by the date when the value of the field last changed - * - `name` sorts by the field name - * - `screensCount` sorts by the number of screens related to a field - */ - orderBy?: - | 'contextsCount' - | '-contextsCount' - | '+contextsCount' - | 'lastUsed' - | '-lastUsed' - | '+lastUsed' - | 'name' - | '-name' - | '+name' - | 'screensCount' - | '-screensCount' - | '+screensCount' - | 'projectsCount' - | '-projectsCount' - | '+projectsCount' - | 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: - * - * - `key` returns the key for each field - * - `lastUsed` returns the date when the value of the field last changed - * - `screensCount` returns the number of screens related to a field - * - `contextsCount` returns the number of contexts related to a field - * - `isLocked` returns information about whether the field is [locked](https://confluence.atlassian.com/x/ZSN7Og) - * - `searcherKey` returns the searcher key for each custom field - */ - expand?: OneOrMany<'key' | 'lastUsed' | 'screensCount' | 'contextsCount' | 'isLocked' | 'searcherKey' | string>; - projectIds?: number[]; -} diff --git a/src/version2/parameters/getFieldsPaginatedParameters.ts b/src/version2/parameters/getFieldsPaginatedParameters.ts new file mode 100644 index 0000000000..9e6e7ebf99 --- /dev/null +++ b/src/version2/parameters/getFieldsPaginatedParameters.ts @@ -0,0 +1,61 @@ +import { z } from 'zod'; + +export const GetFieldsPaginatedParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** The type of fields to search. */ + type: z.array(z.enum(['custom', 'system'])).optional(), + /** The IDs of the custom fields to return or, where `query` is specified, filter. */ + id: z.array(z.string()).optional(), + /** String used to perform a case-insensitive partial match with field names or descriptions. */ + query: z.string().optional(), + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by: + * + * - `contextsCount` sorts by the number of contexts related to a field + * - `lastUsed` sorts by the date when the value of the field last changed + * - `name` sorts by the field name + * - `screensCount` sorts by the number of screens related to a field + */ + orderBy: z + .enum([ + 'contextsCount', + '-contextsCount', + '+contextsCount', + 'lastUsed', + '-lastUsed', + '+lastUsed', + 'name', + '-name', + '+name', + 'screensCount', + '-screensCount', + '+screensCount', + 'projectsCount', + '-projectsCount', + '+projectsCount', + ]) + .optional(), + /** + * 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: + * + * - `key` returns the key for each field + * - `stableId` returns the stableId for each field + * - `lastUsed` returns the date when the value of the field last changed + * - `screensCount` returns the number of screens related to a field + * - `contextsCount` returns the number of contexts related to a field + * - `isLocked` returns information about whether the field is locked + * - `searcherKey` returns the searcher key for each custom field + */ + expand: z.string().optional(), + /** + * The IDs of the projects to filter the fields by. Fields belonging to project Ids that the user does not have access + * to will not be returned + */ + projectIds: z.array(z.number().int()).optional(), +}); + +export type GetFieldsPaginatedParameters = z.infer; diff --git a/src/version2/parameters/getFieldsParameters.ts b/src/version2/parameters/getFieldsParameters.ts new file mode 100644 index 0000000000..7f061a6136 --- /dev/null +++ b/src/version2/parameters/getFieldsParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetFieldsParametersSchema = z.object({}); + +export type GetFieldsParameters = z.infer; diff --git a/src/version2/parameters/getFilter.ts b/src/version2/parameters/getFilter.ts deleted file mode 100644 index 28c05f8891..0000000000 --- a/src/version2/parameters/getFilter.ts +++ /dev/null @@ -1,24 +0,0 @@ -export interface GetFilter { - /** The ID of the filter to return. */ - id: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. - * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the - * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is - * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For - * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: 'sharedUsers' | 'subscriptions' | ('sharedUsers' | 'subscriptions')[] | string | string[]; - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version2/parameters/getFilterParameters.ts b/src/version2/parameters/getFilterParameters.ts new file mode 100644 index 0000000000..ca604047b7 --- /dev/null +++ b/src/version2/parameters/getFilterParameters.ts @@ -0,0 +1,28 @@ +import { z } from 'zod'; + +export const GetFilterParametersSchema = z.object({ + /** The ID of the filter to return. */ + id: z.number().int(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. + * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the + * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is + * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For + * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand: z.string().optional(), + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions: z.boolean().optional(), +}); + +export type GetFilterParameters = z.infer; diff --git a/src/version2/parameters/getFiltersPaginated.ts b/src/version2/parameters/getFiltersPaginated.ts deleted file mode 100644 index 32808b1488..0000000000 --- a/src/version2/parameters/getFiltersPaginated.ts +++ /dev/null @@ -1,121 +0,0 @@ -export interface GetFiltersPaginated { - /** String used to perform a case-insensitive partial match with `name`. */ - filterName?: string; - /** - * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with - * `owner`. - */ - accountId?: string; - /** - * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns - * filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used - * with the `groupId` parameter. - */ - groupname?: string; - /** - * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This - * parameter cannot be used with the `groupname` parameter. - */ - groupId?: string; - /** Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. */ - projectId?: number; - /** - * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * `id=10000&id=10001`. Do not exceed 200 filter IDs. - */ - id?: number[]; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: - * - * - `description` Sorts by filter description. Note that this sorting works independently of whether the expand to - * display the description field is in use. - * - `favourite_count` Sorts by the count of how many users have this filter as a favorite. - * - `is_favourite` Sorts by whether the filter is marked as a favorite. - * - `id` Sorts by filter ID. - * - `name` Sorts by filter name. - * - `owner` Sorts by the ID of the filter owner. - * - `is_shared` Sorts by whether the filter is shared. - */ - orderBy?: - | 'description' - | '-description' - | '+description' - | 'favourite_count' - | '-favourite_count' - | '+favourite_count' - | 'id' - | '-id' - | '+id' - | 'is_favourite' - | '-is_favourite' - | '+is_favourite' - | 'name' - | '-name' - | '+name' - | 'owner' - | '-owner' - | '+owner' - | 'is_shared' - | '-is_shared' - | '+is_shared' - | string; - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `description` Returns the description of the filter. - * - `favourite` Returns an indicator of whether the user has set the filter as a favorite. - * - `favouritedCount` Returns a count of how many users have set this filter as a favorite. - * - `jql` Returns the JQL query that the filter uses. - * - `owner` Returns the owner of the filter. - * - `searchUrl` Returns a URL to perform the filter's JQL query. - * - `sharePermissions` Returns the share permissions defined for the filter. - * - `editPermissions` Returns the edit permissions defined for the filter. - * - `isWritable` Returns whether the current user has permission to edit the filter. - * - `subscriptions` Returns the users that are subscribed to the filter. - * - `viewUrl` Returns a URL to view the filter. - */ - expand?: - | 'description' - | 'favourite' - | 'favouritedCount' - | 'jql' - | 'owner' - | 'searchUrl' - | 'sharePermissions' - | 'editPermissions' - | 'isWritable' - | 'subscriptions' - | 'viewUrl' - | ( - | 'description' - | 'favourite' - | 'favouritedCount' - | 'jql' - | 'owner' - | 'searchUrl' - | 'sharePermissions' - | 'editPermissions' - | 'isWritable' - | 'subscriptions' - | 'viewUrl' - )[] - | string - | string[]; - - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; - /** - * 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/getFiltersPaginatedParameters.ts b/src/version2/parameters/getFiltersPaginatedParameters.ts new file mode 100644 index 0000000000..737407ebfb --- /dev/null +++ b/src/version2/parameters/getFiltersPaginatedParameters.ts @@ -0,0 +1,108 @@ +import { z } from 'zod'; + +export const GetFiltersPaginatedParametersSchema = z.object({ + /** String used to perform a case-insensitive partial match with `name`. */ + filterName: z.string().optional(), + /** + * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with + * `owner`. + */ + accountId: z.string().optional(), + /** + * This parameter is deprecated because of privacy changes. Use `accountId` instead. See the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. User name used to return filters with the matching `owner.name`. This parameter cannot be used with + * `accountId`. + */ + owner: z.string().optional(), + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns + * filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used + * with the `groupId` parameter. + */ + groupname: z.string().optional(), + /** + * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This + * parameter cannot be used with the `groupname` parameter. + */ + groupId: z.string().optional(), + /** Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. */ + projectId: z.number().int().optional(), + /** + * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `id=10000&id=10001`. Do not exceed 200 filter IDs. + */ + id: z.array(z.number().int()).optional(), + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `description` Sorts by filter description. Note that this sorting works independently of whether the expand to + * display the description field is in use. + * - `favourite_count` Sorts by the count of how many users have this filter as a favorite. + * - `is_favourite` Sorts by whether the filter is marked as a favorite. + * - `id` Sorts by filter ID. + * - `name` Sorts by filter name. + * - `owner` Sorts by the ID of the filter owner. + * - `is_shared` Sorts by whether the filter is shared. + */ + orderBy: z + .enum([ + 'description', + '-description', + '+description', + 'favourite_count', + '-favourite_count', + '+favourite_count', + 'id', + '-id', + '+id', + 'is_favourite', + '-is_favourite', + '+is_favourite', + 'name', + '-name', + '+name', + 'owner', + '-owner', + '+owner', + 'is_shared', + '-is_shared', + '+is_shared', + ]) + .optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `description` Returns the description of the filter. + * - `favourite` Returns an indicator of whether the user has set the filter as a favorite. + * - `favouritedCount` Returns a count of how many users have set this filter as a favorite. + * - `jql` Returns the JQL query that the filter uses. + * - `owner` Returns the owner of the filter. + * - `searchUrl` Returns a URL to perform the filter's JQL query. + * - `sharePermissions` Returns the share permissions defined for the filter. + * - `editPermissions` Returns the edit permissions defined for the filter. + * - `isWritable` Returns whether the current user has permission to edit the filter. + * - `approximateLastUsed` [Experimental] Returns the approximate date and time when the filter was last evaluated. + * - `subscriptions` Returns the users that are subscribed to the filter. + * - `viewUrl` Returns a URL to view the filter. + */ + expand: z.string().optional(), + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions: z.boolean().optional(), + /** + * 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: z.boolean().optional(), +}); + +export type GetFiltersPaginatedParameters = z.infer; diff --git a/src/version2/parameters/getHierarchy.ts b/src/version2/parameters/getHierarchy.ts deleted file mode 100644 index ee2ae8c627..0000000000 --- a/src/version2/parameters/getHierarchy.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetHierarchy { - /** The ID of the project. */ - projectId: string | number; -} diff --git a/src/version2/parameters/getHierarchyParameters.ts b/src/version2/parameters/getHierarchyParameters.ts new file mode 100644 index 0000000000..0d0578284c --- /dev/null +++ b/src/version2/parameters/getHierarchyParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetHierarchyParametersSchema = z.object({ + /** The ID of the project. */ + projectId: z.number().int(), +}); + +export type GetHierarchyParameters = z.infer; diff --git a/src/version2/parameters/getIdsOfWorklogsDeletedSince.ts b/src/version2/parameters/getIdsOfWorklogsDeletedSince.ts deleted file mode 100644 index 14b6ae537f..0000000000 --- a/src/version2/parameters/getIdsOfWorklogsDeletedSince.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetIdsOfWorklogsDeletedSince { - /** The date and time, as a UNIX timestamp in milliseconds, after which deleted worklogs are returned. */ - since?: number; -} diff --git a/src/version2/parameters/getIdsOfWorklogsDeletedSinceParameters.ts b/src/version2/parameters/getIdsOfWorklogsDeletedSinceParameters.ts new file mode 100644 index 0000000000..ea4389cf52 --- /dev/null +++ b/src/version2/parameters/getIdsOfWorklogsDeletedSinceParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetIdsOfWorklogsDeletedSinceParametersSchema = z.object({ + /** The date and time, as a UNIX timestamp in milliseconds, after which deleted worklogs are returned. */ + since: z.number().int().optional(), +}); + +export type GetIdsOfWorklogsDeletedSinceParameters = z.infer; diff --git a/src/version2/parameters/getIdsOfWorklogsModifiedSince.ts b/src/version2/parameters/getIdsOfWorklogsModifiedSince.ts deleted file mode 100644 index 08b4a09958..0000000000 --- a/src/version2/parameters/getIdsOfWorklogsModifiedSince.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface GetIdsOfWorklogsModifiedSince { - /** The date and time, as a UNIX timestamp in milliseconds, after which updated worklogs are returned. */ - since?: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about worklogs in the response. This parameter accepts `properties` that returns the properties of each - * worklog. - */ - expand?: string; -} diff --git a/src/version2/parameters/getIdsOfWorklogsModifiedSinceParameters.ts b/src/version2/parameters/getIdsOfWorklogsModifiedSinceParameters.ts new file mode 100644 index 0000000000..82386feb10 --- /dev/null +++ b/src/version2/parameters/getIdsOfWorklogsModifiedSinceParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetIdsOfWorklogsModifiedSinceParametersSchema = z.object({ + /** The date and time, as a UNIX timestamp in milliseconds, after which updated worklogs are returned. */ + since: z.number().int().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about worklogs in the response. This parameter accepts `properties` that returns the properties of each + * worklog. + */ + expand: z.string().optional(), +}); + +export type GetIdsOfWorklogsModifiedSinceParameters = z.infer; diff --git a/src/version2/parameters/getIsWatchingIssueBulk.ts b/src/version2/parameters/getIsWatchingIssueBulk.ts deleted file mode 100644 index 5b64ce105b..0000000000 --- a/src/version2/parameters/getIsWatchingIssueBulk.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueList } from '../models'; - -export interface GetIsWatchingIssueBulk extends IssueList {} diff --git a/src/version2/parameters/getIsWatchingIssueBulkParameters.ts b/src/version2/parameters/getIsWatchingIssueBulkParameters.ts new file mode 100644 index 0000000000..ec8988902b --- /dev/null +++ b/src/version2/parameters/getIsWatchingIssueBulkParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetIsWatchingIssueBulkParametersSchema = z.object({ + /** The list of issue IDs. */ + issueIds: z.array(z.string()), +}); + +export type GetIsWatchingIssueBulkParameters = z.infer; diff --git a/src/version2/parameters/getIssue.ts b/src/version2/parameters/getIssue.ts deleted file mode 100644 index 5fb6802390..0000000000 --- a/src/version2/parameters/getIssue.ts +++ /dev/null @@ -1,76 +0,0 @@ -export interface GetIssue { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a - * subset of fields. Allowed values: - * - * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to - * exclude. - * - * Examples: - * - * `summary,comment` Returns only the summary and comments fields. `-description` Returns all (default) fields except - * description. `*navigable,-comment` Returns all navigable fields except comment. - * - * This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. - * - * Note: All fields are returned by default. This differs from [Search for issues using JQL - * (GET)](#api-rest-api-2-search-get) and [Search for issues using JQL (POST)](#api-rest-api-2-search-post) where the - * default is all navigable fields. - */ - fields?: string[]; - /** - * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been - * added by a connect app and a field's key may differ from its ID. - */ - fieldsByKeys?: boolean; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about the issues in the response. This parameter accepts a comma-separated list. Expand options - * include: - * - * - `renderedFields` Returns field values rendered in HTML format. - * - `names` Returns the display name of each field. -`schema` Returns the schema describing a field type. - * - `transitions` Returns all possible transitions for the issue. - * - `editmeta` Returns information about how each field can be edited. - * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. - * - `versionedRepresentations` Returns a JSON array for each version of a field's value, with the highest number - * representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. - */ - expand?: - | 'renderedFields' - | 'names' - | 'transitions' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - | ('renderedFields' | 'names' | 'transitions' | 'editmeta' | 'changelog' | 'versionedRepresentations')[] - | string - | string[]; - /** - * A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: - * - * `*all` Returns all issue properties. Any issue property key, prefixed with a minus to exclude. - * - * Examples: - * - * `*all` Returns all properties. `*all,-prop1` Returns all properties except `prop1`. `prop1,prop2` Returns `prop1` - * and `prop2` properties. - * - * This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. - */ - properties?: string[]; - /** - * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown - * under **Projects** in Jira. This also populates the [JQL issues search](#api-rest-api-2-search-get) `lastViewed` - * field. - */ - updateHistory?: boolean; - /** - * 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/getIssueAllTypesParameters.ts b/src/version2/parameters/getIssueAllTypesParameters.ts new file mode 100644 index 0000000000..e7cf0e9838 --- /dev/null +++ b/src/version2/parameters/getIssueAllTypesParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetIssueAllTypesParametersSchema = z.object({}); + +export type GetIssueAllTypesParameters = z.infer; diff --git a/src/version2/parameters/getIssueFieldOption.ts b/src/version2/parameters/getIssueFieldOption.ts deleted file mode 100644 index 5c663a11d3..0000000000 --- a/src/version2/parameters/getIssueFieldOption.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface GetIssueFieldOption { - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; - /** The ID of the option to be returned. */ - optionId: number; -} diff --git a/src/version2/parameters/getIssueFieldOptionParameters.ts b/src/version2/parameters/getIssueFieldOptionParameters.ts new file mode 100644 index 0000000000..53f6eb4d83 --- /dev/null +++ b/src/version2/parameters/getIssueFieldOptionParameters.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +export const GetIssueFieldOptionParametersSchema = z.object({ + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * - Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. + * - Run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For example, + * `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: z.string(), + /** The ID of the option to be returned. */ + optionId: z.number().int(), +}); + +export type GetIssueFieldOptionParameters = z.infer; diff --git a/src/version2/parameters/getIssueLimitReport.ts b/src/version2/parameters/getIssueLimitReport.ts deleted file mode 100644 index 7e404984b7..0000000000 --- a/src/version2/parameters/getIssueLimitReport.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { 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/getIssueLimitReportParameters.ts b/src/version2/parameters/getIssueLimitReportParameters.ts new file mode 100644 index 0000000000..432885b66e --- /dev/null +++ b/src/version2/parameters/getIssueLimitReportParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetIssueLimitReportParametersSchema = z.object({ + /** + * 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: z.boolean().optional(), +}); + +export type GetIssueLimitReportParameters = z.infer; diff --git a/src/version2/parameters/getIssueLink.ts b/src/version2/parameters/getIssueLink.ts deleted file mode 100644 index cd291d03d9..0000000000 --- a/src/version2/parameters/getIssueLink.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetIssueLink { - /** The ID of the issue link. */ - linkId: string; -} diff --git a/src/version2/parameters/getIssueLinkParameters.ts b/src/version2/parameters/getIssueLinkParameters.ts new file mode 100644 index 0000000000..65744a114b --- /dev/null +++ b/src/version2/parameters/getIssueLinkParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetIssueLinkParametersSchema = z.object({ + /** The ID of the issue link. */ + linkId: z.string(), +}); + +export type GetIssueLinkParameters = z.infer; diff --git a/src/version2/parameters/getIssueLinkType.ts b/src/version2/parameters/getIssueLinkType.ts deleted file mode 100644 index f54c77a48c..0000000000 --- a/src/version2/parameters/getIssueLinkType.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetIssueLinkType { - /** The ID of the issue link type. */ - issueLinkTypeId: string; -} diff --git a/src/version2/parameters/getIssueLinkTypeParameters.ts b/src/version2/parameters/getIssueLinkTypeParameters.ts new file mode 100644 index 0000000000..4b2fe48f61 --- /dev/null +++ b/src/version2/parameters/getIssueLinkTypeParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetIssueLinkTypeParametersSchema = z.object({ + /** The ID of the issue link type. */ + issueLinkTypeId: z.string(), +}); + +export type GetIssueLinkTypeParameters = z.infer; diff --git a/src/version2/parameters/getIssueLinkTypesParameters.ts b/src/version2/parameters/getIssueLinkTypesParameters.ts new file mode 100644 index 0000000000..3dd7cc93a0 --- /dev/null +++ b/src/version2/parameters/getIssueLinkTypesParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetIssueLinkTypesParametersSchema = z.object({}); + +export type GetIssueLinkTypesParameters = z.infer; diff --git a/src/version2/parameters/getIssueNavigatorDefaultColumnsParameters.ts b/src/version2/parameters/getIssueNavigatorDefaultColumnsParameters.ts new file mode 100644 index 0000000000..0beb5f7aa3 --- /dev/null +++ b/src/version2/parameters/getIssueNavigatorDefaultColumnsParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetIssueNavigatorDefaultColumnsParametersSchema = z.object({}); + +export type GetIssueNavigatorDefaultColumnsParameters = z.infer; diff --git a/src/version2/parameters/getIssueParameters.ts b/src/version2/parameters/getIssueParameters.ts new file mode 100644 index 0000000000..4076935e66 --- /dev/null +++ b/src/version2/parameters/getIssueParameters.ts @@ -0,0 +1,76 @@ +import { z } from 'zod'; + +export const GetIssueParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** + * A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a + * subset of fields. Allowed values: + * + * - `*all` Returns all fields. + * - `*navigable` Returns navigable fields. + * - Any issue field, prefixed with a minus to exclude. + * + * Examples: + * + * - `summary,comment` Returns only the summary and comments fields. + * - `-description` Returns all (default) fields except description. + * - `*navigable,-comment` Returns all navigable fields except comment. + * + * This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. + * + * Note: All fields are returned by default. This differs from [Search for issues using JQL + * (GET)](#api-rest-api-2-search-get) and [Search for issues using JQL (POST)](#api-rest-api-2-search-post) where the + * default is all navigable fields. + */ + fields: z.array(z.string()).optional(), + /** + * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been + * added by a connect app and a field's key may differ from its ID. + */ + fieldsByKeys: z.boolean().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about the issues in the response. This parameter accepts a comma-separated list. Expand options + * include: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Returns a JSON array for each version of a field's value, with the highest number + * representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. + */ + expand: z.string().optional(), + /** + * A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: + * + * - `*all` Returns all issue properties. + * - Any issue property key, prefixed with a minus to exclude. + * + * Examples: + * + * - `*all` Returns all properties. + * - `*all,-prop1` Returns all properties except `prop1`. + * - `prop1,prop2` Returns `prop1` and `prop2` properties. + * + * This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. + */ + properties: z.array(z.string()).optional(), + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown + * under **Projects** in Jira. This also populates the [JQL issues search](#api-rest-api-2-search-get) `lastViewed` + * field. + */ + updateHistory: z.boolean().optional(), + /** + * 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: z.boolean().optional(), +}); + +export type GetIssueParameters = z.infer; diff --git a/src/version2/parameters/getIssuePickerResource.ts b/src/version2/parameters/getIssuePickerResource.ts deleted file mode 100644 index 762048d325..0000000000 --- a/src/version2/parameters/getIssuePickerResource.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface GetIssuePickerResource { - /** A string to match against text fields in the issue such as title, description, or comments. */ - query?: string; - /** - * A JQL query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be - * used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. - */ - currentJQL?: string; - /** - * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform - * this query. - */ - currentIssueKey?: string; - /** The ID of a project that suggested issues must belong to. */ - currentProjectId?: string; - /** Indicate whether to include subtasks in the suggestions list. */ - showSubTasks?: boolean; - /** - * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the - * query. - */ - showSubTaskParent?: boolean; -} diff --git a/src/version2/parameters/getIssuePickerResourceParameters.ts b/src/version2/parameters/getIssuePickerResourceParameters.ts new file mode 100644 index 0000000000..d70d975be7 --- /dev/null +++ b/src/version2/parameters/getIssuePickerResourceParameters.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +export const GetIssuePickerResourceParametersSchema = z.object({ + /** A string to match against text fields in the issue such as title, description, or comments. */ + query: z.string().optional(), + /** + * A JQL query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be + * used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. + */ + currentJQL: z.string().optional(), + /** + * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform + * this query. + */ + currentIssueKey: z.string().optional(), + /** The ID of a project that suggested issues must belong to. */ + currentProjectId: z.string().optional(), + /** Indicate whether to include subtasks in the suggestions list. */ + showSubTasks: z.boolean().optional(), + /** + * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the + * query. + */ + showSubTaskParent: z.boolean().optional(), +}); + +export type GetIssuePickerResourceParameters = z.infer; diff --git a/src/version2/parameters/getIssueProperty.ts b/src/version2/parameters/getIssueProperty.ts deleted file mode 100644 index ffedf6bc29..0000000000 --- a/src/version2/parameters/getIssueProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetIssueProperty { - /** The key or ID of the issue. */ - issueIdOrKey: string; - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/getIssuePropertyKeys.ts b/src/version2/parameters/getIssuePropertyKeys.ts deleted file mode 100644 index e218754e3a..0000000000 --- a/src/version2/parameters/getIssuePropertyKeys.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetIssuePropertyKeys { - /** The key or ID of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/getIssuePropertyKeysParameters.ts b/src/version2/parameters/getIssuePropertyKeysParameters.ts new file mode 100644 index 0000000000..41763a7e14 --- /dev/null +++ b/src/version2/parameters/getIssuePropertyKeysParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetIssuePropertyKeysParametersSchema = z.object({ + /** The key or ID of the issue. */ + issueIdOrKey: z.string(), +}); + +export type GetIssuePropertyKeysParameters = z.infer; diff --git a/src/version2/parameters/getIssuePropertyParameters.ts b/src/version2/parameters/getIssuePropertyParameters.ts new file mode 100644 index 0000000000..ae128fe3bd --- /dev/null +++ b/src/version2/parameters/getIssuePropertyParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetIssuePropertyParametersSchema = z.object({ + /** The key or ID of the issue. */ + issueIdOrKey: z.string(), + /** The key of the property. */ + propertyKey: z.string(), +}); + +export type GetIssuePropertyParameters = z.infer; diff --git a/src/version2/parameters/getIssueSecurityLevel.ts b/src/version2/parameters/getIssueSecurityLevel.ts deleted file mode 100644 index 3fef72e503..0000000000 --- a/src/version2/parameters/getIssueSecurityLevel.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetIssueSecurityLevel { - /** The ID of the issue security level. */ - id: string; -} diff --git a/src/version2/parameters/getIssueSecurityLevelMembers.ts b/src/version2/parameters/getIssueSecurityLevelMembers.ts deleted file mode 100644 index b2839c217c..0000000000 --- a/src/version2/parameters/getIssueSecurityLevelMembers.ts +++ /dev/null @@ -1,26 +0,0 @@ -export interface GetIssueSecurityLevelMembers { - /** - * The ID of the issue security scheme. Use the [Get issue security schemes](#api-rest-api-2-issuesecurityschemes-get) - * operation to get a list of issue security scheme IDs. - */ - issueSecuritySchemeId: 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. */ - maxResults?: number; - /** - * The list of issue security level IDs. To include multiple issue security levels separate IDs with ampersand: - * `issueSecurityLevelId=10000&issueSecurityLevelId=10001`. - */ - issueSecurityLevelId?: number[]; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand - * options include: - * - * `all` Returns all expandable information. `field` Returns information about the custom field granted the - * permission. `group` Returns information about the group that is granted the permission. `projectRole` Returns - * information about the project role granted the permission. `user` Returns information about the user who is granted - * the permission. - */ - expand?: string; -} diff --git a/src/version2/parameters/getIssueSecurityLevelMembersParameters.ts b/src/version2/parameters/getIssueSecurityLevelMembersParameters.ts new file mode 100644 index 0000000000..f83ecb5935 --- /dev/null +++ b/src/version2/parameters/getIssueSecurityLevelMembersParameters.ts @@ -0,0 +1,31 @@ +import { z } from 'zod'; + +export const GetIssueSecurityLevelMembersParametersSchema = z.object({ + /** + * The ID of the issue security scheme. Use the [Get issue security schemes](#api-rest-api-2-issuesecurityschemes-get) + * operation to get a list of issue security scheme IDs. + */ + issueSecuritySchemeId: z.number().int(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of issue security level IDs. To include multiple issue security levels separate IDs with ampersand: + * `issueSecurityLevelId=10000&issueSecurityLevelId=10001`. + */ + issueSecurityLevelId: z.array(z.string()).optional(), + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand + * options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand: z.string().optional(), +}); + +export type GetIssueSecurityLevelMembersParameters = z.infer; diff --git a/src/version2/parameters/getIssueSecurityLevelParameters.ts b/src/version2/parameters/getIssueSecurityLevelParameters.ts new file mode 100644 index 0000000000..99d2294744 --- /dev/null +++ b/src/version2/parameters/getIssueSecurityLevelParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetIssueSecurityLevelParametersSchema = z.object({ + /** The ID of the issue security level. */ + id: z.string(), +}); + +export type GetIssueSecurityLevelParameters = z.infer; diff --git a/src/version2/parameters/getIssueSecurityScheme.ts b/src/version2/parameters/getIssueSecurityScheme.ts deleted file mode 100644 index c6021aab75..0000000000 --- a/src/version2/parameters/getIssueSecurityScheme.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface GetIssueSecurityScheme { - /** - * The ID of the issue security scheme. Use the [Get issue security schemes](#api-rest-api-2-issuesecurityschemes-get) - * operation to get a list of issue security scheme IDs. - */ - id: number; -} diff --git a/src/version2/parameters/getIssueSecuritySchemeParameters.ts b/src/version2/parameters/getIssueSecuritySchemeParameters.ts new file mode 100644 index 0000000000..15d2d8a673 --- /dev/null +++ b/src/version2/parameters/getIssueSecuritySchemeParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const GetIssueSecuritySchemeParametersSchema = z.object({ + /** + * The ID of the issue security scheme. Use the [Get issue security schemes](#api-rest-api-2-issuesecurityschemes-get) + * operation to get a list of issue security scheme IDs. + */ + id: z.number().int(), +}); + +export type GetIssueSecuritySchemeParameters = z.infer; diff --git a/src/version2/parameters/getIssueSecuritySchemesParameters.ts b/src/version2/parameters/getIssueSecuritySchemesParameters.ts new file mode 100644 index 0000000000..65143f6da1 --- /dev/null +++ b/src/version2/parameters/getIssueSecuritySchemesParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetIssueSecuritySchemesParametersSchema = z.object({}); + +export type GetIssueSecuritySchemesParameters = z.infer; diff --git a/src/version2/parameters/getIssueType.ts b/src/version2/parameters/getIssueType.ts deleted file mode 100644 index 09da2aba1f..0000000000 --- a/src/version2/parameters/getIssueType.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetIssueType { - /** The ID of the issue type. */ - id: string; -} diff --git a/src/version2/parameters/getIssueTypeMappingsForContexts.ts b/src/version2/parameters/getIssueTypeMappingsForContexts.ts deleted file mode 100644 index 0734c75e1c..0000000000 --- a/src/version2/parameters/getIssueTypeMappingsForContexts.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface GetIssueTypeMappingsForContexts { - /** The ID of the custom field. */ - fieldId: string; - /** - * The ID of the context. To include multiple contexts, provide an ampersand-separated list. For example, - * `contextId=10001&contextId=10002`. - */ - contextId?: 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. */ - maxResults?: number; -} diff --git a/src/version2/parameters/getIssueTypeMappingsForContextsParameters.ts b/src/version2/parameters/getIssueTypeMappingsForContextsParameters.ts new file mode 100644 index 0000000000..c5b6e56dec --- /dev/null +++ b/src/version2/parameters/getIssueTypeMappingsForContextsParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const GetIssueTypeMappingsForContextsParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** + * The ID of the context. To include multiple contexts, provide an ampersand-separated list. For example, + * `contextId=10001&contextId=10002`. + */ + contextId: z.array(z.number().int()).optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetIssueTypeMappingsForContextsParameters = z.infer; diff --git a/src/version2/parameters/getIssueTypeParameters.ts b/src/version2/parameters/getIssueTypeParameters.ts new file mode 100644 index 0000000000..0816595475 --- /dev/null +++ b/src/version2/parameters/getIssueTypeParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetIssueTypeParametersSchema = z.object({ + /** The ID of the issue type. */ + id: z.string(), +}); + +export type GetIssueTypeParameters = z.infer; diff --git a/src/version2/parameters/getIssueTypeProperty.ts b/src/version2/parameters/getIssueTypeProperty.ts deleted file mode 100644 index e39f0fafff..0000000000 --- a/src/version2/parameters/getIssueTypeProperty.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface GetIssueTypeProperty { - /** The ID of the issue type. */ - issueTypeId: string; - /** - * The key of the property. Use [Get issue type property keys](#api-rest-api-2-issuetype-issueTypeId-properties-get) - * to get a list of all issue type property keys. - */ - propertyKey: string; -} diff --git a/src/version2/parameters/getIssueTypePropertyKeys.ts b/src/version2/parameters/getIssueTypePropertyKeys.ts deleted file mode 100644 index 87de3f2d1f..0000000000 --- a/src/version2/parameters/getIssueTypePropertyKeys.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetIssueTypePropertyKeys { - /** The ID of the issue type. */ - issueTypeId: string; -} diff --git a/src/version2/parameters/getIssueTypePropertyKeysParameters.ts b/src/version2/parameters/getIssueTypePropertyKeysParameters.ts new file mode 100644 index 0000000000..85b7556954 --- /dev/null +++ b/src/version2/parameters/getIssueTypePropertyKeysParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetIssueTypePropertyKeysParametersSchema = z.object({ + /** The ID of the issue type. */ + issueTypeId: z.string(), +}); + +export type GetIssueTypePropertyKeysParameters = z.infer; diff --git a/src/version2/parameters/getIssueTypePropertyParameters.ts b/src/version2/parameters/getIssueTypePropertyParameters.ts new file mode 100644 index 0000000000..9eedbaa289 --- /dev/null +++ b/src/version2/parameters/getIssueTypePropertyParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const GetIssueTypePropertyParametersSchema = z.object({ + /** The ID of the issue type. */ + issueTypeId: z.string(), + /** + * The key of the property. Use [Get issue type property keys](#api-rest-api-2-issuetype-issueTypeId-properties-get) + * to get a list of all issue type property keys. + */ + propertyKey: z.string(), +}); + +export type GetIssueTypePropertyParameters = z.infer; diff --git a/src/version2/parameters/getIssueTypeSchemeForProjects.ts b/src/version2/parameters/getIssueTypeSchemeForProjects.ts deleted file mode 100644 index aaf455ca82..0000000000 --- a/src/version2/parameters/getIssueTypeSchemeForProjects.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface GetIssueTypeSchemeForProjects { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of project IDs. To include multiple project IDs, provide an ampersand-separated list. For example, - * `projectId=10000&projectId=10001`. - */ - projectId: (string | number)[]; -} diff --git a/src/version2/parameters/getIssueTypeSchemeForProjectsParameters.ts b/src/version2/parameters/getIssueTypeSchemeForProjectsParameters.ts new file mode 100644 index 0000000000..cf04fc9163 --- /dev/null +++ b/src/version2/parameters/getIssueTypeSchemeForProjectsParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const GetIssueTypeSchemeForProjectsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of project IDs. To include multiple project IDs, provide an ampersand-separated list. For example, + * `projectId=10000&projectId=10001`. + */ + projectId: z.array(z.number().int()), +}); + +export type GetIssueTypeSchemeForProjectsParameters = z.infer; diff --git a/src/version2/parameters/getIssueTypeSchemesMapping.ts b/src/version2/parameters/getIssueTypeSchemesMapping.ts deleted file mode 100644 index 4f70d56682..0000000000 --- a/src/version2/parameters/getIssueTypeSchemesMapping.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface GetIssueTypeSchemesMapping { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of issue type scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * `issueTypeSchemeId=10000&issueTypeSchemeId=10001`. - */ - issueTypeSchemeId?: number[]; -} diff --git a/src/version2/parameters/getIssueTypeSchemesMappingParameters.ts b/src/version2/parameters/getIssueTypeSchemesMappingParameters.ts new file mode 100644 index 0000000000..8f17d67c27 --- /dev/null +++ b/src/version2/parameters/getIssueTypeSchemesMappingParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const GetIssueTypeSchemesMappingParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of issue type scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `issueTypeSchemeId=10000&issueTypeSchemeId=10001`. + */ + issueTypeSchemeId: z.array(z.number().int()).optional(), +}); + +export type GetIssueTypeSchemesMappingParameters = z.infer; diff --git a/src/version2/parameters/getIssueTypeScreenSchemeMappings.ts b/src/version2/parameters/getIssueTypeScreenSchemeMappings.ts deleted file mode 100644 index 3eddb4f458..0000000000 --- a/src/version2/parameters/getIssueTypeScreenSchemeMappings.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface GetIssueTypeScreenSchemeMappings { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of issue type screen scheme IDs. To include multiple issue type screen schemes, separate IDs with - * ampersand: `issueTypeScreenSchemeId=10000&issueTypeScreenSchemeId=10001`. - */ - issueTypeScreenSchemeId?: number[]; -} diff --git a/src/version2/parameters/getIssueTypeScreenSchemeMappingsParameters.ts b/src/version2/parameters/getIssueTypeScreenSchemeMappingsParameters.ts new file mode 100644 index 0000000000..a966972013 --- /dev/null +++ b/src/version2/parameters/getIssueTypeScreenSchemeMappingsParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const GetIssueTypeScreenSchemeMappingsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of issue type screen scheme IDs. To include multiple issue type screen schemes, separate IDs with + * ampersand: `issueTypeScreenSchemeId=10000&issueTypeScreenSchemeId=10001`. + */ + issueTypeScreenSchemeId: z.array(z.number().int()).optional(), +}); + +export type GetIssueTypeScreenSchemeMappingsParameters = z.infer< + typeof GetIssueTypeScreenSchemeMappingsParametersSchema +>; diff --git a/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.ts b/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.ts deleted file mode 100644 index 82ac3fabdc..0000000000 --- a/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface GetIssueTypeScreenSchemeProjectAssociations { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of project IDs. To include multiple projects, separate IDs with ampersand: - * `projectId=10000&projectId=10001`. - */ - projectId: (string | number)[]; -} diff --git a/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociationsParameters.ts b/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociationsParameters.ts new file mode 100644 index 0000000000..a14f822041 --- /dev/null +++ b/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociationsParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const GetIssueTypeScreenSchemeProjectAssociationsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of project IDs. To include multiple projects, separate IDs with ampersand: + * `projectId=10000&projectId=10001`. + */ + projectId: z.array(z.number().int()), +}); + +export type GetIssueTypeScreenSchemeProjectAssociationsParameters = z.infer< + typeof GetIssueTypeScreenSchemeProjectAssociationsParametersSchema +>; diff --git a/src/version2/parameters/getIssueTypeScreenSchemes.ts b/src/version2/parameters/getIssueTypeScreenSchemes.ts deleted file mode 100644 index e53b313eda..0000000000 --- a/src/version2/parameters/getIssueTypeScreenSchemes.ts +++ /dev/null @@ -1,26 +0,0 @@ -export interface GetIssueTypeScreenSchemes { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of issue type screen scheme IDs. To include multiple IDs, provide an ampersand-separated list. For - * example, `id=10000&id=10001`. - */ - id?: number[]; - /** String used to perform a case-insensitive partial match with issue type screen scheme name. */ - queryString?: string; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: - * - * - `name` Sorts by issue type screen scheme name. - * - `id` Sorts by issue type screen scheme ID. - */ - orderBy?: 'name' | '-name' | '+name' | 'id' | '-id' | '+id' | string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts `projects` that, for each issue type screen schemes, returns - * information about the projects the issue type screen scheme is assigned to. - */ - expand?: string; -} diff --git a/src/version2/parameters/getIssueTypeScreenSchemesParameters.ts b/src/version2/parameters/getIssueTypeScreenSchemesParameters.ts new file mode 100644 index 0000000000..a813c461f8 --- /dev/null +++ b/src/version2/parameters/getIssueTypeScreenSchemesParameters.ts @@ -0,0 +1,30 @@ +import { z } from 'zod'; + +export const GetIssueTypeScreenSchemesParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of issue type screen scheme IDs. To include multiple IDs, provide an ampersand-separated list. For + * example, `id=10000&id=10001`. + */ + id: z.array(z.number().int()).optional(), + /** String used to perform a case-insensitive partial match with issue type screen scheme name. */ + queryString: z.string().optional(), + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `name` Sorts by issue type screen scheme name. + * - `id` Sorts by issue type screen scheme ID. + */ + orderBy: z.enum(['name', '-name', '+name', 'id', '-id', '+id']).optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts `projects` that, for each issue type screen schemes, returns + * information about the projects the issue type screen scheme is assigned to. + */ + expand: z.string().optional(), +}); + +export type GetIssueTypeScreenSchemesParameters = z.infer; diff --git a/src/version2/parameters/getIssueTypesForProject.ts b/src/version2/parameters/getIssueTypesForProject.ts deleted file mode 100644 index b06312da99..0000000000 --- a/src/version2/parameters/getIssueTypesForProject.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface GetIssueTypesForProject { - /** The ID of the project. */ - projectId: string | number; - /** - * The level of the issue type to filter by. Use: - * - * `-1` for Subtask. `0` for Base. `1` for Epic. - */ - level?: number; -} diff --git a/src/version2/parameters/getIssueTypesForProjectParameters.ts b/src/version2/parameters/getIssueTypesForProjectParameters.ts new file mode 100644 index 0000000000..42eb03de9d --- /dev/null +++ b/src/version2/parameters/getIssueTypesForProjectParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const GetIssueTypesForProjectParametersSchema = z.object({ + /** The ID of the project. */ + projectId: z.number().int(), + /** + * The level of the issue type to filter by. Use: + * + * - `-1` for Subtask. + * - `0` for Base. + * - `1` for Epic. + */ + level: z.number().int().optional(), +}); + +export type GetIssueTypesForProjectParameters = z.infer; diff --git a/src/version2/parameters/getIssueWatchers.ts b/src/version2/parameters/getIssueWatchers.ts deleted file mode 100644 index c19451281e..0000000000 --- a/src/version2/parameters/getIssueWatchers.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetIssueWatchers { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/getIssueWatchersParameters.ts b/src/version2/parameters/getIssueWatchersParameters.ts new file mode 100644 index 0000000000..97fedbc1bc --- /dev/null +++ b/src/version2/parameters/getIssueWatchersParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetIssueWatchersParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), +}); + +export type GetIssueWatchersParameters = z.infer; diff --git a/src/version2/parameters/getIssueWorklog.ts b/src/version2/parameters/getIssueWorklog.ts deleted file mode 100644 index eba9d2734a..0000000000 --- a/src/version2/parameters/getIssueWorklog.ts +++ /dev/null @@ -1,17 +0,0 @@ -export interface GetIssueWorklog { - /** The ID or key of the issue. */ - issueIdOrKey: 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; - /** The worklog start date and time, as a UNIX timestamp in milliseconds, after which worklogs are returned. */ - startedAfter?: number; - /** The worklog start date and time, as a UNIX timestamp in milliseconds, before which worklogs are returned. */ - startedBefore?: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about worklogs in the response. This parameter accepts`properties`, which returns worklog properties. - */ - expand?: string; -} diff --git a/src/version2/parameters/getIssueWorklogParameters.ts b/src/version2/parameters/getIssueWorklogParameters.ts new file mode 100644 index 0000000000..3a18604bc0 --- /dev/null +++ b/src/version2/parameters/getIssueWorklogParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const GetIssueWorklogParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** The worklog start date and time, as a UNIX timestamp in milliseconds, after which worklogs are returned. */ + startedAfter: z.number().int().optional(), + /** The worklog start date and time, as a UNIX timestamp in milliseconds, before which worklogs are returned. */ + startedBefore: z.number().int().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about worklogs in the response. This parameter accepts`properties`, which returns worklog properties. + */ + expand: z.string().optional(), +}); + +export type GetIssueWorklogParameters = z.infer; diff --git a/src/version2/parameters/getLicenseParameters.ts b/src/version2/parameters/getLicenseParameters.ts new file mode 100644 index 0000000000..ec08d705df --- /dev/null +++ b/src/version2/parameters/getLicenseParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetLicenseParametersSchema = z.object({}); + +export type GetLicenseParameters = z.infer; diff --git a/src/version2/parameters/getLocaleParameters.ts b/src/version2/parameters/getLocaleParameters.ts new file mode 100644 index 0000000000..7c163e17fc --- /dev/null +++ b/src/version2/parameters/getLocaleParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetLocaleParametersSchema = z.object({}); + +export type GetLocaleParameters = z.infer; diff --git a/src/version2/parameters/getModulesParameters.ts b/src/version2/parameters/getModulesParameters.ts new file mode 100644 index 0000000000..6b5921319f --- /dev/null +++ b/src/version2/parameters/getModulesParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetModulesParametersSchema = z.object({}); + +export type GetModulesParameters = z.infer; diff --git a/src/version2/parameters/getMyFilters.ts b/src/version2/parameters/getMyFilters.ts deleted file mode 100644 index 1eebac1163..0000000000 --- a/src/version2/parameters/getMyFilters.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface GetMyFilters { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't - * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of - * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to - * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: string; - /** Include the user's favorite filters in the response. */ - includeFavourites?: boolean; -} diff --git a/src/version2/parameters/getMyFiltersParameters.ts b/src/version2/parameters/getMyFiltersParameters.ts new file mode 100644 index 0000000000..148c118d5e --- /dev/null +++ b/src/version2/parameters/getMyFiltersParameters.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const GetMyFiltersParametersSchema = z.object({ + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. + * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the + * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is + * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For + * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand: z.string().optional(), + /** Include the user's favorite filters in the response. */ + includeFavourites: z.boolean().optional(), +}); + +export type GetMyFiltersParameters = z.infer; diff --git a/src/version2/parameters/getMyPermissions.ts b/src/version2/parameters/getMyPermissions.ts deleted file mode 100644 index a4e3f61549..0000000000 --- a/src/version2/parameters/getMyPermissions.ts +++ /dev/null @@ -1,19 +0,0 @@ -export interface GetMyPermissions { - /** The key of project. Ignored if `projectId` is provided. */ - projectKey?: string; - /** The ID of project. */ - projectId?: string; - /** The key of the issue. Ignored if `issueId` is provided. */ - issueKey?: string; - /** The ID of the issue. */ - issueId?: string; - /** - * A list of permission keys. (Required) This parameter accepts a comma-separated list. To get the list of available - * permissions, use [Get all permissions](#api-rest-api-2-permissions-get). - */ - permissions?: string; - projectUuid?: string; - projectConfigurationUuid?: string; - /** The ID of the comment. */ - commentId?: string; -} diff --git a/src/version2/parameters/getMyPermissionsParameters.ts b/src/version2/parameters/getMyPermissionsParameters.ts new file mode 100644 index 0000000000..389bfef408 --- /dev/null +++ b/src/version2/parameters/getMyPermissionsParameters.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const GetMyPermissionsParametersSchema = z.object({ + /** The key of project. Ignored if `projectId` is provided. */ + projectKey: z.string().optional(), + /** The ID of project. */ + projectId: z.string().optional(), + /** The key of the issue. Ignored if `issueId` is provided. */ + issueKey: z.string().optional(), + /** The ID of the issue. */ + issueId: z.string().optional(), + /** + * A list of permission keys. (Required) This parameter accepts a comma-separated list. To get the list of available + * permissions, use [Get all permissions](#api-rest-api-2-permissions-get). + */ + permissions: z.string().optional(), + projectUuid: z.string().optional(), + projectConfigurationUuid: z.string().optional(), + /** The ID of the comment. */ + commentId: z.string().optional(), +}); + +export type GetMyPermissionsParameters = z.infer; diff --git a/src/version2/parameters/getNotificationScheme.ts b/src/version2/parameters/getNotificationScheme.ts deleted file mode 100644 index 17836ac59d..0000000000 --- a/src/version2/parameters/getNotificationScheme.ts +++ /dev/null @@ -1,29 +0,0 @@ -export interface GetNotificationScheme { - /** - * The ID of the notification scheme. Use [Get notification schemes paginated](#api-rest-api-2-notificationscheme-get) - * to get a list of notification scheme IDs. - */ - id: 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: - * - * - `all` Returns all expandable information. - * - `field` Returns information about any custom fields assigned to receive an event. - * - `group` Returns information about any groups assigned to receive an event. - * - `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable - * information. - * - `projectRole` Returns information about any project roles assigned to receive an event. - * - `user` Returns information about any users assigned to receive an event. - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'notificationSchemeEvents' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'notificationSchemeEvents' | 'projectRole' | 'user')[] - | string - | string[]; -} diff --git a/src/version2/parameters/getNotificationSchemeForProject.ts b/src/version2/parameters/getNotificationSchemeForProject.ts deleted file mode 100644 index 965cfa7800..0000000000 --- a/src/version2/parameters/getNotificationSchemeForProject.ts +++ /dev/null @@ -1,26 +0,0 @@ -export interface GetNotificationSchemeForProject { - /** The project ID or project key (case sensitive). */ - projectKeyOrId: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `all` Returns all expandable information - * - `field` Returns information about any custom fields assigned to receive an event - * - `group` Returns information about any groups assigned to receive an event - * - `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable - * information - * - `projectRole` Returns information about any project roles assigned to receive an event - * - `user` Returns information about any users assigned to receive an event - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'notificationSchemeEvents' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'notificationSchemeEvents' | 'projectRole' | 'user')[] - | string - | string[]; -} diff --git a/src/version2/parameters/getNotificationSchemeForProjectParameters.ts b/src/version2/parameters/getNotificationSchemeForProjectParameters.ts new file mode 100644 index 0000000000..b5f58bc55f --- /dev/null +++ b/src/version2/parameters/getNotificationSchemeForProjectParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const GetNotificationSchemeForProjectParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectKeyOrId: z.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: + * + * - `all` Returns all expandable information + * - `field` Returns information about any custom fields assigned to receive an event + * - `group` Returns information about any groups assigned to receive an event + * - `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable + * information + * - `projectRole` Returns information about any project roles assigned to receive an event + * - `user` Returns information about any users assigned to receive an event + */ + expand: z.string().optional(), +}); + +export type GetNotificationSchemeForProjectParameters = z.infer; diff --git a/src/version2/parameters/getNotificationSchemeParameters.ts b/src/version2/parameters/getNotificationSchemeParameters.ts new file mode 100644 index 0000000000..eb5c743c68 --- /dev/null +++ b/src/version2/parameters/getNotificationSchemeParameters.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; + +export const GetNotificationSchemeParametersSchema = z.object({ + /** + * The ID of the notification scheme. Use [Get notification schemes paginated](#api-rest-api-2-notificationscheme-get) + * to get a list of notification scheme IDs. + */ + id: z.number().int(), + /** + * 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: + * + * - `all` Returns all expandable information + * - `field` Returns information about any custom fields assigned to receive an event + * - `group` Returns information about any groups assigned to receive an event + * - `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable + * information + * - `projectRole` Returns information about any project roles assigned to receive an event + * - `user` Returns information about any users assigned to receive an event + */ + expand: z.string().optional(), +}); + +export type GetNotificationSchemeParameters = z.infer; diff --git a/src/version2/parameters/getNotificationSchemeToProjectMappings.ts b/src/version2/parameters/getNotificationSchemeToProjectMappings.ts deleted file mode 100644 index bfb504e6e2..0000000000 --- a/src/version2/parameters/getNotificationSchemeToProjectMappings.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface GetNotificationSchemeToProjectMappings { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** The list of notifications scheme IDs to be filtered out */ - notificationSchemeId?: string[]; - /** The list of project IDs to be filtered out */ - projectId?: string[]; -} diff --git a/src/version2/parameters/getNotificationSchemeToProjectMappingsParameters.ts b/src/version2/parameters/getNotificationSchemeToProjectMappingsParameters.ts new file mode 100644 index 0000000000..7dbb802d79 --- /dev/null +++ b/src/version2/parameters/getNotificationSchemeToProjectMappingsParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const GetNotificationSchemeToProjectMappingsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.string().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.string().optional(), + /** The list of notifications scheme IDs to be filtered out */ + notificationSchemeId: z.array(z.string()).optional(), + /** The list of project IDs to be filtered out */ + projectId: z.array(z.string()).optional(), +}); + +export type GetNotificationSchemeToProjectMappingsParameters = z.infer< + typeof GetNotificationSchemeToProjectMappingsParametersSchema +>; diff --git a/src/version2/parameters/getNotificationSchemes.ts b/src/version2/parameters/getNotificationSchemes.ts deleted file mode 100644 index fdb5de734c..0000000000 --- a/src/version2/parameters/getNotificationSchemes.ts +++ /dev/null @@ -1,37 +0,0 @@ -export interface GetNotificationSchemes { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** The list of notification schemes IDs to be filtered by */ - id?: string[]; - /** The list of projects IDs to be filtered by */ - projectId?: string[]; - /** - * When set to true, returns only the default notification scheme. If you provide project IDs not associated with the - * default, returns an empty page. The default value is false. - */ - onlyDefault?: boolean; - /** - * 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: - * - * - `all` Returns all expandable information - * - `field` Returns information about any custom fields assigned to receive an event - * - `group` Returns information about any groups assigned to receive an event - * - `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable - * information - * - `projectRole` Returns information about any project roles assigned to receive an event - * - `user` Returns information about any users assigned to receive an event - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'notificationSchemeEvents' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'notificationSchemeEvents' | 'projectRole' | 'user')[] - | string - | string[]; -} diff --git a/src/version2/parameters/getNotificationSchemesParameters.ts b/src/version2/parameters/getNotificationSchemesParameters.ts new file mode 100644 index 0000000000..b81eb635ea --- /dev/null +++ b/src/version2/parameters/getNotificationSchemesParameters.ts @@ -0,0 +1,32 @@ +import { z } from 'zod'; + +export const GetNotificationSchemesParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.string().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.string().optional(), + /** The list of notification schemes IDs to be filtered by */ + id: z.array(z.string()).optional(), + /** The list of projects IDs to be filtered by */ + projectId: z.array(z.string()).optional(), + /** + * When set to true, returns only the default notification scheme. If you provide project IDs not associated with the + * default, returns an empty page. The default value is false. + */ + onlyDefault: z.boolean().optional(), + /** + * 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: + * + * - `all` Returns all expandable information + * - `field` Returns information about any custom fields assigned to receive an event + * - `group` Returns information about any groups assigned to receive an event + * - `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable + * information + * - `projectRole` Returns information about any project roles assigned to receive an event + * - `user` Returns information about any users assigned to receive an event + */ + expand: z.string().optional(), +}); + +export type GetNotificationSchemesParameters = z.infer; diff --git a/src/version2/parameters/getOptionsForContext.ts b/src/version2/parameters/getOptionsForContext.ts deleted file mode 100644 index 849ddb8501..0000000000 --- a/src/version2/parameters/getOptionsForContext.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface GetOptionsForContext { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; - /** The ID of the option. */ - optionId?: number; - /** Whether only options are returned. */ - onlyOptions?: boolean; - /** 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/getOptionsForContextParameters.ts b/src/version2/parameters/getOptionsForContextParameters.ts new file mode 100644 index 0000000000..9853f8a921 --- /dev/null +++ b/src/version2/parameters/getOptionsForContextParameters.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +export const GetOptionsForContextParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The ID of the context. */ + contextId: z.number().int(), + /** The ID of the option. */ + optionId: z.number().int().optional(), + /** Whether only options are returned. */ + onlyOptions: z.boolean().optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetOptionsForContextParameters = z.infer; diff --git a/src/version2/parameters/getPermissionScheme.ts b/src/version2/parameters/getPermissionScheme.ts deleted file mode 100644 index db01ec65a5..0000000000 --- a/src/version2/parameters/getPermissionScheme.ts +++ /dev/null @@ -1,25 +0,0 @@ -export interface GetPermissionScheme { - /** The ID of the permission scheme to return. */ - schemeId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are included when you specify any value. Expand options include: - * - * - `all` Returns all expandable information. - * - `field` Returns information about the custom field granted the permission. - * - `group` Returns information about the group that is granted the permission. - * - `permissions` Returns all permission grants for each permission scheme. - * - `projectRole` Returns information about the project role granted the permission. - * - `user` Returns information about the user who is granted the permission. - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'permissions' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] - | string - | string[]; -} diff --git a/src/version2/parameters/getPermissionSchemeGrant.ts b/src/version2/parameters/getPermissionSchemeGrant.ts deleted file mode 100644 index 752cbab2f5..0000000000 --- a/src/version2/parameters/getPermissionSchemeGrant.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface GetPermissionSchemeGrant { - /** The ID of the permission scheme. */ - schemeId: number; - /** The ID of the permission grant. */ - permissionId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `all` Returns all expandable information. `field` Returns information about the custom field granted the - * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all - * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the - * permission. `user` Returns information about the user who is granted the permission. - */ - expand?: string; -} diff --git a/src/version2/parameters/getPermissionSchemeGrantParameters.ts b/src/version2/parameters/getPermissionSchemeGrantParameters.ts new file mode 100644 index 0000000000..e8144bf5db --- /dev/null +++ b/src/version2/parameters/getPermissionSchemeGrantParameters.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; + +export const GetPermissionSchemeGrantParametersSchema = z.object({ + /** The ID of the permission scheme. */ + schemeId: z.number().int(), + /** The ID of the permission grant. */ + permissionId: z.number().int(), + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand: z.string().optional(), +}); + +export type GetPermissionSchemeGrantParameters = z.infer; diff --git a/src/version2/parameters/getPermissionSchemeGrants.ts b/src/version2/parameters/getPermissionSchemeGrants.ts deleted file mode 100644 index 79b340eb20..0000000000 --- a/src/version2/parameters/getPermissionSchemeGrants.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface GetPermissionSchemeGrants { - /** The ID of the permission scheme. */ - schemeId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `permissions` Returns all permission grants for each permission scheme. `user` Returns information about the user - * who is granted the permission. `group` Returns information about the group that is granted the permission. - * `projectRole` Returns information about the project role granted the permission. `field` Returns information about - * the custom field granted the permission. `all` Returns all expandable information. - */ - expand?: string; -} diff --git a/src/version2/parameters/getPermissionSchemeGrantsParameters.ts b/src/version2/parameters/getPermissionSchemeGrantsParameters.ts new file mode 100644 index 0000000000..066e070bd5 --- /dev/null +++ b/src/version2/parameters/getPermissionSchemeGrantsParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const GetPermissionSchemeGrantsParametersSchema = z.object({ + /** The ID of the permission scheme. */ + schemeId: z.number().int(), + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * - `permissions` Returns all permission grants for each permission scheme. + * - `user` Returns information about the user who is granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `projectRole` Returns information about the project role granted the permission. + * - `field` Returns information about the custom field granted the permission. + * - `all` Returns all expandable information. + */ + expand: z.string().optional(), +}); + +export type GetPermissionSchemeGrantsParameters = z.infer; diff --git a/src/version2/parameters/getPermissionSchemeParameters.ts b/src/version2/parameters/getPermissionSchemeParameters.ts new file mode 100644 index 0000000000..68ad9a092b --- /dev/null +++ b/src/version2/parameters/getPermissionSchemeParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const GetPermissionSchemeParametersSchema = z.object({ + /** The ID of the permission scheme to return. */ + schemeId: z.number().int(), + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are included when you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand: z.string().optional(), +}); + +export type GetPermissionSchemeParameters = z.infer; diff --git a/src/version2/parameters/getPermittedProjects.ts b/src/version2/parameters/getPermittedProjects.ts deleted file mode 100644 index 4c1c5c91c2..0000000000 --- a/src/version2/parameters/getPermittedProjects.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PermissionsKeys } from '../models'; - -export interface GetPermittedProjects extends PermissionsKeys {} diff --git a/src/version2/parameters/getPermittedProjectsParameters.ts b/src/version2/parameters/getPermittedProjectsParameters.ts new file mode 100644 index 0000000000..9b0fb07f80 --- /dev/null +++ b/src/version2/parameters/getPermittedProjectsParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetPermittedProjectsParametersSchema = z.object({ + /** A list of permission keys. */ + permissions: z.array(z.string()), +}); + +export type GetPermittedProjectsParameters = z.infer; diff --git a/src/version2/parameters/getPlan.ts b/src/version2/parameters/getPlan.ts deleted file mode 100644 index 9ed1b0df18..0000000000 --- a/src/version2/parameters/getPlan.ts +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index f48b73a426..0000000000 --- a/src/version2/parameters/getPlanOnlyTeam.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/getPlanOnlyTeamParameters.ts b/src/version2/parameters/getPlanOnlyTeamParameters.ts new file mode 100644 index 0000000000..ec577c963a --- /dev/null +++ b/src/version2/parameters/getPlanOnlyTeamParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetPlanOnlyTeamParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), + /** The ID of the plan-only team. */ + planOnlyTeamId: z.number().int(), +}); + +export type GetPlanOnlyTeamParameters = z.infer; diff --git a/src/version2/parameters/getPlanParameters.ts b/src/version2/parameters/getPlanParameters.ts new file mode 100644 index 0000000000..43cf95814f --- /dev/null +++ b/src/version2/parameters/getPlanParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetPlanParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), + /** Whether to return group IDs instead of group names. Group names are deprecated. */ + useGroupId: z.boolean().optional(), +}); + +export type GetPlanParameters = z.infer; diff --git a/src/version2/parameters/getPlans.ts b/src/version2/parameters/getPlans.ts deleted file mode 100644 index 2633d4c9e8..0000000000 --- a/src/version2/parameters/getPlans.ts +++ /dev/null @@ -1,10 +0,0 @@ -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/getPlansParameters.ts b/src/version2/parameters/getPlansParameters.ts new file mode 100644 index 0000000000..bd7ce82c49 --- /dev/null +++ b/src/version2/parameters/getPlansParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetPlansParametersSchema = z.object({ + /** Whether to include trashed plans in the results. */ + includeTrashed: z.boolean().optional(), + /** Whether to include archived plans in the results. */ + includeArchived: z.boolean().optional(), + /** The cursor to start from. If not provided, the first page will be returned. */ + cursor: z.string().optional(), + /** The maximum number of plans to return per page. The maximum value is 50. The default value is 50. */ + maxResults: z.number().int().optional(), +}); + +export type GetPlansParameters = z.infer; diff --git a/src/version2/parameters/getPolicies.ts b/src/version2/parameters/getPolicies.ts deleted file mode 100644 index afba75fdec..0000000000 --- a/src/version2/parameters/getPolicies.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetPolicies { - /** A list of project identifiers. This parameter accepts a comma-separated list. */ - ids?: string; -} diff --git a/src/version2/parameters/getPoliciesParameters.ts b/src/version2/parameters/getPoliciesParameters.ts new file mode 100644 index 0000000000..d8879cd8ca --- /dev/null +++ b/src/version2/parameters/getPoliciesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetPoliciesParametersSchema = z.object({ + /** A list of project identifiers. This parameter accepts a comma-separated list. */ + ids: z.string().optional(), +}); + +export type GetPoliciesParameters = z.infer; diff --git a/src/version2/parameters/getPolicyParameters.ts b/src/version2/parameters/getPolicyParameters.ts new file mode 100644 index 0000000000..3c59a217ad --- /dev/null +++ b/src/version2/parameters/getPolicyParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetPolicyParametersSchema = z.object({}); + +export type GetPolicyParameters = z.infer; diff --git a/src/version2/parameters/getPrecomputations.ts b/src/version2/parameters/getPrecomputations.ts deleted file mode 100644 index bc668412fe..0000000000 --- a/src/version2/parameters/getPrecomputations.ts +++ /dev/null @@ -1,37 +0,0 @@ -export interface GetPrecomputations { - /** - * The function key in format: - * - * Forge: `ari:cloud:ecosystem::extension/[App ID]/[Environment ID]/static/[Function key from manifest]` Connect: - * `[App key]__[Module key]` - */ - functionKey?: 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; - /** - * @deprecated [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a - * field: - * - * - `functionKey` Sorts by the functionKey. - * - `used` Sorts by the used timestamp. - * - `created` Sorts by the created timestamp. - * - `updated` Sorts by the updated timestamp. - */ - filter?: string; - orderBy?: - | 'functionKey' - | 'used' - | 'created' - | 'updated' - | '+functionKey' - | '+used' - | '+created' - | '+updated' - | '-functionKey' - | '-used' - | '-created' - | '-updated' - | string; -} diff --git a/src/version2/parameters/getPrecomputationsByID.ts b/src/version2/parameters/getPrecomputationsByID.ts deleted file mode 100644 index 5100bb6dfc..0000000000 --- a/src/version2/parameters/getPrecomputationsByID.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { 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/getPrecomputationsByIDParameters.ts b/src/version2/parameters/getPrecomputationsByIDParameters.ts new file mode 100644 index 0000000000..e56ebe936d --- /dev/null +++ b/src/version2/parameters/getPrecomputationsByIDParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const GetPrecomputationsByIDParametersSchema = z.object({ + /** + * [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: z.string().optional(), + precomputationIDs: z.array(z.string()).optional(), +}); + +export type GetPrecomputationsByIDParameters = z.infer; diff --git a/src/version2/parameters/getPrecomputationsParameters.ts b/src/version2/parameters/getPrecomputationsParameters.ts new file mode 100644 index 0000000000..558468cdc0 --- /dev/null +++ b/src/version2/parameters/getPrecomputationsParameters.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; + +export const GetPrecomputationsParametersSchema = z.object({ + /** + * The function key in format: + * + * - Forge: `ari:cloud:ecosystem::extension/[App ID]/[Environment ID]/static/[Function key from manifest]` + * - Connect: `[App key]__[Module key]` + */ + functionKey: z.array(z.string()).optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * [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: z.string().optional(), +}); + +export type GetPrecomputationsParameters = z.infer; diff --git a/src/version2/parameters/getPreference.ts b/src/version2/parameters/getPreference.ts deleted file mode 100644 index 10fec8c078..0000000000 --- a/src/version2/parameters/getPreference.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetPreference { - /** The key of the preference. */ - key: string; -} diff --git a/src/version2/parameters/getPreferenceParameters.ts b/src/version2/parameters/getPreferenceParameters.ts new file mode 100644 index 0000000000..45e8c64e79 --- /dev/null +++ b/src/version2/parameters/getPreferenceParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetPreferenceParametersSchema = z.object({ + /** The key of the preference. */ + key: z.string(), +}); + +export type GetPreferenceParameters = z.infer; diff --git a/src/version2/parameters/getPrioritiesByPriorityScheme.ts b/src/version2/parameters/getPrioritiesByPriorityScheme.ts deleted file mode 100644 index 6cd7fcedac..0000000000 --- a/src/version2/parameters/getPrioritiesByPriorityScheme.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface GetPrioritiesByPriorityScheme { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** The priority scheme ID. */ - schemeId: string; -} diff --git a/src/version2/parameters/getPrioritiesByPrioritySchemeParameters.ts b/src/version2/parameters/getPrioritiesByPrioritySchemeParameters.ts new file mode 100644 index 0000000000..588b7ae95b --- /dev/null +++ b/src/version2/parameters/getPrioritiesByPrioritySchemeParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetPrioritiesByPrioritySchemeParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.string().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.string().optional(), + /** The priority scheme ID. */ + schemeId: z.string(), +}); + +export type GetPrioritiesByPrioritySchemeParameters = z.infer; diff --git a/src/version2/parameters/getPriority.ts b/src/version2/parameters/getPriority.ts deleted file mode 100644 index b267f4cbd4..0000000000 --- a/src/version2/parameters/getPriority.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetPriority { - /** The ID of the issue priority. */ - id: string; -} diff --git a/src/version2/parameters/getPriorityParameters.ts b/src/version2/parameters/getPriorityParameters.ts new file mode 100644 index 0000000000..b423881d9b --- /dev/null +++ b/src/version2/parameters/getPriorityParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetPriorityParametersSchema = z.object({ + /** The ID of the issue priority. */ + id: z.string(), +}); + +export type GetPriorityParameters = z.infer; diff --git a/src/version2/parameters/getPrioritySchemes.ts b/src/version2/parameters/getPrioritySchemes.ts deleted file mode 100644 index b5917ef600..0000000000 --- a/src/version2/parameters/getPrioritySchemes.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface GetPrioritySchemes { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * A set of priority IDs to filter by. To include multiple IDs, provide an ampersand-separated list. For example, - * `priorityId=10000&priorityId=10001`. - */ - priorityId?: number[]; - /** - * A set of priority scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * `schemeId=10000&schemeId=10001`. - */ - schemeId?: number[]; - /** The name of scheme to search for. */ - schemeName?: string; - /** Whether only the default priority is returned. */ - onlyDefault?: boolean; - /** The ordering to return the priority schemes by. */ - orderBy?: 'name' | '+name' | '-name' | string; - /** - * A comma separated list of additional information to return. "priorities" will return priorities associated with the - * priority scheme. "projects" will return projects associated with the priority scheme. - * `expand=priorities,projects`. - */ - expand?: string; -} diff --git a/src/version2/parameters/getPrioritySchemesParameters.ts b/src/version2/parameters/getPrioritySchemesParameters.ts new file mode 100644 index 0000000000..b9dc3cc5fa --- /dev/null +++ b/src/version2/parameters/getPrioritySchemesParameters.ts @@ -0,0 +1,32 @@ +import { z } from 'zod'; + +export const GetPrioritySchemesParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.string().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.string().optional(), + /** + * A set of priority IDs to filter by. To include multiple IDs, provide an ampersand-separated list. For example, + * `priorityId=10000&priorityId=10001`. + */ + priorityId: z.array(z.number().int()).optional(), + /** + * A set of priority scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `schemeId=10000&schemeId=10001`. + */ + schemeId: z.array(z.number().int()).optional(), + /** The name of scheme to search for. */ + schemeName: z.string().optional(), + /** Whether only the default priority is returned. */ + onlyDefault: z.boolean().optional(), + /** The ordering to return the priority schemes by. */ + orderBy: z.enum(['name', '+name', '-name']).optional(), + /** + * 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: z.string().optional(), +}); + +export type GetPrioritySchemesParameters = z.infer; diff --git a/src/version2/parameters/getProject.ts b/src/version2/parameters/getProject.ts deleted file mode 100644 index 0bc6063a6e..0000000000 --- a/src/version2/parameters/getProject.ts +++ /dev/null @@ -1,26 +0,0 @@ -export interface GetProject { - /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string | number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Note that the project description, - * issue types, and project lead are included in all responses by default. Expand options include: - * - * - `description` The project description. - * - `issueTypes` The issue types associated with the project. - * - `lead` The project lead. - * - `projectKeys` All project keys associated with the project. - * - `issueTypeHierarchy` The project issue type hierarchy. - */ - expand?: - | 'description' - | 'issueTypes' - | 'lead' - | 'projectKeys' - | 'issueTypeHierarchy' - | ('description' | 'issueTypes' | 'lead' | 'projectKeys' | 'issueTypeHierarchy')[] - | string - | string[]; - /** 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/getProjectCategoryById.ts b/src/version2/parameters/getProjectCategoryById.ts deleted file mode 100644 index 792cb7b366..0000000000 --- a/src/version2/parameters/getProjectCategoryById.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetProjectCategoryById { - /** The ID of the project category. */ - id: number; -} diff --git a/src/version2/parameters/getProjectCategoryByIdParameters.ts b/src/version2/parameters/getProjectCategoryByIdParameters.ts new file mode 100644 index 0000000000..25c4e1df15 --- /dev/null +++ b/src/version2/parameters/getProjectCategoryByIdParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetProjectCategoryByIdParametersSchema = z.object({ + /** The ID of the project category. */ + id: z.number().int(), +}); + +export type GetProjectCategoryByIdParameters = z.infer; diff --git a/src/version2/parameters/getProjectComponents.ts b/src/version2/parameters/getProjectComponents.ts deleted file mode 100644 index 5c47fd94d6..0000000000 --- a/src/version2/parameters/getProjectComponents.ts +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index f861052bd0..0000000000 --- a/src/version2/parameters/getProjectComponentsPaginated.ts +++ /dev/null @@ -1,43 +0,0 @@ -export interface GetProjectComponentsPaginated { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - 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. - * - `issueCount` Sorts by the count of issues associated with the component. - * - `lead` Sorts by the user key of the component's project lead. - * - `name` Sorts by component name. - */ - orderBy?: - | 'description' - | '-description' - | '+description' - | 'issueCount' - | '-issueCount' - | '+issueCount' - | 'lead' - | '-lead' - | '+lead' - | 'name' - | '-name' - | '+name' - | string; - /** - * Filter the results using a literal string. Components with a matching `name` or `description` are returned (case - * 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/getProjectComponentsPaginatedParameters.ts b/src/version2/parameters/getProjectComponentsPaginatedParameters.ts new file mode 100644 index 0000000000..95a07b0b32 --- /dev/null +++ b/src/version2/parameters/getProjectComponentsPaginatedParameters.ts @@ -0,0 +1,47 @@ +import { z } from 'zod'; + +export const GetProjectComponentsPaginatedParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `description` Sorts by the component description. + * - `issueCount` Sorts by the count of issues associated with the component. + * - `lead` Sorts by the user key of the component's project lead. + * - `name` Sorts by component name. + */ + orderBy: z + .enum([ + 'description', + '-description', + '+description', + 'issueCount', + '-issueCount', + '+issueCount', + 'lead', + '-lead', + '+lead', + 'name', + '-name', + '+name', + ]) + .optional(), + /** + * 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`. + */ + componentSource: z.enum(['jira', 'compass', 'auto']).optional(), + /** + * Filter the results using a literal string. Components with a matching `name` or `description` are returned (case + * insensitive). + */ + query: z.string().optional(), +}); + +export type GetProjectComponentsPaginatedParameters = z.infer; diff --git a/src/version2/parameters/getProjectComponentsParameters.ts b/src/version2/parameters/getProjectComponentsParameters.ts new file mode 100644 index 0000000000..31a4ae15dd --- /dev/null +++ b/src/version2/parameters/getProjectComponentsParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetProjectComponentsParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.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`. + */ + componentSource: z.enum(['jira', 'compass', 'auto']).optional(), +}); + +export type GetProjectComponentsParameters = z.infer; diff --git a/src/version2/parameters/getProjectContextMapping.ts b/src/version2/parameters/getProjectContextMapping.ts deleted file mode 100644 index 9bb371268a..0000000000 --- a/src/version2/parameters/getProjectContextMapping.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface GetProjectContextMapping { - /** The ID of the custom field, for example `customfield\_10000`. */ - fieldId: string; - /** - * The list of context IDs. To include multiple context, separate IDs with ampersand: - * `contextId=10000&contextId=10001`. - */ - contextId?: 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. */ - maxResults?: number; -} diff --git a/src/version2/parameters/getProjectContextMappingParameters.ts b/src/version2/parameters/getProjectContextMappingParameters.ts new file mode 100644 index 0000000000..6a69f6d475 --- /dev/null +++ b/src/version2/parameters/getProjectContextMappingParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const GetProjectContextMappingParametersSchema = z.object({ + /** The ID of the custom field, for example `customfield\_10000`. */ + fieldId: z.string(), + /** + * The list of context IDs. To include multiple context, separate IDs with ampersand: + * `contextId=10000&contextId=10001`. + */ + contextId: z.array(z.number().int()).optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), +}); + +export type GetProjectContextMappingParameters = z.infer; diff --git a/src/version2/parameters/getProjectEmail.ts b/src/version2/parameters/getProjectEmail.ts deleted file mode 100644 index 5a8b7e0ab5..0000000000 --- a/src/version2/parameters/getProjectEmail.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetProjectEmail { - /** The project ID. */ - projectId: string | number; -} diff --git a/src/version2/parameters/getProjectEmailParameters.ts b/src/version2/parameters/getProjectEmailParameters.ts new file mode 100644 index 0000000000..5d9a25cd4e --- /dev/null +++ b/src/version2/parameters/getProjectEmailParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetProjectEmailParametersSchema = z.object({ + /** The project ID. */ + projectId: z.number().int(), +}); + +export type GetProjectEmailParameters = z.infer; diff --git a/src/version2/parameters/getProjectIssueSecurityScheme.ts b/src/version2/parameters/getProjectIssueSecurityScheme.ts deleted file mode 100644 index 688c8930b2..0000000000 --- a/src/version2/parameters/getProjectIssueSecurityScheme.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetProjectIssueSecurityScheme { - /** The project ID or project key (case sensitive). */ - projectKeyOrId: string; -} diff --git a/src/version2/parameters/getProjectIssueSecuritySchemeParameters.ts b/src/version2/parameters/getProjectIssueSecuritySchemeParameters.ts new file mode 100644 index 0000000000..c20e596c75 --- /dev/null +++ b/src/version2/parameters/getProjectIssueSecuritySchemeParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetProjectIssueSecuritySchemeParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectKeyOrId: z.string(), +}); + +export type GetProjectIssueSecuritySchemeParameters = z.infer; diff --git a/src/version2/parameters/getProjectIssueTypeUsagesForStatus.ts b/src/version2/parameters/getProjectIssueTypeUsagesForStatus.ts deleted file mode 100644 index 80deab4e9d..0000000000 --- a/src/version2/parameters/getProjectIssueTypeUsagesForStatus.ts +++ /dev/null @@ -1,10 +0,0 @@ -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/getProjectIssueTypeUsagesForStatusParameters.ts b/src/version2/parameters/getProjectIssueTypeUsagesForStatusParameters.ts new file mode 100644 index 0000000000..01c97526eb --- /dev/null +++ b/src/version2/parameters/getProjectIssueTypeUsagesForStatusParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const GetProjectIssueTypeUsagesForStatusParametersSchema = z.object({ + /** The statusId to fetch issue type usages for */ + statusId: z.string(), + /** The projectId to fetch issue type usages for */ + projectId: z.string(), + /** The cursor for pagination */ + nextPageToken: z.string().optional(), + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults: z.number().int().optional(), +}); + +export type GetProjectIssueTypeUsagesForStatusParameters = z.infer< + typeof GetProjectIssueTypeUsagesForStatusParametersSchema +>; diff --git a/src/version2/parameters/getProjectParameters.ts b/src/version2/parameters/getProjectParameters.ts new file mode 100644 index 0000000000..2515cd1dd4 --- /dev/null +++ b/src/version2/parameters/getProjectParameters.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; + +export const GetProjectParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Note that the project description, + * issue types, and project lead are included in all responses by default. Expand options include: + * + * - `description` The project description. + * - `issueTypes` The issue types associated with the project. + * - `lead` The project lead. + * - `projectKeys` All project keys associated with the project. + * - `issueTypeHierarchy` The project issue type hierarchy. + */ + expand: z.string().optional(), + /** A list of project properties to return for the project. This parameter accepts a comma-separated list. */ + properties: z.array(z.string()).optional(), +}); + +export type GetProjectParameters = z.infer; diff --git a/src/version2/parameters/getProjectProperty.ts b/src/version2/parameters/getProjectProperty.ts deleted file mode 100644 index bbccb2a75e..0000000000 --- a/src/version2/parameters/getProjectProperty.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface GetProjectProperty { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; - /** - * The project property key. Use [Get project property keys](#api-rest-api-2-project-projectIdOrKey-properties-get) to - * get a list of all project property keys. - */ - propertyKey: string; -} diff --git a/src/version2/parameters/getProjectPropertyKeys.ts b/src/version2/parameters/getProjectPropertyKeys.ts deleted file mode 100644 index ed63fb62bb..0000000000 --- a/src/version2/parameters/getProjectPropertyKeys.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetProjectPropertyKeys { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; -} diff --git a/src/version2/parameters/getProjectPropertyKeysParameters.ts b/src/version2/parameters/getProjectPropertyKeysParameters.ts new file mode 100644 index 0000000000..2180d2815b --- /dev/null +++ b/src/version2/parameters/getProjectPropertyKeysParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetProjectPropertyKeysParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), +}); + +export type GetProjectPropertyKeysParameters = z.infer; diff --git a/src/version2/parameters/getProjectPropertyParameters.ts b/src/version2/parameters/getProjectPropertyParameters.ts new file mode 100644 index 0000000000..f3542b2093 --- /dev/null +++ b/src/version2/parameters/getProjectPropertyParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const GetProjectPropertyParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** + * The project property key. Use [Get project property keys](#api-rest-api-2-project-projectIdOrKey-properties-get) to + * get a list of all project property keys. + */ + propertyKey: z.string(), +}); + +export type GetProjectPropertyParameters = z.infer; diff --git a/src/version2/parameters/getProjectRole.ts b/src/version2/parameters/getProjectRole.ts deleted file mode 100644 index 9e20884faf..0000000000 --- a/src/version2/parameters/getProjectRole.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface GetProjectRole { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; - /** Exclude inactive users. */ - excludeInactiveUsers?: boolean; -} diff --git a/src/version2/parameters/getProjectRoleActorsForRole.ts b/src/version2/parameters/getProjectRoleActorsForRole.ts deleted file mode 100644 index 3b5400740d..0000000000 --- a/src/version2/parameters/getProjectRoleActorsForRole.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface GetProjectRoleActorsForRole { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version2/parameters/getProjectRoleActorsForRoleParameters.ts b/src/version2/parameters/getProjectRoleActorsForRoleParameters.ts new file mode 100644 index 0000000000..e867d57773 --- /dev/null +++ b/src/version2/parameters/getProjectRoleActorsForRoleParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const GetProjectRoleActorsForRoleParametersSchema = z.object({ + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: z.number().int(), +}); + +export type GetProjectRoleActorsForRoleParameters = z.infer; diff --git a/src/version2/parameters/getProjectRoleById.ts b/src/version2/parameters/getProjectRoleById.ts deleted file mode 100644 index d681f7f437..0000000000 --- a/src/version2/parameters/getProjectRoleById.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface GetProjectRoleById { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version2/parameters/getProjectRoleByIdParameters.ts b/src/version2/parameters/getProjectRoleByIdParameters.ts new file mode 100644 index 0000000000..efb941dfc7 --- /dev/null +++ b/src/version2/parameters/getProjectRoleByIdParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const GetProjectRoleByIdParametersSchema = z.object({ + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: z.number().int(), +}); + +export type GetProjectRoleByIdParameters = z.infer; diff --git a/src/version2/parameters/getProjectRoleDetails.ts b/src/version2/parameters/getProjectRoleDetails.ts deleted file mode 100644 index 4330c48a78..0000000000 --- a/src/version2/parameters/getProjectRoleDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface GetProjectRoleDetails { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; - /** Whether the roles should be filtered to include only those the user is assigned to. */ - currentMember?: boolean; - excludeConnectAddons?: boolean; -} diff --git a/src/version2/parameters/getProjectRoleDetailsParameters.ts b/src/version2/parameters/getProjectRoleDetailsParameters.ts new file mode 100644 index 0000000000..e18194dcea --- /dev/null +++ b/src/version2/parameters/getProjectRoleDetailsParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const GetProjectRoleDetailsParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** Whether the roles should be filtered to include only those the user is assigned to. */ + currentMember: z.boolean().optional(), + excludeConnectAddons: z.boolean().optional(), +}); + +export type GetProjectRoleDetailsParameters = z.infer; diff --git a/src/version2/parameters/getProjectRoleParameters.ts b/src/version2/parameters/getProjectRoleParameters.ts new file mode 100644 index 0000000000..0743f0f003 --- /dev/null +++ b/src/version2/parameters/getProjectRoleParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const GetProjectRoleParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: z.number().int(), + /** Exclude inactive users. */ + excludeInactiveUsers: z.boolean().optional(), +}); + +export type GetProjectRoleParameters = z.infer; diff --git a/src/version2/parameters/getProjectRoles.ts b/src/version2/parameters/getProjectRoles.ts deleted file mode 100644 index 3f5792c849..0000000000 --- a/src/version2/parameters/getProjectRoles.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetProjectRoles { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; -} diff --git a/src/version2/parameters/getProjectRolesParameters.ts b/src/version2/parameters/getProjectRolesParameters.ts new file mode 100644 index 0000000000..d01d75728c --- /dev/null +++ b/src/version2/parameters/getProjectRolesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetProjectRolesParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), +}); + +export type GetProjectRolesParameters = z.infer; diff --git a/src/version2/parameters/getProjectTypeByKey.ts b/src/version2/parameters/getProjectTypeByKey.ts deleted file mode 100644 index d371bfda66..0000000000 --- a/src/version2/parameters/getProjectTypeByKey.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetProjectTypeByKey { - /** The key of the project type. */ - projectTypeKey: 'software' | 'service_desk' | 'business' | 'product_discovery' | string; -} diff --git a/src/version2/parameters/getProjectTypeByKeyParameters.ts b/src/version2/parameters/getProjectTypeByKeyParameters.ts new file mode 100644 index 0000000000..8c6dd8e881 --- /dev/null +++ b/src/version2/parameters/getProjectTypeByKeyParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetProjectTypeByKeyParametersSchema = z.object({ + /** The key of the project type. */ + projectTypeKey: z.enum(['software', 'service_desk', 'business', 'product_discovery']), +}); + +export type GetProjectTypeByKeyParameters = z.infer; diff --git a/src/version2/parameters/getProjectUsagesForStatus.ts b/src/version2/parameters/getProjectUsagesForStatus.ts deleted file mode 100644 index 0e8913c901..0000000000 --- a/src/version2/parameters/getProjectUsagesForStatus.ts +++ /dev/null @@ -1,8 +0,0 @@ -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/getProjectUsagesForStatusParameters.ts b/src/version2/parameters/getProjectUsagesForStatusParameters.ts new file mode 100644 index 0000000000..604d559d1a --- /dev/null +++ b/src/version2/parameters/getProjectUsagesForStatusParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetProjectUsagesForStatusParametersSchema = z.object({ + /** The statusId to fetch project usages for */ + statusId: z.string(), + /** The cursor for pagination */ + nextPageToken: z.string().optional(), + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults: z.number().int().optional(), +}); + +export type GetProjectUsagesForStatusParameters = z.infer; diff --git a/src/version2/parameters/getProjectUsagesForWorkflow.ts b/src/version2/parameters/getProjectUsagesForWorkflow.ts deleted file mode 100644 index e70544f1f4..0000000000 --- a/src/version2/parameters/getProjectUsagesForWorkflow.ts +++ /dev/null @@ -1,8 +0,0 @@ -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/getProjectUsagesForWorkflowParameters.ts b/src/version2/parameters/getProjectUsagesForWorkflowParameters.ts new file mode 100644 index 0000000000..337355c466 --- /dev/null +++ b/src/version2/parameters/getProjectUsagesForWorkflowParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetProjectUsagesForWorkflowParametersSchema = z.object({ + /** The workflow ID */ + workflowId: z.string(), + /** The cursor for pagination */ + nextPageToken: z.string().optional(), + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults: z.number().int().optional(), +}); + +export type GetProjectUsagesForWorkflowParameters = z.infer; diff --git a/src/version2/parameters/getProjectUsagesForWorkflowScheme.ts b/src/version2/parameters/getProjectUsagesForWorkflowScheme.ts deleted file mode 100644 index 0266959608..0000000000 --- a/src/version2/parameters/getProjectUsagesForWorkflowScheme.ts +++ /dev/null @@ -1,8 +0,0 @@ -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/getProjectUsagesForWorkflowSchemeParameters.ts b/src/version2/parameters/getProjectUsagesForWorkflowSchemeParameters.ts new file mode 100644 index 0000000000..97b9d165be --- /dev/null +++ b/src/version2/parameters/getProjectUsagesForWorkflowSchemeParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetProjectUsagesForWorkflowSchemeParametersSchema = z.object({ + /** The workflow scheme ID */ + workflowSchemeId: z.string(), + /** The cursor for pagination */ + nextPageToken: z.string().optional(), + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults: z.number().int().optional(), +}); + +export type GetProjectUsagesForWorkflowSchemeParameters = z.infer< + typeof GetProjectUsagesForWorkflowSchemeParametersSchema +>; diff --git a/src/version2/parameters/getProjectVersions.ts b/src/version2/parameters/getProjectVersions.ts deleted file mode 100644 index 27c96b0c7c..0000000000 --- a/src/version2/parameters/getProjectVersions.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface GetProjectVersions { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts `operations`, which returns actions that can be performed on - * the version. - */ - expand?: string; -} diff --git a/src/version2/parameters/getProjectVersionsPaginated.ts b/src/version2/parameters/getProjectVersionsPaginated.ts deleted file mode 100644 index 46df6f405d..0000000000 --- a/src/version2/parameters/getProjectVersionsPaginated.ts +++ /dev/null @@ -1,61 +0,0 @@ -export interface GetProjectVersionsPaginated { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: - * - * - `description` Sorts by version description. - * - `name` Sorts by version name. - * - `releaseDate` Sorts by release date, starting with the oldest date. Versions with no release date are listed last. - * - `sequence` Sorts by the order of appearance in the user interface. - * - `startDate` Sorts by start date, starting with the oldest date. Versions with no start date are listed last. - */ - orderBy?: - | 'description' - | '-description' - | '+description' - | 'name' - | '-name' - | '+name' - | 'releaseDate' - | '-releaseDate' - | '+releaseDate' - | 'sequence' - | '-sequence' - | '+sequence' - | 'startDate' - | '-startDate' - | '+startDate' - | string; - /** - * Filter the results using a literal string. Versions with matching `name` or `description` are returned (case - * insensitive). - */ - query?: string; - /** - * A list of status values used to filter the results by version status. This parameter accepts a comma-separated - * list. The status values are `released`, `unreleased`, and `archived`. - */ - status?: 'released' | 'unreleased' | 'archived' | 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: - * - * - `issuesstatus` Returns the number of issues in each status category for each version. - * - `operations` Returns actions that can be performed on the specified version. - * - `driver` Returns the Atlassian account ID of the version driver. - * - `approvers` Returns a list containing the approvers for this version. - */ - expand?: - | 'issuesstatus' - | 'operations' - | 'driver' - | 'approvers' - | ('issuesstatus' | 'operations' | 'driver' | 'approvers')[] - | string - | string[]; -} diff --git a/src/version2/parameters/getProjectVersionsPaginatedParameters.ts b/src/version2/parameters/getProjectVersionsPaginatedParameters.ts new file mode 100644 index 0000000000..1c48ffcb48 --- /dev/null +++ b/src/version2/parameters/getProjectVersionsPaginatedParameters.ts @@ -0,0 +1,60 @@ +import { z } from 'zod'; + +export const GetProjectVersionsPaginatedParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `description` Sorts by version description. + * - `name` Sorts by version name. + * - `releaseDate` Sorts by release date, starting with the oldest date. Versions with no release date are listed last. + * - `sequence` Sorts by the order of appearance in the user interface. + * - `startDate` Sorts by start date, starting with the oldest date. Versions with no start date are listed last. + */ + orderBy: z + .enum([ + 'description', + '-description', + '+description', + 'name', + '-name', + '+name', + 'releaseDate', + '-releaseDate', + '+releaseDate', + 'sequence', + '-sequence', + '+sequence', + 'startDate', + '-startDate', + '+startDate', + ]) + .optional(), + /** + * Filter the results using a literal string. Versions with matching `name` or `description` are returned (case + * insensitive). + */ + query: z.string().optional(), + /** + * A list of status values used to filter the results by version status. This parameter accepts a comma-separated + * list. The status values are `released`, `unreleased`, and `archived`. + */ + status: z.string().optional(), + /** + * 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: + * + * - `issuesstatus` Returns the number of issues in each status category for each version. + * - `operations` Returns actions that can be performed on the specified version. + * - `driver` Returns the Atlassian account ID of the version driver. + * - `approvers` Returns a list containing the approvers for this version. + */ + expand: z.string().optional(), +}); + +export type GetProjectVersionsPaginatedParameters = z.infer; diff --git a/src/version2/parameters/getProjectVersionsParameters.ts b/src/version2/parameters/getProjectVersionsParameters.ts new file mode 100644 index 0000000000..5831d28af4 --- /dev/null +++ b/src/version2/parameters/getProjectVersionsParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetProjectVersionsParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts `operations`, which returns actions that can be performed on + * the version. + */ + expand: z.string().optional(), +}); + +export type GetProjectVersionsParameters = z.infer; diff --git a/src/version2/parameters/getProjectsByPriorityScheme.ts b/src/version2/parameters/getProjectsByPriorityScheme.ts deleted file mode 100644 index 607505f6d4..0000000000 --- a/src/version2/parameters/getProjectsByPriorityScheme.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface GetProjectsByPriorityScheme { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** The project IDs to filter by. For example, `projectId=10000&projectId=10001`. */ - projectId?: number[]; - /** The priority scheme ID. */ - schemeId: string; - /** The string to query projects on by name. */ - query?: string; -} diff --git a/src/version2/parameters/getProjectsByPrioritySchemeParameters.ts b/src/version2/parameters/getProjectsByPrioritySchemeParameters.ts new file mode 100644 index 0000000000..4933e1a4a1 --- /dev/null +++ b/src/version2/parameters/getProjectsByPrioritySchemeParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const GetProjectsByPrioritySchemeParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.string().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.string().optional(), + /** The project IDs to filter by. For example, `projectId=10000&projectId=10001`. */ + projectId: z.array(z.number().int()).optional(), + /** The priority scheme ID. */ + schemeId: z.string(), + /** The string to query projects on by name. */ + query: z.string().optional(), +}); + +export type GetProjectsByPrioritySchemeParameters = z.infer; diff --git a/src/version2/parameters/getProjectsForIssueTypeScreenScheme.ts b/src/version2/parameters/getProjectsForIssueTypeScreenScheme.ts deleted file mode 100644 index d6be3c9b26..0000000000 --- a/src/version2/parameters/getProjectsForIssueTypeScreenScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface GetProjectsForIssueTypeScreenScheme { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: 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. */ - maxResults?: number; - query?: string; -} diff --git a/src/version2/parameters/getProjectsForIssueTypeScreenSchemeParameters.ts b/src/version2/parameters/getProjectsForIssueTypeScreenSchemeParameters.ts new file mode 100644 index 0000000000..4b51ed5582 --- /dev/null +++ b/src/version2/parameters/getProjectsForIssueTypeScreenSchemeParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const GetProjectsForIssueTypeScreenSchemeParametersSchema = z.object({ + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: z.number().int(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + query: z.string().optional(), +}); + +export type GetProjectsForIssueTypeScreenSchemeParameters = z.infer< + typeof GetProjectsForIssueTypeScreenSchemeParametersSchema +>; diff --git a/src/version2/parameters/getRecent.ts b/src/version2/parameters/getRecent.ts deleted file mode 100644 index 0295d4887d..0000000000 --- a/src/version2/parameters/getRecent.ts +++ /dev/null @@ -1,33 +0,0 @@ -export interface GetRecent { - /** - * 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. - * - `projectKeys` Returns all project keys associated with a project. - * - `lead` Returns information about the project lead. - * - `issueTypes` Returns all issue types associated with the project. - * - `url` Returns the URL associated with the project. - * - `permissions` Returns the permissions associated with the project. - * - `insight` EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the - * project. - * - `*` Returns the project with all available expand options. - */ - expand?: - | 'description' - | 'projectKeys' - | 'lead' - | 'issueTypes' - | 'url' - | 'permissions' - | 'insight' - | '*' - | ('description' | 'projectKeys' | 'lead' | 'issueTypes' | 'url' | 'permissions' | 'insight')[] - | string - | string[]; - /** - * EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated - * list. Invalid property names are ignored. - */ - properties?: string[]; -} diff --git a/src/version2/parameters/getRecentParameters.ts b/src/version2/parameters/getRecentParameters.ts new file mode 100644 index 0000000000..283b280434 --- /dev/null +++ b/src/version2/parameters/getRecentParameters.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; +import { StringListSchema } from './stringList'; + +export const GetRecentParametersSchema = z.object({ + /** + * 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. + * - `projectKeys` Returns all project keys associated with a project. + * - `lead` Returns information about the project lead. + * - `issueTypes` Returns all issue types associated with the project. + * - `url` Returns the URL associated with the project. + * - `permissions` Returns the permissions associated with the project. + * - `insight` EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the + * project. + * - `*` Returns the project with all available expand options. + */ + expand: z.string().optional(), + /** + * EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated + * list. Invalid property names are ignored. + */ + properties: z.array(StringListSchema).optional(), +}); + +export type GetRecentParameters = z.infer; diff --git a/src/version2/parameters/getRedactionStatusParameters.ts b/src/version2/parameters/getRedactionStatusParameters.ts new file mode 100644 index 0000000000..f62223a014 --- /dev/null +++ b/src/version2/parameters/getRedactionStatusParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetRedactionStatusParametersSchema = z.object({ + /** Redaction job id */ + jobId: z.string(), +}); + +export type GetRedactionStatusParameters = z.infer; diff --git a/src/version2/parameters/getRelatedWork.ts b/src/version2/parameters/getRelatedWork.ts deleted file mode 100644 index b6388182d0..0000000000 --- a/src/version2/parameters/getRelatedWork.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetRelatedWork { - /** The ID of the version. */ - id: string; -} diff --git a/src/version2/parameters/getRelatedWorkParameters.ts b/src/version2/parameters/getRelatedWorkParameters.ts new file mode 100644 index 0000000000..b043efb9f9 --- /dev/null +++ b/src/version2/parameters/getRelatedWorkParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetRelatedWorkParametersSchema = z.object({ + /** The ID of the version. */ + id: z.string(), +}); + +export type GetRelatedWorkParameters = z.infer; diff --git a/src/version2/parameters/getRemoteIssueLinkById.ts b/src/version2/parameters/getRemoteIssueLinkById.ts deleted file mode 100644 index 5f9406bb63..0000000000 --- a/src/version2/parameters/getRemoteIssueLinkById.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetRemoteIssueLinkById { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the remote issue link. */ - linkId: string; -} diff --git a/src/version2/parameters/getRemoteIssueLinkByIdParameters.ts b/src/version2/parameters/getRemoteIssueLinkByIdParameters.ts new file mode 100644 index 0000000000..250c4a0d53 --- /dev/null +++ b/src/version2/parameters/getRemoteIssueLinkByIdParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetRemoteIssueLinkByIdParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The ID of the remote issue link. */ + linkId: z.string(), +}); + +export type GetRemoteIssueLinkByIdParameters = z.infer; diff --git a/src/version2/parameters/getRemoteIssueLinks.ts b/src/version2/parameters/getRemoteIssueLinks.ts deleted file mode 100644 index 75939463e7..0000000000 --- a/src/version2/parameters/getRemoteIssueLinks.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetRemoteIssueLinks { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The global ID of the remote issue link. */ - globalId?: string; -} diff --git a/src/version2/parameters/getRemoteIssueLinksParameters.ts b/src/version2/parameters/getRemoteIssueLinksParameters.ts new file mode 100644 index 0000000000..2a679ca9a6 --- /dev/null +++ b/src/version2/parameters/getRemoteIssueLinksParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetRemoteIssueLinksParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The global ID of the remote issue link. */ + globalId: z.string().optional(), +}); + +export type GetRemoteIssueLinksParameters = z.infer; diff --git a/src/version2/parameters/getResolution.ts b/src/version2/parameters/getResolution.ts deleted file mode 100644 index 13eba23264..0000000000 --- a/src/version2/parameters/getResolution.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetResolution { - /** The ID of the issue resolution value. */ - id: string; -} diff --git a/src/version2/parameters/getResolutionParameters.ts b/src/version2/parameters/getResolutionParameters.ts new file mode 100644 index 0000000000..d1033fc2de --- /dev/null +++ b/src/version2/parameters/getResolutionParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetResolutionParametersSchema = z.object({ + /** The ID of the issue resolution value. */ + id: z.string(), +}); + +export type GetResolutionParameters = z.infer; diff --git a/src/version2/parameters/getScreenSchemes.ts b/src/version2/parameters/getScreenSchemes.ts deleted file mode 100644 index a83d0eedf5..0000000000 --- a/src/version2/parameters/getScreenSchemes.ts +++ /dev/null @@ -1,26 +0,0 @@ -export interface GetScreenSchemes { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of screen scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * `id=10000&id=10001`. - */ - id?: number[]; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) include additional - * information in the response. This parameter accepts `issueTypeScreenSchemes` that, for each screen schemes, returns - * information about the issue type screen scheme the screen scheme is assigned to. - */ - expand?: string; - /** String used to perform a case-insensitive partial match with screen scheme name. */ - queryString?: string; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: - * - * - `id` Sorts by screen scheme ID. - * - `name` Sorts by screen scheme name. - */ - orderBy?: 'name' | '-name' | '+name' | 'id' | '-id' | '+id' | string; -} diff --git a/src/version2/parameters/getScreenSchemesParameters.ts b/src/version2/parameters/getScreenSchemesParameters.ts new file mode 100644 index 0000000000..95203d2fe0 --- /dev/null +++ b/src/version2/parameters/getScreenSchemesParameters.ts @@ -0,0 +1,30 @@ +import { z } from 'zod'; + +export const GetScreenSchemesParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of screen scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `id=10000&id=10001`. + */ + id: z.array(z.number().int()).optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) include additional + * information in the response. This parameter accepts `issueTypeScreenSchemes` that, for each screen schemes, returns + * information about the issue type screen scheme the screen scheme is assigned to. + */ + expand: z.string().optional(), + /** String used to perform a case-insensitive partial match with screen scheme name. */ + queryString: z.string().optional(), + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `id` Sorts by screen scheme ID. + * - `name` Sorts by screen scheme name. + */ + orderBy: z.enum(['name', '-name', '+name', 'id', '-id', '+id']).optional(), +}); + +export type GetScreenSchemesParameters = z.infer; diff --git a/src/version2/parameters/getScreens.ts b/src/version2/parameters/getScreens.ts deleted file mode 100644 index 97e04a52ee..0000000000 --- a/src/version2/parameters/getScreens.ts +++ /dev/null @@ -1,25 +0,0 @@ -export interface GetScreens { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of screen IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * `id=10000&id=10001`. - */ - id?: number[]; - /** String used to perform a case-insensitive partial match with screen name. */ - queryString?: string; - /** - * The scope filter string. To filter by multiple scope, provide an ampersand-separated list. For example, - * `scope=GLOBAL&scope=PROJECT`. - */ - scope?: ('GLOBAL' | 'TEMPLATE' | 'PROJECT' | string)[]; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: - * - * - `id` Sorts by screen ID. - * - `name` Sorts by screen name. - */ - orderBy?: 'name' | '-name' | '+name' | 'id' | '-id' | '+id' | string; -} diff --git a/src/version2/parameters/getScreensForField.ts b/src/version2/parameters/getScreensForField.ts deleted file mode 100644 index b9f05c9c16..0000000000 --- a/src/version2/parameters/getScreensForField.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface GetScreensForField { - /** The ID of the field to return screens 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; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about screens in the response. This parameter accepts `tab` which returns details about the screen tabs - * the field is used in. - */ - expand?: string; -} diff --git a/src/version2/parameters/getScreensForFieldParameters.ts b/src/version2/parameters/getScreensForFieldParameters.ts new file mode 100644 index 0000000000..02f1b73069 --- /dev/null +++ b/src/version2/parameters/getScreensForFieldParameters.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +export const GetScreensForFieldParametersSchema = z.object({ + /** The ID of the field to return screens for. */ + fieldId: z.string(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about screens in the response. This parameter accepts `tab` which returns details about the screen tabs + * the field is used in. + */ + expand: z.string().optional(), +}); + +export type GetScreensForFieldParameters = z.infer; diff --git a/src/version2/parameters/getScreensParameters.ts b/src/version2/parameters/getScreensParameters.ts new file mode 100644 index 0000000000..1fd7ed4bf9 --- /dev/null +++ b/src/version2/parameters/getScreensParameters.ts @@ -0,0 +1,29 @@ +import { z } from 'zod'; + +export const GetScreensParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * The list of screen IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `id=10000&id=10001`. + */ + id: z.array(z.number().int()).optional(), + /** String used to perform a case-insensitive partial match with screen name. */ + queryString: z.string().optional(), + /** + * The scope filter string. To filter by multiple scope, provide an ampersand-separated list. For example, + * `scope=GLOBAL&scope=PROJECT`. + */ + scope: z.array(z.enum(['GLOBAL', 'TEMPLATE', 'PROJECT'])).optional(), + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `id` Sorts by screen ID. + * - `name` Sorts by screen name. + */ + orderBy: z.enum(['name', '-name', '+name', 'id', '-id', '+id']).optional(), +}); + +export type GetScreensParameters = z.infer; diff --git a/src/version2/parameters/getSecurityLevelMembers.ts b/src/version2/parameters/getSecurityLevelMembers.ts deleted file mode 100644 index ceb2e31ef6..0000000000 --- a/src/version2/parameters/getSecurityLevelMembers.ts +++ /dev/null @@ -1,40 +0,0 @@ -export interface GetSecurityLevelMembers { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of issue security level member IDs. To include multiple issue security level members separate IDs with an - * ampersand: `id=10000&id=10001`. - */ - id?: string | string[]; - /** - * The list of issue security scheme IDs. To include multiple issue security schemes separate IDs with an ampersand: - * `schemeId=10000&schemeId=10001`. - */ - schemeId?: string | string[]; - /** - * The list of issue security level IDs. To include multiple issue security levels separate IDs with an ampersand: - * `levelId=10000&levelId=10001`. - */ - levelId?: string | string[]; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand - * options include: - * - * - `all` Returns all expandable information - * - `field` Returns information about the custom field granted the permission - * - `group` Returns information about the group that is granted the permission - * - `projectRole` Returns information about the project role granted the permission - * - `user` Returns information about the user who is granted the permission - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'projectRole' | 'user')[] - | string - | string[]; -} diff --git a/src/version2/parameters/getSecurityLevelMembersParameters.ts b/src/version2/parameters/getSecurityLevelMembersParameters.ts new file mode 100644 index 0000000000..80c8039936 --- /dev/null +++ b/src/version2/parameters/getSecurityLevelMembersParameters.ts @@ -0,0 +1,36 @@ +import { z } from 'zod'; + +export const GetSecurityLevelMembersParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.string().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.string().optional(), + /** + * The list of issue security level member IDs. To include multiple issue security level members separate IDs with an + * ampersand: `id=10000&id=10001`. + */ + id: z.array(z.string()).optional(), + /** + * The list of issue security scheme IDs. To include multiple issue security schemes separate IDs with an ampersand: + * `schemeId=10000&schemeId=10001`. + */ + schemeId: z.array(z.string()).optional(), + /** + * The list of issue security level IDs. To include multiple issue security levels separate IDs with an ampersand: + * `levelId=10000&levelId=10001`. + */ + levelId: z.array(z.string()).optional(), + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand + * options include: + * + * - `all` Returns all expandable information + * - `field` Returns information about the custom field granted the permission + * - `group` Returns information about the group that is granted the permission + * - `projectRole` Returns information about the project role granted the permission + * - `user` Returns information about the user who is granted the permission + */ + expand: z.string().optional(), +}); + +export type GetSecurityLevelMembersParameters = z.infer; diff --git a/src/version2/parameters/getSecurityLevels.ts b/src/version2/parameters/getSecurityLevels.ts deleted file mode 100644 index cd8503604b..0000000000 --- a/src/version2/parameters/getSecurityLevels.ts +++ /dev/null @@ -1,21 +0,0 @@ -export interface GetSecurityLevels { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of issue security scheme level IDs. To include multiple issue security levels, separate IDs with an - * ampersand: `id=10000&id=10001`. - */ - id?: string | string[]; - /** - * The list of issue security scheme IDs. To include multiple issue security schemes, separate IDs with an ampersand: - * `schemeId=10000&schemeId=10001`. - */ - schemeId?: string | string[]; - /** - * When set to true, returns multiple default levels for each security scheme containing a default. If you provide - * scheme and level IDs not associated with the default, returns an empty page. The default value is false. - */ - onlyDefault?: boolean; -} diff --git a/src/version2/parameters/getSecurityLevelsForProject.ts b/src/version2/parameters/getSecurityLevelsForProject.ts deleted file mode 100644 index 425a50c07a..0000000000 --- a/src/version2/parameters/getSecurityLevelsForProject.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetSecurityLevelsForProject { - /** The project ID or project key (case sensitive). */ - projectKeyOrId: string; -} diff --git a/src/version2/parameters/getSecurityLevelsForProjectParameters.ts b/src/version2/parameters/getSecurityLevelsForProjectParameters.ts new file mode 100644 index 0000000000..56410be150 --- /dev/null +++ b/src/version2/parameters/getSecurityLevelsForProjectParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetSecurityLevelsForProjectParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectKeyOrId: z.string(), +}); + +export type GetSecurityLevelsForProjectParameters = z.infer; diff --git a/src/version2/parameters/getSecurityLevelsParameters.ts b/src/version2/parameters/getSecurityLevelsParameters.ts new file mode 100644 index 0000000000..bb2941de8c --- /dev/null +++ b/src/version2/parameters/getSecurityLevelsParameters.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; + +export const GetSecurityLevelsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.string().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.string().optional(), + /** + * The list of issue security scheme level IDs. To include multiple issue security levels, separate IDs with an + * ampersand: `id=10000&id=10001`. + */ + id: z.array(z.string()).optional(), + /** + * The list of issue security scheme IDs. To include multiple issue security schemes, separate IDs with an ampersand: + * `schemeId=10000&schemeId=10001`. + */ + schemeId: z.array(z.string()).optional(), + /** + * When set to true, returns multiple default levels for each security scheme containing a default. If you provide + * scheme and level IDs not associated with the default, returns an empty page. The default value is false. + */ + onlyDefault: z.boolean().optional(), +}); + +export type GetSecurityLevelsParameters = z.infer; diff --git a/src/version2/parameters/getSelectableIssueFieldOptions.ts b/src/version2/parameters/getSelectableIssueFieldOptions.ts deleted file mode 100644 index b928e3c016..0000000000 --- a/src/version2/parameters/getSelectableIssueFieldOptions.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface GetSelectableIssueFieldOptions { - /** 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; - /** Filters the results to options that are only available in the specified project. */ - projectId?: number; - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; -} diff --git a/src/version2/parameters/getSelectableIssueFieldOptionsParameters.ts b/src/version2/parameters/getSelectableIssueFieldOptionsParameters.ts new file mode 100644 index 0000000000..917049ebc3 --- /dev/null +++ b/src/version2/parameters/getSelectableIssueFieldOptionsParameters.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const GetSelectableIssueFieldOptionsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** Filters the results to options that are only available in the specified project. */ + projectId: z.number().int().optional(), + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * - Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. + * - Run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For example, + * `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: z.string(), +}); + +export type GetSelectableIssueFieldOptionsParameters = z.infer; diff --git a/src/version2/parameters/getSelectedTimeTrackingImplementationParameters.ts b/src/version2/parameters/getSelectedTimeTrackingImplementationParameters.ts new file mode 100644 index 0000000000..1b8f1b5840 --- /dev/null +++ b/src/version2/parameters/getSelectedTimeTrackingImplementationParameters.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const GetSelectedTimeTrackingImplementationParametersSchema = z.object({}); + +export type GetSelectedTimeTrackingImplementationParameters = z.infer< + typeof GetSelectedTimeTrackingImplementationParametersSchema +>; diff --git a/src/version2/parameters/getServerInfoParameters.ts b/src/version2/parameters/getServerInfoParameters.ts new file mode 100644 index 0000000000..ffc22db9e4 --- /dev/null +++ b/src/version2/parameters/getServerInfoParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetServerInfoParametersSchema = z.object({}); + +export type GetServerInfoParameters = z.infer; diff --git a/src/version2/parameters/getSharePermission.ts b/src/version2/parameters/getSharePermission.ts deleted file mode 100644 index 34aa5b201c..0000000000 --- a/src/version2/parameters/getSharePermission.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetSharePermission { - /** The ID of the filter. */ - id: number; - /** The ID of the share permission. */ - permissionId: number; -} diff --git a/src/version2/parameters/getSharePermissionParameters.ts b/src/version2/parameters/getSharePermissionParameters.ts new file mode 100644 index 0000000000..4319bb4bfe --- /dev/null +++ b/src/version2/parameters/getSharePermissionParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetSharePermissionParametersSchema = z.object({ + /** The ID of the filter. */ + id: z.number().int(), + /** The ID of the share permission. */ + permissionId: z.number().int(), +}); + +export type GetSharePermissionParameters = z.infer; diff --git a/src/version2/parameters/getSharePermissions.ts b/src/version2/parameters/getSharePermissions.ts deleted file mode 100644 index 3e68467212..0000000000 --- a/src/version2/parameters/getSharePermissions.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetSharePermissions { - /** The ID of the filter. */ - id: number; -} diff --git a/src/version2/parameters/getSharePermissionsParameters.ts b/src/version2/parameters/getSharePermissionsParameters.ts new file mode 100644 index 0000000000..a95f80f8d5 --- /dev/null +++ b/src/version2/parameters/getSharePermissionsParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetSharePermissionsParametersSchema = z.object({ + /** The ID of the filter. */ + id: z.number().int(), +}); + +export type GetSharePermissionsParameters = z.infer; diff --git a/src/version2/parameters/getSharedTimeTrackingConfigurationParameters.ts b/src/version2/parameters/getSharedTimeTrackingConfigurationParameters.ts new file mode 100644 index 0000000000..dde3735083 --- /dev/null +++ b/src/version2/parameters/getSharedTimeTrackingConfigurationParameters.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const GetSharedTimeTrackingConfigurationParametersSchema = z.object({}); + +export type GetSharedTimeTrackingConfigurationParameters = z.infer< + typeof GetSharedTimeTrackingConfigurationParametersSchema +>; diff --git a/src/version2/parameters/getStatus.ts b/src/version2/parameters/getStatus.ts deleted file mode 100644 index 785e56ceea..0000000000 --- a/src/version2/parameters/getStatus.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetStatus { - /** The ID or name of the status. */ - idOrName: string; -} diff --git a/src/version2/parameters/getStatusCategoriesParameters.ts b/src/version2/parameters/getStatusCategoriesParameters.ts new file mode 100644 index 0000000000..66340333f0 --- /dev/null +++ b/src/version2/parameters/getStatusCategoriesParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetStatusCategoriesParametersSchema = z.object({}); + +export type GetStatusCategoriesParameters = z.infer; diff --git a/src/version2/parameters/getStatusCategory.ts b/src/version2/parameters/getStatusCategory.ts deleted file mode 100644 index 30731cbe8c..0000000000 --- a/src/version2/parameters/getStatusCategory.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetStatusCategory { - /** The ID or key of the status category. */ - idOrKey: string; -} diff --git a/src/version2/parameters/getStatusCategoryParameters.ts b/src/version2/parameters/getStatusCategoryParameters.ts new file mode 100644 index 0000000000..4a6c1c7465 --- /dev/null +++ b/src/version2/parameters/getStatusCategoryParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetStatusCategoryParametersSchema = z.object({ + /** The ID or key of the status category. */ + idOrKey: z.string(), +}); + +export type GetStatusCategoryParameters = z.infer; diff --git a/src/version2/parameters/getStatusParameters.ts b/src/version2/parameters/getStatusParameters.ts new file mode 100644 index 0000000000..269e155442 --- /dev/null +++ b/src/version2/parameters/getStatusParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetStatusParametersSchema = z.object({ + /** The ID or name of the status. */ + idOrName: z.string(), +}); + +export type GetStatusParameters = z.infer; diff --git a/src/version2/parameters/getStatusesById.ts b/src/version2/parameters/getStatusesById.ts deleted file mode 100644 index 6fcf7cea09..0000000000 --- a/src/version2/parameters/getStatusesById.ts +++ /dev/null @@ -1,20 +0,0 @@ -export interface GetStatusesById { - /** - * @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: - * - * - `usages` Returns the project and issue types that use the status in their workflow. - * - `workflowUsages` Returns the workflows that use the status. - */ - expand?: 'usages' | 'workflowUsages' | ('usages' | 'workflowUsages')[] | string | string[]; - /** - * The list of status IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * id=10000&id=10001. - * - * Min items `1`, Max items `50` - */ - id: string[]; -} diff --git a/src/version2/parameters/getStatusesByIdParameters.ts b/src/version2/parameters/getStatusesByIdParameters.ts new file mode 100644 index 0000000000..d4edcb0843 --- /dev/null +++ b/src/version2/parameters/getStatusesByIdParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const GetStatusesByIdParametersSchema = z.object({ + /** + * The list of status IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * id=10000&id=10001. + * + * Min items `1`, Max items `50` + */ + id: z.array(z.string()), +}); + +export type GetStatusesByIdParameters = z.infer; diff --git a/src/version2/parameters/getStatusesParameters.ts b/src/version2/parameters/getStatusesParameters.ts new file mode 100644 index 0000000000..e00ed32ff4 --- /dev/null +++ b/src/version2/parameters/getStatusesParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const GetStatusesParametersSchema = z.object({}); + +export type GetStatusesParameters = z.infer; diff --git a/src/version2/parameters/getTask.ts b/src/version2/parameters/getTask.ts deleted file mode 100644 index a1b74151b2..0000000000 --- a/src/version2/parameters/getTask.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetTask { - /** The ID of the task. */ - taskId: string; -} diff --git a/src/version2/parameters/getTaskParameters.ts b/src/version2/parameters/getTaskParameters.ts new file mode 100644 index 0000000000..6468e702b9 --- /dev/null +++ b/src/version2/parameters/getTaskParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetTaskParametersSchema = z.object({ + /** The ID of the task. */ + taskId: z.string(), +}); + +export type GetTaskParameters = z.infer; diff --git a/src/version2/parameters/getTeams.ts b/src/version2/parameters/getTeams.ts deleted file mode 100644 index 289f646714..0000000000 --- a/src/version2/parameters/getTeams.ts +++ /dev/null @@ -1,8 +0,0 @@ -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/getTeamsParameters.ts b/src/version2/parameters/getTeamsParameters.ts new file mode 100644 index 0000000000..2105b29011 --- /dev/null +++ b/src/version2/parameters/getTeamsParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetTeamsParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), + /** The cursor to start from. If not provided, the first page will be returned. */ + cursor: z.string().optional(), + /** The maximum number of plan teams to return per page. The maximum value is 50. The default value is 50. */ + maxResults: z.number().int().optional(), +}); + +export type GetTeamsParameters = z.infer; diff --git a/src/version2/parameters/getTransitions.ts b/src/version2/parameters/getTransitions.ts deleted file mode 100644 index a521bf98a0..0000000000 --- a/src/version2/parameters/getTransitions.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface GetTransitions { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about transitions in the response. This parameter accepts `transitions.fields`, which returns - * information about the fields in the transition screen for each transition. Fields hidden from the screen are not - * returned. Use this information to populate the `fields` and `update` fields in [Transition - * issue](#api-rest-api-2-issue-issueIdOrKey-transitions-post). - */ - expand?: string; - /** The ID of the transition. */ - transitionId?: string; - /** Whether transitions with the condition _Hide From User Condition_ are included in the response. */ - skipRemoteOnlyCondition?: boolean; - /** Whether details of transitions that fail a condition are included in the response */ - includeUnavailableTransitions?: boolean; - /** - * Whether the transitions are sorted by ops-bar sequence value first then category order (Todo, In Progress, Done) or - * only by ops-bar sequence value. - */ - sortByOpsBarAndStatus?: boolean; -} diff --git a/src/version2/parameters/getTransitionsParameters.ts b/src/version2/parameters/getTransitionsParameters.ts new file mode 100644 index 0000000000..f3a486f1e0 --- /dev/null +++ b/src/version2/parameters/getTransitionsParameters.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +export const GetTransitionsParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about transitions in the response. This parameter accepts `transitions.fields`, which returns + * information about the fields in the transition screen for each transition. Fields hidden from the screen are not + * returned. Use this information to populate the `fields` and `update` fields in [Transition + * issue](#api-rest-api-2-issue-issueIdOrKey-transitions-post). + */ + expand: z.string().optional(), + /** The ID of the transition. */ + transitionId: z.string().optional(), + /** Whether transitions with the condition _Hide From User Condition_ are included in the response. */ + skipRemoteOnlyCondition: z.boolean().optional(), + /** Whether details of transitions that fail a condition are included in the response */ + includeUnavailableTransitions: z.boolean().optional(), + /** + * Whether the transitions are sorted by ops-bar sequence value first then category order (Todo, In Progress, Done) or + * only by ops-bar sequence value. + */ + sortByOpsBarAndStatus: z.boolean().optional(), +}); + +export type GetTransitionsParameters = z.infer; diff --git a/src/version2/parameters/getTrashedFieldsPaginated.ts b/src/version2/parameters/getTrashedFieldsPaginated.ts deleted file mode 100644 index 9a82dd1ccb..0000000000 --- a/src/version2/parameters/getTrashedFieldsPaginated.ts +++ /dev/null @@ -1,31 +0,0 @@ -export interface GetTrashedFieldsPaginated { - /** 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; - id?: string[]; - /** String used to perform a case-insensitive partial match with field names or descriptions. */ - query?: string; - expand?: string | string[]; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: - * - * - `name` sorts by the field name - * - `trashDate` sorts by the date the field was moved to the trash - * - `plannedDeletionDate` sorts by the planned deletion date - */ - orderBy?: - | 'name' - | '-name' - | '+name' - | 'trashDate' - | '-trashDate' - | '+trashDate' - | 'plannedDeletionDate' - | '-plannedDeletionDate' - | '+plannedDeletionDate' - | 'projectsCount' - | '-projectsCount' - | '+projectsCount' - | string; -} diff --git a/src/version2/parameters/getTrashedFieldsPaginatedParameters.ts b/src/version2/parameters/getTrashedFieldsPaginatedParameters.ts new file mode 100644 index 0000000000..7d40d234d9 --- /dev/null +++ b/src/version2/parameters/getTrashedFieldsPaginatedParameters.ts @@ -0,0 +1,37 @@ +import { z } from 'zod'; + +export const GetTrashedFieldsPaginatedParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + id: z.array(z.string()).optional(), + /** String used to perform a case-insensitive partial match with field names or descriptions. */ + query: z.string().optional(), + expand: z + .enum([ + 'name', + '-name', + '+name', + 'trashDate', + '-trashDate', + '+trashDate', + 'plannedDeletionDate', + '-plannedDeletionDate', + '+plannedDeletionDate', + 'projectsCount', + '-projectsCount', + '+projectsCount', + ]) + .optional(), + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `name` sorts by the field name + * - `trashDate` sorts by the date the field was moved to the trash + * - `plannedDeletionDate` sorts by the planned deletion date + */ + orderBy: z.string().optional(), +}); + +export type GetTrashedFieldsPaginatedParameters = z.infer; diff --git a/src/version2/parameters/getUiModifications.ts b/src/version2/parameters/getUiModifications.ts deleted file mode 100644 index 657b7ac9c9..0000000000 --- a/src/version2/parameters/getUiModifications.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface GetUiModifications { - /** 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 to include additional information in the response. This parameter accepts a comma-separated list. Expand - * options include: - * - * - `data` Returns UI modification data. - * - `contexts` Returns UI modification contexts. - */ - expand?: 'data' | 'contexts' | ('data' | 'contexts')[] | string | string[]; -} diff --git a/src/version2/parameters/getUiModificationsParameters.ts b/src/version2/parameters/getUiModificationsParameters.ts new file mode 100644 index 0000000000..028c4c620e --- /dev/null +++ b/src/version2/parameters/getUiModificationsParameters.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +export const GetUiModificationsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand + * options include: + * + * - `data` Returns UI modification data. + * - `contexts` Returns UI modification contexts. + */ + expand: z.string().optional(), +}); + +export type GetUiModificationsParameters = z.infer; diff --git a/src/version2/parameters/getUser.ts b/src/version2/parameters/getUser.ts deleted file mode 100644 index f5435dab67..0000000000 --- a/src/version2/parameters/getUser.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface GetUser { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. Required. - */ - accountId?: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about users in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `groups` includes all groups and nested groups to which the user belongs. - * - `applicationRoles` includes details of all the applications to which the user has access. - */ - expand?: 'groups' | 'applicationRoles' | ('groups' | 'applicationRoles')[] | string | string[]; -} diff --git a/src/version2/parameters/getUserDefaultColumns.ts b/src/version2/parameters/getUserDefaultColumns.ts deleted file mode 100644 index 536ff274bf..0000000000 --- a/src/version2/parameters/getUserDefaultColumns.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface GetUserDefaultColumns { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - 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. - */ - username?: string; -} diff --git a/src/version2/parameters/getUserDefaultColumnsParameters.ts b/src/version2/parameters/getUserDefaultColumnsParameters.ts new file mode 100644 index 0000000000..ec24fc01a8 --- /dev/null +++ b/src/version2/parameters/getUserDefaultColumnsParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const GetUserDefaultColumnsParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** + * 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: z.string().optional(), +}); + +export type GetUserDefaultColumnsParameters = z.infer; diff --git a/src/version2/parameters/getUserEmail.ts b/src/version2/parameters/getUserEmail.ts deleted file mode 100644 index afd344afef..0000000000 --- a/src/version2/parameters/getUserEmail.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface GetUserEmail { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * `5b10ac8d82e05b22cc7d4ef5`. - */ - accountId: string; -} diff --git a/src/version2/parameters/getUserEmailBulk.ts b/src/version2/parameters/getUserEmailBulk.ts deleted file mode 100644 index ac36e3ac6e..0000000000 --- a/src/version2/parameters/getUserEmailBulk.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface GetUserEmailBulk { - /** - * The account IDs of the users for which emails are required. An `accountId` is an identifier that uniquely - * identifies the user across all Atlassian products. For example, `5b10ac8d82e05b22cc7d4ef5`. Note, this should be - * treated as an opaque identifier (that is, do not assume any structure in the value). - */ - accountId: string[]; -} diff --git a/src/version2/parameters/getUserEmailBulkParameters.ts b/src/version2/parameters/getUserEmailBulkParameters.ts new file mode 100644 index 0000000000..14b69748e8 --- /dev/null +++ b/src/version2/parameters/getUserEmailBulkParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetUserEmailBulkParametersSchema = z.object({ + /** + * The account IDs of the users for which emails are required. An `accountId` is an identifier that uniquely + * identifies the user across all Atlassian products. For example, `5b10ac8d82e05b22cc7d4ef5`. Note, this should be + * treated as an opaque identifier (that is, do not assume any structure in the value). + */ + accountId: z.array(z.string()), +}); + +export type GetUserEmailBulkParameters = z.infer; diff --git a/src/version2/parameters/getUserEmailParameters.ts b/src/version2/parameters/getUserEmailParameters.ts new file mode 100644 index 0000000000..0999ca7ca4 --- /dev/null +++ b/src/version2/parameters/getUserEmailParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const GetUserEmailParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * `5b10ac8d82e05b22cc7d4ef5`. + */ + accountId: z.string(), +}); + +export type GetUserEmailParameters = z.infer; diff --git a/src/version2/parameters/getUserGroups.ts b/src/version2/parameters/getUserGroups.ts deleted file mode 100644 index 9357e00bbe..0000000000 --- a/src/version2/parameters/getUserGroups.ts +++ /dev/null @@ -1,19 +0,0 @@ -export interface GetUserGroups { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - 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. - */ - 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. - */ - key?: string; -} diff --git a/src/version2/parameters/getUserGroupsParameters.ts b/src/version2/parameters/getUserGroupsParameters.ts new file mode 100644 index 0000000000..72b351a5b4 --- /dev/null +++ b/src/version2/parameters/getUserGroupsParameters.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const GetUserGroupsParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.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. + */ + username: z.string().optional(), + /** + * 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: z.string().optional(), +}); + +export type GetUserGroupsParameters = z.infer; diff --git a/src/version2/parameters/getUserNavProperty.ts b/src/version2/parameters/getUserNavProperty.ts deleted file mode 100644 index e2682e5e38..0000000000 --- a/src/version2/parameters/getUserNavProperty.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface GetUserNavProperty { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The key of the user's property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/getUserNavPropertyParameters.ts b/src/version2/parameters/getUserNavPropertyParameters.ts new file mode 100644 index 0000000000..302eca6cfd --- /dev/null +++ b/src/version2/parameters/getUserNavPropertyParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const GetUserNavPropertyParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** The key of the user's property. */ + propertyKey: z.string(), +}); + +export type GetUserNavPropertyParameters = z.infer; diff --git a/src/version2/parameters/getUserParameters.ts b/src/version2/parameters/getUserParameters.ts new file mode 100644 index 0000000000..8206877511 --- /dev/null +++ b/src/version2/parameters/getUserParameters.ts @@ -0,0 +1,31 @@ +import { z } from 'zod'; + +export const GetUserParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. Required. + */ + accountId: z.string().optional(), + /** + * 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: z.string().optional(), + /** + * 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: z.string().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about users in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `groups` includes all groups and nested groups to which the user belongs. + * - `applicationRoles` includes details of all the applications to which the user has access. + */ + expand: z.string().optional(), +}); + +export type GetUserParameters = z.infer; diff --git a/src/version2/parameters/getUserProperty.ts b/src/version2/parameters/getUserProperty.ts deleted file mode 100644 index ae3e3798c2..0000000000 --- a/src/version2/parameters/getUserProperty.ts +++ /dev/null @@ -1,21 +0,0 @@ -export interface GetUserProperty { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** - * This parameter 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. - */ - userKey?: string; - /** - * This parameter 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. - */ - username?: string; - /** The key of the user's property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/getUserPropertyKeys.ts b/src/version2/parameters/getUserPropertyKeys.ts deleted file mode 100644 index b8d8c361f0..0000000000 --- a/src/version2/parameters/getUserPropertyKeys.ts +++ /dev/null @@ -1,19 +0,0 @@ -export interface GetUserPropertyKeys { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** - * This parameter 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. - */ - userKey?: string; - /** - * This parameter 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. - */ - username?: string; -} diff --git a/src/version2/parameters/getUserPropertyKeysParameters.ts b/src/version2/parameters/getUserPropertyKeysParameters.ts new file mode 100644 index 0000000000..42a30e9485 --- /dev/null +++ b/src/version2/parameters/getUserPropertyKeysParameters.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const GetUserPropertyKeysParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** + * This parameter 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. + */ + userKey: z.string().optional(), + /** + * This parameter 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. + */ + username: z.string().optional(), +}); + +export type GetUserPropertyKeysParameters = z.infer; diff --git a/src/version2/parameters/getUserPropertyParameters.ts b/src/version2/parameters/getUserPropertyParameters.ts new file mode 100644 index 0000000000..557fbdc3d6 --- /dev/null +++ b/src/version2/parameters/getUserPropertyParameters.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; + +export const GetUserPropertyParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** + * This parameter 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. + */ + userKey: z.string().optional(), + /** + * This parameter 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. + */ + username: z.string().optional(), + /** The key of the user's property. */ + propertyKey: z.string(), +}); + +export type GetUserPropertyParameters = z.infer; diff --git a/src/version2/parameters/getUsersFromGroup.ts b/src/version2/parameters/getUsersFromGroup.ts deleted file mode 100644 index 0960b901b1..0000000000 --- a/src/version2/parameters/getUsersFromGroup.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface GetUsersFromGroup { - /** - * 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; - /** Include inactive users. */ - includeInactiveUsers?: boolean; - /** 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/getUsersFromGroupParameters.ts b/src/version2/parameters/getUsersFromGroupParameters.ts new file mode 100644 index 0000000000..4a2f0807f6 --- /dev/null +++ b/src/version2/parameters/getUsersFromGroupParameters.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +export const GetUsersFromGroupParametersSchema = z.object({ + /** + * 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: z.string().optional(), + /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ + groupId: z.string().optional(), + /** Include inactive users. */ + includeInactiveUsers: z.boolean().optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page (number should be between 1 and 50). */ + maxResults: z.number().int().optional(), +}); + +export type GetUsersFromGroupParameters = z.infer; diff --git a/src/version2/parameters/getValidProjectKey.ts b/src/version2/parameters/getValidProjectKey.ts deleted file mode 100644 index 989b792572..0000000000 --- a/src/version2/parameters/getValidProjectKey.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetValidProjectKey { - /** The project key. */ - key?: string; -} diff --git a/src/version2/parameters/getValidProjectKeyParameters.ts b/src/version2/parameters/getValidProjectKeyParameters.ts new file mode 100644 index 0000000000..2e4201e8ba --- /dev/null +++ b/src/version2/parameters/getValidProjectKeyParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetValidProjectKeyParametersSchema = z.object({ + /** The project key. */ + key: z.string().optional(), +}); + +export type GetValidProjectKeyParameters = z.infer; diff --git a/src/version2/parameters/getValidProjectName.ts b/src/version2/parameters/getValidProjectName.ts deleted file mode 100644 index f6a220b4a1..0000000000 --- a/src/version2/parameters/getValidProjectName.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetValidProjectName { - /** The project name. */ - name: string; -} diff --git a/src/version2/parameters/getValidProjectNameParameters.ts b/src/version2/parameters/getValidProjectNameParameters.ts new file mode 100644 index 0000000000..4cfd3a4c62 --- /dev/null +++ b/src/version2/parameters/getValidProjectNameParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetValidProjectNameParametersSchema = z.object({ + /** The project name. */ + name: z.string(), +}); + +export type GetValidProjectNameParameters = z.infer; diff --git a/src/version2/parameters/getVersion.ts b/src/version2/parameters/getVersion.ts deleted file mode 100644 index 3f2c0ead24..0000000000 --- a/src/version2/parameters/getVersion.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface GetVersion { - /** The ID of the version. */ - id: 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: - * - * - `operations` Returns the list of operations available for this version. - * - `issuesstatus` Returns the count of issues in this version for each of the status categories _to do_, _in - * progress_, _done_, and _unmapped_. The _unmapped_ property represents the number of issues with a status other - * than _to do_, _in progress_, and _done_. - * - `driver` Returns the Atlassian account ID of the version driver. - * - `approvers` Returns a list containing the Atlassian account IDs of approvers for this version. - */ - expand?: - | 'operations' - | 'issuesstatus' - | 'driver' - | 'approvers' - | ('operations' | 'issuesstatus' | 'driver' | 'approvers')[] - | string - | string[]; -} diff --git a/src/version2/parameters/getVersionParameters.ts b/src/version2/parameters/getVersionParameters.ts new file mode 100644 index 0000000000..a5c1c2257d --- /dev/null +++ b/src/version2/parameters/getVersionParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const GetVersionParametersSchema = z.object({ + /** The ID of the version. */ + id: z.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: + * + * - `operations` Returns the list of operations available for this version. + * - `issuesstatus` Returns the count of issues in this version for each of the status categories _to do_, _in + * progress_, _done_, and _unmapped_. The _unmapped_ property represents the number of issues with a status other + * than _to do_, _in progress_, and _done_. + * - `driver` Returns the Atlassian account ID of the version driver. + * - `approvers` Returns a list containing the Atlassian account IDs of approvers for this version. + */ + expand: z.string().optional(), +}); + +export type GetVersionParameters = z.infer; diff --git a/src/version2/parameters/getVersionRelatedIssues.ts b/src/version2/parameters/getVersionRelatedIssues.ts deleted file mode 100644 index 625ae55b44..0000000000 --- a/src/version2/parameters/getVersionRelatedIssues.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetVersionRelatedIssues { - /** The ID of the version. */ - id: string; -} diff --git a/src/version2/parameters/getVersionRelatedIssuesParameters.ts b/src/version2/parameters/getVersionRelatedIssuesParameters.ts new file mode 100644 index 0000000000..fa07210371 --- /dev/null +++ b/src/version2/parameters/getVersionRelatedIssuesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetVersionRelatedIssuesParametersSchema = z.object({ + /** The ID of the version. */ + id: z.string(), +}); + +export type GetVersionRelatedIssuesParameters = z.infer; diff --git a/src/version2/parameters/getVersionUnresolvedIssues.ts b/src/version2/parameters/getVersionUnresolvedIssues.ts deleted file mode 100644 index f32912a6d5..0000000000 --- a/src/version2/parameters/getVersionUnresolvedIssues.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetVersionUnresolvedIssues { - /** The ID of the version. */ - id: string; -} diff --git a/src/version2/parameters/getVersionUnresolvedIssuesParameters.ts b/src/version2/parameters/getVersionUnresolvedIssuesParameters.ts new file mode 100644 index 0000000000..bea39f1ac8 --- /dev/null +++ b/src/version2/parameters/getVersionUnresolvedIssuesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetVersionUnresolvedIssuesParametersSchema = z.object({ + /** The ID of the version. */ + id: z.string(), +}); + +export type GetVersionUnresolvedIssuesParameters = z.infer; diff --git a/src/version2/parameters/getVisibleIssueFieldOptions.ts b/src/version2/parameters/getVisibleIssueFieldOptions.ts deleted file mode 100644 index 7eafbbe7de..0000000000 --- a/src/version2/parameters/getVisibleIssueFieldOptions.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface GetVisibleIssueFieldOptions { - /** 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; - /** Filters the results to options that are only available in the specified project. */ - projectId?: number; - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; -} diff --git a/src/version2/parameters/getVisibleIssueFieldOptionsParameters.ts b/src/version2/parameters/getVisibleIssueFieldOptionsParameters.ts new file mode 100644 index 0000000000..3ae9f7e9a3 --- /dev/null +++ b/src/version2/parameters/getVisibleIssueFieldOptionsParameters.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const GetVisibleIssueFieldOptionsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** Filters the results to options that are only available in the specified project. */ + projectId: z.number().int().optional(), + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * - Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. + * - Run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For example, + * `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: z.string(), +}); + +export type GetVisibleIssueFieldOptionsParameters = z.infer; diff --git a/src/version2/parameters/getVotes.ts b/src/version2/parameters/getVotes.ts deleted file mode 100644 index 9b4ee57b27..0000000000 --- a/src/version2/parameters/getVotes.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetVotes { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/getVotesParameters.ts b/src/version2/parameters/getVotesParameters.ts new file mode 100644 index 0000000000..b9ad9af91a --- /dev/null +++ b/src/version2/parameters/getVotesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetVotesParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), +}); + +export type GetVotesParameters = z.infer; diff --git a/src/version2/parameters/getWorkflow.ts b/src/version2/parameters/getWorkflow.ts deleted file mode 100644 index 0c672a4e9f..0000000000 --- a/src/version2/parameters/getWorkflow.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface GetWorkflow { - /** The ID of the workflow scheme. */ - id: number; - /** - * The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified - * workflow. - */ - workflowName?: string; - /** - * Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft - * exists, the mapping from the workflow scheme is returned. - */ - returnDraftIfExists?: boolean; -} diff --git a/src/version2/parameters/getWorkflowParameters.ts b/src/version2/parameters/getWorkflowParameters.ts new file mode 100644 index 0000000000..b0a21c24f7 --- /dev/null +++ b/src/version2/parameters/getWorkflowParameters.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +export const GetWorkflowParametersSchema = z.object({ + /** The ID of the workflow scheme. */ + id: z.number().int(), + /** + * The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified + * workflow. + */ + workflowName: z.string().optional(), + /** + * Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft + * exists, the mapping from the workflow scheme is returned. + */ + returnDraftIfExists: z.boolean().optional(), +}); + +export type GetWorkflowParameters = z.infer; diff --git a/src/version2/parameters/getWorkflowProjectIssueTypeUsages.ts b/src/version2/parameters/getWorkflowProjectIssueTypeUsages.ts deleted file mode 100644 index 42ce81e475..0000000000 --- a/src/version2/parameters/getWorkflowProjectIssueTypeUsages.ts +++ /dev/null @@ -1,10 +0,0 @@ -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/getWorkflowProjectIssueTypeUsagesParameters.ts b/src/version2/parameters/getWorkflowProjectIssueTypeUsagesParameters.ts new file mode 100644 index 0000000000..9a6ab23ff8 --- /dev/null +++ b/src/version2/parameters/getWorkflowProjectIssueTypeUsagesParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const GetWorkflowProjectIssueTypeUsagesParametersSchema = z.object({ + /** The workflow ID */ + workflowId: z.string(), + /** The project ID */ + projectId: z.number().int(), + /** The cursor for pagination */ + nextPageToken: z.string().optional(), + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults: z.number().int().optional(), +}); + +export type GetWorkflowProjectIssueTypeUsagesParameters = z.infer< + typeof GetWorkflowProjectIssueTypeUsagesParametersSchema +>; diff --git a/src/version2/parameters/getWorkflowScheme.ts b/src/version2/parameters/getWorkflowScheme.ts deleted file mode 100644 index 98a1d9be67..0000000000 --- a/src/version2/parameters/getWorkflowScheme.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface GetWorkflowScheme { - /** - * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the - * URL as `schemeId`. For example, _schemeId=10301_. - */ - id: number; - /** - * Returns the workflow scheme's draft rather than scheme itself, if set to true. If the workflow scheme does not have - * a draft, then the workflow scheme is returned. - */ - returnDraftIfExists?: boolean; -} diff --git a/src/version2/parameters/getWorkflowSchemeDraft.ts b/src/version2/parameters/getWorkflowSchemeDraft.ts deleted file mode 100644 index b58d0452c3..0000000000 --- a/src/version2/parameters/getWorkflowSchemeDraft.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface GetWorkflowSchemeDraft { - /** The ID of the active workflow scheme that the draft was created from. */ - id: number; -} diff --git a/src/version2/parameters/getWorkflowSchemeDraftIssueType.ts b/src/version2/parameters/getWorkflowSchemeDraftIssueType.ts deleted file mode 100644 index a3a2620252..0000000000 --- a/src/version2/parameters/getWorkflowSchemeDraftIssueType.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetWorkflowSchemeDraftIssueType { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The ID of the issue type. */ - issueType: string; -} diff --git a/src/version2/parameters/getWorkflowSchemeDraftIssueTypeParameters.ts b/src/version2/parameters/getWorkflowSchemeDraftIssueTypeParameters.ts new file mode 100644 index 0000000000..b872c536e9 --- /dev/null +++ b/src/version2/parameters/getWorkflowSchemeDraftIssueTypeParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetWorkflowSchemeDraftIssueTypeParametersSchema = z.object({ + /** The ID of the workflow scheme that the draft belongs to. */ + id: z.number().int(), + /** The ID of the issue type. */ + issueType: z.string(), +}); + +export type GetWorkflowSchemeDraftIssueTypeParameters = z.infer; diff --git a/src/version2/parameters/getWorkflowSchemeDraftParameters.ts b/src/version2/parameters/getWorkflowSchemeDraftParameters.ts new file mode 100644 index 0000000000..0664526cca --- /dev/null +++ b/src/version2/parameters/getWorkflowSchemeDraftParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const GetWorkflowSchemeDraftParametersSchema = z.object({ + /** The ID of the active workflow scheme that the draft was created from. */ + id: z.number().int(), +}); + +export type GetWorkflowSchemeDraftParameters = z.infer; diff --git a/src/version2/parameters/getWorkflowSchemeIssueType.ts b/src/version2/parameters/getWorkflowSchemeIssueType.ts deleted file mode 100644 index bd634ffb65..0000000000 --- a/src/version2/parameters/getWorkflowSchemeIssueType.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface GetWorkflowSchemeIssueType { - /** The ID of the workflow scheme. */ - id: number; - /** The ID of the issue type. */ - issueType: string; - /** - * Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft - * exists, the mapping from the workflow scheme is returned. - */ - returnDraftIfExists?: boolean; -} diff --git a/src/version2/parameters/getWorkflowSchemeIssueTypeParameters.ts b/src/version2/parameters/getWorkflowSchemeIssueTypeParameters.ts new file mode 100644 index 0000000000..2348136581 --- /dev/null +++ b/src/version2/parameters/getWorkflowSchemeIssueTypeParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const GetWorkflowSchemeIssueTypeParametersSchema = z.object({ + /** The ID of the workflow scheme. */ + id: z.number().int(), + /** The ID of the issue type. */ + issueType: z.string(), + /** + * Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft + * exists, the mapping from the workflow scheme is returned. + */ + returnDraftIfExists: z.boolean().optional(), +}); + +export type GetWorkflowSchemeIssueTypeParameters = z.infer; diff --git a/src/version2/parameters/getWorkflowSchemeParameters.ts b/src/version2/parameters/getWorkflowSchemeParameters.ts new file mode 100644 index 0000000000..23ea2a375d --- /dev/null +++ b/src/version2/parameters/getWorkflowSchemeParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const GetWorkflowSchemeParametersSchema = z.object({ + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the + * URL as `schemeId`. For example, _schemeId=10301_. + */ + id: z.number().int(), + /** + * Returns the workflow scheme's draft rather than scheme itself, if set to true. If the workflow scheme does not have + * a draft, then the workflow scheme is returned. + */ + returnDraftIfExists: z.boolean().optional(), +}); + +export type GetWorkflowSchemeParameters = z.infer; diff --git a/src/version2/parameters/getWorkflowSchemeProjectAssociations.ts b/src/version2/parameters/getWorkflowSchemeProjectAssociations.ts deleted file mode 100644 index e39ce06f95..0000000000 --- a/src/version2/parameters/getWorkflowSchemeProjectAssociations.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface GetWorkflowSchemeProjectAssociations { - /** - * The ID of a project to return the workflow schemes for. To include multiple projects, provide an ampersand-Jim: - * oneseparated list. For example, `projectId=10000&projectId=10001`. - */ - projectId: (string | number)[]; -} diff --git a/src/version2/parameters/getWorkflowSchemeProjectAssociationsParameters.ts b/src/version2/parameters/getWorkflowSchemeProjectAssociationsParameters.ts new file mode 100644 index 0000000000..4eb370e83d --- /dev/null +++ b/src/version2/parameters/getWorkflowSchemeProjectAssociationsParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const GetWorkflowSchemeProjectAssociationsParametersSchema = z.object({ + /** + * The ID of a project to return the workflow schemes for. To include multiple projects, provide an ampersand-Jim: + * oneseparated list. For example, `projectId=10000&projectId=10001`. + */ + projectId: z.array(z.number().int()), +}); + +export type GetWorkflowSchemeProjectAssociationsParameters = z.infer< + typeof GetWorkflowSchemeProjectAssociationsParametersSchema +>; diff --git a/src/version2/parameters/getWorkflowSchemeUsagesForWorkflow.ts b/src/version2/parameters/getWorkflowSchemeUsagesForWorkflow.ts deleted file mode 100644 index dae488d332..0000000000 --- a/src/version2/parameters/getWorkflowSchemeUsagesForWorkflow.ts +++ /dev/null @@ -1,8 +0,0 @@ -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/getWorkflowSchemeUsagesForWorkflowParameters.ts b/src/version2/parameters/getWorkflowSchemeUsagesForWorkflowParameters.ts new file mode 100644 index 0000000000..133673bfd7 --- /dev/null +++ b/src/version2/parameters/getWorkflowSchemeUsagesForWorkflowParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetWorkflowSchemeUsagesForWorkflowParametersSchema = z.object({ + /** The workflow ID */ + workflowId: z.string(), + /** The cursor for pagination */ + nextPageToken: z.string().optional(), + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults: z.number().int().optional(), +}); + +export type GetWorkflowSchemeUsagesForWorkflowParameters = z.infer< + typeof GetWorkflowSchemeUsagesForWorkflowParametersSchema +>; diff --git a/src/version2/parameters/getWorkflowTransitionProperties.ts b/src/version2/parameters/getWorkflowTransitionProperties.ts deleted file mode 100644 index fbfb681220..0000000000 --- a/src/version2/parameters/getWorkflowTransitionProperties.ts +++ /dev/null @@ -1,21 +0,0 @@ -export interface GetWorkflowTransitionProperties { - /** - * The ID of the transition. To get the ID, view the workflow in text mode in the Jira administration console. The ID - * is shown next to the transition. - */ - transitionId: number; - /** - * Some properties with keys that have the _jira._ prefix are reserved, which means they are not editable. To include - * these properties in the results, set this parameter to _true_. - */ - includeReservedKeys?: boolean; - /** - * The key of the property being returned, also known as the name of the property. If this parameter is not specified, - * all properties on the transition are returned. - */ - key?: string; - /** The name of the workflow that the transition belongs to. */ - workflowName: string; - /** The workflow status. Set to _live_ for active and inactive workflows, or _draft_ for draft workflows. */ - workflowMode?: 'live' | 'draft' | string; -} diff --git a/src/version2/parameters/getWorkflowTransitionRuleConfigurations.ts b/src/version2/parameters/getWorkflowTransitionRuleConfigurations.ts deleted file mode 100644 index 8b4780f059..0000000000 --- a/src/version2/parameters/getWorkflowTransitionRuleConfigurations.ts +++ /dev/null @@ -1,25 +0,0 @@ -export interface GetWorkflowTransitionRuleConfigurations { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** The types of the transition rules to return. */ - types: ('postfunction' | 'condition' | 'validator' | string)[]; - /** - * The transition rule class keys, as defined in the Connect or the Forge app descriptor, of the transition rules to - * return. - */ - keys?: string[]; - /** The list of workflow names to filter by. */ - workflowNames?: string[]; - /** The list of `tags` to filter by. */ - withTags?: string[]; - /** Whether draft or published workflows are returned. If not provided, both workflow types are returned. */ - draft?: boolean; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts `transition`, which, for each rule, returns information about - * the transition the rule is assigned to. - */ - expand?: 'transition' | string; -} diff --git a/src/version2/parameters/getWorkflowTransitionRuleConfigurationsParameters.ts b/src/version2/parameters/getWorkflowTransitionRuleConfigurationsParameters.ts new file mode 100644 index 0000000000..1bd61ce6ae --- /dev/null +++ b/src/version2/parameters/getWorkflowTransitionRuleConfigurationsParameters.ts @@ -0,0 +1,31 @@ +import { z } from 'zod'; + +export const GetWorkflowTransitionRuleConfigurationsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** The types of the transition rules to return. */ + types: z.array(z.enum(['postfunction', 'condition', 'validator'])), + /** + * The transition rule class keys, as defined in the Connect or the Forge app descriptor, of the transition rules to + * return. + */ + keys: z.array(z.string()).optional(), + /** The list of workflow names to filter by. */ + workflowNames: z.array(z.string()).optional(), + /** The list of `tags` to filter by. */ + withTags: z.array(z.string()).optional(), + /** Whether draft or published workflows are returned. If not provided, both workflow types are returned. */ + draft: z.boolean().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts `transition`, which, for each rule, returns information about + * the transition the rule is assigned to. + */ + expand: z.string().optional(), +}); + +export type GetWorkflowTransitionRuleConfigurationsParameters = z.infer< + typeof GetWorkflowTransitionRuleConfigurationsParametersSchema +>; diff --git a/src/version2/parameters/getWorkflowUsagesForStatus.ts b/src/version2/parameters/getWorkflowUsagesForStatus.ts deleted file mode 100644 index cdfb21d971..0000000000 --- a/src/version2/parameters/getWorkflowUsagesForStatus.ts +++ /dev/null @@ -1,8 +0,0 @@ -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/getWorkflowUsagesForStatusParameters.ts b/src/version2/parameters/getWorkflowUsagesForStatusParameters.ts new file mode 100644 index 0000000000..674c452bea --- /dev/null +++ b/src/version2/parameters/getWorkflowUsagesForStatusParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetWorkflowUsagesForStatusParametersSchema = z.object({ + /** The statusId to fetch workflow usages for */ + statusId: z.string(), + /** The cursor for pagination */ + nextPageToken: z.string().optional(), + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults: z.number().int().optional(), +}); + +export type GetWorkflowUsagesForStatusParameters = z.infer; diff --git a/src/version2/parameters/getWorkflowsPaginated.ts b/src/version2/parameters/getWorkflowsPaginated.ts deleted file mode 100644 index e11a018a58..0000000000 --- a/src/version2/parameters/getWorkflowsPaginated.ts +++ /dev/null @@ -1,77 +0,0 @@ -export interface GetWorkflowsPaginated { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The name of a workflow to return. To include multiple workflows, provide an ampersand-separated list. For example, - * `workflowName=name1&workflowName=name2`. - */ - workflowName?: 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: - * - * - `transitions` For each workflow, returns information about the transitions inside the workflow. - * - `transitions.rules` For each workflow transition, returns information about its rules. Transitions are included - * automatically if this expand is requested. - * - `transitions.properties` For each workflow transition, returns information about its properties. Transitions are - * included automatically if this expand is requested. - * - `statuses` For each workflow, returns information about the statuses inside the workflow. - * - `statuses.properties` For each workflow status, returns information about its properties. Statuses are included - * automatically if this expand is requested. - * - `default` For each workflow, returns information about whether this is the default workflow. - * - `schemes` For each workflow, returns information about the workflow schemes the workflow is assigned to. - * - `projects` For each workflow, returns information about the projects the workflow is assigned to, through workflow - * schemes. - * - `hasDraftWorkflow` For each workflow, returns information about whether the workflow has a draft version. - * - `operations` For each workflow, returns information about the actions that can be undertaken on the workflow. - */ - expand?: - | 'transitions' - | 'transitions.rules' - | 'transitions.properties' - | 'statuses' - | 'statuses.properties' - | 'default' - | 'schemes' - | 'projects' - | 'hasDraftWorkflow' - | 'operations' - | ( - | 'transitions' - | 'transitions.rules' - | 'transitions.properties' - | 'statuses' - | 'statuses.properties' - | 'default' - | 'schemes' - | 'projects' - | 'hasDraftWorkflow' - | 'operations' - )[] - | string - | 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' - | '-name' - | '+name' - | 'created' - | '-created' - | '+created' - | 'updated' - | '+updated' - | '-updated' - | string; - /** Filters active and inactive workflows. */ - isActive?: boolean; -} diff --git a/src/version2/parameters/getWorklog.ts b/src/version2/parameters/getWorklog.ts deleted file mode 100644 index 44ce855d97..0000000000 --- a/src/version2/parameters/getWorklog.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface GetWorklog { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the worklog. */ - id: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about work logs in the response. This parameter accepts - * - * `properties`, which returns worklog properties. - */ - expand?: string; -} diff --git a/src/version2/parameters/getWorklogParameters.ts b/src/version2/parameters/getWorklogParameters.ts new file mode 100644 index 0000000000..e6f9b4c3df --- /dev/null +++ b/src/version2/parameters/getWorklogParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const GetWorklogParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The ID of the worklog. */ + id: z.string(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about work logs in the response. This parameter accepts + * + * `properties`, which returns worklog properties. + */ + expand: z.string().optional(), +}); + +export type GetWorklogParameters = z.infer; diff --git a/src/version2/parameters/getWorklogProperty.ts b/src/version2/parameters/getWorklogProperty.ts deleted file mode 100644 index 6739fa3f6b..0000000000 --- a/src/version2/parameters/getWorklogProperty.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface GetWorklogProperty { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the worklog. */ - worklogId: string; - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/getWorklogPropertyKeys.ts b/src/version2/parameters/getWorklogPropertyKeys.ts deleted file mode 100644 index 53d0bd6bc0..0000000000 --- a/src/version2/parameters/getWorklogPropertyKeys.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface GetWorklogPropertyKeys { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the worklog. */ - worklogId: string; -} diff --git a/src/version2/parameters/getWorklogPropertyKeysParameters.ts b/src/version2/parameters/getWorklogPropertyKeysParameters.ts new file mode 100644 index 0000000000..1b1a97c4c6 --- /dev/null +++ b/src/version2/parameters/getWorklogPropertyKeysParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetWorklogPropertyKeysParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The ID of the worklog. */ + worklogId: z.string(), +}); + +export type GetWorklogPropertyKeysParameters = z.infer; diff --git a/src/version2/parameters/getWorklogPropertyParameters.ts b/src/version2/parameters/getWorklogPropertyParameters.ts new file mode 100644 index 0000000000..259252aad6 --- /dev/null +++ b/src/version2/parameters/getWorklogPropertyParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetWorklogPropertyParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The ID of the worklog. */ + worklogId: z.string(), + /** The key of the property. */ + propertyKey: z.string(), +}); + +export type GetWorklogPropertyParameters = z.infer; diff --git a/src/version2/parameters/getWorklogsForIds.ts b/src/version2/parameters/getWorklogsForIds.ts deleted file mode 100644 index cc76e46681..0000000000 --- a/src/version2/parameters/getWorklogsForIds.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { WorklogIdsRequest } from '../models'; - -export interface GetWorklogsForIds extends WorklogIdsRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about worklogs in the response. This parameter accepts `properties` that returns the properties of each - * worklog. - */ - expand?: string; -} diff --git a/src/version2/parameters/getWorklogsForIdsParameters.ts b/src/version2/parameters/getWorklogsForIdsParameters.ts new file mode 100644 index 0000000000..63bc3388b9 --- /dev/null +++ b/src/version2/parameters/getWorklogsForIdsParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const GetWorklogsForIdsParametersSchema = z.object({ + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about worklogs in the response. This parameter accepts `properties` that returns the properties of each + * worklog. + */ + expand: z.string().optional(), + /** A list of worklog IDs. */ + ids: z.array(z.number().int()), +}); + +export type GetWorklogsForIdsParameters = z.infer; diff --git a/src/version2/parameters/index.ts b/src/version2/parameters/index.ts deleted file mode 100644 index e732b1b7bd..0000000000 --- a/src/version2/parameters/index.ts +++ /dev/null @@ -1,539 +0,0 @@ -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'; -export * from './addSecurityLevel'; -export * from './addSecurityLevelMembers'; -export * from './addSharePermission'; -export * from './addUserToGroup'; -export * from './addVote'; -export * from './addWatcher'; -export * from './addWorklog'; -export * from './analyseExpression'; -export * from './appendMappingsForIssueTypeScreenScheme'; -export * from './archiveIssues'; -export * from './archiveIssuesAsync'; -export * from './archivePlan'; -export * from './archiveProject'; -export * from './assignFieldConfigurationSchemeToProject'; -export * from './assignIssue'; -export * from './assignIssueTypeSchemeToProject'; -export * from './assignIssueTypeScreenSchemeToProject'; -export * from './assignPermissionScheme'; -export * from './assignProjectsToCustomFieldContext'; -export * from './assignSchemeToProject'; -export * from './associateSchemesToProjects'; -export * from './bulkDeleteIssueProperty'; -export * from './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 './createAssociations'; -export * from './createComponent'; -export * from './createCustomField'; -export * from './createCustomFieldContext'; -export * from './createCustomFieldOption'; -export * from './createDashboard'; -export * from './createFieldConfiguration'; -export * from './createFieldConfigurationScheme'; -export * from './createFilter'; -export * from './createGroup'; -export * from './createIssue'; -export * from './createIssueFieldOption'; -export * from './createIssueLinkType'; -export * from './createIssues'; -export * from './createIssueSecurityScheme'; -export * from './createIssueType'; -export * from './createIssueTypeAvatar'; -export * from './createIssueTypeScheme'; -export * from './createIssueTypeScreenScheme'; -export * from './createNotificationScheme'; -export * from './createOrUpdateRemoteIssueLink'; -export * from './createPermissionGrant'; -export * from './createPermissionScheme'; -export * from './createPlan'; -export * from './createPlanOnlyTeam'; -export * from './createPriority'; -export * from './createPriorityScheme'; -export * from './createProject'; -export * from './createProjectAvatar'; -export * from './createProjectCategory'; -export * from './createProjectRole'; -export * from './createProjectWithCustomTemplate'; -export * from './createRelatedWork'; -export * from './createResolution'; -export * from './createScreen'; -export * from './createScreenScheme'; -export * from './createStatuses'; -export * from './createUiModification'; -export * from './createUser'; -export * from './createVersion'; -export * from './createWorkflow'; -export * from './createWorkflows'; -export * from './createWorkflowScheme'; -export * from './createWorkflowSchemeDraftFromParent'; -export * from './createWorkflowTransitionProperty'; -export * from './deleteActor'; -export * from './deleteAddonProperty'; -export * from './deleteAndReplaceVersion'; -export * from './deleteAppProperty'; -export * from './deleteAvatar'; -export * from './deleteComment'; -export * from './deleteCommentProperty'; -export * from './deleteComponent'; -export * from './deleteCustomField'; -export * from './deleteCustomFieldContext'; -export * from './deleteCustomFieldOption'; -export * from './deleteDashboard'; -export * from './deleteDashboardItemProperty'; -export * from './deleteDefaultWorkflow'; -export * from './deleteDraftDefaultWorkflow'; -export * from './deleteDraftWorkflowMapping'; -export * from './deleteFavouriteForFilter'; -export * from './deleteFieldConfiguration'; -export * from './deleteFieldConfigurationScheme'; -export * from './deleteFilter'; -export * from './deleteInactiveWorkflow'; -export * from './deleteIssue'; -export * from './deleteIssueFieldOption'; -export * from './deleteIssueLink'; -export * from './deleteIssueLinkType'; -export * from './deleteIssueProperty'; -export * from './deleteIssueType'; -export * from './deleteIssueTypeProperty'; -export * from './deleteIssueTypeScheme'; -export * from './deleteIssueTypeScreenScheme'; -export * from './deleteNotificationScheme'; -export * from './deletePermissionScheme'; -export * from './deletePermissionSchemeEntity'; -export * from './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'; -export * from './deleteScreen'; -export * from './deleteScreenScheme'; -export * from './deleteScreenTab'; -export * from './deleteSecurityScheme'; -export * from './deleteSharePermission'; -export * from './deleteStatusesById'; -export * from './deleteUiModification'; -export * from './deleteUserProperty'; -export * from './deleteWebhookById'; -export * from './deleteWorkflowMapping'; -export * from './deleteWorkflowScheme'; -export * from './deleteWorkflowSchemeDraft'; -export * from './deleteWorkflowSchemeDraftIssueType'; -export * from './deleteWorkflowSchemeIssueType'; -export * from './deleteWorkflowTransitionProperty'; -export * from './deleteWorkflowTransitionRuleConfigurations'; -export * from './deleteWorklog'; -export * from './deleteWorklogProperty'; -export * from './doTransition'; -export * from './duplicatePlan'; -export * from './editIssue'; -export * from './evaluateJiraExpression'; -export * from './evaluateJiraExpressionUsingEnhancedSearch'; -export * from './expandAttachmentForHumans'; -export * from './expandAttachmentForMachines'; -export * from './exportArchivedIssues'; -export * from './findAssignableUsers'; -export * from './findBulkAssignableUsers'; -export * from './findComponentsForProjects'; -export * from './findGroups'; -export * from './findUserKeysByQuery'; -export * from './findUsers'; -export * from './findUsersAndGroups'; -export * from './findUsersByQuery'; -export * from './findUsersForPicker'; -export * from './findUsersWithAllPermissions'; -export * from './findUsersWithBrowsePermission'; -export * from './fullyUpdateProjectRole'; -export * from './getAccessibleProjectTypeByKey'; -export * from './getAddonProperties'; -export * from './getAddonProperty'; -export * from './getAllDashboards'; -export * from './getAllFieldConfigurations'; -export * from './getAllFieldConfigurationSchemes'; -export * from './getAllGadgets'; -export * from './getAllIssueFieldOptions'; -export * from './getAllIssueTypeSchemes'; -export * from './getAllLabels'; -export * from './getAllPermissionSchemes'; -export * from './getAllProjectAvatars'; -export * from './getAllScreenTabFields'; -export * from './getAllScreenTabs'; -export * from './getAllStatuses'; -export * from './getAllSystemAvatars'; -export * from './getAllUserDataClassificationLevels'; -export * from './getAllUsers'; -export * from './getAllUsersDefault'; -export * from './getAllWorkflowSchemes'; -export * from './getAlternativeIssueTypes'; -export * from './getApplicationProperty'; -export * from './getApplicationRole'; -export * from './getAssignedPermissionScheme'; -export * from './getAtlassianTeam'; -export * from './getAttachment'; -export * from './getAttachmentContent'; -export * from './getAttachmentThumbnail'; -export * from './getAuditRecords'; -export * from './getAutoCompletePost'; -export * from './getAvailablePrioritiesByPriorityScheme'; -export * from './getAvailableScreenFields'; -export * from './getAvatarImageByID'; -export * from './getAvatarImageByOwner'; -export * from './getAvatarImageByType'; -export * from './getAvatars'; -export * from './getBulkChangelogs'; -export * from './getBulkPermissions'; -export * from './getBulkScreenTabs'; -export * from './getChangeLogs'; -export * from './getChangeLogsByIds'; -export * from './getColumns'; -export * from './getComment'; -export * from './getCommentProperty'; -export * from './getCommentPropertyKeys'; -export * from './getComments'; -export * from './getCommentsByIds'; -export * from './getComponent'; -export * from './getComponentRelatedIssues'; -export * from './getContextsForField'; -export * from './getCreateIssueMeta'; -export * from './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'; -export * from './getDraftWorkflow'; -export * from './getDynamicWebhooksForApp'; -export * from './getEditIssueMeta'; -export * from './getFailedWebhooks'; -export * from './getFavouriteFilters'; -export * from './getFeaturesForProject'; -export * from './getFieldAutoCompleteForQueryString'; -export * from './getFieldConfigurationItems'; -export * from './getFieldConfigurationSchemeMappings'; -export * from './getFieldConfigurationSchemeProjectMapping'; -export * from './getFieldsPaginated'; -export * from './getFilter'; -export * from './getFiltersPaginated'; -export * from './getHierarchy'; -export * from './getIdsOfWorklogsDeletedSince'; -export * from './getIdsOfWorklogsModifiedSince'; -export * from './getIssue'; -export * from './getIssueFieldOption'; -export * from './getIssueLimitReport'; -export * from './getIssueLink'; -export * from './getIssueLinkType'; -export * from './getIssuePickerResource'; -export * from './getIssueProperty'; -export * from './getIssuePropertyKeys'; -export * from './getIssueSecurityLevel'; -export * from './getIssueSecurityLevelMembers'; -export * from './getIssueSecurityScheme'; -export * from './getIssueType'; -export * from './getIssueTypeMappingsForContexts'; -export * from './getIssueTypeProperty'; -export * from './getIssueTypePropertyKeys'; -export * from './getIssueTypeSchemeForProjects'; -export * from './getIssueTypeSchemesMapping'; -export * from './getIssueTypeScreenSchemeMappings'; -export * from './getIssueTypeScreenSchemeProjectAssociations'; -export * from './getIssueTypeScreenSchemes'; -export * from './getIssueTypesForProject'; -export * from './getIssueWatchers'; -export * from './getIssueWorklog'; -export * from './getIsWatchingIssueBulk'; -export * from './getMyFilters'; -export * from './getMyPermissions'; -export * from './getNotificationScheme'; -export * from './getNotificationSchemeForProject'; -export * from './getNotificationSchemes'; -export * from './getNotificationSchemeToProjectMappings'; -export * from './getOptionsForContext'; -export * from './getPermissionScheme'; -export * from './getPermissionSchemeGrant'; -export * from './getPermissionSchemeGrants'; -export * from './getPermittedProjects'; -export * from './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'; -export * from './getProjectComponentsPaginated'; -export * from './getProjectContextMapping'; -export * from './getProjectEmail'; -export * from './getProjectIssueSecurityScheme'; -export * from './getProjectIssueTypeUsagesForStatus'; -export * from './getProjectProperty'; -export * from './getProjectPropertyKeys'; -export * from './getProjectRole'; -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'; -export * from './getSecurityLevelMembers'; -export * from './getSecurityLevels'; -export * from './getSecurityLevelsForProject'; -export * from './getSelectableIssueFieldOptions'; -export * from './getSharePermission'; -export * from './getSharePermissions'; -export * from './getStatus'; -export * from './getStatusCategory'; -export * from './getStatusesById'; -export * from './getTask'; -export * from './getTeams'; -export * from './getTransitions'; -export * from './getTrashedFieldsPaginated'; -export * from './getUiModifications'; -export * from './getUser'; -export * from './getUserDefaultColumns'; -export * from './getUserEmail'; -export * from './getUserEmailBulk'; -export * from './getUserGroups'; -export * from './getUserNavProperty'; -export * from './getUserProperty'; -export * from './getUserPropertyKeys'; -export * from './getUsersFromGroup'; -export * from './getValidProjectKey'; -export * from './getValidProjectName'; -export * from './getVersion'; -export * from './getVersionRelatedIssues'; -export * from './getVersionUnresolvedIssues'; -export * from './getVisibleIssueFieldOptions'; -export * from './getVotes'; -export * from './getWorkflow'; -export * from './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'; -export * from './getWorklogsForIds'; -export * from './linkIssues'; -export * from './matchIssues'; -export * from './mergeVersions'; -export * from './migrateQueries'; -export * from './movePriorities'; -export * from './moveResolutions'; -export * from './moveScreenTab'; -export * from './moveScreenTabField'; -export * from './moveVersion'; -export * from './notify'; -export * from './parseJqlQueries'; -export * from './partialUpdateProjectRole'; -export * from './publishDraftWorkflowScheme'; -export * from './putAddonProperty'; -export * from './putAppProperty'; -export * from './readWorkflows'; -export * from './readWorkflowSchemes'; -export * from './refreshWebhooks'; -export * from './registerDynamicWebhooks'; -export * from './registerModules'; -export * from './removeAssociations'; -export * from './removeAtlassianTeam'; -export * from './removeAttachment'; -export * from './removeCustomFieldContextFromProjects'; -export * from './removeDefaultProjectClassification'; -export * from './removeGadget'; -export * from './removeGroup'; -export * from './removeIssueTypeFromIssueTypeScheme'; -export * from './removeIssueTypesFromContext'; -export * from './removeIssueTypesFromGlobalFieldConfigurationScheme'; -export * from './removeLevel'; -export * from './removeMappingsFromIssueTypeScreenScheme'; -export * from './removeMemberFromSecurityLevel'; -export * from './removeModules'; -export * from './removeNotificationFromNotificationScheme'; -export * from './removePreference'; -export * from './removeProjectCategory'; -export * from './removeScreenTabField'; -export * from './removeUser'; -export * from './removeUserFromGroup'; -export * from './removeVote'; -export * from './removeWatcher'; -export * from './renameScreenTab'; -export * from './reorderCustomFieldOptions'; -export * from './reorderIssueTypesInIssueTypeScheme'; -export * from './replaceCustomFieldOption'; -export * from './replaceIssueFieldOption'; -export * from './resetColumns'; -export * from './resetUserColumns'; -export * from './restore'; -export * from './restoreCustomField'; -export * from './sanitiseJqlQueries'; -export * from './search'; -export * from './searchForIssuesIds'; -export * from './searchForIssuesUsingJql'; -export * from './searchForIssuesUsingJqlEnhancedSearch'; -export * from './searchForIssuesUsingJqlEnhancedSearchPost'; -export * from './searchForIssuesUsingJqlPost'; -export * from './searchPriorities'; -export * from './searchProjects'; -export * from './searchProjectsUsingSecuritySchemes'; -export * from './searchResolutions'; -export * from './searchSecuritySchemes'; -export * from './searchWorkflows'; -export * from './selectTimeTrackingImplementation'; -export * from './services'; -export * from './setActors'; -export * from './setApplicationProperty'; -export * from './setBanner'; -export * from './setColumns'; -export * from './setCommentProperty'; -export * from './setDashboardItemProperty'; -export * from './setDefaultLevels'; -export * from './setDefaultPriority'; -export * from './setDefaultResolution'; -export * from './setDefaultShareScope'; -export * from './setDefaultValues'; -export * from './setFavouriteForFilter'; -export * from './setFieldConfigurationSchemeMapping'; -export * from './setIssueProperty'; -export * from './setIssueTypeProperty'; -export * from './setPreference'; -export * from './setProjectProperty'; -export * from './setSharedTimeTrackingConfiguration'; -export * from './setUserColumns'; -export * from './setUserNavProperty'; -export * from './setUserProperty'; -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'; -export * from './updateCustomFieldConfiguration'; -export * from './updateCustomFieldContext'; -export * from './updateCustomFieldOption'; -export * from './updateCustomFieldValue'; -export * from './updateDashboard'; -export * from './updateDefaultProjectClassification'; -export * from './updateDefaultScreenScheme'; -export * from './updateDefaultWorkflow'; -export * from './updateDraftDefaultWorkflow'; -export * from './updateDraftWorkflowMapping'; -export * from './updateEntityPropertiesValue'; -export * from './updateFieldConfiguration'; -export * from './updateFieldConfigurationItems'; -export * from './updateFieldConfigurationScheme'; -export * from './updateFilter'; -export * from './updateGadget'; -export * from './updateIssueFieldOption'; -export * from './updateIssueFields'; -export * from './updateIssueLinkType'; -export * from './updateIssueSecurityScheme'; -export * from './updateIssueType'; -export * from './updateIssueTypeScheme'; -export * from './updateIssueTypeScreenScheme'; -export * from './updateMultipleCustomFieldValues'; -export * from './updateNotificationScheme'; -export * from './updatePermissionScheme'; -export * from './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'; -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/version2/parameters/linkIssues.ts b/src/version2/parameters/linkIssues.ts deleted file mode 100644 index e5ebe00533..0000000000 --- a/src/version2/parameters/linkIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { LinkIssueRequestJson } from '../models'; - -export interface LinkIssues extends LinkIssueRequestJson {} diff --git a/src/version2/parameters/linkIssuesParameters.ts b/src/version2/parameters/linkIssuesParameters.ts new file mode 100644 index 0000000000..57da3bbc62 --- /dev/null +++ b/src/version2/parameters/linkIssuesParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { CommentSchema } from './comment'; +import { LinkedIssueSchema } from './linkedIssue'; +import { IssueLinkTypeSchema } from './issueLinkType'; + +export const LinkIssuesParametersSchema = z.object({ + comment: CommentSchema.optional(), + inwardIssue: LinkedIssueSchema, + outwardIssue: LinkedIssueSchema, + type: IssueLinkTypeSchema, +}); + +export type LinkIssuesParameters = z.infer; diff --git a/src/version2/parameters/liveTemplateParameters.ts b/src/version2/parameters/liveTemplateParameters.ts new file mode 100644 index 0000000000..1b50cc7be5 --- /dev/null +++ b/src/version2/parameters/liveTemplateParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const LiveTemplateParametersSchema = z.object({ + /** Optional - The {@link String} containing the project key linked to the custom template to retrieve */ + projectId: z.string().optional(), + /** Optional - The {@link String} containing the key of the custom template to retrieve */ + templateKey: z.string().optional(), +}); + +export type LiveTemplateParameters = z.infer; diff --git a/src/version2/parameters/matchIssues.ts b/src/version2/parameters/matchIssues.ts deleted file mode 100644 index 291f23a7d4..0000000000 --- a/src/version2/parameters/matchIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssuesAndJQLQueries } from '../models'; - -export interface MatchIssues extends IssuesAndJQLQueries {} diff --git a/src/version2/parameters/matchIssuesParameters.ts b/src/version2/parameters/matchIssuesParameters.ts new file mode 100644 index 0000000000..76f3289e19 --- /dev/null +++ b/src/version2/parameters/matchIssuesParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const MatchIssuesParametersSchema = z.object({ + /** A list of issue IDs. */ + issueIds: z.array(z.number().int()), + /** A list of JQL queries. */ + jqls: z.array(z.string()), +}); + +export type MatchIssuesParameters = z.infer; diff --git a/src/version2/parameters/mergeVersions.ts b/src/version2/parameters/mergeVersions.ts deleted file mode 100644 index bab2680f35..0000000000 --- a/src/version2/parameters/mergeVersions.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface MergeVersions { - /** The ID of the version to delete. */ - id: string; - /** The ID of the version to merge into. */ - moveIssuesTo: string; -} diff --git a/src/version2/parameters/mergeVersionsParameters.ts b/src/version2/parameters/mergeVersionsParameters.ts new file mode 100644 index 0000000000..eed06ab0c0 --- /dev/null +++ b/src/version2/parameters/mergeVersionsParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const MergeVersionsParametersSchema = z.object({ + /** The ID of the version to delete. */ + id: z.string(), + /** The ID of the version to merge into. */ + moveIssuesTo: z.string(), +}); + +export type MergeVersionsParameters = z.infer; diff --git a/src/version2/parameters/migrateQueries.ts b/src/version2/parameters/migrateQueries.ts deleted file mode 100644 index f382ddc373..0000000000 --- a/src/version2/parameters/migrateQueries.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { JQLPersonalDataMigrationRequest } from '../models'; - -export interface MigrateQueries extends JQLPersonalDataMigrationRequest {} diff --git a/src/version2/parameters/migrateQueriesParameters.ts b/src/version2/parameters/migrateQueriesParameters.ts new file mode 100644 index 0000000000..9a78f48939 --- /dev/null +++ b/src/version2/parameters/migrateQueriesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const MigrateQueriesParametersSchema = z.object({ + /** A list of queries with user identifiers. Maximum of 100 queries. */ + queryStrings: z.array(z.string()).optional(), +}); + +export type MigrateQueriesParameters = z.infer; diff --git a/src/version2/parameters/movePriorities.ts b/src/version2/parameters/movePriorities.ts deleted file mode 100644 index bb34503590..0000000000 --- a/src/version2/parameters/movePriorities.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ReorderIssuePriorities } from '../models'; - -export interface MovePriorities extends ReorderIssuePriorities {} diff --git a/src/version2/parameters/movePrioritiesParameters.ts b/src/version2/parameters/movePrioritiesParameters.ts new file mode 100644 index 0000000000..d4b0b8d738 --- /dev/null +++ b/src/version2/parameters/movePrioritiesParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const MovePrioritiesParametersSchema = z.object({ + /** The ID of the priority. Required if `position` isn't provided. */ + after: z.string().optional(), + /** The list of issue IDs to be reordered. Cannot contain duplicates nor after ID. */ + ids: z.array(z.string()), + /** The position for issue priorities to be moved to. Required if `after` isn't provided. */ + position: z.string().optional(), +}); + +export type MovePrioritiesParameters = z.infer; diff --git a/src/version2/parameters/moveResolutions.ts b/src/version2/parameters/moveResolutions.ts deleted file mode 100644 index 3e4ba45456..0000000000 --- a/src/version2/parameters/moveResolutions.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ReorderIssueResolutionsRequest } from '../models'; - -export interface MoveResolutions extends ReorderIssueResolutionsRequest {} diff --git a/src/version2/parameters/moveResolutionsParameters.ts b/src/version2/parameters/moveResolutionsParameters.ts new file mode 100644 index 0000000000..334f838824 --- /dev/null +++ b/src/version2/parameters/moveResolutionsParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const MoveResolutionsParametersSchema = z.object({ + /** The ID of the resolution. Required if `position` isn't provided. */ + after: z.string().optional(), + /** The list of resolution IDs to be reordered. Cannot contain duplicates nor after ID. */ + ids: z.array(z.string()), + /** The position for issue resolutions to be moved to. Required if `after` isn't provided. */ + position: z.string().optional(), +}); + +export type MoveResolutionsParameters = z.infer; diff --git a/src/version2/parameters/moveScreenTab.ts b/src/version2/parameters/moveScreenTab.ts deleted file mode 100644 index 8694db033d..0000000000 --- a/src/version2/parameters/moveScreenTab.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface MoveScreenTab { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; - /** The position of tab. The base index is 0. */ - pos: number; -} diff --git a/src/version2/parameters/moveScreenTabField.ts b/src/version2/parameters/moveScreenTabField.ts deleted file mode 100644 index 6e66763a87..0000000000 --- a/src/version2/parameters/moveScreenTabField.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { MoveField } from '../models'; - -export interface MoveScreenTabField extends MoveField { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; - /** The ID of the field. */ - id: string; -} diff --git a/src/version2/parameters/moveScreenTabFieldParameters.ts b/src/version2/parameters/moveScreenTabFieldParameters.ts new file mode 100644 index 0000000000..789b9e1fbe --- /dev/null +++ b/src/version2/parameters/moveScreenTabFieldParameters.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +export const MoveScreenTabFieldParametersSchema = z.object({ + /** The ID of the screen. */ + screenId: z.number().int(), + /** The ID of the screen tab. */ + tabId: z.number().int(), + /** The ID of the field. */ + id: z.string(), + /** + * The ID of the screen tab field after which to place the moved screen tab field. Required if `position` isn't + * provided. + */ + after: z.string().optional(), + /** The named position to which the screen tab field should be moved. Required if `after` isn't provided. */ + position: z.enum(['Earlier', 'Later', 'First', 'Last']).optional(), +}); + +export type MoveScreenTabFieldParameters = z.infer; diff --git a/src/version2/parameters/moveScreenTabParameters.ts b/src/version2/parameters/moveScreenTabParameters.ts new file mode 100644 index 0000000000..10a0dedaea --- /dev/null +++ b/src/version2/parameters/moveScreenTabParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const MoveScreenTabParametersSchema = z.object({ + /** The ID of the screen. */ + screenId: z.number().int(), + /** The ID of the screen tab. */ + tabId: z.number().int(), + /** The position of tab. The base index is 0. */ + pos: z.number().int(), +}); + +export type MoveScreenTabParameters = z.infer; diff --git a/src/version2/parameters/moveVersion.ts b/src/version2/parameters/moveVersion.ts deleted file mode 100644 index d696f1196a..0000000000 --- a/src/version2/parameters/moveVersion.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { VersionMove } from '../models'; - -export interface MoveVersion extends VersionMove { - /** The ID of the version to be moved. */ - id: string; -} diff --git a/src/version2/parameters/moveVersionParameters.ts b/src/version2/parameters/moveVersionParameters.ts new file mode 100644 index 0000000000..6ab5899279 --- /dev/null +++ b/src/version2/parameters/moveVersionParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const MoveVersionParametersSchema = z.object({ + /** The ID of the version to be moved. */ + id: z.string(), + /** The URL (self link) of the version after which to place the moved version. Cannot be used with `position`. */ + after: z.string().optional(), + /** An absolute position in which to place the moved version. Cannot be used with `after`. */ + position: z.enum(['Earlier', 'Later', 'First', 'Last']).optional(), +}); + +export type MoveVersionParameters = z.infer; diff --git a/src/version2/parameters/notify.ts b/src/version2/parameters/notify.ts deleted file mode 100644 index 1281546476..0000000000 --- a/src/version2/parameters/notify.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Notification } from '../models'; - -export interface Notify extends Notification { - /** ID or key of the issue that the notification is sent for. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/notifyParameters.ts b/src/version2/parameters/notifyParameters.ts new file mode 100644 index 0000000000..69edefecfc --- /dev/null +++ b/src/version2/parameters/notifyParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const NotifyParametersSchema = z.object({ + /** ID or key of the issue that the notification is sent for. */ + issueIdOrKey: z.string(), + /** The HTML body of the email notification for the issue. */ + htmlBody: z.string().optional(), + /** Restricts the notifications to users with the specified permissions. */ + restrict: z.unknown().optional(), + /** + * The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue + * key and summary. + */ + subject: z.string().optional(), + /** The plain text body of the email notification for the issue. */ + textBody: z.string().optional(), + /** The recipients of the email notification for the issue. */ + to: z.unknown().optional(), +}); + +export type NotifyParameters = z.infer; diff --git a/src/version2/parameters/parseJqlQueries.ts b/src/version2/parameters/parseJqlQueries.ts deleted file mode 100644 index 10b59520e9..0000000000 --- a/src/version2/parameters/parseJqlQueries.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { JqlQueriesToParse } from '../models'; - -export interface ParseJqlQueries extends JqlQueriesToParse { - /** - * How to validate the JQL query and treat the validation results. Validation options include: - * - * - `strict` Returns all errors. If validation fails, the query structure is not returned. - * - `warn` Returns all errors. If validation fails but the JQL query is correctly formed, the query structure is - * returned. - * - `none` No validation is performed. If JQL query is correctly formed, the query structure is returned. - */ - validation?: 'strict' | 'warn' | 'none' | string; -} diff --git a/src/version2/parameters/parseJqlQueriesParameters.ts b/src/version2/parameters/parseJqlQueriesParameters.ts new file mode 100644 index 0000000000..27d73afdb7 --- /dev/null +++ b/src/version2/parameters/parseJqlQueriesParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const ParseJqlQueriesParametersSchema = z.object({ + /** + * How to validate the JQL query and treat the validation results. Validation options include: + * + * - `strict` Returns all errors. If validation fails, the query structure is not returned. + * - `warn` Returns all errors. If validation fails but the JQL query is correctly formed, the query structure is + * returned. + * - `none` No validation is performed. If JQL query is correctly formed, the query structure is returned. + */ + validation: z.enum(['strict', 'warn', 'none']), + /** A list of queries to parse. */ + queries: z.array(z.string()), +}); + +export type ParseJqlQueriesParameters = z.infer; diff --git a/src/version2/parameters/partialUpdateProjectRole.ts b/src/version2/parameters/partialUpdateProjectRole.ts deleted file mode 100644 index b4cfe847ca..0000000000 --- a/src/version2/parameters/partialUpdateProjectRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { CreateUpdateRoleRequest } from '../models'; - -export interface PartialUpdateProjectRole extends CreateUpdateRoleRequest { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version2/parameters/partialUpdateProjectRoleParameters.ts b/src/version2/parameters/partialUpdateProjectRoleParameters.ts new file mode 100644 index 0000000000..b0db33909e --- /dev/null +++ b/src/version2/parameters/partialUpdateProjectRoleParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const PartialUpdateProjectRoleParametersSchema = z.object({ + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: z.number().int(), + /** + * A description of the project role. Required when fully updating a project role. Optional when creating or partially + * updating a project role. + */ + description: z.string().optional(), + /** + * The name of the project role. Must be unique. Cannot begin or end with whitespace. The maximum length is 255 + * characters. Required when creating a project role. Optional when partially updating a project role. + */ + name: z.string().optional(), +}); + +export type PartialUpdateProjectRoleParameters = z.infer; diff --git a/src/version2/parameters/publishDraftWorkflowScheme.ts b/src/version2/parameters/publishDraftWorkflowScheme.ts deleted file mode 100644 index 7d6281a41e..0000000000 --- a/src/version2/parameters/publishDraftWorkflowScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { StatusMapping } from '../models'; - -export interface PublishDraftWorkflowScheme { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** Whether the request only performs a validation. */ - validateOnly?: boolean; - statusMappings?: StatusMapping[]; -} diff --git a/src/version2/parameters/publishDraftWorkflowSchemeParameters.ts b/src/version2/parameters/publishDraftWorkflowSchemeParameters.ts new file mode 100644 index 0000000000..9299fd27da --- /dev/null +++ b/src/version2/parameters/publishDraftWorkflowSchemeParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { StatusMappingSchema } from './statusMapping'; + +export const PublishDraftWorkflowSchemeParametersSchema = z.object({ + /** The ID of the workflow scheme that the draft belongs to. */ + id: z.number().int(), + /** Whether the request only performs a validation. */ + validateOnly: z.boolean().optional(), + /** Mappings of statuses to new statuses for issue types. */ + statusMappings: z.array(StatusMappingSchema).optional(), +}); + +export type PublishDraftWorkflowSchemeParameters = z.infer; diff --git a/src/version2/parameters/putAddonProperty.ts b/src/version2/parameters/putAddonProperty.ts deleted file mode 100644 index b9c56822bb..0000000000 --- a/src/version2/parameters/putAddonProperty.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface PutAddonProperty { - /** The key of the app, as defined in its descriptor. */ - addonKey: string; - /** The key of the property. */ - propertyKey: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - propertyValue: any; -} diff --git a/src/version2/parameters/putAddonPropertyParameters.ts b/src/version2/parameters/putAddonPropertyParameters.ts new file mode 100644 index 0000000000..b7c3aa1547 --- /dev/null +++ b/src/version2/parameters/putAddonPropertyParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const PutAddonPropertyParametersSchema = z.object({ + /** The key of the app, as defined in its descriptor. */ + addonKey: z.string(), + /** The key of the property. */ + propertyKey: z.string(), +}); + +export type PutAddonPropertyParameters = z.infer; diff --git a/src/version2/parameters/putAppProperty.ts b/src/version2/parameters/putAppProperty.ts deleted file mode 100644 index a5707ed36a..0000000000 --- a/src/version2/parameters/putAppProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface PutAppProperty { - /** The key of the property. */ - propertyKey: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - propertyValue: any; -} diff --git a/src/version2/parameters/putForgeAppPropertyParameters.ts b/src/version2/parameters/putForgeAppPropertyParameters.ts new file mode 100644 index 0000000000..4e6609dc2a --- /dev/null +++ b/src/version2/parameters/putForgeAppPropertyParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const PutForgeAppPropertyParametersSchema = z.object({ + /** The key of the property. */ + propertyKey: z.string(), +}); + +export type PutForgeAppPropertyParameters = z.infer; diff --git a/src/version2/parameters/readWorkflowSchemes.ts b/src/version2/parameters/readWorkflowSchemes.ts deleted file mode 100644 index c4c4234b2e..0000000000 --- a/src/version2/parameters/readWorkflowSchemes.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { 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/readWorkflowSchemesParameters.ts b/src/version2/parameters/readWorkflowSchemesParameters.ts new file mode 100644 index 0000000000..1669529be5 --- /dev/null +++ b/src/version2/parameters/readWorkflowSchemesParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const ReadWorkflowSchemesParametersSchema = z.object({ + /** The list of project IDs to query. */ + projectIds: z.array(z.string()).optional(), + /** The list of workflow scheme IDs to query. */ + workflowSchemeIds: z.array(z.string()).optional(), +}); + +export type ReadWorkflowSchemesParameters = z.infer; diff --git a/src/version2/parameters/readWorkflows.ts b/src/version2/parameters/readWorkflows.ts deleted file mode 100644 index 81e3eeddb7..0000000000 --- a/src/version2/parameters/readWorkflows.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { ProjectAndIssueTypePair } from '../models'; - -export interface ReadWorkflows { - /** - * Return the new fields (`toStatusReference`/`links`) instead of the deprecated fields (`to`/`from`) for workflow - * transition port mappings. - */ - useTransitionLinksFormat?: boolean; - /** - * Return the new field `approvalConfiguration` instead of the deprecated status properties for approval - * configuration. - */ - useApprovalConfiguration?: boolean; - /** The list of projects and issue types to query. */ - projectAndIssueTypes?: ProjectAndIssueTypePair[]; - /** The list of workflow IDs to query. */ - workflowIds?: string[]; - /** The list of workflow names to query. */ - workflowNames?: string[]; -} diff --git a/src/version2/parameters/readWorkflowsParameters.ts b/src/version2/parameters/readWorkflowsParameters.ts new file mode 100644 index 0000000000..42459ed915 --- /dev/null +++ b/src/version2/parameters/readWorkflowsParameters.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { ProjectAndIssueTypePairSchema } from './projectAndIssueTypePair'; + +export const ReadWorkflowsParametersSchema = z.object({ + /** + * Return the new field `approvalConfiguration` instead of the deprecated status properties for approval + * configuration. + */ + useApprovalConfiguration: z.boolean().optional(), + /** The list of projects and issue types to query. */ + projectAndIssueTypes: z.array(ProjectAndIssueTypePairSchema).optional(), + /** The list of workflow IDs to query. */ + workflowIds: z.array(z.string()).optional(), + /** The list of workflow names to query. */ + workflowNames: z.array(z.string()).optional(), +}); + +export type ReadWorkflowsParameters = z.infer; diff --git a/src/version2/parameters/redactParameters.ts b/src/version2/parameters/redactParameters.ts new file mode 100644 index 0000000000..859806b063 --- /dev/null +++ b/src/version2/parameters/redactParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; +import { SingleRedactionRequestSchema } from './singleRedactionRequest'; + +export const RedactParametersSchema = z.object({ + redactions: z.array(SingleRedactionRequestSchema).optional(), +}); + +export type RedactParameters = z.infer; diff --git a/src/version2/parameters/refreshWebhooks.ts b/src/version2/parameters/refreshWebhooks.ts deleted file mode 100644 index cd46c3e6ee..0000000000 --- a/src/version2/parameters/refreshWebhooks.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ContainerForWebhookIDs } from '../models'; - -export interface RefreshWebhooks extends ContainerForWebhookIDs {} diff --git a/src/version2/parameters/refreshWebhooksParameters.ts b/src/version2/parameters/refreshWebhooksParameters.ts new file mode 100644 index 0000000000..88836b81d8 --- /dev/null +++ b/src/version2/parameters/refreshWebhooksParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const RefreshWebhooksParametersSchema = z.object({ + /** A list of webhook IDs. */ + webhookIds: z.array(z.number().int()), +}); + +export type RefreshWebhooksParameters = z.infer; diff --git a/src/version2/parameters/registerDynamicWebhooks.ts b/src/version2/parameters/registerDynamicWebhooks.ts deleted file mode 100644 index 504529bd0e..0000000000 --- a/src/version2/parameters/registerDynamicWebhooks.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WebhookRegistrationDetails } from '../models'; - -export interface RegisterDynamicWebhooks extends WebhookRegistrationDetails {} diff --git a/src/version2/parameters/registerDynamicWebhooksParameters.ts b/src/version2/parameters/registerDynamicWebhooksParameters.ts new file mode 100644 index 0000000000..f39cc2faba --- /dev/null +++ b/src/version2/parameters/registerDynamicWebhooksParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { WebhookDetailsSchema } from './webhookDetails'; + +export const RegisterDynamicWebhooksParametersSchema = z.object({ + /** + * The URL that specifies where to send the webhooks. This URL must use the same base URL as the Connect app. Only a + * single URL per app is allowed to be registered. + */ + url: z.string(), + /** A list of webhooks. */ + webhooks: z.array(WebhookDetailsSchema), +}); + +export type RegisterDynamicWebhooksParameters = z.infer; diff --git a/src/version2/parameters/registerModules.ts b/src/version2/parameters/registerModules.ts deleted file mode 100644 index 3e62537a7e..0000000000 --- a/src/version2/parameters/registerModules.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ConnectModules } from '../models'; - -export interface RegisterModules extends ConnectModules {} diff --git a/src/version2/parameters/registerModulesParameters.ts b/src/version2/parameters/registerModulesParameters.ts new file mode 100644 index 0000000000..edb0335eb6 --- /dev/null +++ b/src/version2/parameters/registerModulesParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { ConnectModuleSchema } from './connectModule'; + +export const RegisterModulesParametersSchema = z.object({ + /** + * A list of app modules in the same format as the `modules` property in the [app + * descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). + */ + modules: z.array(ConnectModuleSchema), +}); + +export type RegisterModulesParameters = z.infer; diff --git a/src/version2/parameters/removeAssociations.ts b/src/version2/parameters/removeAssociations.ts deleted file mode 100644 index 063731afe3..0000000000 --- a/src/version2/parameters/removeAssociations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FieldAssociationsRequest } from '../models'; - -export interface RemoveAssociations extends FieldAssociationsRequest {} diff --git a/src/version2/parameters/removeAssociationsParameters.ts b/src/version2/parameters/removeAssociationsParameters.ts new file mode 100644 index 0000000000..94d36a384f --- /dev/null +++ b/src/version2/parameters/removeAssociationsParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { AssociationContextObjectSchema } from './associationContextObject'; +import { FieldIdentifierObjectSchema } from './fieldIdentifierObject'; + +export const RemoveAssociationsParametersSchema = z.object({ + /** Contexts to associate/unassociate the fields with. */ + associationContexts: z.array(AssociationContextObjectSchema), + /** Fields to associate/unassociate with projects. */ + fields: z.array(FieldIdentifierObjectSchema), +}); + +export type RemoveAssociationsParameters = z.infer; diff --git a/src/version2/parameters/removeAtlassianTeam.ts b/src/version2/parameters/removeAtlassianTeam.ts deleted file mode 100644 index 02650c1553..0000000000 --- a/src/version2/parameters/removeAtlassianTeam.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface RemoveAtlassianTeam { - /** The ID of the plan. */ - planId: number; - /** The ID of the Atlassian team. */ - atlassianTeamId: string; -} diff --git a/src/version2/parameters/removeAtlassianTeamParameters.ts b/src/version2/parameters/removeAtlassianTeamParameters.ts new file mode 100644 index 0000000000..9a10ea3c29 --- /dev/null +++ b/src/version2/parameters/removeAtlassianTeamParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const RemoveAtlassianTeamParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), + /** The ID of the Atlassian team. */ + atlassianTeamId: z.string(), +}); + +export type RemoveAtlassianTeamParameters = z.infer; diff --git a/src/version2/parameters/removeAttachment.ts b/src/version2/parameters/removeAttachment.ts deleted file mode 100644 index 0aa27fb753..0000000000 --- a/src/version2/parameters/removeAttachment.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface RemoveAttachment { - /** The ID of the attachment. */ - id: string; -} diff --git a/src/version2/parameters/removeAttachmentParameters.ts b/src/version2/parameters/removeAttachmentParameters.ts new file mode 100644 index 0000000000..c469fda5b3 --- /dev/null +++ b/src/version2/parameters/removeAttachmentParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const RemoveAttachmentParametersSchema = z.object({ + /** The ID of the attachment. */ + id: z.string(), +}); + +export type RemoveAttachmentParameters = z.infer; diff --git a/src/version2/parameters/removeCustomFieldContextFromProjects.ts b/src/version2/parameters/removeCustomFieldContextFromProjects.ts deleted file mode 100644 index 487394936b..0000000000 --- a/src/version2/parameters/removeCustomFieldContextFromProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectIds } from '../models'; - -export interface RemoveCustomFieldContextFromProjects extends ProjectIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/removeCustomFieldContextFromProjectsParameters.ts b/src/version2/parameters/removeCustomFieldContextFromProjectsParameters.ts new file mode 100644 index 0000000000..a9eddc4f13 --- /dev/null +++ b/src/version2/parameters/removeCustomFieldContextFromProjectsParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const RemoveCustomFieldContextFromProjectsParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The ID of the context. */ + contextId: z.number().int(), + /** The IDs of projects. */ + projectIds: z.array(z.string()), +}); + +export type RemoveCustomFieldContextFromProjectsParameters = z.infer< + typeof RemoveCustomFieldContextFromProjectsParametersSchema +>; diff --git a/src/version2/parameters/removeDefaultProjectClassification.ts b/src/version2/parameters/removeDefaultProjectClassification.ts deleted file mode 100644 index 103f00b406..0000000000 --- a/src/version2/parameters/removeDefaultProjectClassification.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface RemoveDefaultProjectClassification { - /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string; -} diff --git a/src/version2/parameters/removeDefaultProjectClassificationParameters.ts b/src/version2/parameters/removeDefaultProjectClassificationParameters.ts new file mode 100644 index 0000000000..b4b38088f7 --- /dev/null +++ b/src/version2/parameters/removeDefaultProjectClassificationParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const RemoveDefaultProjectClassificationParametersSchema = z.object({ + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: z.string(), +}); + +export type RemoveDefaultProjectClassificationParameters = z.infer< + typeof RemoveDefaultProjectClassificationParametersSchema +>; diff --git a/src/version2/parameters/removeGadget.ts b/src/version2/parameters/removeGadget.ts deleted file mode 100644 index a4880e5405..0000000000 --- a/src/version2/parameters/removeGadget.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface RemoveGadget { - /** The ID of the dashboard. */ - dashboardId: number; - /** The ID of the gadget. */ - gadgetId: number; -} diff --git a/src/version2/parameters/removeGadgetParameters.ts b/src/version2/parameters/removeGadgetParameters.ts new file mode 100644 index 0000000000..410f370934 --- /dev/null +++ b/src/version2/parameters/removeGadgetParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const RemoveGadgetParametersSchema = z.object({ + /** The ID of the dashboard. */ + dashboardId: z.number().int(), + /** The ID of the gadget. */ + gadgetId: z.number().int(), +}); + +export type RemoveGadgetParameters = z.infer; diff --git a/src/version2/parameters/removeGroup.ts b/src/version2/parameters/removeGroup.ts deleted file mode 100644 index a33bfbc5cf..0000000000 --- a/src/version2/parameters/removeGroup.ts +++ /dev/null @@ -1,21 +0,0 @@ -export interface RemoveGroup { - /** - * 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; - /** - * As a group's name can change, use of `swapGroupId` is recommended to identify a group. The group to transfer - * restrictions to. Only comments and worklogs are transferred. If restrictions are not transferred, comments and - * worklogs are inaccessible after the deletion. This parameter cannot be used with the `swapGroupId` parameter. - */ - swapGroup?: string; - /** - * The ID of the group to transfer restrictions to. Only comments and worklogs are transferred. If restrictions are - * not transferred, comments and worklogs are inaccessible after the deletion. This parameter cannot be used with the - * `swapGroup` parameter. - */ - swapGroupId?: string; -} diff --git a/src/version2/parameters/removeGroupParameters.ts b/src/version2/parameters/removeGroupParameters.ts new file mode 100644 index 0000000000..f810058282 --- /dev/null +++ b/src/version2/parameters/removeGroupParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const RemoveGroupParametersSchema = z.object({ + groupname: z.string().optional(), + /** The ID of the group. This parameter cannot be used with the `groupname` parameter. */ + groupId: z.string().optional(), + /** + * As a group's name can change, use of `swapGroupId` is recommended to identify a group. The group to transfer + * restrictions to. Only comments and worklogs are transferred. If restrictions are not transferred, comments and + * worklogs are inaccessible after the deletion. This parameter cannot be used with the `swapGroupId` parameter. + */ + swapGroup: z.string().optional(), + /** + * The ID of the group to transfer restrictions to. Only comments and worklogs are transferred. If restrictions are + * not transferred, comments and worklogs are inaccessible after the deletion. This parameter cannot be used with the + * `swapGroup` parameter. + */ + swapGroupId: z.string().optional(), +}); + +export type RemoveGroupParameters = z.infer; diff --git a/src/version2/parameters/removeIssueTypeFromIssueTypeScheme.ts b/src/version2/parameters/removeIssueTypeFromIssueTypeScheme.ts deleted file mode 100644 index 036afea1ad..0000000000 --- a/src/version2/parameters/removeIssueTypeFromIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface RemoveIssueTypeFromIssueTypeScheme { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; - /** The ID of the issue type. */ - issueTypeId: number; -} diff --git a/src/version2/parameters/removeIssueTypeFromIssueTypeSchemeParameters.ts b/src/version2/parameters/removeIssueTypeFromIssueTypeSchemeParameters.ts new file mode 100644 index 0000000000..5f6373377d --- /dev/null +++ b/src/version2/parameters/removeIssueTypeFromIssueTypeSchemeParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const RemoveIssueTypeFromIssueTypeSchemeParametersSchema = z.object({ + /** The ID of the issue type scheme. */ + issueTypeSchemeId: z.number().int(), + /** The ID of the issue type. */ + issueTypeId: z.number().int(), +}); + +export type RemoveIssueTypeFromIssueTypeSchemeParameters = z.infer< + typeof RemoveIssueTypeFromIssueTypeSchemeParametersSchema +>; diff --git a/src/version2/parameters/removeIssueTypesFromContext.ts b/src/version2/parameters/removeIssueTypesFromContext.ts deleted file mode 100644 index 9a61242b60..0000000000 --- a/src/version2/parameters/removeIssueTypesFromContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypeIds } from '../models'; - -export interface RemoveIssueTypesFromContext extends IssueTypeIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/removeIssueTypesFromContextParameters.ts b/src/version2/parameters/removeIssueTypesFromContextParameters.ts new file mode 100644 index 0000000000..f192f2e4cf --- /dev/null +++ b/src/version2/parameters/removeIssueTypesFromContextParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const RemoveIssueTypesFromContextParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The ID of the context. */ + contextId: z.number().int(), + /** The list of issue type IDs. */ + issueTypeIds: z.array(z.string()), +}); + +export type RemoveIssueTypesFromContextParameters = z.infer; diff --git a/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts b/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts deleted file mode 100644 index fd70e028f5..0000000000 --- a/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeIdsToRemove } from '../models'; - -export interface RemoveIssueTypesFromGlobalFieldConfigurationScheme extends IssueTypeIdsToRemove { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationSchemeParameters.ts b/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationSchemeParameters.ts new file mode 100644 index 0000000000..0e7a3e457c --- /dev/null +++ b/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationSchemeParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const RemoveIssueTypesFromGlobalFieldConfigurationSchemeParametersSchema = z.object({ + /** The ID of the field configuration scheme. */ + id: z.number().int(), + /** + * The list of issue type IDs. Must contain unique values not longer than 255 characters and not be empty. Maximum of + * 100 IDs. + */ + issueTypeIds: z.array(z.string()), +}); + +export type RemoveIssueTypesFromGlobalFieldConfigurationSchemeParameters = z.infer< + typeof RemoveIssueTypesFromGlobalFieldConfigurationSchemeParametersSchema +>; diff --git a/src/version2/parameters/removeLevel.ts b/src/version2/parameters/removeLevel.ts deleted file mode 100644 index 571f2e800f..0000000000 --- a/src/version2/parameters/removeLevel.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface RemoveLevel { - /** The ID of the issue security scheme. */ - schemeId: string; - /** The ID of the issue security level to remove. */ - levelId: string; - /** The ID of the issue security level that will replace the currently selected level. */ - replaceWith?: string; -} diff --git a/src/version2/parameters/removeLevelParameters.ts b/src/version2/parameters/removeLevelParameters.ts new file mode 100644 index 0000000000..976cb47930 --- /dev/null +++ b/src/version2/parameters/removeLevelParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const RemoveLevelParametersSchema = z.object({ + /** The ID of the issue security scheme. */ + schemeId: z.string(), + /** The ID of the issue security level to remove. */ + levelId: z.string(), + /** The ID of the issue security level that will replace the currently selected level. */ + replaceWith: z.string().optional(), +}); + +export type RemoveLevelParameters = z.infer; diff --git a/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.ts b/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.ts deleted file mode 100644 index adcfffbf7a..0000000000 --- a/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeIds } from '../models'; - -export interface RemoveMappingsFromIssueTypeScreenScheme extends IssueTypeIds { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version2/parameters/removeMappingsFromIssueTypeScreenSchemeParameters.ts b/src/version2/parameters/removeMappingsFromIssueTypeScreenSchemeParameters.ts new file mode 100644 index 0000000000..943a9c944f --- /dev/null +++ b/src/version2/parameters/removeMappingsFromIssueTypeScreenSchemeParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const RemoveMappingsFromIssueTypeScreenSchemeParametersSchema = z.object({ + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: z.string(), + /** The list of issue type IDs. */ + issueTypeIds: z.array(z.string()), +}); + +export type RemoveMappingsFromIssueTypeScreenSchemeParameters = z.infer< + typeof RemoveMappingsFromIssueTypeScreenSchemeParametersSchema +>; diff --git a/src/version2/parameters/removeMemberFromSecurityLevel.ts b/src/version2/parameters/removeMemberFromSecurityLevel.ts deleted file mode 100644 index 6a880e85e2..0000000000 --- a/src/version2/parameters/removeMemberFromSecurityLevel.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface RemoveMemberFromSecurityLevel { - /** The ID of the issue security scheme. */ - schemeId: string; - /** The ID of the issue security level. */ - levelId: string; - /** The ID of the issue security level member to be removed. */ - memberId: string; -} diff --git a/src/version2/parameters/removeMemberFromSecurityLevelParameters.ts b/src/version2/parameters/removeMemberFromSecurityLevelParameters.ts new file mode 100644 index 0000000000..b6013902cf --- /dev/null +++ b/src/version2/parameters/removeMemberFromSecurityLevelParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const RemoveMemberFromSecurityLevelParametersSchema = z.object({ + /** The ID of the issue security scheme. */ + schemeId: z.string(), + /** The ID of the issue security level. */ + levelId: z.string(), + /** The ID of the issue security level member to be removed. */ + memberId: z.string(), +}); + +export type RemoveMemberFromSecurityLevelParameters = z.infer; diff --git a/src/version2/parameters/removeModules.ts b/src/version2/parameters/removeModules.ts deleted file mode 100644 index 4a5552c847..0000000000 --- a/src/version2/parameters/removeModules.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface RemoveModules { - /** - * The key of the module to remove. To include multiple module keys, provide multiple copies of this parameter. For - * example, `moduleKey=dynamic-attachment-entity-property&moduleKey=dynamic-select-field`. Nonexistent keys are - * ignored. - */ - moduleKey?: string[]; -} diff --git a/src/version2/parameters/removeModulesParameters.ts b/src/version2/parameters/removeModulesParameters.ts new file mode 100644 index 0000000000..68980e7b13 --- /dev/null +++ b/src/version2/parameters/removeModulesParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const RemoveModulesParametersSchema = z.object({ + /** + * The key of the module to remove. To include multiple module keys, provide multiple copies of this parameter. For + * example, `moduleKey=dynamic-attachment-entity-property&moduleKey=dynamic-select-field`. Nonexistent keys are + * ignored. + */ + moduleKey: z.array(z.string()).optional(), +}); + +export type RemoveModulesParameters = z.infer; diff --git a/src/version2/parameters/removeNotificationFromNotificationScheme.ts b/src/version2/parameters/removeNotificationFromNotificationScheme.ts deleted file mode 100644 index 4a18e35626..0000000000 --- a/src/version2/parameters/removeNotificationFromNotificationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface RemoveNotificationFromNotificationScheme { - /** The ID of the notification scheme. */ - notificationSchemeId: string; - /** The ID of the notification. */ - notificationId: string; -} diff --git a/src/version2/parameters/removeNotificationFromNotificationSchemeParameters.ts b/src/version2/parameters/removeNotificationFromNotificationSchemeParameters.ts new file mode 100644 index 0000000000..cd09ffbb7e --- /dev/null +++ b/src/version2/parameters/removeNotificationFromNotificationSchemeParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const RemoveNotificationFromNotificationSchemeParametersSchema = z.object({ + /** The ID of the notification scheme. */ + notificationSchemeId: z.string(), + /** The ID of the notification. */ + notificationId: z.string(), +}); + +export type RemoveNotificationFromNotificationSchemeParameters = z.infer< + typeof RemoveNotificationFromNotificationSchemeParametersSchema +>; diff --git a/src/version2/parameters/removePreference.ts b/src/version2/parameters/removePreference.ts deleted file mode 100644 index d059fe7738..0000000000 --- a/src/version2/parameters/removePreference.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface RemovePreference { - /** The key of the preference. */ - key: string; -} diff --git a/src/version2/parameters/removePreferenceParameters.ts b/src/version2/parameters/removePreferenceParameters.ts new file mode 100644 index 0000000000..78175e796a --- /dev/null +++ b/src/version2/parameters/removePreferenceParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const RemovePreferenceParametersSchema = z.object({ + /** The key of the preference. */ + key: z.string(), +}); + +export type RemovePreferenceParameters = z.infer; diff --git a/src/version2/parameters/removeProjectCategory.ts b/src/version2/parameters/removeProjectCategory.ts deleted file mode 100644 index 173ac1d90d..0000000000 --- a/src/version2/parameters/removeProjectCategory.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface RemoveProjectCategory { - /** ID of the project category to delete. */ - id: number; -} diff --git a/src/version2/parameters/removeProjectCategoryParameters.ts b/src/version2/parameters/removeProjectCategoryParameters.ts new file mode 100644 index 0000000000..75aa3c4eff --- /dev/null +++ b/src/version2/parameters/removeProjectCategoryParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const RemoveProjectCategoryParametersSchema = z.object({ + /** ID of the project category to delete. */ + id: z.number().int(), +}); + +export type RemoveProjectCategoryParameters = z.infer; diff --git a/src/version2/parameters/removeScreenTabField.ts b/src/version2/parameters/removeScreenTabField.ts deleted file mode 100644 index ace5d1b5dd..0000000000 --- a/src/version2/parameters/removeScreenTabField.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface RemoveScreenTabField { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; - /** The ID of the field. */ - id: string; -} diff --git a/src/version2/parameters/removeScreenTabFieldParameters.ts b/src/version2/parameters/removeScreenTabFieldParameters.ts new file mode 100644 index 0000000000..ad390291a0 --- /dev/null +++ b/src/version2/parameters/removeScreenTabFieldParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const RemoveScreenTabFieldParametersSchema = z.object({ + /** The ID of the screen. */ + screenId: z.number().int(), + /** The ID of the screen tab. */ + tabId: z.number().int(), + /** The ID of the field. */ + id: z.string(), +}); + +export type RemoveScreenTabFieldParameters = z.infer; diff --git a/src/version2/parameters/removeTemplateParameters.ts b/src/version2/parameters/removeTemplateParameters.ts new file mode 100644 index 0000000000..399d167084 --- /dev/null +++ b/src/version2/parameters/removeTemplateParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const RemoveTemplateParametersSchema = z.object({ + /** The {@link String} containing the key of the custom template to remove */ + templateKey: z.string(), +}); + +export type RemoveTemplateParameters = z.infer; diff --git a/src/version2/parameters/removeUser.ts b/src/version2/parameters/removeUser.ts deleted file mode 100644 index 9a94e575af..0000000000 --- a/src/version2/parameters/removeUser.ts +++ /dev/null @@ -1,19 +0,0 @@ -export interface RemoveUser { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - 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. - */ - 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. - */ - key?: string; -} diff --git a/src/version2/parameters/removeUserFromGroup.ts b/src/version2/parameters/removeUserFromGroup.ts deleted file mode 100644 index b083bd5ce3..0000000000 --- a/src/version2/parameters/removeUserFromGroup.ts +++ /dev/null @@ -1,20 +0,0 @@ -export interface RemoveUserFromGroup { - /** - * 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; - /** - * 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; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId: string; -} diff --git a/src/version2/parameters/removeUserFromGroupParameters.ts b/src/version2/parameters/removeUserFromGroupParameters.ts new file mode 100644 index 0000000000..a0a275dae0 --- /dev/null +++ b/src/version2/parameters/removeUserFromGroupParameters.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; + +export const RemoveUserFromGroupParametersSchema = z.object({ + /** + * 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: z.string().optional(), + /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ + groupId: z.string().optional(), + /** + * 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: z.string().optional(), + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string(), +}); + +export type RemoveUserFromGroupParameters = z.infer; diff --git a/src/version2/parameters/removeUserParameters.ts b/src/version2/parameters/removeUserParameters.ts new file mode 100644 index 0000000000..2e61495f36 --- /dev/null +++ b/src/version2/parameters/removeUserParameters.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const RemoveUserParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.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. + */ + username: z.string().optional(), + /** + * 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: z.string().optional(), +}); + +export type RemoveUserParameters = z.infer; diff --git a/src/version2/parameters/removeVote.ts b/src/version2/parameters/removeVote.ts deleted file mode 100644 index c02b5c918d..0000000000 --- a/src/version2/parameters/removeVote.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface RemoveVote { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/removeVoteParameters.ts b/src/version2/parameters/removeVoteParameters.ts new file mode 100644 index 0000000000..5a8375cde8 --- /dev/null +++ b/src/version2/parameters/removeVoteParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const RemoveVoteParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), +}); + +export type RemoveVoteParameters = z.infer; diff --git a/src/version2/parameters/removeWatcher.ts b/src/version2/parameters/removeWatcher.ts deleted file mode 100644 index ed174aef02..0000000000 --- a/src/version2/parameters/removeWatcher.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface RemoveWatcher { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. Required. - */ - accountId?: string; -} diff --git a/src/version2/parameters/removeWatcherParameters.ts b/src/version2/parameters/removeWatcherParameters.ts new file mode 100644 index 0000000000..083cb81760 --- /dev/null +++ b/src/version2/parameters/removeWatcherParameters.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +export const RemoveWatcherParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.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. + */ + username: z.string().optional(), + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. Required. + */ + accountId: z.string().optional(), +}); + +export type RemoveWatcherParameters = z.infer; diff --git a/src/version2/parameters/renameScreenTab.ts b/src/version2/parameters/renameScreenTab.ts deleted file mode 100644 index 3deebda81e..0000000000 --- a/src/version2/parameters/renameScreenTab.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ScreenableTab } from '../models'; - -export interface RenameScreenTab extends ScreenableTab { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; -} diff --git a/src/version2/parameters/renameScreenTabParameters.ts b/src/version2/parameters/renameScreenTabParameters.ts new file mode 100644 index 0000000000..d42e5f84df --- /dev/null +++ b/src/version2/parameters/renameScreenTabParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const RenameScreenTabParametersSchema = z.object({ + /** The ID of the screen. */ + screenId: z.number().int(), + /** The ID of the screen tab. */ + tabId: z.number().int(), + /** The ID of the screen tab. */ + id: z.number().int().optional(), + /** The name of the screen tab. The maximum length is 255 characters. */ + name: z.string(), +}); + +export type RenameScreenTabParameters = z.infer; diff --git a/src/version2/parameters/reorderCustomFieldOptions.ts b/src/version2/parameters/reorderCustomFieldOptions.ts deleted file mode 100644 index 83eb779b40..0000000000 --- a/src/version2/parameters/reorderCustomFieldOptions.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { OrderOfCustomFieldOptions } from '../models'; - -export interface ReorderCustomFieldOptions extends OrderOfCustomFieldOptions { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/reorderCustomFieldOptionsParameters.ts b/src/version2/parameters/reorderCustomFieldOptionsParameters.ts new file mode 100644 index 0000000000..abd9c55972 --- /dev/null +++ b/src/version2/parameters/reorderCustomFieldOptionsParameters.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; + +export const ReorderCustomFieldOptionsParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The ID of the context. */ + contextId: z.number().int(), + /** + * The ID of the custom field option or cascading option to place the moved options after. Required if `position` + * isn't provided. + */ + after: z.string().optional(), + /** + * A list of IDs of custom field options to move. The order of the custom field option IDs in the list is the order + * they are given after the move. The list must contain custom field options or cascading options, but not both. + */ + customFieldOptionIds: z.array(z.string()), + /** The position the custom field options should be moved to. Required if `after` isn't provided. */ + position: z.enum(['First', 'Last']).optional(), +}); + +export type ReorderCustomFieldOptionsParameters = z.infer; diff --git a/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.ts b/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.ts deleted file mode 100644 index 7a529e5f9f..0000000000 --- a/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { OrderOfIssueTypes } from '../models'; - -export interface ReorderIssueTypesInIssueTypeScheme extends OrderOfIssueTypes { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version2/parameters/reorderIssueTypesInIssueTypeSchemeParameters.ts b/src/version2/parameters/reorderIssueTypesInIssueTypeSchemeParameters.ts new file mode 100644 index 0000000000..66621cae85 --- /dev/null +++ b/src/version2/parameters/reorderIssueTypesInIssueTypeSchemeParameters.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +export const ReorderIssueTypesInIssueTypeSchemeParametersSchema = z.object({ + /** The ID of the issue type scheme. */ + issueTypeSchemeId: z.number().int(), + /** The ID of the issue type to place the moved issue types after. Required if `position` isn't provided. */ + after: z.string().optional(), + /** + * A list of the issue type IDs to move. The order of the issue type IDs in the list is the order they are given after + * the move. + */ + issueTypeIds: z.array(z.string()), + /** The position the issue types should be moved to. Required if `after` isn't provided. */ + position: z.enum(['First', 'Last']).optional(), +}); + +export type ReorderIssueTypesInIssueTypeSchemeParameters = z.infer< + typeof ReorderIssueTypesInIssueTypeSchemeParametersSchema +>; diff --git a/src/version2/parameters/replaceCustomFieldOption.ts b/src/version2/parameters/replaceCustomFieldOption.ts deleted file mode 100644 index aa7b88be53..0000000000 --- a/src/version2/parameters/replaceCustomFieldOption.ts +++ /dev/null @@ -1,12 +0,0 @@ -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/replaceCustomFieldOptionParameters.ts b/src/version2/parameters/replaceCustomFieldOptionParameters.ts new file mode 100644 index 0000000000..f2cfc64e7d --- /dev/null +++ b/src/version2/parameters/replaceCustomFieldOptionParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const ReplaceCustomFieldOptionParametersSchema = z.object({ + /** The ID of the option that will replace the currently selected option. */ + replaceWith: z.number().int().optional(), + /** A JQL query that specifies the issues to be updated. For example, _project=10000_. */ + jql: z.string().optional(), + /** The ID of the custom field. */ + fieldId: z.string(), + /** The ID of the option to be deselected. */ + optionId: z.number().int(), + /** The ID of the context. */ + contextId: z.number().int(), +}); + +export type ReplaceCustomFieldOptionParameters = z.infer; diff --git a/src/version2/parameters/replaceIssueFieldOption.ts b/src/version2/parameters/replaceIssueFieldOption.ts deleted file mode 100644 index f184891952..0000000000 --- a/src/version2/parameters/replaceIssueFieldOption.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface ReplaceIssueFieldOption { - /** The ID of the option that will replace the currently selected option. */ - replaceWith?: number; - /** A JQL query that specifies the issues to be updated. For example, _project=10000_. */ - jql?: string; - /** - * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app - * users with admin permission. - */ - overrideScreenSecurity?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; - /** The ID of the option to be deselected. */ - optionId: number; -} diff --git a/src/version2/parameters/replaceIssueFieldOptionParameters.ts b/src/version2/parameters/replaceIssueFieldOptionParameters.ts new file mode 100644 index 0000000000..a56eabe630 --- /dev/null +++ b/src/version2/parameters/replaceIssueFieldOptionParameters.ts @@ -0,0 +1,33 @@ +import { z } from 'zod'; + +export const ReplaceIssueFieldOptionParametersSchema = z.object({ + /** The ID of the option that will replace the currently selected option. */ + replaceWith: z.number().int().optional(), + /** A JQL query that specifies the issues to be updated. For example, _project=10000_. */ + jql: z.string().optional(), + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app + * users with admin permission. + */ + overrideScreenSecurity: z.boolean().optional(), + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag: z.boolean().optional(), + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * - Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. + * - Run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For example, + * `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: z.string(), + /** The ID of the option to be deselected. */ + optionId: z.number().int(), +}); + +export type ReplaceIssueFieldOptionParameters = z.infer; diff --git a/src/version2/parameters/resetColumns.ts b/src/version2/parameters/resetColumns.ts deleted file mode 100644 index 92d708f2a8..0000000000 --- a/src/version2/parameters/resetColumns.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface ResetColumns { - /** The ID of the filter. */ - id: number; -} diff --git a/src/version2/parameters/resetColumnsParameters.ts b/src/version2/parameters/resetColumnsParameters.ts new file mode 100644 index 0000000000..08388d796b --- /dev/null +++ b/src/version2/parameters/resetColumnsParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const ResetColumnsParametersSchema = z.object({ + /** The ID of the filter. */ + id: z.number().int(), +}); + +export type ResetColumnsParameters = z.infer; diff --git a/src/version2/parameters/resetUserColumns.ts b/src/version2/parameters/resetUserColumns.ts deleted file mode 100644 index db5e050077..0000000000 --- a/src/version2/parameters/resetUserColumns.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface ResetUserColumns { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - 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. - */ - username?: string; -} diff --git a/src/version2/parameters/resetUserColumnsParameters.ts b/src/version2/parameters/resetUserColumnsParameters.ts new file mode 100644 index 0000000000..57c2b76b8c --- /dev/null +++ b/src/version2/parameters/resetUserColumnsParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const ResetUserColumnsParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** + * 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: z.string().optional(), +}); + +export type ResetUserColumnsParameters = z.infer; diff --git a/src/version2/parameters/restore.ts b/src/version2/parameters/restore.ts deleted file mode 100644 index c8fd6ca5ef..0000000000 --- a/src/version2/parameters/restore.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface Restore { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; -} diff --git a/src/version2/parameters/restoreCustomField.ts b/src/version2/parameters/restoreCustomField.ts deleted file mode 100644 index 8820c2b124..0000000000 --- a/src/version2/parameters/restoreCustomField.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface RestoreCustomField { - /** The ID of a custom field. */ - id: string; -} diff --git a/src/version2/parameters/restoreCustomFieldParameters.ts b/src/version2/parameters/restoreCustomFieldParameters.ts new file mode 100644 index 0000000000..51e66fde75 --- /dev/null +++ b/src/version2/parameters/restoreCustomFieldParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const RestoreCustomFieldParametersSchema = z.object({ + /** The ID of a custom field. */ + id: z.string(), +}); + +export type RestoreCustomFieldParameters = z.infer; diff --git a/src/version2/parameters/restoreParameters.ts b/src/version2/parameters/restoreParameters.ts new file mode 100644 index 0000000000..dde337b9d9 --- /dev/null +++ b/src/version2/parameters/restoreParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const RestoreParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), +}); + +export type RestoreParameters = z.infer; diff --git a/src/version2/parameters/sanitiseJqlQueries.ts b/src/version2/parameters/sanitiseJqlQueries.ts deleted file mode 100644 index adfad86df5..0000000000 --- a/src/version2/parameters/sanitiseJqlQueries.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { JqlQueriesToSanitize } from '../models'; - -export interface SanitiseJqlQueries extends JqlQueriesToSanitize {} diff --git a/src/version2/parameters/sanitiseJqlQueriesParameters.ts b/src/version2/parameters/sanitiseJqlQueriesParameters.ts new file mode 100644 index 0000000000..ddf1e963ec --- /dev/null +++ b/src/version2/parameters/sanitiseJqlQueriesParameters.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { JqlQueryToSanitizeSchema } from './jqlQueryToSanitize'; + +export const SanitiseJqlQueriesParametersSchema = z.object({ + /** The list of JQL queries to sanitize. Must contain unique values. Maximum of 20 queries. */ + queries: z.array(JqlQueryToSanitizeSchema), +}); + +export type SanitiseJqlQueriesParameters = z.infer; diff --git a/src/version2/parameters/saveTemplateParameters.ts b/src/version2/parameters/saveTemplateParameters.ts new file mode 100644 index 0000000000..36fb90d637 --- /dev/null +++ b/src/version2/parameters/saveTemplateParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { SaveProjectTemplateRequestSchema } from './saveProjectTemplateRequest'; + +export const SaveTemplateParametersSchema = z.object({ + /** The description of the template */ + templateDescription: z.string().optional(), + templateFromProjectRequest: SaveProjectTemplateRequestSchema.optional(), + /** The name of the template */ + templateName: z.string().optional(), +}); + +export type SaveTemplateParameters = z.infer; diff --git a/src/version2/parameters/search.ts b/src/version2/parameters/search.ts deleted file mode 100644 index d704f138de..0000000000 --- a/src/version2/parameters/search.ts +++ /dev/null @@ -1,20 +0,0 @@ -export interface Search { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `usages` Returns the project and issue types that use the status in their workflow. - * - `workflowUsages` Returns the workflows that use the status. - */ - expand?: 'usages' | 'workflowUsages' | ('usages' | 'workflowUsages')[] | string | string[]; - /** The project the status is part of or null for global statuses. */ - projectId?: 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; - /** Term to match status names against or null to search for all statuses in the search scope. */ - searchString?: string; - /** Category of the status to filter by. The supported values are: `TODO`, `IN_PROGRESS`, and `DONE`. */ - statusCategory?: 'TODO' | 'IN_PROGRESS' | 'DONE' | string; -} diff --git a/src/version2/parameters/searchAndReconsileIssuesUsingJqlParameters.ts b/src/version2/parameters/searchAndReconsileIssuesUsingJqlParameters.ts new file mode 100644 index 0000000000..1aef4ce16b --- /dev/null +++ b/src/version2/parameters/searchAndReconsileIssuesUsingJqlParameters.ts @@ -0,0 +1,82 @@ +import { z } from 'zod'; + +export const SearchAndReconsileIssuesUsingJqlParametersSchema = z.object({ + /** + * 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: z.string().optional(), + /** + * 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. + * + * Note: The `nextPageToken` field is **not included** in the response for the last page, indicating there is no next + * page. + */ + nextPageToken: z.string().optional(), + /** + * 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 or properties are requested. The greatest number of items returned per page is achieved when + * requesting `id` or `key` only. It returns max 5000 issues. + */ + maxResults: z.number().int().optional(), + /** + * 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: z.array(z.string()).optional(), + /** + * 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: z.string().optional(), + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties: z.array(z.string()).optional(), + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys: z.boolean().optional(), + /** Fail this request early if we can't retrieve all field data. */ + failFast: z.boolean().optional(), + /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids */ + reconcileIssues: z.array(z.number().int()).optional(), +}); + +export type SearchAndReconsileIssuesUsingJqlParameters = z.infer< + typeof SearchAndReconsileIssuesUsingJqlParametersSchema +>; diff --git a/src/version2/parameters/searchAndReconsileIssuesUsingJqlPostParameters.ts b/src/version2/parameters/searchAndReconsileIssuesUsingJqlPostParameters.ts new file mode 100644 index 0000000000..ece37f4fda --- /dev/null +++ b/src/version2/parameters/searchAndReconsileIssuesUsingJqlPostParameters.ts @@ -0,0 +1,76 @@ +import { z } from 'zod'; + +export const SearchAndReconsileIssuesUsingJqlPostParametersSchema = z.object({ + /** + * 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: z.string().optional(), + /** + * 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: z.array(z.string()).optional(), + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys: z.boolean().optional(), + /** + * 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: z.string().optional(), + /** + * 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: z.number().int().optional(), + /** + * 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: z.string().optional(), + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties: z.array(z.string()).optional(), + /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids */ + reconcileIssues: z.array(z.number().int()).optional(), +}); + +export type SearchAndReconsileIssuesUsingJqlPostParameters = z.infer< + typeof SearchAndReconsileIssuesUsingJqlPostParametersSchema +>; diff --git a/src/version2/parameters/searchForIssuesIds.ts b/src/version2/parameters/searchForIssuesIds.ts deleted file mode 100644 index 636f73ce0d..0000000000 --- a/src/version2/parameters/searchForIssuesIds.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IdSearchRequest } from '../models'; - -export interface SearchForIssuesIds extends IdSearchRequest {} diff --git a/src/version2/parameters/searchForIssuesUsingJql.ts b/src/version2/parameters/searchForIssuesUsingJql.ts deleted file mode 100644 index 8e1a025a00..0000000000 --- a/src/version2/parameters/searchForIssuesUsingJql.ts +++ /dev/null @@ -1,85 +0,0 @@ -export interface SearchForIssuesUsingJql { - /** - * The [JQL](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: - * - * If no JQL expression is provided, all issues are returned. `username` and `userkey` cannot be used as search terms - * due to privacy reasons. Use `accountId` instead. If a user has hidden their email address in their user profile, - * partial matches of the email address will not find the user. An exact match is required. - */ - jql?: string; - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** - * The maximum number of items to return per page. To manage page size, Jira may return fewer items per page where a - * large number of fields are requested. The greatest number of items returned per page is achieved when requesting - * `id` or `key` only. - */ - maxResults?: number; - /** - * Determines how to validate the JQL query and treat the validation results. Supported values are: - * - * - `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). - * - `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for - * - `strict`. `false` _Deprecated_ A legacy synonym for `warn`. - * - * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. - */ - validateQuery?: 'strict' | 'warn' | 'none' | string; - /** - * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a - * comma-separated list. Expand options include: - * - * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to - * exclude. - * - * Examples: - * - * `summary,comment` Returns only the summary and comments fields. `-description` Returns all navigable (default) - * fields except description. `*all,-comment` Returns all fields except comments. - * - * This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. - * - * Note: All navigable fields are returned by default. This differs from [GET - * issue](#api-rest-api-2-issue-issueIdOrKey-get) where the default is all fields. - */ - fields?: string[]; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about issues in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `renderedFields` Returns field values rendered in HTML format. - * - `names` Returns the display name of each field. - * - `schema` Returns the schema describing a field type. - * - `transitions` Returns all possible transitions for the issue. - * - `operations` Returns all possible operations for the issue. - * - `editmeta` Returns information about how each field can be edited. - * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. - * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each - * version of a field's value, with the highest numbered item representing the most recent version. - */ - expand?: - | 'renderedFields' - | 'names' - | 'schema' - | 'transitions' - | 'operations' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - | string - | string[]; - /** - * A list of issue property keys for issue properties to include in the results. This parameter accepts a - * comma-separated list. Multiple properties can also be provided using an ampersand separated list. For example, - * `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. - */ - properties?: string[]; - /** Reference fields by their key (rather than ID). */ - fieldsByKeys?: boolean; - /** - * Whether to fail the request quickly in case of an error while loading fields for an issue. For `failFast=true`, if - * one field fails, the entire operation fails. For `failFast=false`, the operation will continue even if a field - * fails. It will return a valid response, but without values for the failed field(s). - */ - failFast?: boolean; -} diff --git a/src/version2/parameters/searchForIssuesUsingJqlEnhancedSearch.ts b/src/version2/parameters/searchForIssuesUsingJqlEnhancedSearch.ts deleted file mode 100644 index d40a56810d..0000000000 --- a/src/version2/parameters/searchForIssuesUsingJqlEnhancedSearch.ts +++ /dev/null @@ -1,79 +0,0 @@ -export interface SearchForIssuesUsingJqlEnhancedSearch { - /** - * The [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a - * bounded query. A bounded query is a query with a search restriction. - * - * - Example of an unbounded query: `order by key desc`. - * - Example of a bounded query: `assignee = currentUser() order by key`. - * - * Additionally, `orderBy` clause can contain a maximum of 7 fields. - */ - jql: string; - /** - * The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. Use the - * `nextPageToken` to fetch the next page of issues. - */ - nextPageToken?: string; - /** - * The maximum number of items to return per page. To manage page size, API may return fewer items per page where a - * large number of fields are requested. The greatest number of items returned per page is achieved when requesting - * `id` or `key` only. - * - * It returns max 5000 issues. - * - * Default: `50` - * - * Format: `int32` - */ - maxResults?: number; - /** - * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a - * comma-separated list. Expand options include: - * - * - `*all` Returns all fields. - * - `*navigable` Returns navigable fields. - * - `id` Returns only issue IDs. - * - Any issue field, prefixed with a minus to exclude. - * - * The default is `id`. - * - * Examples: - * - * - `summary,comment` Returns only the summary and comments fields. - * - `-description` Returns all navigable (default) fields except description. - * - `*all,-comment` Returns all fields except comments. - * - * Multiple `fields` parameters can be included in a request. - * - * Note: By default, this resource returns IDs only. This differs from [GET - * issue](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-get) - * where the default is all fields. - */ - fields?: string[]; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about issues in the response. Note that, unlike the majority of instances where `expand` is specified, - * `expand` is defined as a comma-delimited string of values. The expand options are: - * - * - `renderedFields` Returns field values rendered in HTML format. - * - `names` Returns the display name of each field. - * - `schema` Returns the schema describing a field type. - * - `transitions` Returns all possible transitions for the issue. - * - `operations` Returns all possible operations for the issue. - * - `editmeta` Returns information about how each field can be edited. - * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. - * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each - * version of a field's value, with the highest numbered item representing the most recent version. - * - * Examples: `names,changelog` Returns the display name of each field as well as a list of recent updates to an issue. - */ - expand?: string; - /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ - properties?: string[]; - /** Reference fields by their key (rather than ID). The default is `false`. */ - fieldsByKeys?: boolean; - /** Fail this request early if we can't retrieve all field data. The default is `false`. */ - failFast?: boolean; - /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids. All issues must exist. */ - reconcileIssues?: number[]; -} diff --git a/src/version2/parameters/searchForIssuesUsingJqlEnhancedSearchPost.ts b/src/version2/parameters/searchForIssuesUsingJqlEnhancedSearchPost.ts deleted file mode 100644 index cfdc466032..0000000000 --- a/src/version2/parameters/searchForIssuesUsingJqlEnhancedSearchPost.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { EnhancedSearchRequest } from '../models'; - -export interface SearchForIssuesUsingJqlEnhancedSearchPost extends EnhancedSearchRequest {} diff --git a/src/version2/parameters/searchForIssuesUsingJqlPost.ts b/src/version2/parameters/searchForIssuesUsingJqlPost.ts deleted file mode 100644 index 810e175fe4..0000000000 --- a/src/version2/parameters/searchForIssuesUsingJqlPost.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SearchRequest } from '../models'; - -export interface SearchForIssuesUsingJqlPost extends SearchRequest {} diff --git a/src/version2/parameters/searchParameters.ts b/src/version2/parameters/searchParameters.ts new file mode 100644 index 0000000000..5ebf9a3717 --- /dev/null +++ b/src/version2/parameters/searchParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const SearchParametersSchema = z.object({ + /** The project the status is part of or null for global statuses. */ + projectId: z.string().optional(), + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** Term to match status names against or null to search for all statuses in the search scope. */ + searchString: z.string().optional(), + /** Category of the status to filter by. The supported values are: `TODO`, `IN_PROGRESS`, and `DONE`. */ + statusCategory: z.string().optional(), +}); + +export type SearchParameters = z.infer; diff --git a/src/version2/parameters/searchPriorities.ts b/src/version2/parameters/searchPriorities.ts deleted file mode 100644 index 7ad7be9707..0000000000 --- a/src/version2/parameters/searchPriorities.ts +++ /dev/null @@ -1,22 +0,0 @@ -export interface SearchPriorities { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** The list of priority IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=2&id=3`. */ - id?: string[]; - /** - * The list of projects IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * `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/searchProjects.ts b/src/version2/parameters/searchProjects.ts deleted file mode 100644 index f8212f04f9..0000000000 --- a/src/version2/parameters/searchProjects.ts +++ /dev/null @@ -1,131 +0,0 @@ -export interface SearchProjects { - /** 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. - * - * - `category` Sorts by project category. A complete list of category IDs is found using [Get all project - * categories](#api-rest-api-2-projectCategory-get). - * - `issueCount` Sorts by the total number of issues in each project. - * - `key` Sorts by project key. - * - `lastIssueUpdatedTime` Sorts by the last issue update time. - * - `name` Sorts by project name. - * - `owner` Sorts by project lead. - * - `archivedDate` EXPERIMENTAL. Sorts by project archived date. - * - `deletedDate` EXPERIMENTAL. Sorts by project deleted date. - */ - orderBy?: - | 'category' - | '-category' - | '+category' - | 'key' - | '-key' - | '+key' - | 'name' - | '-name' - | '+name' - | 'owner' - | '-owner' - | '+owner' - | 'issueCount' - | '-issueCount' - | '+issueCount' - | 'lastIssueUpdatedDate' - | '-lastIssueUpdatedDate' - | '+lastIssueUpdatedDate' - | 'archivedDate' - | '+archivedDate' - | '-archivedDate' - | 'deletedDate' - | '+deletedDate' - | '-deletedDate' - | string; - /** - * The project IDs to filter the results by. To include multiple IDs, provide an ampersand-separated list. For - * example, `id=10000&id=10001`. Up to 50 project IDs can be provided. - */ - id?: number[]; - /** - * The project keys to filter the results by. To include multiple keys, provide an ampersand-separated list. For - * example, `keys=PA&keys=PB`. Up to 50 project keys can be provided. - */ - keys?: string[]; - /** - * Filter the results using a literal string. Projects with a matching `key` or `name` are returned (case - * insensitive). - */ - query?: string; - /** - * Orders results by the [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes). This - * parameter accepts a comma-separated list. Valid values are `business`, `service_desk`, and `software`. - */ - typeKey?: string; - /** - * 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. - */ - categoryId?: number; - /** - * Filter results by projects for which the user can: - * - * `view` the project, meaning that they have one of the following permissions: - * - * _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). `browse` the project, meaning that they have the - * _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. `edit` the - * project, meaning that they have one of the following permissions: - * - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). `create` the project, meaning that they have - * the _Create issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the - * issue is created. - */ - action?: 'view' | 'browse' | 'edit' | 'create' | 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. Expanded options include: - * - * - `description` Returns the project description. - * - `projectKeys` Returns all project keys associated with a project. - * - `lead` Returns information about the project lead. - * - `issueTypes` Returns all issue types associated with the project. - * - `url` Returns the URL associated with the project. - * - `insight` EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the - * project. - */ - expand?: - | 'description' - | 'projectKeys' - | 'lead' - | 'issueTypes' - | 'url' - | 'insight' - | ('description' | 'projectKeys' | 'lead' | 'issueTypes' | 'url' | 'insight')[] - | string - | string[]; - /** - * EXPERIMENTAL. Filter results by project status: - * - * - `live` Search live projects. - * - `archived` Search archived projects. - * - `deleted` Search deleted projects, those in the recycle bin. - */ - status?: ('live' | 'archived' | 'deleted' | string)[]; - /** - * EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated - * list. - */ - properties?: string[]; - /** - * EXPERIMENTAL. A query string used to search properties. The query string cannot be specified using a JSON object. - * For example, to search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use - * `[thepropertykey].something.nested=1`. Note that the propertyQuery key is enclosed in square brackets to enable - * searching where the propertyQuery key includes dot (.) or equals (=) characters. Note that `thepropertykey` is only - * returned when included in `properties`. - */ - propertyQuery?: string; -} diff --git a/src/version2/parameters/searchProjectsParameters.ts b/src/version2/parameters/searchProjectsParameters.ts new file mode 100644 index 0000000000..98a3f5eb37 --- /dev/null +++ b/src/version2/parameters/searchProjectsParameters.ts @@ -0,0 +1,133 @@ +import { z } from 'zod'; +import { StringListSchema } from './stringList'; + +export const SearchProjectsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** + * The maximum number of items to return per page. Must be less than or equal to 100. If a value greater than 100 is + * provided, the `maxResults` parameter will default to 100. + */ + maxResults: z.number().int().optional(), + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field. + * + * - `category` Sorts by project category. A complete list of category IDs is found using [Get all project + * categories](#api-rest-api-2-projectCategory-get). + * - `issueCount` Sorts by the total number of issues in each project. + * - `key` Sorts by project key. + * - `lastIssueUpdatedTime` Sorts by the last issue update time. + * - `name` Sorts by project name. + * - `owner` Sorts by project lead. + * - `archivedDate` EXPERIMENTAL. Sorts by project archived date. + * - `deletedDate` EXPERIMENTAL. Sorts by project deleted date. + */ + orderBy: z + .enum([ + 'category', + '-category', + '+category', + 'key', + '-key', + '+key', + 'name', + '-name', + '+name', + 'owner', + '-owner', + '+owner', + 'issueCount', + '-issueCount', + '+issueCount', + 'lastIssueUpdatedDate', + '-lastIssueUpdatedDate', + '+lastIssueUpdatedDate', + 'archivedDate', + '+archivedDate', + '-archivedDate', + 'deletedDate', + '+deletedDate', + '-deletedDate', + ]) + .optional(), + /** + * The project IDs to filter the results by. To include multiple IDs, provide an ampersand-separated list. For + * example, `id=10000&id=10001`. Up to 50 project IDs can be provided. + */ + id: z.array(z.number().int()).optional(), + /** + * The project keys to filter the results by. To include multiple keys, provide an ampersand-separated list. For + * example, `keys=PA&keys=PB`. Up to 50 project keys can be provided. + */ + keys: z.array(z.string()).optional(), + /** + * Filter the results using a literal string. Projects with a matching `key` or `name` are returned (case + * insensitive). + */ + query: z.string().optional(), + /** + * Orders results by the [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes). This + * parameter accepts a comma-separated list. Valid values are `business`, `service_desk`, and `software`. + */ + typeKey: z.string().optional(), + /** + * 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. + */ + categoryId: z.number().int().optional(), + /** + * Filter results by projects for which the user can: + * + * - `view` the project, meaning that they have one of the following permissions: + * + * - _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). + * - `browse` the project, meaning that they have the _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - `edit` the project, meaning that they have one of the following permissions: + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - `create` the project, meaning that they have the _Create issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the issue is created. + */ + action: z.enum(['view', 'browse', 'edit', 'create']).optional(), + /** + * 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. + * - `projectKeys` Returns all project keys associated with a project. + * - `lead` Returns information about the project lead. + * - `issueTypes` Returns all issue types associated with the project. + * - `url` Returns the URL associated with the project. + * - `insight` EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the + * project. + */ + expand: z.string().optional(), + /** + * EXPERIMENTAL. Filter results by project status: + * + * - `live` Search live projects. + * - `archived` Search archived projects. + * - `deleted` Search deleted projects, those in the recycle bin. + */ + status: z.array(z.enum(['live', 'archived', 'deleted'])).optional(), + /** + * EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated + * list. + */ + properties: z.array(StringListSchema).optional(), + /** + * EXPERIMENTAL. A query string used to search properties. The query string cannot be specified using a JSON object. + * For example, to search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use + * `[thepropertykey].something.nested=1`. Note that the propertyQuery key is enclosed in square brackets to enable + * searching where the propertyQuery key includes dot (.) or equals (=) characters. Note that `thepropertykey` is only + * returned when included in `properties`. + */ + propertyQuery: z.string().optional(), +}); + +export type SearchProjectsParameters = z.infer; diff --git a/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts b/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts deleted file mode 100644 index ba08b5778f..0000000000 --- a/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface SearchProjectsUsingSecuritySchemes { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** The list of security scheme IDs to be filtered out. */ - issueSecuritySchemeId?: string[]; - /** The list of project IDs to be filtered out. */ - projectId?: string[]; -} diff --git a/src/version2/parameters/searchProjectsUsingSecuritySchemesParameters.ts b/src/version2/parameters/searchProjectsUsingSecuritySchemesParameters.ts new file mode 100644 index 0000000000..562c1c08fa --- /dev/null +++ b/src/version2/parameters/searchProjectsUsingSecuritySchemesParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const SearchProjectsUsingSecuritySchemesParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.string().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.string().optional(), + /** The list of security scheme IDs to be filtered out. */ + issueSecuritySchemeId: z.array(z.string()).optional(), + /** The list of project IDs to be filtered out. */ + projectId: z.array(z.string()).optional(), +}); + +export type SearchProjectsUsingSecuritySchemesParameters = z.infer< + typeof SearchProjectsUsingSecuritySchemesParametersSchema +>; diff --git a/src/version2/parameters/searchResolutions.ts b/src/version2/parameters/searchResolutions.ts deleted file mode 100644 index d41dc361ba..0000000000 --- a/src/version2/parameters/searchResolutions.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface SearchResolutions { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** The list of resolutions IDs to be filtered out */ - id?: string[]; - /** - * When set to true, return default only,when IDs provided, if none of them is default, return empty page. Default - * value is false - */ - onlyDefault?: boolean; -} diff --git a/src/version2/parameters/searchResolutionsParameters.ts b/src/version2/parameters/searchResolutionsParameters.ts new file mode 100644 index 0000000000..9652966315 --- /dev/null +++ b/src/version2/parameters/searchResolutionsParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const SearchResolutionsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.string().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.string().optional(), + /** The list of resolutions IDs to be filtered out */ + id: z.array(z.string()).optional(), + /** + * When set to true, return default only, when IDs provided, if none of them is default, return empty page. Default + * value is false + */ + onlyDefault: z.boolean().optional(), +}); + +export type SearchResolutionsParameters = z.infer; diff --git a/src/version2/parameters/searchSecuritySchemes.ts b/src/version2/parameters/searchSecuritySchemes.ts deleted file mode 100644 index 150e06463d..0000000000 --- a/src/version2/parameters/searchSecuritySchemes.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface SearchSecuritySchemes { - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * The list of issue security scheme IDs. To include multiple issue security scheme IDs, separate IDs with an - * ampersand: `id=10000&id=10001`. - */ - id?: string | string[]; - /** - * The list of project IDs. To include multiple project IDs, separate IDs with an ampersand: - * `projectId=10000&projectId=10001`. - */ - projectId?: string | string[]; -} diff --git a/src/version2/parameters/searchSecuritySchemesParameters.ts b/src/version2/parameters/searchSecuritySchemesParameters.ts new file mode 100644 index 0000000000..2664b54246 --- /dev/null +++ b/src/version2/parameters/searchSecuritySchemesParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const SearchSecuritySchemesParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.string().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.string().optional(), + /** + * The list of issue security scheme IDs. To include multiple issue security scheme IDs, separate IDs with an + * ampersand: `id=10000&id=10001`. + */ + id: z.array(z.string()).optional(), + /** + * The list of project IDs. To include multiple project IDs, separate IDs with an ampersand: + * `projectId=10000&projectId=10001`. + */ + projectId: z.array(z.string()).optional(), +}); + +export type SearchSecuritySchemesParameters = z.infer; diff --git a/src/version2/parameters/searchWorkflows.ts b/src/version2/parameters/searchWorkflows.ts deleted file mode 100644 index b0c6e94475..0000000000 --- a/src/version2/parameters/searchWorkflows.ts +++ /dev/null @@ -1,25 +0,0 @@ -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/searchWorkflowsParameters.ts b/src/version2/parameters/searchWorkflowsParameters.ts new file mode 100644 index 0000000000..5c1508ec1a --- /dev/null +++ b/src/version2/parameters/searchWorkflowsParameters.ts @@ -0,0 +1,31 @@ +import { z } from 'zod'; + +export const SearchWorkflowsParametersSchema = z.object({ + /** The index of the first item to return in a page of results (page offset). */ + startAt: z.number().int().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** + * 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: z.string().optional(), + /** String used to perform a case-insensitive partial match with workflow name. */ + queryString: z.string().optional(), + /** + * [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: z.string().optional(), + /** The scope of the workflow. Global for company-managed projects and Project for team-managed projects. */ + scope: z.string().optional(), + /** Filters active and inactive workflows. */ + isActive: z.boolean().optional(), +}); + +export type SearchWorkflowsParameters = z.infer; diff --git a/src/version2/parameters/selectTimeTrackingImplementation.ts b/src/version2/parameters/selectTimeTrackingImplementation.ts deleted file mode 100644 index 3adc87b62d..0000000000 --- a/src/version2/parameters/selectTimeTrackingImplementation.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TimeTrackingProvider } from '../models'; - -export interface SelectTimeTrackingImplementation extends TimeTrackingProvider {} diff --git a/src/version2/parameters/selectTimeTrackingImplementationParameters.ts b/src/version2/parameters/selectTimeTrackingImplementationParameters.ts new file mode 100644 index 0000000000..2268cfce26 --- /dev/null +++ b/src/version2/parameters/selectTimeTrackingImplementationParameters.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +export const SelectTimeTrackingImplementationParametersSchema = z.object({ + /** The key for the time tracking provider. For example, _JIRA_. */ + key: z.string(), + /** The name of the time tracking provider. For example, _JIRA provided time tracking_. */ + name: z.string().optional(), + /** + * The URL of the configuration page for the time tracking provider app. For example, _/example/config/url_. This + * property is only returned if the `adminPageKey` property is set in the module descriptor of the time tracking + * provider app. + */ + url: z.string().optional(), +}); + +export type SelectTimeTrackingImplementationParameters = z.infer< + typeof SelectTimeTrackingImplementationParametersSchema +>; diff --git a/src/version2/parameters/services.ts b/src/version2/parameters/services.ts deleted file mode 100644 index 296a9d0439..0000000000 --- a/src/version2/parameters/services.ts +++ /dev/null @@ -1,4 +0,0 @@ -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/servicesParameters.ts b/src/version2/parameters/servicesParameters.ts new file mode 100644 index 0000000000..5ab65f1695 --- /dev/null +++ b/src/version2/parameters/servicesParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const ServicesParametersSchema = z.object({ + /** The ID of the services (the strings starting with "b:" need to be decoded in Base64). */ + serviceIds: z.array(z.string()), +}); + +export type ServicesParameters = z.infer; diff --git a/src/version2/parameters/setActors.ts b/src/version2/parameters/setActors.ts deleted file mode 100644 index f17dcfc08d..0000000000 --- a/src/version2/parameters/setActors.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ProjectRoleActorsUpdate } from '../models'; - -export interface SetActors extends ProjectRoleActorsUpdate { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version2/parameters/setActorsParameters.ts b/src/version2/parameters/setActorsParameters.ts new file mode 100644 index 0000000000..d095ea437d --- /dev/null +++ b/src/version2/parameters/setActorsParameters.ts @@ -0,0 +1,33 @@ +import { z } from 'zod'; + +export const SetActorsParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: z.number().int(), + /** + * The actors to add to the project role. + * + * Add groups using: + * + * - `atlassian-group-role-actor` and a list of group names. + * - `atlassian-group-role-actor-id` and a list of group IDs. + * + * As a group's name can change, use of `atlassian-group-role-actor-id` is recommended. For example, + * `"atlassian-group-role-actor-id":["eef79f81-0b89-4fca-a736-4be531a10869","77f6ab39-e755-4570-a6ae-2d7a8df0bcb8"]`. + * + * Add users using `atlassian-user-role-actor` and a list of account IDs. For example, + * `"atlassian-user-role-actor":["12345678-9abc-def1-2345-6789abcdef12", "abcdef12-3456-789a-bcde-f123456789ab"]`. + */ + categorisedActors: z.object({}).optional(), + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: z.number().int().optional(), +}); + +export type SetActorsParameters = z.infer; diff --git a/src/version2/parameters/setApplicationProperty.ts b/src/version2/parameters/setApplicationProperty.ts deleted file mode 100644 index 612127a0ea..0000000000 --- a/src/version2/parameters/setApplicationProperty.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { SimpleApplicationProperty } from '../models'; - -export interface SetApplicationProperty extends SimpleApplicationProperty { - /** The key of the application property to update. */ - id: string; - - body?: { - /** The ID of the application property. */ - id?: string; - - /** The new value. */ - value?: string; - }; -} diff --git a/src/version2/parameters/setApplicationPropertyParameters.ts b/src/version2/parameters/setApplicationPropertyParameters.ts new file mode 100644 index 0000000000..22b3ec98a5 --- /dev/null +++ b/src/version2/parameters/setApplicationPropertyParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const SetApplicationPropertyParametersSchema = z.object({ + /** The key of the application property to update. */ + id: z.string(), + /** The ID of the application property. */ + id: z.string().optional(), + /** The new value. */ + value: z.string().optional(), +}); + +export type SetApplicationPropertyParameters = z.infer; diff --git a/src/version2/parameters/setBanner.ts b/src/version2/parameters/setBanner.ts deleted file mode 100644 index f2ad4a63bf..0000000000 --- a/src/version2/parameters/setBanner.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AnnouncementBannerConfigurationUpdate } from '../models'; - -export interface SetBanner extends AnnouncementBannerConfigurationUpdate {} diff --git a/src/version2/parameters/setBannerParameters.ts b/src/version2/parameters/setBannerParameters.ts new file mode 100644 index 0000000000..072f351a85 --- /dev/null +++ b/src/version2/parameters/setBannerParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const SetBannerParametersSchema = z.object({ + /** Flag indicating if the announcement banner can be dismissed by the user. */ + isDismissible: z.boolean().optional(), + /** Flag indicating if the announcement banner is enabled or not. */ + isEnabled: z.boolean().optional(), + /** The text on the announcement banner. */ + message: z.string().optional(), + /** Visibility of the announcement banner. Can be public or private. */ + visibility: z.string().optional(), +}); + +export type SetBannerParameters = z.infer; diff --git a/src/version2/parameters/setColumns.ts b/src/version2/parameters/setColumns.ts deleted file mode 100644 index 29531882e1..0000000000 --- a/src/version2/parameters/setColumns.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface SetColumns { - /** The ID of the filter. */ - id: number; - columns: string[]; -} diff --git a/src/version2/parameters/setColumnsParameters.ts b/src/version2/parameters/setColumnsParameters.ts new file mode 100644 index 0000000000..72134a82e8 --- /dev/null +++ b/src/version2/parameters/setColumnsParameters.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export const SetColumnsParametersSchema = z.object({ + /** The ID of the filter. */ + id: z.number().int(), + columns: z.array(z.string()).optional(), +}); + +export type SetColumnsParameters = z.infer; diff --git a/src/version2/parameters/setCommentProperty.ts b/src/version2/parameters/setCommentProperty.ts deleted file mode 100644 index e99af93039..0000000000 --- a/src/version2/parameters/setCommentProperty.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface SetCommentProperty { - /** The ID of the comment. */ - commentId: string; - /** The key of the property. The maximum length is 255 characters. */ - propertyKey: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - property: any; -} diff --git a/src/version2/parameters/setCommentPropertyParameters.ts b/src/version2/parameters/setCommentPropertyParameters.ts new file mode 100644 index 0000000000..bad5c0b851 --- /dev/null +++ b/src/version2/parameters/setCommentPropertyParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const SetCommentPropertyParametersSchema = z.object({ + /** The ID of the comment. */ + commentId: z.string(), + /** The key of the property. The maximum length is 255 characters. */ + propertyKey: z.string(), +}); + +export type SetCommentPropertyParameters = z.infer; diff --git a/src/version2/parameters/setDashboardItemProperty.ts b/src/version2/parameters/setDashboardItemProperty.ts deleted file mode 100644 index 0326f4f325..0000000000 --- a/src/version2/parameters/setDashboardItemProperty.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface SetDashboardItemProperty { - /** The ID of the dashboard. */ - dashboardId: string; - /** The ID of the dashboard item. */ - itemId: string; - /** - * The key of the dashboard item property. The maximum length is 255 characters. For dashboard items with a spec URI - * and no complete module key, if the provided propertyKey is equal to "config", the request body's JSON must be an - * object with all keys and values as strings. - */ - propertyKey: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - propertyValue: any; -} diff --git a/src/version2/parameters/setDashboardItemPropertyParameters.ts b/src/version2/parameters/setDashboardItemPropertyParameters.ts new file mode 100644 index 0000000000..e44c82adfb --- /dev/null +++ b/src/version2/parameters/setDashboardItemPropertyParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const SetDashboardItemPropertyParametersSchema = z.object({ + /** The ID of the dashboard. */ + dashboardId: z.string(), + /** The ID of the dashboard item. */ + itemId: z.string(), + /** + * The key of the dashboard item property. The maximum length is 255 characters. For dashboard items with a spec URI + * and no complete module key, if the provided propertyKey is equal to "config", the request body's JSON must be an + * object with all keys and values as strings. + */ + propertyKey: z.string(), +}); + +export type SetDashboardItemPropertyParameters = z.infer; diff --git a/src/version2/parameters/setDefaultLevels.ts b/src/version2/parameters/setDefaultLevels.ts deleted file mode 100644 index 9938a31889..0000000000 --- a/src/version2/parameters/setDefaultLevels.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SetDefaultLevelsRequest } from '../models'; - -export interface SetDefaultLevels extends SetDefaultLevelsRequest {} diff --git a/src/version2/parameters/setDefaultLevelsParameters.ts b/src/version2/parameters/setDefaultLevelsParameters.ts new file mode 100644 index 0000000000..e9b5f26564 --- /dev/null +++ b/src/version2/parameters/setDefaultLevelsParameters.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { DefaultLevelValueSchema } from './defaultLevelValue'; + +export const SetDefaultLevelsParametersSchema = z.object({ + /** List of objects with issue security scheme ID and new default level ID. */ + defaultValues: z.array(DefaultLevelValueSchema), +}); + +export type SetDefaultLevelsParameters = z.infer; diff --git a/src/version2/parameters/setDefaultPriority.ts b/src/version2/parameters/setDefaultPriority.ts deleted file mode 100644 index 57b1ccf85f..0000000000 --- a/src/version2/parameters/setDefaultPriority.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SetDefaultPriorityRequest } from '../models'; - -export interface SetDefaultPriority extends SetDefaultPriorityRequest {} diff --git a/src/version2/parameters/setDefaultPriorityParameters.ts b/src/version2/parameters/setDefaultPriorityParameters.ts new file mode 100644 index 0000000000..0295bf2e7a --- /dev/null +++ b/src/version2/parameters/setDefaultPriorityParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const SetDefaultPriorityParametersSchema = z.object({ + /** + * The ID of the new default issue priority. Must be an existing ID or null. Setting this to null erases the default + * priority setting. + */ + id: z.string(), +}); + +export type SetDefaultPriorityParameters = z.infer; diff --git a/src/version2/parameters/setDefaultResolution.ts b/src/version2/parameters/setDefaultResolution.ts deleted file mode 100644 index 02fc1a6246..0000000000 --- a/src/version2/parameters/setDefaultResolution.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SetDefaultResolutionRequest } from '../models'; - -export interface SetDefaultResolution extends SetDefaultResolutionRequest {} diff --git a/src/version2/parameters/setDefaultResolutionParameters.ts b/src/version2/parameters/setDefaultResolutionParameters.ts new file mode 100644 index 0000000000..39b0cbd710 --- /dev/null +++ b/src/version2/parameters/setDefaultResolutionParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const SetDefaultResolutionParametersSchema = z.object({ + /** + * The ID of the new default issue resolution. Must be an existing ID or null. Setting this to null erases the default + * resolution setting. + */ + id: z.string(), +}); + +export type SetDefaultResolutionParameters = z.infer; diff --git a/src/version2/parameters/setDefaultShareScope.ts b/src/version2/parameters/setDefaultShareScope.ts deleted file mode 100644 index 79ec3a100a..0000000000 --- a/src/version2/parameters/setDefaultShareScope.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { DefaultShareScope } from '../models'; - -export interface SetDefaultShareScope extends DefaultShareScope {} diff --git a/src/version2/parameters/setDefaultShareScopeParameters.ts b/src/version2/parameters/setDefaultShareScopeParameters.ts new file mode 100644 index 0000000000..ac82953528 --- /dev/null +++ b/src/version2/parameters/setDefaultShareScopeParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const SetDefaultShareScopeParametersSchema = z.object({ + /** + * The scope of the default sharing for new filters and dashboards: + * + * - `AUTHENTICATED` Shared with all logged-in users. + * - `GLOBAL` Shared with all logged-in users. This shows as `AUTHENTICATED` in the response. + * - `PRIVATE` Not shared with any users. + */ + scope: z.enum(['GLOBAL', 'AUTHENTICATED', 'PRIVATE']), +}); + +export type SetDefaultShareScopeParameters = z.infer; diff --git a/src/version2/parameters/setDefaultValues.ts b/src/version2/parameters/setDefaultValues.ts deleted file mode 100644 index 8f0fac89ab..0000000000 --- a/src/version2/parameters/setDefaultValues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CustomFieldContextDefaultValueUpdate } from '../models'; - -export interface SetDefaultValues extends CustomFieldContextDefaultValueUpdate { - /** The ID of the custom field. */ - fieldId: string; -} diff --git a/src/version2/parameters/setDefaultValuesParameters.ts b/src/version2/parameters/setDefaultValuesParameters.ts new file mode 100644 index 0000000000..e0f51ebbd3 --- /dev/null +++ b/src/version2/parameters/setDefaultValuesParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { CustomFieldContextDefaultValueSchema } from './customFieldContextDefaultValue'; + +export const SetDefaultValuesParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + defaultValues: z.array(CustomFieldContextDefaultValueSchema).optional(), +}); + +export type SetDefaultValuesParameters = z.infer; diff --git a/src/version2/parameters/setFavouriteForFilter.ts b/src/version2/parameters/setFavouriteForFilter.ts deleted file mode 100644 index e7a8369c29..0000000000 --- a/src/version2/parameters/setFavouriteForFilter.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface SetFavouriteForFilter { - /** The ID of the filter. */ - id: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't - * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of - * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to - * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: string; -} diff --git a/src/version2/parameters/setFavouriteForFilterParameters.ts b/src/version2/parameters/setFavouriteForFilterParameters.ts new file mode 100644 index 0000000000..73a56b1d56 --- /dev/null +++ b/src/version2/parameters/setFavouriteForFilterParameters.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const SetFavouriteForFilterParametersSchema = z.object({ + /** The ID of the filter. */ + id: z.number().int(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. + * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the + * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is + * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For + * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand: z.string().optional(), +}); + +export type SetFavouriteForFilterParameters = z.infer; diff --git a/src/version2/parameters/setFieldConfigurationSchemeMapping.ts b/src/version2/parameters/setFieldConfigurationSchemeMapping.ts deleted file mode 100644 index b801911194..0000000000 --- a/src/version2/parameters/setFieldConfigurationSchemeMapping.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AssociateFieldConfigurationsWithIssueTypesRequest } from '../models'; - -export interface SetFieldConfigurationSchemeMapping extends AssociateFieldConfigurationsWithIssueTypesRequest { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version2/parameters/setFieldConfigurationSchemeMappingParameters.ts b/src/version2/parameters/setFieldConfigurationSchemeMappingParameters.ts new file mode 100644 index 0000000000..d9be0d8ed9 --- /dev/null +++ b/src/version2/parameters/setFieldConfigurationSchemeMappingParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { FieldConfigurationToIssueTypeMappingSchema } from './fieldConfigurationToIssueTypeMapping'; + +export const SetFieldConfigurationSchemeMappingParametersSchema = z.object({ + /** The ID of the field configuration scheme. */ + id: z.number().int(), + /** Field configuration to issue type mappings. */ + mappings: z.array(FieldConfigurationToIssueTypeMappingSchema), +}); + +export type SetFieldConfigurationSchemeMappingParameters = z.infer< + typeof SetFieldConfigurationSchemeMappingParametersSchema +>; diff --git a/src/version2/parameters/setIssueNavigatorDefaultColumnsParameters.ts b/src/version2/parameters/setIssueNavigatorDefaultColumnsParameters.ts new file mode 100644 index 0000000000..7ace52836a --- /dev/null +++ b/src/version2/parameters/setIssueNavigatorDefaultColumnsParameters.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const SetIssueNavigatorDefaultColumnsParametersSchema = z.object({}); + +export type SetIssueNavigatorDefaultColumnsParameters = z.infer; diff --git a/src/version2/parameters/setIssueProperty.ts b/src/version2/parameters/setIssueProperty.ts deleted file mode 100644 index 2784d73305..0000000000 --- a/src/version2/parameters/setIssueProperty.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface SetIssueProperty { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The key of the issue property. The maximum length is 255 characters. */ - propertyKey: string; - /** The value of the issue property. Can be of any type. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - propertyValue: any; -} diff --git a/src/version2/parameters/setIssuePropertyParameters.ts b/src/version2/parameters/setIssuePropertyParameters.ts new file mode 100644 index 0000000000..f3d154158b --- /dev/null +++ b/src/version2/parameters/setIssuePropertyParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const SetIssuePropertyParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The key of the issue property. The maximum length is 255 characters. */ + propertyKey: z.string(), +}); + +export type SetIssuePropertyParameters = z.infer; diff --git a/src/version2/parameters/setIssueTypeProperty.ts b/src/version2/parameters/setIssueTypeProperty.ts deleted file mode 100644 index 2916db3228..0000000000 --- a/src/version2/parameters/setIssueTypeProperty.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface SetIssueTypeProperty { - /** The ID of the issue type. */ - issueTypeId: string; - /** The key of the issue type property. The maximum length is 255 characters. */ - propertyKey: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - propertyValue: any; -} diff --git a/src/version2/parameters/setIssueTypePropertyParameters.ts b/src/version2/parameters/setIssueTypePropertyParameters.ts new file mode 100644 index 0000000000..88bf29ff51 --- /dev/null +++ b/src/version2/parameters/setIssueTypePropertyParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const SetIssueTypePropertyParametersSchema = z.object({ + /** The ID of the issue type. */ + issueTypeId: z.string(), + /** The key of the issue type property. The maximum length is 255 characters. */ + propertyKey: z.string(), +}); + +export type SetIssueTypePropertyParameters = z.infer; diff --git a/src/version2/parameters/setPreference.ts b/src/version2/parameters/setPreference.ts deleted file mode 100644 index b54dd95532..0000000000 --- a/src/version2/parameters/setPreference.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface SetPreference { - /** The key of the preference. The maximum length is 255 characters. */ - key: string; - value: string; -} diff --git a/src/version2/parameters/setPreferenceParameters.ts b/src/version2/parameters/setPreferenceParameters.ts new file mode 100644 index 0000000000..5eaf351990 --- /dev/null +++ b/src/version2/parameters/setPreferenceParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const SetPreferenceParametersSchema = z.object({ + /** The key of the preference. The maximum length is 255 characters. */ + key: z.string(), +}); + +export type SetPreferenceParameters = z.infer; diff --git a/src/version2/parameters/setProjectProperty.ts b/src/version2/parameters/setProjectProperty.ts deleted file mode 100644 index 2ff27299a2..0000000000 --- a/src/version2/parameters/setProjectProperty.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface SetProjectProperty { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string | number; - /** The key of the project property. The maximum length is 255 characters. */ - propertyKey: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - propertyValue: any; -} diff --git a/src/version2/parameters/setProjectPropertyParameters.ts b/src/version2/parameters/setProjectPropertyParameters.ts new file mode 100644 index 0000000000..d1cf9c9767 --- /dev/null +++ b/src/version2/parameters/setProjectPropertyParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const SetProjectPropertyParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** The key of the project property. The maximum length is 255 characters. */ + propertyKey: z.string(), +}); + +export type SetProjectPropertyParameters = z.infer; diff --git a/src/version2/parameters/setSharedTimeTrackingConfiguration.ts b/src/version2/parameters/setSharedTimeTrackingConfiguration.ts deleted file mode 100644 index 4a43b9041b..0000000000 --- a/src/version2/parameters/setSharedTimeTrackingConfiguration.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TimeTrackingConfiguration } from '../models'; - -export interface SetSharedTimeTrackingConfiguration extends TimeTrackingConfiguration {} diff --git a/src/version2/parameters/setSharedTimeTrackingConfigurationParameters.ts b/src/version2/parameters/setSharedTimeTrackingConfigurationParameters.ts new file mode 100644 index 0000000000..fac752f4c2 --- /dev/null +++ b/src/version2/parameters/setSharedTimeTrackingConfigurationParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const SetSharedTimeTrackingConfigurationParametersSchema = z.object({ + /** The default unit of time applied to logged time. */ + defaultUnit: z.enum(['minute', 'hour', 'day', 'week']), + /** The format that will appear on an issue's _Time Spent_ field. */ + timeFormat: z.enum(['pretty', 'days', 'hours']), + /** The number of days in a working week. */ + workingDaysPerWeek: z.number(), + /** The number of hours in a working day. */ + workingHoursPerDay: z.number(), +}); + +export type SetSharedTimeTrackingConfigurationParameters = z.infer< + typeof SetSharedTimeTrackingConfigurationParametersSchema +>; diff --git a/src/version2/parameters/setUserColumns.ts b/src/version2/parameters/setUserColumns.ts deleted file mode 100644 index ee28a67fcb..0000000000 --- a/src/version2/parameters/setUserColumns.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface SetUserColumns { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - columns: any; -} diff --git a/src/version2/parameters/setUserColumnsParameters.ts b/src/version2/parameters/setUserColumnsParameters.ts new file mode 100644 index 0000000000..c0aa70f726 --- /dev/null +++ b/src/version2/parameters/setUserColumnsParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const SetUserColumnsParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), +}); + +export type SetUserColumnsParameters = z.infer; diff --git a/src/version2/parameters/setUserNavProperty.ts b/src/version2/parameters/setUserNavProperty.ts deleted file mode 100644 index a8080b1f2d..0000000000 --- a/src/version2/parameters/setUserNavProperty.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface SetUserNavProperty { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The key of the nav property. The maximum length is 255 characters. */ - propertyKey: string; -} diff --git a/src/version2/parameters/setUserNavPropertyParameters.ts b/src/version2/parameters/setUserNavPropertyParameters.ts new file mode 100644 index 0000000000..7cbeab152f --- /dev/null +++ b/src/version2/parameters/setUserNavPropertyParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const SetUserNavPropertyParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** The key of the nav property. The maximum length is 255 characters. */ + propertyKey: z.string(), +}); + +export type SetUserNavPropertyParameters = z.infer; diff --git a/src/version2/parameters/setUserProperty.ts b/src/version2/parameters/setUserProperty.ts deleted file mode 100644 index cb41b227b2..0000000000 --- a/src/version2/parameters/setUserProperty.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface SetUserProperty { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The key of the user's property. The maximum length is 255 characters. */ - propertyKey: string; - // eslint-disable-next-line - propertyValue: any; -} diff --git a/src/version2/parameters/setUserPropertyParameters.ts b/src/version2/parameters/setUserPropertyParameters.ts new file mode 100644 index 0000000000..6021e02b5b --- /dev/null +++ b/src/version2/parameters/setUserPropertyParameters.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; + +export const SetUserPropertyParametersSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** + * This parameter 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. + */ + userKey: z.string().optional(), + /** + * This parameter 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. + */ + username: z.string().optional(), + /** The key of the user's property. The maximum length is 255 characters. */ + propertyKey: z.string(), +}); + +export type SetUserPropertyParameters = z.infer; diff --git a/src/version2/parameters/setWorkflowSchemeDraftIssueType.ts b/src/version2/parameters/setWorkflowSchemeDraftIssueType.ts deleted file mode 100644 index 6b884437e9..0000000000 --- a/src/version2/parameters/setWorkflowSchemeDraftIssueType.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { IssueTypeWorkflowMapping } from '../models'; - -export interface SetWorkflowSchemeDraftIssueType extends IssueTypeWorkflowMapping { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The ID of the issue type. */ - issueType: string; - - /** Details about the mapping between an issue type and a workflow. */ - details: { - /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ - issueType?: string; - /** The name of the workflow. */ - workflow?: string; - /** - * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types - * mapping. - */ - updateDraftIfNeeded?: boolean; - }; -} diff --git a/src/version2/parameters/setWorkflowSchemeDraftIssueTypeParameters.ts b/src/version2/parameters/setWorkflowSchemeDraftIssueTypeParameters.ts new file mode 100644 index 0000000000..ced166d039 --- /dev/null +++ b/src/version2/parameters/setWorkflowSchemeDraftIssueTypeParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const SetWorkflowSchemeDraftIssueTypeParametersSchema = z.object({ + /** The ID of the workflow scheme that the draft belongs to. */ + id: z.number().int(), + /** The ID of the issue type. */ + issueType: z.string(), + /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ + issueType: z.string().optional(), + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types + * mapping. + */ + updateDraftIfNeeded: z.boolean().optional(), + /** The name of the workflow. */ + workflow: z.string().optional(), +}); + +export type SetWorkflowSchemeDraftIssueTypeParameters = z.infer; diff --git a/src/version2/parameters/setWorkflowSchemeIssueType.ts b/src/version2/parameters/setWorkflowSchemeIssueType.ts deleted file mode 100644 index 5a33c66933..0000000000 --- a/src/version2/parameters/setWorkflowSchemeIssueType.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { IssueTypeWorkflowMapping } from '../models'; - -export interface SetWorkflowSchemeIssueType extends IssueTypeWorkflowMapping { - /** The ID of the workflow scheme. */ - id: number; - /** The ID of the issue type. */ - issueType: string; - - /** Details about the mapping between an issue type and a workflow. */ - details: { - /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ - issueType?: string; - - /** The name of the workflow. */ - workflow?: string; - - /** - * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types - * mapping. - */ - updateDraftIfNeeded?: boolean; - }; -} diff --git a/src/version2/parameters/setWorkflowSchemeIssueTypeParameters.ts b/src/version2/parameters/setWorkflowSchemeIssueTypeParameters.ts new file mode 100644 index 0000000000..445a235fa5 --- /dev/null +++ b/src/version2/parameters/setWorkflowSchemeIssueTypeParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const SetWorkflowSchemeIssueTypeParametersSchema = z.object({ + /** The ID of the workflow scheme. */ + id: z.number().int(), + /** The ID of the issue type. */ + issueType: z.string(), + /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ + issueType: z.string().optional(), + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types + * mapping. + */ + updateDraftIfNeeded: z.boolean().optional(), + /** The name of the workflow. */ + workflow: z.string().optional(), +}); + +export type SetWorkflowSchemeIssueTypeParameters = z.infer; diff --git a/src/version2/parameters/setWorklogProperty.ts b/src/version2/parameters/setWorklogProperty.ts deleted file mode 100644 index 7aa1105513..0000000000 --- a/src/version2/parameters/setWorklogProperty.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface SetWorklogProperty { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the worklog. */ - worklogId: string; - /** The key of the issue property. The maximum length is 255 characters. */ - propertyKey: string; -} diff --git a/src/version2/parameters/setWorklogPropertyParameters.ts b/src/version2/parameters/setWorklogPropertyParameters.ts new file mode 100644 index 0000000000..020f7577d7 --- /dev/null +++ b/src/version2/parameters/setWorklogPropertyParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const SetWorklogPropertyParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The ID of the worklog. */ + worklogId: z.string(), + /** The key of the issue property. The maximum length is 255 characters. */ + propertyKey: z.string(), +}); + +export type SetWorklogPropertyParameters = z.infer; diff --git a/src/version2/parameters/storeAvatar.ts b/src/version2/parameters/storeAvatar.ts deleted file mode 100644 index 398a59baff..0000000000 --- a/src/version2/parameters/storeAvatar.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface StoreAvatar { - /** The avatar type. */ - type: 'project' | 'issuetype' | string; - /** The ID of the item the avatar is associated with. */ - entityId: number | string; - /** The X coordinate of the top-left corner of the crop region. */ - x?: number; - /** The Y coordinate of the top-left corner of the crop region. */ - y?: number; - /** - * The length of each side of the crop region. - * - * @default 0 - */ - size?: number; - mimeType: string; - avatar: Buffer | ArrayBuffer | Uint8Array; -} diff --git a/src/version2/parameters/storeAvatarParameters.ts b/src/version2/parameters/storeAvatarParameters.ts new file mode 100644 index 0000000000..ea10453b29 --- /dev/null +++ b/src/version2/parameters/storeAvatarParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const StoreAvatarParametersSchema = z.object({ + /** The avatar type. */ + type: z.enum(['project', 'issuetype', 'priority']), + /** The ID of the item the avatar is associated with. */ + entityId: z.string(), + /** The X coordinate of the top-left corner of the crop region. */ + x: z.number().int().optional(), + /** The Y coordinate of the top-left corner of the crop region. */ + y: z.number().int().optional(), + /** The length of each side of the crop region. */ + size: z.number().int(), +}); + +export type StoreAvatarParameters = z.infer; diff --git a/src/version2/parameters/suggestedPrioritiesForMappings.ts b/src/version2/parameters/suggestedPrioritiesForMappings.ts deleted file mode 100644 index 5dd3d57bcd..0000000000 --- a/src/version2/parameters/suggestedPrioritiesForMappings.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SuggestedMappingsRequest } from '../models'; - -export interface SuggestedPrioritiesForMappings extends SuggestedMappingsRequest {} diff --git a/src/version2/parameters/suggestedPrioritiesForMappingsParameters.ts b/src/version2/parameters/suggestedPrioritiesForMappingsParameters.ts new file mode 100644 index 0000000000..4bf1a9c654 --- /dev/null +++ b/src/version2/parameters/suggestedPrioritiesForMappingsParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const SuggestedPrioritiesForMappingsParametersSchema = z.object({ + /** The maximum number of results that could be on the page. */ + maxResults: z.number().int().optional(), + /** The priority changes in the scheme. */ + priorities: z.unknown().optional(), + /** The project changes in the scheme. */ + projects: z.unknown().optional(), + /** The id of the priority scheme. */ + schemeId: z.number().int().optional(), + /** The index of the first item returned on the page. */ + startAt: z.number().int().optional(), +}); + +export type SuggestedPrioritiesForMappingsParameters = z.infer; diff --git a/src/version2/parameters/toggleFeatureForProject.ts b/src/version2/parameters/toggleFeatureForProject.ts deleted file mode 100644 index cf15f0158d..0000000000 --- a/src/version2/parameters/toggleFeatureForProject.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectFeatureToggleRequest } from '../models'; - -export interface ToggleFeatureForProject extends ProjectFeatureToggleRequest { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string | number; - /** The key of the feature. */ - featureKey: string; -} diff --git a/src/version2/parameters/toggleFeatureForProjectParameters.ts b/src/version2/parameters/toggleFeatureForProjectParameters.ts new file mode 100644 index 0000000000..738e309264 --- /dev/null +++ b/src/version2/parameters/toggleFeatureForProjectParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const ToggleFeatureForProjectParametersSchema = z.object({ + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: z.string(), + /** The key of the feature. */ + featureKey: z.string(), + /** The feature state. */ + state: z.enum(['ENABLED', 'DISABLED', 'COMING_SOON']).optional(), +}); + +export type ToggleFeatureForProjectParameters = z.infer; diff --git a/src/version2/parameters/trashCustomField.ts b/src/version2/parameters/trashCustomField.ts deleted file mode 100644 index d4b35f3922..0000000000 --- a/src/version2/parameters/trashCustomField.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface TrashCustomField { - /** The ID of a custom field. */ - id: string; -} diff --git a/src/version2/parameters/trashCustomFieldParameters.ts b/src/version2/parameters/trashCustomFieldParameters.ts new file mode 100644 index 0000000000..209ce5d9c5 --- /dev/null +++ b/src/version2/parameters/trashCustomFieldParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const TrashCustomFieldParametersSchema = z.object({ + /** The ID of a custom field. */ + id: z.string(), +}); + +export type TrashCustomFieldParameters = z.infer; diff --git a/src/version2/parameters/trashPlan.ts b/src/version2/parameters/trashPlan.ts deleted file mode 100644 index e960cc100a..0000000000 --- a/src/version2/parameters/trashPlan.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface TrashPlan { - /** The ID of the plan. */ - planId: number; -} diff --git a/src/version2/parameters/trashPlanParameters.ts b/src/version2/parameters/trashPlanParameters.ts new file mode 100644 index 0000000000..1f1db9c0ee --- /dev/null +++ b/src/version2/parameters/trashPlanParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const TrashPlanParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), +}); + +export type TrashPlanParameters = z.infer; diff --git a/src/version2/parameters/unarchiveIssues.ts b/src/version2/parameters/unarchiveIssues.ts deleted file mode 100644 index bb04ae1fcf..0000000000 --- a/src/version2/parameters/unarchiveIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface UnarchiveIssues { - issueIdsOrKeys?: string[]; -} diff --git a/src/version2/parameters/unarchiveIssuesParameters.ts b/src/version2/parameters/unarchiveIssuesParameters.ts new file mode 100644 index 0000000000..78cf0f45b7 --- /dev/null +++ b/src/version2/parameters/unarchiveIssuesParameters.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const UnarchiveIssuesParametersSchema = z.object({ + issueIdsOrKeys: z.array(z.string()).optional(), +}); + +export type UnarchiveIssuesParameters = z.infer; diff --git a/src/version2/parameters/updateAtlassianTeam.ts b/src/version2/parameters/updateAtlassianTeam.ts deleted file mode 100644 index d5a9fb9dfe..0000000000 --- a/src/version2/parameters/updateAtlassianTeam.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface UpdateAtlassianTeam { - /** The ID of the plan. */ - planId: number; - /** The ID of the Atlassian team. */ - atlassianTeamId: string; -} diff --git a/src/version2/parameters/updateAtlassianTeamParameters.ts b/src/version2/parameters/updateAtlassianTeamParameters.ts new file mode 100644 index 0000000000..1cb184049e --- /dev/null +++ b/src/version2/parameters/updateAtlassianTeamParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const UpdateAtlassianTeamParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), + /** The ID of the Atlassian team. */ + atlassianTeamId: z.string(), + body: z.any(), +}); + +export type UpdateAtlassianTeamParameters = z.infer; diff --git a/src/version2/parameters/updateComment.ts b/src/version2/parameters/updateComment.ts deleted file mode 100644 index 21037b7e3a..0000000000 --- a/src/version2/parameters/updateComment.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { Comment } from '../models'; - -export interface UpdateComment extends Comment { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the comment. */ - id: string; - /** Whether users are notified when a comment is updated. */ - notifyUsers?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on - * behalf of users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body - * rendered in HTML. - */ - expand?: 'renderedBody' | ['renderedBody'] | string | string[]; -} diff --git a/src/version2/parameters/updateCommentParameters.ts b/src/version2/parameters/updateCommentParameters.ts new file mode 100644 index 0000000000..b5c4402b84 --- /dev/null +++ b/src/version2/parameters/updateCommentParameters.ts @@ -0,0 +1,61 @@ +import { z } from 'zod'; +import { EntityPropertySchema } from './entityProperty'; + +export const UpdateCommentParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The ID of the comment. */ + id: z.string(), + /** Whether users are notified when a comment is updated. */ + notifyUsers: z.boolean().optional(), + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on + * behalf of users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag: z.boolean().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body + * rendered in HTML. + */ + expand: z.string().optional(), + /** The ID of the user who created the comment. */ + author: z.unknown().optional(), + /** The comment text. */ + body: z.string().optional(), + /** The date and time at which the comment was created. */ + created: z.string().datetime().optional(), + /** The ID of the comment. */ + id: z.string().optional(), + /** + * Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external + * emails to be added as comments on + * issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for + * information on setting up this feature. + */ + jsdAuthorCanSeeRequest: z.boolean().optional(), + /** + * Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud + * Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk + * project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its + * visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request + * comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) + * operation. + */ + jsdPublic: z.boolean().optional(), + /** A list of comment properties. Optional on create and update. */ + properties: z.array(EntityPropertySchema).optional(), + /** The rendered version of the comment. */ + renderedBody: z.string().optional(), + /** The URL of the comment. */ + self: z.string().optional(), + /** The ID of the user who updated the comment last. */ + updateAuthor: z.unknown().optional(), + /** The date and time at which the comment was updated last. */ + updated: z.string().datetime().optional(), + /** The group or role to which this comment is visible. Optional on create and update. */ + visibility: z.unknown().optional(), +}); + +export type UpdateCommentParameters = z.infer; diff --git a/src/version2/parameters/updateComponent.ts b/src/version2/parameters/updateComponent.ts deleted file mode 100644 index af4e08ac30..0000000000 --- a/src/version2/parameters/updateComponent.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ProjectComponent } from '../models'; - -export interface UpdateComponent extends ProjectComponent { - /** The ID of the component. */ - id: string; -} diff --git a/src/version2/parameters/updateComponentParameters.ts b/src/version2/parameters/updateComponentParameters.ts new file mode 100644 index 0000000000..f0fa757002 --- /dev/null +++ b/src/version2/parameters/updateComponentParameters.ts @@ -0,0 +1,80 @@ +import { z } from 'zod'; + +export const UpdateComponentParametersSchema = z.object({ + /** The ID of the component. */ + id: z.string(), + /** Compass component's ID. Can't be updated. Not required for creating a Project Component. */ + ari: z.string().optional(), + /** + * The details of the user associated with `assigneeType`, if any. See `realAssignee` for details of the user assigned + * to issues created with this component. + */ + assignee: z.unknown().optional(), + /** + * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` + * for details on how the type of the user, and hence the user, assigned to issues is determined. Can take the + * following values: + * + * - `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the + * component is in. + * - `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for the component. + * - `UNASSIGNED` an assignee is not set for issues created with this component. + * - `PROJECT_DEFAULT` the assignee to any issues created with this component is nominally the default assignee for the + * project that the component is in. + * + * Default value: `PROJECT_DEFAULT`. Optional when creating or updating a component. + */ + assigneeType: z.enum(['PROJECT_DEFAULT', 'COMPONENT_LEAD', 'PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** The description for the component. Optional when creating or updating a component. */ + description: z.string().optional(), + /** The unique identifier for the component. */ + id: z.string().optional(), + /** + * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but + * the component lead is not set, then `false` is returned. + */ + isAssigneeTypeValid: z.boolean().optional(), + /** The user details for the component's lead user. */ + lead: z.unknown().optional(), + /** + * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian + * products. For example, _5b10ac8d82e05b22cc7d4ef5_. + */ + leadAccountId: z.string().optional(), + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + leadUserName: z.string().optional(), + /** Compass component's metadata. Can't be updated. Not required for creating a Project Component. */ + metadata: z.object({}).optional(), + /** + * The unique name for the component in the project. Required when creating a component. Optional when updating a + * component. The maximum length is 255 characters. + */ + name: z.string().optional(), + /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ + project: z.string().optional(), + /** The ID of the project the component is assigned to. */ + projectId: z.number().int().optional(), + /** The user assigned to issues created with this component, when `assigneeType` does not identify a valid assignee. */ + realAssignee: z.unknown().optional(), + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set + * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This + * property is set to one of the following values: + * + * - `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in + * the project that the component is in. + * - `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component lead has permission to be assigned + * issues in the project that the component is in. + * - `UNASSIGNED` when `assigneeType` is `UNASSIGNED` and Jira is configured to allow unassigned issues. + * - `PROJECT_DEFAULT` when none of the preceding cases are true. + */ + realAssigneeType: z.enum(['PROJECT_DEFAULT', 'COMPONENT_LEAD', 'PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** The URL of the component. */ + self: z.string().optional(), +}); + +export type UpdateComponentParameters = z.infer; diff --git a/src/version2/parameters/updateCustomField.ts b/src/version2/parameters/updateCustomField.ts deleted file mode 100644 index 2fbe69b563..0000000000 --- a/src/version2/parameters/updateCustomField.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateCustomFieldDetails } from '../models'; - -export interface UpdateCustomField extends UpdateCustomFieldDetails { - /** The ID of the custom field. */ - fieldId: string; -} diff --git a/src/version2/parameters/updateCustomFieldConfiguration.ts b/src/version2/parameters/updateCustomFieldConfiguration.ts deleted file mode 100644 index ea35875273..0000000000 --- a/src/version2/parameters/updateCustomFieldConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CustomFieldConfigurations } from '../models'; - -export interface UpdateCustomFieldConfiguration extends CustomFieldConfigurations { - /** The ID or key of the custom field, for example `customfield_10000`. */ - fieldIdOrKey: string; -} diff --git a/src/version2/parameters/updateCustomFieldConfigurationParameters.ts b/src/version2/parameters/updateCustomFieldConfigurationParameters.ts new file mode 100644 index 0000000000..2529cbeb93 --- /dev/null +++ b/src/version2/parameters/updateCustomFieldConfigurationParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { ContextualConfigurationSchema } from './contextualConfiguration'; + +export const UpdateCustomFieldConfigurationParametersSchema = z.object({ + /** The ID or key of the custom field, for example `customfield_10000`. */ + fieldIdOrKey: z.string(), + /** The list of custom field configuration details. */ + configurations: z.array(ContextualConfigurationSchema), +}); + +export type UpdateCustomFieldConfigurationParameters = z.infer; diff --git a/src/version2/parameters/updateCustomFieldContext.ts b/src/version2/parameters/updateCustomFieldContext.ts deleted file mode 100644 index 016ca52b87..0000000000 --- a/src/version2/parameters/updateCustomFieldContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CustomFieldContextUpdateDetails } from '../models'; - -export interface UpdateCustomFieldContext extends CustomFieldContextUpdateDetails { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/updateCustomFieldContextParameters.ts b/src/version2/parameters/updateCustomFieldContextParameters.ts new file mode 100644 index 0000000000..df3188aa01 --- /dev/null +++ b/src/version2/parameters/updateCustomFieldContextParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const UpdateCustomFieldContextParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The ID of the context. */ + contextId: z.number().int(), + /** The description of the custom field context. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the custom field context. The name must be unique. The maximum length is 255 characters. */ + name: z.string().optional(), +}); + +export type UpdateCustomFieldContextParameters = z.infer; diff --git a/src/version2/parameters/updateCustomFieldOption.ts b/src/version2/parameters/updateCustomFieldOption.ts deleted file mode 100644 index b0879d5ba9..0000000000 --- a/src/version2/parameters/updateCustomFieldOption.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BulkCustomFieldOptionUpdateRequest } from '../models'; - -export interface UpdateCustomFieldOption extends BulkCustomFieldOptionUpdateRequest { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/updateCustomFieldOptionParameters.ts b/src/version2/parameters/updateCustomFieldOptionParameters.ts new file mode 100644 index 0000000000..9c1b37205e --- /dev/null +++ b/src/version2/parameters/updateCustomFieldOptionParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { CustomFieldOptionUpdateSchema } from './customFieldOptionUpdate'; + +export const UpdateCustomFieldOptionParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The ID of the context. */ + contextId: z.number().int(), + /** Details of the options to update. */ + options: z.array(CustomFieldOptionUpdateSchema).optional(), +}); + +export type UpdateCustomFieldOptionParameters = z.infer; diff --git a/src/version2/parameters/updateCustomFieldParameters.ts b/src/version2/parameters/updateCustomFieldParameters.ts new file mode 100644 index 0000000000..d1815f44cd --- /dev/null +++ b/src/version2/parameters/updateCustomFieldParameters.ts @@ -0,0 +1,55 @@ +import { z } from 'zod'; + +export const UpdateCustomFieldParametersSchema = z.object({ + /** The ID of the custom field. */ + fieldId: z.string(), + /** The description of the custom field. The maximum length is 40000 characters. */ + description: z.string().optional(), + /** The name of the custom field. It doesn't have to be unique. The maximum length is 255 characters. */ + name: z.string().optional(), + /** + * The searcher that defines the way the field is searched in Jira. It can be set to `null`, otherwise you must + * specify the valid searcher for the field type, as listed below (abbreviated values shown): + * + * - `cascadingselect`: `cascadingselectsearcher` + * - `datepicker`: `daterange` + * - `datetime`: `datetimerange` + * - `float`: `exactnumber` or `numberrange` + * - `grouppicker`: `grouppickersearcher` + * - `importid`: `exactnumber` or `numberrange` + * - `labels`: `labelsearcher` + * - `multicheckboxes`: `multiselectsearcher` + * - `multigrouppicker`: `multiselectsearcher` + * - `multiselect`: `multiselectsearcher` + * - `multiuserpicker`: `userpickergroupsearcher` + * - `multiversion`: `versionsearcher` + * - `project`: `projectsearcher` + * - `radiobuttons`: `multiselectsearcher` + * - `readonlyfield`: `textsearcher` + * - `select`: `multiselectsearcher` + * - `textarea`: `textsearcher` + * - `textfield`: `textsearcher` + * - `url`: `exacttextsearcher` + * - `userpicker`: `userpickergroupsearcher` + * - `version`: `versionsearcher` + */ + searcherKey: z + .enum([ + 'com.atlassian.jira.plugin.system.customfieldtypes:cascadingselectsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:daterange', + 'com.atlassian.jira.plugin.system.customfieldtypes:datetimerange', + 'com.atlassian.jira.plugin.system.customfieldtypes:exactnumber', + 'com.atlassian.jira.plugin.system.customfieldtypes:exacttextsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:numberrange', + 'com.atlassian.jira.plugin.system.customfieldtypes:projectsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:textsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:versionsearcher', + ]) + .optional(), +}); + +export type UpdateCustomFieldParameters = z.infer; diff --git a/src/version2/parameters/updateCustomFieldValue.ts b/src/version2/parameters/updateCustomFieldValue.ts deleted file mode 100644 index 8fa595e3f7..0000000000 --- a/src/version2/parameters/updateCustomFieldValue.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CustomFieldValueUpdateDetails } from '../models'; - -export interface UpdateCustomFieldValue extends CustomFieldValueUpdateDetails { - /** The ID or key of the custom field. For example, `customfield_10010`. */ - fieldIdOrKey: string; - /** Whether to generate a changelog for this update. */ - generateChangelog?: boolean; -} diff --git a/src/version2/parameters/updateCustomFieldValueParameters.ts b/src/version2/parameters/updateCustomFieldValueParameters.ts new file mode 100644 index 0000000000..a155394f79 --- /dev/null +++ b/src/version2/parameters/updateCustomFieldValueParameters.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { CustomFieldValueUpdateSchema } from './customFieldValueUpdate'; + +export const UpdateCustomFieldValueParametersSchema = z.object({ + /** The ID or key of the custom field. For example, `customfield_10010`. */ + fieldIdOrKey: z.string(), + /** Whether to generate a changelog for this update. */ + generateChangelog: z.boolean().optional(), + /** The list of custom field update details. */ + updates: z.array(CustomFieldValueUpdateSchema).optional(), +}); + +export type UpdateCustomFieldValueParameters = z.infer; diff --git a/src/version2/parameters/updateDashboard.ts b/src/version2/parameters/updateDashboard.ts deleted file mode 100644 index 1e6ecee291..0000000000 --- a/src/version2/parameters/updateDashboard.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { 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/updateDashboardParameters.ts b/src/version2/parameters/updateDashboardParameters.ts new file mode 100644 index 0000000000..7bca18bf6b --- /dev/null +++ b/src/version2/parameters/updateDashboardParameters.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { SharePermissionSchema } from './sharePermission'; + +export const UpdateDashboardParametersSchema = z.object({ + /** The ID of the dashboard to update. */ + id: z.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: z.boolean().optional(), + /** The description of the dashboard. */ + description: z.string().optional(), + /** The edit permissions for the dashboard. */ + editPermissions: z.array(SharePermissionSchema), + /** The name of the dashboard. */ + name: z.string(), + /** The share permissions for the dashboard. */ + sharePermissions: z.array(SharePermissionSchema), +}); + +export type UpdateDashboardParameters = z.infer; diff --git a/src/version2/parameters/updateDefaultProjectClassification.ts b/src/version2/parameters/updateDefaultProjectClassification.ts deleted file mode 100644 index bb29709a47..0000000000 --- a/src/version2/parameters/updateDefaultProjectClassification.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateDefaultProjectClassification as UpdateDefaultProjectClassificationModel } from '../models'; - -export interface UpdateDefaultProjectClassification extends UpdateDefaultProjectClassificationModel { - /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string; -} diff --git a/src/version2/parameters/updateDefaultProjectClassificationParameters.ts b/src/version2/parameters/updateDefaultProjectClassificationParameters.ts new file mode 100644 index 0000000000..e074291ede --- /dev/null +++ b/src/version2/parameters/updateDefaultProjectClassificationParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const UpdateDefaultProjectClassificationParametersSchema = z.object({ + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: z.string(), + /** The ID of the project classification. */ + id: z.string(), +}); + +export type UpdateDefaultProjectClassificationParameters = z.infer< + typeof UpdateDefaultProjectClassificationParametersSchema +>; diff --git a/src/version2/parameters/updateDefaultScreenScheme.ts b/src/version2/parameters/updateDefaultScreenScheme.ts deleted file mode 100644 index 4f7b3c2a20..0000000000 --- a/src/version2/parameters/updateDefaultScreenScheme.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface UpdateDefaultScreenScheme { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; - - /** The ID of the screen scheme. */ - screenSchemeId: string; -} diff --git a/src/version2/parameters/updateDefaultScreenSchemeParameters.ts b/src/version2/parameters/updateDefaultScreenSchemeParameters.ts new file mode 100644 index 0000000000..5b32aeedf3 --- /dev/null +++ b/src/version2/parameters/updateDefaultScreenSchemeParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const UpdateDefaultScreenSchemeParametersSchema = z.object({ + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: z.string(), + /** The ID of the screen scheme. */ + screenSchemeId: z.string(), +}); + +export type UpdateDefaultScreenSchemeParameters = z.infer; diff --git a/src/version2/parameters/updateDefaultWorkflow.ts b/src/version2/parameters/updateDefaultWorkflow.ts deleted file mode 100644 index 5560fb205c..0000000000 --- a/src/version2/parameters/updateDefaultWorkflow.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DefaultWorkflow } from '../models'; - -export interface UpdateDefaultWorkflow extends DefaultWorkflow { - /** The ID of the workflow scheme. */ - id: number; -} diff --git a/src/version2/parameters/updateDefaultWorkflowParameters.ts b/src/version2/parameters/updateDefaultWorkflowParameters.ts new file mode 100644 index 0000000000..e67abe2801 --- /dev/null +++ b/src/version2/parameters/updateDefaultWorkflowParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const UpdateDefaultWorkflowParametersSchema = z.object({ + /** The ID of the workflow scheme. */ + id: z.number().int(), + /** + * Whether a draft workflow scheme is created or updated when updating an active workflow scheme. The draft is updated + * with the new default workflow. Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), + /** The name of the workflow to set as the default workflow. */ + workflow: z.string(), +}); + +export type UpdateDefaultWorkflowParameters = z.infer; diff --git a/src/version2/parameters/updateDraftDefaultWorkflow.ts b/src/version2/parameters/updateDraftDefaultWorkflow.ts deleted file mode 100644 index b7bdce9f61..0000000000 --- a/src/version2/parameters/updateDraftDefaultWorkflow.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DefaultWorkflow } from '../models'; - -export interface UpdateDraftDefaultWorkflow extends DefaultWorkflow { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; -} diff --git a/src/version2/parameters/updateDraftDefaultWorkflowParameters.ts b/src/version2/parameters/updateDraftDefaultWorkflowParameters.ts new file mode 100644 index 0000000000..fa84ab409c --- /dev/null +++ b/src/version2/parameters/updateDraftDefaultWorkflowParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const UpdateDraftDefaultWorkflowParametersSchema = z.object({ + /** The ID of the workflow scheme that the draft belongs to. */ + id: z.number().int(), + /** + * Whether a draft workflow scheme is created or updated when updating an active workflow scheme. The draft is updated + * with the new default workflow. Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), + /** The name of the workflow to set as the default workflow. */ + workflow: z.string(), +}); + +export type UpdateDraftDefaultWorkflowParameters = z.infer; diff --git a/src/version2/parameters/updateDraftWorkflowMapping.ts b/src/version2/parameters/updateDraftWorkflowMapping.ts deleted file mode 100644 index 4b728dd255..0000000000 --- a/src/version2/parameters/updateDraftWorkflowMapping.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypesWorkflowMapping } from '../models'; - -export interface UpdateDraftWorkflowMapping extends IssueTypesWorkflowMapping { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The name of the workflow. */ - workflowName: string; -} diff --git a/src/version2/parameters/updateDraftWorkflowMappingParameters.ts b/src/version2/parameters/updateDraftWorkflowMappingParameters.ts new file mode 100644 index 0000000000..9203ff12a1 --- /dev/null +++ b/src/version2/parameters/updateDraftWorkflowMappingParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const UpdateDraftWorkflowMappingParametersSchema = z.object({ + /** The ID of the workflow scheme that the draft belongs to. */ + id: z.number().int(), + /** The name of the workflow. */ + workflowName: z.string(), + /** Whether the workflow is the default workflow for the workflow scheme. */ + defaultMapping: z.boolean().optional(), + /** The list of issue type IDs. */ + issueTypes: z.array(z.string()).optional(), + /** + * Whether a draft workflow scheme is created or updated when updating an active workflow scheme. The draft is updated + * with the new workflow-issue types mapping. Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), + /** The name of the workflow. Optional if updating the workflow-issue types mapping. */ + workflow: z.string().optional(), +}); + +export type UpdateDraftWorkflowMappingParameters = z.infer; diff --git a/src/version2/parameters/updateEntityPropertiesValue.ts b/src/version2/parameters/updateEntityPropertiesValue.ts deleted file mode 100644 index a33480f263..0000000000 --- a/src/version2/parameters/updateEntityPropertiesValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { EntityPropertyDetails } from '../models'; - -export interface UpdateEntityPropertiesValue { - /** The app migration transfer ID. */ - transferId: string; - /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ - accountId: string; - /** The type indicating the object that contains the entity properties. */ - entityType: - | 'IssueProperty' - | 'CommentProperty' - | 'DashboardItemProperty' - | 'IssueTypeProperty' - | 'ProjectProperty' - | 'UserProperty' - | 'WorklogProperty' - | 'BoardProperty' - | 'SprintProperty' - | string; - - entities?: Array; -} diff --git a/src/version2/parameters/updateEntityPropertiesValueParameters.ts b/src/version2/parameters/updateEntityPropertiesValueParameters.ts new file mode 100644 index 0000000000..25660dd9fb --- /dev/null +++ b/src/version2/parameters/updateEntityPropertiesValueParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const UpdateEntityPropertiesValueParametersSchema = z.object({ + /** The app migration transfer ID. */ + 'Atlassian-Transfer-Id': z.string(), + /** The type indicating the object that contains the entity properties. */ + entityType: z.enum([ + 'IssueProperty', + 'CommentProperty', + 'DashboardItemProperty', + 'IssueTypeProperty', + 'ProjectProperty', + 'UserProperty', + 'WorklogProperty', + 'BoardProperty', + 'SprintProperty', + ]), +}); + +export type UpdateEntityPropertiesValueParameters = z.infer; diff --git a/src/version2/parameters/updateFieldConfiguration.ts b/src/version2/parameters/updateFieldConfiguration.ts deleted file mode 100644 index 2c79c83fc6..0000000000 --- a/src/version2/parameters/updateFieldConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { FieldConfigurationDetails } from '../models'; - -export interface UpdateFieldConfiguration extends FieldConfigurationDetails { - /** The ID of the field configuration. */ - id: number; -} diff --git a/src/version2/parameters/updateFieldConfigurationItems.ts b/src/version2/parameters/updateFieldConfigurationItems.ts deleted file mode 100644 index c8d68c4fe0..0000000000 --- a/src/version2/parameters/updateFieldConfigurationItems.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { FieldConfigurationItemsDetails } from '../models'; - -export interface UpdateFieldConfigurationItems extends FieldConfigurationItemsDetails { - /** The ID of the field configuration. */ - id: number; -} diff --git a/src/version2/parameters/updateFieldConfigurationItemsParameters.ts b/src/version2/parameters/updateFieldConfigurationItemsParameters.ts new file mode 100644 index 0000000000..545e68242b --- /dev/null +++ b/src/version2/parameters/updateFieldConfigurationItemsParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { FieldConfigurationItemSchema } from './fieldConfigurationItem'; + +export const UpdateFieldConfigurationItemsParametersSchema = z.object({ + /** The ID of the field configuration. */ + id: z.number().int(), + /** Details of fields in a field configuration. */ + fieldConfigurationItems: z.array(FieldConfigurationItemSchema), +}); + +export type UpdateFieldConfigurationItemsParameters = z.infer; diff --git a/src/version2/parameters/updateFieldConfigurationParameters.ts b/src/version2/parameters/updateFieldConfigurationParameters.ts new file mode 100644 index 0000000000..fefa6f3bf5 --- /dev/null +++ b/src/version2/parameters/updateFieldConfigurationParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const UpdateFieldConfigurationParametersSchema = z.object({ + /** The ID of the field configuration. */ + id: z.number().int(), + /** The description of the field configuration. */ + description: z.string().optional(), + /** The name of the field configuration. Must be unique. */ + name: z.string(), +}); + +export type UpdateFieldConfigurationParameters = z.infer; diff --git a/src/version2/parameters/updateFieldConfigurationScheme.ts b/src/version2/parameters/updateFieldConfigurationScheme.ts deleted file mode 100644 index 37b4618d22..0000000000 --- a/src/version2/parameters/updateFieldConfigurationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateFieldConfigurationSchemeDetails } from '../models'; - -export interface UpdateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version2/parameters/updateFieldConfigurationSchemeParameters.ts b/src/version2/parameters/updateFieldConfigurationSchemeParameters.ts new file mode 100644 index 0000000000..cf85e60414 --- /dev/null +++ b/src/version2/parameters/updateFieldConfigurationSchemeParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const UpdateFieldConfigurationSchemeParametersSchema = z.object({ + /** The ID of the field configuration scheme. */ + id: z.number().int(), + /** The description of the field configuration scheme. */ + description: z.string().optional(), + /** The name of the field configuration scheme. The name must be unique. */ + name: z.string(), +}); + +export type UpdateFieldConfigurationSchemeParameters = z.infer; diff --git a/src/version2/parameters/updateFilter.ts b/src/version2/parameters/updateFilter.ts deleted file mode 100644 index ae113de70e..0000000000 --- a/src/version2/parameters/updateFilter.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Filter } from '../models'; - -export interface UpdateFilter extends Omit { - /** The ID of the filter to update. */ - id: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't - * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of - * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to - * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: string; - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version2/parameters/updateFilterParameters.ts b/src/version2/parameters/updateFilterParameters.ts new file mode 100644 index 0000000000..aef9551629 --- /dev/null +++ b/src/version2/parameters/updateFilterParameters.ts @@ -0,0 +1,76 @@ +import { z } from 'zod'; +import { SharePermissionSchema } from './sharePermission'; + +export const UpdateFilterParametersSchema = z.object({ + /** The ID of the filter to update. */ + id: z.number().int(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. + * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the + * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is + * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For + * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand: z.string().optional(), + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions: z.boolean().optional(), + /** + * [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: z.string().datetime().optional(), + /** A description of the filter. */ + description: z.string().optional(), + /** The groups and projects that can edit the filter. */ + editPermissions: z.array(SharePermissionSchema).optional(), + /** Whether the filter is selected as a favorite. */ + favourite: z.boolean().optional(), + /** The count of how many users have selected this filter as a favorite, including the filter owner. */ + favouritedCount: z.number().int().optional(), + /** The unique identifier for the filter. */ + id: z.string().optional(), + /** The JQL query for the filter. For example, _project = SSP AND issuetype = Bug_. */ + jql: z.string().optional(), + /** The name of the filter. Must be unique. */ + name: z.string(), + /** + * The user who owns the filter. This is defaulted to the creator of the filter, however Jira administrators can + * change the owner of a shared filter in the admin settings. + */ + owner: z.unknown().optional(), + /** + * A URL to view the filter results in Jira, using the [Search for issues using + * JQL](#api-rest-api-2-filter-search-get) operation with the filter's JQL string to return the filter results. For + * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. + */ + searchUrl: z.string().optional(), + /** The URL of the filter. */ + self: z.string().optional(), + /** The groups and projects that the filter is shared with. */ + sharePermissions: z.array(SharePermissionSchema).optional(), + /** + * A paginated list of the users that the filter is shared with. This includes users that are members of the groups or + * can browse the projects that the filter is shared with. + */ + sharedUsers: z.unknown().optional(), + /** A paginated list of the users that are subscribed to the filter. */ + subscriptions: z.unknown().optional(), + /** + * A URL to view the filter results in Jira, using the ID of the filter. For example, + * _https://your-domain.atlassian.net/issues/?filter=10100_. + */ + viewUrl: z.string().optional(), +}); + +export type UpdateFilterParameters = z.infer; diff --git a/src/version2/parameters/updateGadget.ts b/src/version2/parameters/updateGadget.ts deleted file mode 100644 index 521f428a7a..0000000000 --- a/src/version2/parameters/updateGadget.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { DashboardGadgetUpdateRequest } from '../models'; - -export interface UpdateGadget extends DashboardGadgetUpdateRequest { - /** The ID of the dashboard. */ - dashboardId: number; - /** The ID of the gadget. */ - gadgetId: number; -} diff --git a/src/version2/parameters/updateGadgetParameters.ts b/src/version2/parameters/updateGadgetParameters.ts new file mode 100644 index 0000000000..e62a745e73 --- /dev/null +++ b/src/version2/parameters/updateGadgetParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const UpdateGadgetParametersSchema = z.object({ + /** The ID of the dashboard. */ + dashboardId: z.number().int(), + /** The ID of the gadget. */ + gadgetId: z.number().int(), + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color: z.string().optional(), + /** The position of the gadget. */ + position: z.unknown().optional(), + /** The title of the gadget. */ + title: z.string().optional(), +}); + +export type UpdateGadgetParameters = z.infer; diff --git a/src/version2/parameters/updateIssueFieldOption.ts b/src/version2/parameters/updateIssueFieldOption.ts deleted file mode 100644 index a600deb7d9..0000000000 --- a/src/version2/parameters/updateIssueFieldOption.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { IssueFieldOption } from '../models'; - -export interface UpdateIssueFieldOption extends IssueFieldOption { - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; - /** The ID of the option to be updated. */ - optionId: number; -} diff --git a/src/version2/parameters/updateIssueFieldOptionParameters.ts b/src/version2/parameters/updateIssueFieldOptionParameters.ts new file mode 100644 index 0000000000..3055fe1c68 --- /dev/null +++ b/src/version2/parameters/updateIssueFieldOptionParameters.ts @@ -0,0 +1,32 @@ +import { z } from 'zod'; +import { IssueFieldOptionConfigurationSchema } from './issueFieldOptionConfiguration'; + +export const UpdateIssueFieldOptionParametersSchema = z.object({ + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * - Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. + * - Run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For example, + * `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: z.string(), + /** The ID of the option to be updated. */ + optionId: z.number().int(), + config: IssueFieldOptionConfigurationSchema.optional(), + /** The unique identifier for the option. This is only unique within the select field's set of options. */ + id: z.number().int(), + /** + * The properties of the object, as arbitrary key-value pairs. These properties can be searched using JQL, if the + * extractions (see [Issue Field Option Property + * Index](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/)) are defined + * in the descriptor for the issue field module. + */ + properties: z.object({}).optional(), + /** The option's name, which is displayed in Jira. */ + value: z.string(), +}); + +export type UpdateIssueFieldOptionParameters = z.infer; diff --git a/src/version2/parameters/updateIssueFields.ts b/src/version2/parameters/updateIssueFields.ts deleted file mode 100644 index 18b9aa6717..0000000000 --- a/src/version2/parameters/updateIssueFields.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ConnectCustomFieldValues } from '../models'; - -export interface UpdateIssueFields extends ConnectCustomFieldValues { - /** The ID of the transfer. */ - transferId: string; - /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ - accountId: string; -} diff --git a/src/version2/parameters/updateIssueFieldsParameters.ts b/src/version2/parameters/updateIssueFieldsParameters.ts new file mode 100644 index 0000000000..b9dfa6add6 --- /dev/null +++ b/src/version2/parameters/updateIssueFieldsParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { ConnectCustomFieldValueSchema } from './connectCustomFieldValue'; + +export const UpdateIssueFieldsParametersSchema = z.object({ + /** The ID of the transfer. */ + 'Atlassian-Transfer-Id': z.string(), + /** The list of custom field update details. */ + updateValueList: z.array(ConnectCustomFieldValueSchema).optional(), +}); + +export type UpdateIssueFieldsParameters = z.infer; diff --git a/src/version2/parameters/updateIssueLinkType.ts b/src/version2/parameters/updateIssueLinkType.ts deleted file mode 100644 index 76d3944958..0000000000 --- a/src/version2/parameters/updateIssueLinkType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueLinkType } from '../models'; - -export interface UpdateIssueLinkType extends IssueLinkType { - /** The ID of the issue link type. */ - issueLinkTypeId: string; -} diff --git a/src/version2/parameters/updateIssueLinkTypeParameters.ts b/src/version2/parameters/updateIssueLinkTypeParameters.ts new file mode 100644 index 0000000000..773a18e016 --- /dev/null +++ b/src/version2/parameters/updateIssueLinkTypeParameters.ts @@ -0,0 +1,43 @@ +import { z } from 'zod'; + +export const UpdateIssueLinkTypeParametersSchema = z.object({ + /** The ID of the issue link type. */ + issueLinkTypeId: z.string(), + /** + * The ID of the issue link type and is used as follows: + * + * - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it is the type of issue link. Required on create when + * `name` isn't provided. Otherwise, read only. + * - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is read only. + */ + id: z.string().optional(), + /** + * The description of the issue link type inward link and is used as follows: + * + * - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it is read only. + * - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is required on create and optional on + * update. Otherwise, read only. + */ + inward: z.string().optional(), + /** + * The name of the issue link type and is used as follows: + * + * - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it is the type of issue link. Required on create when + * `id` isn't provided. Otherwise, read only. + * - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is required on create and optional on + * update. Otherwise, read only. + */ + name: z.string().optional(), + /** + * The description of the issue link type outward link and is used as follows: + * + * - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it is read only. + * - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is required on create and optional on + * update. Otherwise, read only. + */ + outward: z.string().optional(), + /** The URL of the issue link type. Read only. */ + self: z.string().optional(), +}); + +export type UpdateIssueLinkTypeParameters = z.infer; diff --git a/src/version2/parameters/updateIssueSecurityScheme.ts b/src/version2/parameters/updateIssueSecurityScheme.ts deleted file mode 100644 index cc5099ec3f..0000000000 --- a/src/version2/parameters/updateIssueSecurityScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateIssueSecuritySchemeRequest } from '../models'; - -export interface UpdateIssueSecurityScheme extends UpdateIssueSecuritySchemeRequest { - /** The ID of the issue security scheme. */ - id: string; -} diff --git a/src/version2/parameters/updateIssueSecuritySchemeParameters.ts b/src/version2/parameters/updateIssueSecuritySchemeParameters.ts new file mode 100644 index 0000000000..366983670e --- /dev/null +++ b/src/version2/parameters/updateIssueSecuritySchemeParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const UpdateIssueSecuritySchemeParametersSchema = z.object({ + /** The ID of the issue security scheme. */ + id: z.string(), + /** The description of the security scheme scheme. */ + description: z.string().optional(), + /** The name of the security scheme scheme. Must be unique. */ + name: z.string().optional(), +}); + +export type UpdateIssueSecuritySchemeParameters = z.infer; diff --git a/src/version2/parameters/updateIssueType.ts b/src/version2/parameters/updateIssueType.ts deleted file mode 100644 index f7558cb563..0000000000 --- a/src/version2/parameters/updateIssueType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeUpdate } from '../models'; - -export interface UpdateIssueType extends IssueTypeUpdate { - /** The ID of the issue type. */ - id: string; -} diff --git a/src/version2/parameters/updateIssueTypeParameters.ts b/src/version2/parameters/updateIssueTypeParameters.ts new file mode 100644 index 0000000000..e2d7f76622 --- /dev/null +++ b/src/version2/parameters/updateIssueTypeParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const UpdateIssueTypeParametersSchema = z.object({ + /** The ID of the issue type. */ + id: z.string(), + /** + * The ID of an issue type avatar. This can be obtained be obtained from the following endpoints: + * + * - [System issue type avatar IDs + * only](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-avatars/#api-rest-api-3-avatar-type-system-get) + * - [System and custom issue type avatar + * IDs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-avatars/#api-rest-api-3-universal-avatar-type-type-owner-entityid-get) + */ + avatarId: z.number().int().optional(), + /** The description of the issue type. */ + description: z.string().optional(), + /** The unique name for the issue type. The maximum length is 60 characters. */ + name: z.string().optional(), +}); + +export type UpdateIssueTypeParameters = z.infer; diff --git a/src/version2/parameters/updateIssueTypeScheme.ts b/src/version2/parameters/updateIssueTypeScheme.ts deleted file mode 100644 index bdd60d23d2..0000000000 --- a/src/version2/parameters/updateIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeSchemeUpdateDetails } from '../models'; - -export interface UpdateIssueTypeScheme extends IssueTypeSchemeUpdateDetails { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version2/parameters/updateIssueTypeSchemeParameters.ts b/src/version2/parameters/updateIssueTypeSchemeParameters.ts new file mode 100644 index 0000000000..50db9bffb5 --- /dev/null +++ b/src/version2/parameters/updateIssueTypeSchemeParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const UpdateIssueTypeSchemeParametersSchema = z.object({ + /** The ID of the issue type scheme. */ + issueTypeSchemeId: z.number().int(), + /** The ID of the default issue type of the issue type scheme. */ + defaultIssueTypeId: z.string().optional(), + /** The description of the issue type scheme. The maximum length is 4000 characters. */ + description: z.string().optional(), + /** The name of the issue type scheme. The name must be unique. The maximum length is 255 characters. */ + name: z.string().optional(), +}); + +export type UpdateIssueTypeSchemeParameters = z.infer; diff --git a/src/version2/parameters/updateIssueTypeScreenScheme.ts b/src/version2/parameters/updateIssueTypeScreenScheme.ts deleted file mode 100644 index 88fa150d73..0000000000 --- a/src/version2/parameters/updateIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeScreenSchemeUpdateDetails } from '../models'; - -export interface UpdateIssueTypeScreenScheme extends IssueTypeScreenSchemeUpdateDetails { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version2/parameters/updateIssueTypeScreenSchemeParameters.ts b/src/version2/parameters/updateIssueTypeScreenSchemeParameters.ts new file mode 100644 index 0000000000..fc945af403 --- /dev/null +++ b/src/version2/parameters/updateIssueTypeScreenSchemeParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const UpdateIssueTypeScreenSchemeParametersSchema = z.object({ + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: z.string(), + /** The description of the issue type screen scheme. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: z.string().optional(), +}); + +export type UpdateIssueTypeScreenSchemeParameters = z.infer; diff --git a/src/version2/parameters/updateMultipleCustomFieldValues.ts b/src/version2/parameters/updateMultipleCustomFieldValues.ts deleted file mode 100644 index 5efc36f336..0000000000 --- a/src/version2/parameters/updateMultipleCustomFieldValues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { MultipleCustomFieldValuesUpdateDetails } from '../models'; - -export interface UpdateMultipleCustomFieldValues extends MultipleCustomFieldValuesUpdateDetails { - /** Whether to generate a changelog for this update. */ - generateChangelog?: boolean; -} diff --git a/src/version2/parameters/updateMultipleCustomFieldValuesParameters.ts b/src/version2/parameters/updateMultipleCustomFieldValuesParameters.ts new file mode 100644 index 0000000000..651b74c0b7 --- /dev/null +++ b/src/version2/parameters/updateMultipleCustomFieldValuesParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { MultipleCustomFieldValuesUpdateSchema } from './multipleCustomFieldValuesUpdate'; + +export const UpdateMultipleCustomFieldValuesParametersSchema = z.object({ + /** Whether to generate a changelog for this update. */ + generateChangelog: z.boolean().optional(), + updates: z.array(MultipleCustomFieldValuesUpdateSchema).optional(), +}); + +export type UpdateMultipleCustomFieldValuesParameters = z.infer; diff --git a/src/version2/parameters/updateNotificationScheme.ts b/src/version2/parameters/updateNotificationScheme.ts deleted file mode 100644 index 1e3fb513d2..0000000000 --- a/src/version2/parameters/updateNotificationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateNotificationSchemeDetails } from '../models'; - -export interface UpdateNotificationScheme extends UpdateNotificationSchemeDetails { - /** The ID of the notification scheme. */ - id: string; -} diff --git a/src/version2/parameters/updateNotificationSchemeParameters.ts b/src/version2/parameters/updateNotificationSchemeParameters.ts new file mode 100644 index 0000000000..67e6d95ff9 --- /dev/null +++ b/src/version2/parameters/updateNotificationSchemeParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const UpdateNotificationSchemeParametersSchema = z.object({ + /** The ID of the notification scheme. */ + id: z.string(), + /** The description of the notification scheme. */ + description: z.string().optional(), + /** The name of the notification scheme. Must be unique. */ + name: z.string().optional(), +}); + +export type UpdateNotificationSchemeParameters = z.infer; diff --git a/src/version2/parameters/updatePermissionScheme.ts b/src/version2/parameters/updatePermissionScheme.ts deleted file mode 100644 index 2f6712dbe9..0000000000 --- a/src/version2/parameters/updatePermissionScheme.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PermissionScheme } from '../models'; - -export interface UpdatePermissionScheme extends PermissionScheme { - /** The ID of the permission scheme to update. */ - schemeId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `all` Returns all expandable information. `field` Returns information about the custom field granted the - * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all - * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the - * permission. `user` Returns information about the user who is granted the permission. - */ - expand?: string; -} diff --git a/src/version2/parameters/updatePermissionSchemeParameters.ts b/src/version2/parameters/updatePermissionSchemeParameters.ts new file mode 100644 index 0000000000..2b55b146cc --- /dev/null +++ b/src/version2/parameters/updatePermissionSchemeParameters.ts @@ -0,0 +1,38 @@ +import { z } from 'zod'; +import { PermissionGrantSchema } from './permissionGrant'; + +export const UpdatePermissionSchemeParametersSchema = z.object({ + /** The ID of the permission scheme to update. */ + schemeId: z.number().int(), + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand: z.string().optional(), + /** A description for the permission scheme. */ + description: z.string().optional(), + /** The expand options available for the permission scheme. */ + expand: z.string().optional(), + /** The ID of the permission scheme. */ + id: z.number().int().optional(), + /** The name of the permission scheme. Must be unique. */ + name: z.string(), + /** + * The permission scheme to create or update. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. + */ + permissions: z.array(PermissionGrantSchema).optional(), + /** The scope of the permission scheme. */ + scope: z.unknown().optional(), + /** The URL of the permission scheme. */ + self: z.string().optional(), +}); + +export type UpdatePermissionSchemeParameters = z.infer; diff --git a/src/version2/parameters/updatePlan.ts b/src/version2/parameters/updatePlan.ts deleted file mode 100644 index 0f21fc0003..0000000000 --- a/src/version2/parameters/updatePlan.ts +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index 7e4b3b5820..0000000000 --- a/src/version2/parameters/updatePlanOnlyTeam.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/updatePlanOnlyTeamParameters.ts b/src/version2/parameters/updatePlanOnlyTeamParameters.ts new file mode 100644 index 0000000000..cce2bd6588 --- /dev/null +++ b/src/version2/parameters/updatePlanOnlyTeamParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const UpdatePlanOnlyTeamParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), + /** The ID of the plan-only team. */ + planOnlyTeamId: z.number().int(), + body: z.any(), +}); + +export type UpdatePlanOnlyTeamParameters = z.infer; diff --git a/src/version2/parameters/updatePlanParameters.ts b/src/version2/parameters/updatePlanParameters.ts new file mode 100644 index 0000000000..378f3bfa58 --- /dev/null +++ b/src/version2/parameters/updatePlanParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const UpdatePlanParametersSchema = z.object({ + /** The ID of the plan. */ + planId: z.number().int(), + /** Whether to accept group IDs instead of group names. Group names are deprecated. */ + useGroupId: z.boolean().optional(), + body: z.any(), +}); + +export type UpdatePlanParameters = z.infer; diff --git a/src/version2/parameters/updatePrecomputations.ts b/src/version2/parameters/updatePrecomputations.ts deleted file mode 100644 index a5c3159aff..0000000000 --- a/src/version2/parameters/updatePrecomputations.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { JqlFunctionPrecomputationUpdateRequest } from '../models'; - -export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest { - skipNotFoundPrecomputations?: boolean; -} diff --git a/src/version2/parameters/updatePrecomputationsParameters.ts b/src/version2/parameters/updatePrecomputationsParameters.ts new file mode 100644 index 0000000000..75a308e7b2 --- /dev/null +++ b/src/version2/parameters/updatePrecomputationsParameters.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { JqlFunctionPrecomputationUpdateBeanSchema } from './jqlFunctionPrecomputationUpdateBean'; + +export const UpdatePrecomputationsParametersSchema = z.object({ + skipNotFoundPrecomputations: z.boolean().optional(), + values: z.array(JqlFunctionPrecomputationUpdateBeanSchema).optional(), +}); + +export type UpdatePrecomputationsParameters = z.infer; diff --git a/src/version2/parameters/updatePriority.ts b/src/version2/parameters/updatePriority.ts deleted file mode 100644 index 042b36d1f5..0000000000 --- a/src/version2/parameters/updatePriority.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdatePriorityDetails } from '../models'; - -export interface UpdatePriority extends UpdatePriorityDetails { - /** The ID of the issue priority. */ - id: string; -} diff --git a/src/version2/parameters/updatePriorityScheme.ts b/src/version2/parameters/updatePriorityScheme.ts deleted file mode 100644 index 94d09549d3..0000000000 --- a/src/version2/parameters/updatePriorityScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdatePrioritySchemeRequest } from '../models'; - -export interface UpdatePriorityScheme extends UpdatePrioritySchemeRequest { - /** The ID of the priority scheme. */ - schemeId: number; -} diff --git a/src/version2/parameters/updatePrioritySchemeParameters.ts b/src/version2/parameters/updatePrioritySchemeParameters.ts new file mode 100644 index 0000000000..8e0e8e7f4b --- /dev/null +++ b/src/version2/parameters/updatePrioritySchemeParameters.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +export const UpdatePrioritySchemeParametersSchema = z.object({ + /** The ID of the priority scheme. */ + schemeId: z.number().int(), + /** The default priority of the scheme. */ + defaultPriorityId: z.number().int().optional(), + /** The description of the priority scheme. */ + description: z.string().optional(), + /** + * Instructions to migrate the priorities of issues. + * + * `in` mappings are used to migrate the priorities of issues to priorities used within the priority scheme. + * + * `out` mappings are used to migrate the priorities of issues to priorities not used within the priority scheme. + * + * - When **priorities** are **added** to the priority scheme, no mapping needs to be provided as the new priorities are + * not used by any issues. + * - When **priorities** are **removed** from the priority scheme, issues that are using those priorities must be + * migrated to new priorities used by the priority scheme. + * + * - An `in` mapping must be provided for each of these priorities. + * - When **projects** are **added** to the priority scheme, the priorities of issues in those projects might need to be + * migrated to new priorities used by the priority scheme. This can occur when the current scheme does not use all + * the priorities in the project(s)' priority scheme(s). + * + * - An `in` mapping must be provided for each of these priorities. + * - When **projects** are **removed** from the priority scheme, the priorities of issues in those projects might need + * to be migrated to new priorities within the **Default Priority Scheme** that are not used by the priority scheme. + * This can occur when the **Default Priority Scheme** does not use all the priorities within the current scheme. + * + * - An `out` mapping must be provided for each of these priorities. + * + * For more information on `in` and `out` mappings, see the child properties documentation for the `PriorityMapping` + * object below. + */ + mappings: z.unknown().optional(), + /** The name of the priority scheme. Must be unique. */ + name: z.string().optional(), + /** The priorities in the scheme. */ + priorities: z.unknown().optional(), + /** The projects in the scheme. */ + projects: z.unknown().optional(), +}); + +export type UpdatePrioritySchemeParameters = z.infer; diff --git a/src/version2/parameters/updateProject.ts b/src/version2/parameters/updateProject.ts deleted file mode 100644 index ea730c0193..0000000000 --- a/src/version2/parameters/updateProject.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { UpdateProjectDetails } from '../models'; - -export interface UpdateProject extends UpdateProjectDetails { - /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string | number; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes), which - * defines the application-specific feature set. If you don't specify the project template you have to specify the - * project type. - */ - projectTypeKey?: 'business' | 'service_desk' | 'software' | string; - /** - * A predefined configuration for a project. The type of the `projectTemplateKey` must match with the type of the - * `projectTypeKey`. - */ - projectTemplateKey?: - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-content-management' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-process-control' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-procurement' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-project-management' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking' - | 'com.atlassian.servicedesk:simplified-it-service-management' - | 'com.atlassian.servicedesk:simplified-general-service-desk' - | 'com.atlassian.servicedesk:simplified-internal-service-desk' - | 'com.atlassian.servicedesk:simplified-external-service-desk' - | 'com.atlassian.servicedesk:simplified-hr-service-desk' - | 'com.atlassian.servicedesk:simplified-facilities-service-desk' - | 'com.atlassian.servicedesk:simplified-legal-service-desk' - | 'com.pyxis.greenhopper.jira:gh-simplified-agility-kanban' - | 'com.pyxis.greenhopper.jira:gh-simplified-agility-scrum' - | 'com.pyxis.greenhopper.jira:gh-simplified-basic' - | 'com.pyxis.greenhopper.jira:gh-simplified-kanban-classic' - | 'com.pyxis.greenhopper.jira:gh-simplified-scrum-classic' - | string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Note that the project description, - * issue types, and project lead are included in all responses by default. Expand options include: - * - * - `description` The project description. - * - `issueTypes` The issue types associated with the project. - * - `lead` The project lead. - * - `projectKeys` All project keys associated with the project. - */ - expand?: - | 'description' - | 'issueTypes' - | 'lead' - | 'projectKeys' - | ('description' | 'issueTypes' | 'lead' | 'projectKeys')[] - | string - | string[]; -} diff --git a/src/version2/parameters/updateProjectAvatar.ts b/src/version2/parameters/updateProjectAvatar.ts deleted file mode 100644 index be051455f8..0000000000 --- a/src/version2/parameters/updateProjectAvatar.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Avatar } from '../models'; - -export interface UpdateProjectAvatar extends Avatar { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string | number; -} diff --git a/src/version2/parameters/updateProjectAvatarParameters.ts b/src/version2/parameters/updateProjectAvatarParameters.ts new file mode 100644 index 0000000000..22483c89a2 --- /dev/null +++ b/src/version2/parameters/updateProjectAvatarParameters.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; + +export const UpdateProjectAvatarParametersSchema = z.object({ + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: z.string(), + /** The file name of the avatar icon. Returned for system avatars. */ + fileName: z.string().optional(), + /** The ID of the avatar. */ + id: z.string(), + /** Whether the avatar can be deleted. */ + isDeletable: z.boolean().optional(), + /** Whether the avatar is used in Jira. For example, shown as a project's avatar. */ + isSelected: z.boolean().optional(), + /** Whether the avatar is a system avatar. */ + isSystemAvatar: z.boolean().optional(), + /** + * The owner of the avatar. For a system avatar the owner is null (and nothing is returned). For non-system avatars + * this is the appropriate identifier, such as the ID for a project or the account ID for a user. + */ + owner: z.string().optional(), + /** The list of avatar icon URLs. */ + urls: z.object({}).optional(), +}); + +export type UpdateProjectAvatarParameters = z.infer; diff --git a/src/version2/parameters/updateProjectCategory.ts b/src/version2/parameters/updateProjectCategory.ts deleted file mode 100644 index 55c31999cf..0000000000 --- a/src/version2/parameters/updateProjectCategory.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ProjectCategory } from '../models'; - -export interface UpdateProjectCategory extends Omit { - id: number; -} diff --git a/src/version2/parameters/updateProjectCategoryParameters.ts b/src/version2/parameters/updateProjectCategoryParameters.ts new file mode 100644 index 0000000000..5673079644 --- /dev/null +++ b/src/version2/parameters/updateProjectCategoryParameters.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const UpdateProjectCategoryParametersSchema = z.object({ + id: z.number().int(), + /** The description of the project category. */ + description: z.string().optional(), + /** The ID of the project category. */ + id: z.string().optional(), + /** The name of the project category. Required on create, optional on update. */ + name: z.string().optional(), + /** The URL of the project category. */ + self: z.string().optional(), +}); + +export type UpdateProjectCategoryParameters = z.infer; diff --git a/src/version2/parameters/updateProjectEmail.ts b/src/version2/parameters/updateProjectEmail.ts deleted file mode 100644 index f45028393b..0000000000 --- a/src/version2/parameters/updateProjectEmail.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ProjectEmailAddress } from '../models'; - -export interface UpdateProjectEmail extends ProjectEmailAddress { - /** The project ID. */ - projectId: string | number; -} diff --git a/src/version2/parameters/updateProjectEmailParameters.ts b/src/version2/parameters/updateProjectEmailParameters.ts new file mode 100644 index 0000000000..1dda0ba52c --- /dev/null +++ b/src/version2/parameters/updateProjectEmailParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const UpdateProjectEmailParametersSchema = z.object({ + /** The project ID. */ + projectId: z.number().int(), + /** The email address. */ + emailAddress: z.string().optional(), + /** When using a custom domain, the status of the email address. */ + emailAddressStatus: z.array(z.string()).optional(), +}); + +export type UpdateProjectEmailParameters = z.infer; diff --git a/src/version2/parameters/updateProjectParameters.ts b/src/version2/parameters/updateProjectParameters.ts new file mode 100644 index 0000000000..1ee7f2c7c5 --- /dev/null +++ b/src/version2/parameters/updateProjectParameters.ts @@ -0,0 +1,69 @@ +import { z } from 'zod'; + +export const UpdateProjectParametersSchema = z.object({ + /** The project ID or project key (case sensitive). */ + projectIdOrKey: z.string(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Note that the project description, + * issue types, and project lead are included in all responses by default. Expand options include: + * + * - `description` The project description. + * - `issueTypes` The issue types associated with the project. + * - `lead` The project lead. + * - `projectKeys` All project keys associated with the project. + */ + expand: z.string().optional(), + /** The default assignee when creating issues for this project. */ + assigneeType: z.enum(['PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** An integer value for the project's avatar. */ + avatarId: z.number().int().optional(), + /** + * 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.` + */ + categoryId: z.number().int().optional(), + /** A brief description of the project. */ + description: z.string().optional(), + /** + * 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 + * scheme IDs. + */ + issueSecurityScheme: z.number().int().optional(), + /** + * 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. + */ + key: z.string().optional(), + /** + * This parameter is deprecated because of privacy changes. Use `leadAccountId` instead. See the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. The user name of the project lead. Cannot be provided with `leadAccountId`. + */ + lead: z.string().optional(), + /** The account ID of the project lead. Cannot be provided with `lead`. */ + leadAccountId: z.string().optional(), + /** The name of the project. */ + name: z.string().optional(), + /** + * 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: z.number().int().optional(), + /** + * 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. + */ + permissionScheme: z.number().int().optional(), + /** + * 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: z.array(z.string()).optional(), + /** A link to information about this project, such as project documentation */ + url: z.string().optional(), +}); + +export type UpdateProjectParameters = z.infer; diff --git a/src/version2/parameters/updateRelatedWork.ts b/src/version2/parameters/updateRelatedWork.ts deleted file mode 100644 index fc67f8caad..0000000000 --- a/src/version2/parameters/updateRelatedWork.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { 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/updateRelatedWorkParameters.ts b/src/version2/parameters/updateRelatedWorkParameters.ts new file mode 100644 index 0000000000..ba7c048894 --- /dev/null +++ b/src/version2/parameters/updateRelatedWorkParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const UpdateRelatedWorkParametersSchema = z.object({ + /** The ID of the version to update the related work on. For the related work id, pass it to the input JSON. */ + id: z.string(), + /** The category of the related work */ + category: z.string(), + /** The ID of the issue associated with the related work (if there is one). Cannot be updated via the Rest API. */ + issueId: z.number().int().optional(), + /** + * 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: z.string().optional(), + /** The title of the related work */ + title: z.string().optional(), + /** The URL of the related work. Will be null for the native release note related work item, but is otherwise required. */ + url: z.string().optional(), +}); + +export type UpdateRelatedWorkParameters = z.infer; diff --git a/src/version2/parameters/updateRemoteIssueLink.ts b/src/version2/parameters/updateRemoteIssueLink.ts deleted file mode 100644 index d5161fef7e..0000000000 --- a/src/version2/parameters/updateRemoteIssueLink.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { RemoteIssueLinkRequest } from '../models'; - -export interface UpdateRemoteIssueLink extends RemoteIssueLinkRequest { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the remote issue link. */ - linkId: string; -} diff --git a/src/version2/parameters/updateRemoteIssueLinkParameters.ts b/src/version2/parameters/updateRemoteIssueLinkParameters.ts new file mode 100644 index 0000000000..88fcb97fbc --- /dev/null +++ b/src/version2/parameters/updateRemoteIssueLinkParameters.ts @@ -0,0 +1,29 @@ +import { z } from 'zod'; + +export const UpdateRemoteIssueLinkParametersSchema = z.object({ + /** The ID or key of the issue. */ + issueIdOrKey: z.string(), + /** The ID of the remote issue link. */ + linkId: z.string(), + /** Details of the remote application the linked item is in. For example, trello. */ + application: z.unknown().optional(), + /** + * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence + * would consist of the app ID and page ID, like this: `appId=456&pageId=123`. + * + * Setting this field enables the remote issue link details to be updated or deleted using remote system and item + * details as the record identifier, rather than using the record's Jira ID. + * + * The maximum length is 255 characters. + */ + globalId: z.string().optional(), + /** Details of the item linked to. */ + object: z.unknown(), + /** + * Description of the relationship between the issue and the linked item. If not set, the relationship description + * "links to" is used in Jira. + */ + relationship: z.string().optional(), +}); + +export type UpdateRemoteIssueLinkParameters = z.infer; diff --git a/src/version2/parameters/updateResolution.ts b/src/version2/parameters/updateResolution.ts deleted file mode 100644 index f0bab6e6c9..0000000000 --- a/src/version2/parameters/updateResolution.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateResolutionDetails } from '../models'; - -export interface UpdateResolution extends UpdateResolutionDetails { - /** The ID of the issue resolution. */ - id: string; -} diff --git a/src/version2/parameters/updateResolutionParameters.ts b/src/version2/parameters/updateResolutionParameters.ts new file mode 100644 index 0000000000..6c53424da5 --- /dev/null +++ b/src/version2/parameters/updateResolutionParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const UpdateResolutionParametersSchema = z.object({ + /** The ID of the issue resolution. */ + id: z.string(), + /** The description of the resolution. */ + description: z.string().optional(), + /** The name of the resolution. Must be unique. */ + name: z.string(), +}); + +export type UpdateResolutionParameters = z.infer; diff --git a/src/version2/parameters/updateSchemes.ts b/src/version2/parameters/updateSchemes.ts deleted file mode 100644 index 04b10f0434..0000000000 --- a/src/version2/parameters/updateSchemes.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowSchemeUpdateRequest } from '../models'; - -export interface UpdateSchemes extends WorkflowSchemeUpdateRequest {} diff --git a/src/version2/parameters/updateSchemesParameters.ts b/src/version2/parameters/updateSchemesParameters.ts new file mode 100644 index 0000000000..01145c6e94 --- /dev/null +++ b/src/version2/parameters/updateSchemesParameters.ts @@ -0,0 +1,37 @@ +import { z } from 'zod'; +import { MappingsByIssueTypeOverrideSchema } from './mappingsByIssueTypeOverride'; +import { MappingsByWorkflowSchema } from './mappingsByWorkflow'; +import { DocumentVersionSchema } from './documentVersion'; +import { WorkflowSchemeAssociationSchema } from './workflowSchemeAssociation'; + +export const UpdateSchemesParametersSchema = z.object({ + /** + * 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: z.string().optional(), + /** The new description for this workflow scheme. */ + description: z.string(), + /** The ID of this workflow scheme. */ + id: z.string(), + /** The new name for this workflow scheme. */ + name: z.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: z.array(MappingsByIssueTypeOverrideSchema).optional(), + /** + * 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: z.array(MappingsByWorkflowSchema).optional(), + version: DocumentVersionSchema, + /** Mappings from workflows to issue types. */ + workflowsForIssueTypes: z.array(WorkflowSchemeAssociationSchema).optional(), +}); + +export type UpdateSchemesParameters = z.infer; diff --git a/src/version2/parameters/updateScreen.ts b/src/version2/parameters/updateScreen.ts deleted file mode 100644 index e47946d21d..0000000000 --- a/src/version2/parameters/updateScreen.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateScreenDetails } from '../models'; - -export interface UpdateScreen extends UpdateScreenDetails { - /** The ID of the screen. */ - screenId: number; -} diff --git a/src/version2/parameters/updateScreenParameters.ts b/src/version2/parameters/updateScreenParameters.ts new file mode 100644 index 0000000000..6cac3b539b --- /dev/null +++ b/src/version2/parameters/updateScreenParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const UpdateScreenParametersSchema = z.object({ + /** The ID of the screen. */ + screenId: z.number().int(), + /** The description of the screen. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the screen. The name must be unique. The maximum length is 255 characters. */ + name: z.string().optional(), +}); + +export type UpdateScreenParameters = z.infer; diff --git a/src/version2/parameters/updateScreenScheme.ts b/src/version2/parameters/updateScreenScheme.ts deleted file mode 100644 index 04da3721f1..0000000000 --- a/src/version2/parameters/updateScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateScreenSchemeDetails } from '../models'; - -export interface UpdateScreenScheme extends UpdateScreenSchemeDetails { - /** The ID of the screen scheme. */ - screenSchemeId: string; -} diff --git a/src/version2/parameters/updateScreenSchemeParameters.ts b/src/version2/parameters/updateScreenSchemeParameters.ts new file mode 100644 index 0000000000..9bcc99b808 --- /dev/null +++ b/src/version2/parameters/updateScreenSchemeParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const UpdateScreenSchemeParametersSchema = z.object({ + /** The ID of the screen scheme. */ + screenSchemeId: z.string(), + /** The description of the screen scheme. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: z.string().optional(), + /** + * The IDs of the screens for the screen types of the screen scheme. Only screens used in classic projects are + * accepted. + */ + screens: z.unknown().optional(), +}); + +export type UpdateScreenSchemeParameters = z.infer; diff --git a/src/version2/parameters/updateSecurityLevel.ts b/src/version2/parameters/updateSecurityLevel.ts deleted file mode 100644 index eacb946cbe..0000000000 --- a/src/version2/parameters/updateSecurityLevel.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { UpdateIssueSecurityLevelDetails } from '../models'; - -export interface UpdateSecurityLevel extends UpdateIssueSecurityLevelDetails { - /** The ID of the issue security scheme level belongs to. */ - schemeId: string; - /** The ID of the issue security level to update. */ - levelId: string; -} diff --git a/src/version2/parameters/updateSecurityLevelParameters.ts b/src/version2/parameters/updateSecurityLevelParameters.ts new file mode 100644 index 0000000000..9c26619733 --- /dev/null +++ b/src/version2/parameters/updateSecurityLevelParameters.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const UpdateSecurityLevelParametersSchema = z.object({ + /** The ID of the issue security scheme level belongs to. */ + schemeId: z.string(), + /** The ID of the issue security level to update. */ + levelId: z.string(), + /** The description of the issue security scheme level. */ + description: z.string().optional(), + /** The name of the issue security scheme level. Must be unique. */ + name: z.string().optional(), +}); + +export type UpdateSecurityLevelParameters = z.infer; diff --git a/src/version2/parameters/updateStatuses.ts b/src/version2/parameters/updateStatuses.ts deleted file mode 100644 index 63aa5c317b..0000000000 --- a/src/version2/parameters/updateStatuses.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { StatusUpdateRequest } from '../models'; - -export interface UpdateStatuses extends StatusUpdateRequest {} diff --git a/src/version2/parameters/updateStatusesParameters.ts b/src/version2/parameters/updateStatusesParameters.ts new file mode 100644 index 0000000000..6f2c772f27 --- /dev/null +++ b/src/version2/parameters/updateStatusesParameters.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { StatusUpdateSchema } from './statusUpdate'; + +export const UpdateStatusesParametersSchema = z.object({ + /** The list of statuses that will be updated. */ + statuses: z.array(StatusUpdateSchema), +}); + +export type UpdateStatusesParameters = z.infer; diff --git a/src/version2/parameters/updateUiModification.ts b/src/version2/parameters/updateUiModification.ts deleted file mode 100644 index 95710e849c..0000000000 --- a/src/version2/parameters/updateUiModification.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateUiModificationDetails } from '../models'; - -export interface UpdateUiModification extends UpdateUiModificationDetails { - /** The ID of the UI modification. */ - uiModificationId: string; -} diff --git a/src/version2/parameters/updateUiModificationParameters.ts b/src/version2/parameters/updateUiModificationParameters.ts new file mode 100644 index 0000000000..773eca6a3a --- /dev/null +++ b/src/version2/parameters/updateUiModificationParameters.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; +import { UiModificationContextDetailsSchema } from './uiModificationContextDetails'; + +export const UpdateUiModificationParametersSchema = z.object({ + /** The ID of the UI modification. */ + uiModificationId: z.string(), + /** + * List of contexts of the UI modification. The maximum number of contexts is 1000. If provided, replaces all existing + * contexts. + */ + contexts: z.array(UiModificationContextDetailsSchema).optional(), + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data: z.string().optional(), + /** The description of the UI modification. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the UI modification. The maximum length is 255 characters. */ + name: z.string().optional(), +}); + +export type UpdateUiModificationParameters = z.infer; diff --git a/src/version2/parameters/updateVersion.ts b/src/version2/parameters/updateVersion.ts deleted file mode 100644 index 0b349bdfff..0000000000 --- a/src/version2/parameters/updateVersion.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Version } from '../models'; - -export interface UpdateVersion extends Version { - /** The ID of the version. */ - id: string; -} diff --git a/src/version2/parameters/updateVersionParameters.ts b/src/version2/parameters/updateVersionParameters.ts new file mode 100644 index 0000000000..5fc25ccdf7 --- /dev/null +++ b/src/version2/parameters/updateVersionParameters.ts @@ -0,0 +1,88 @@ +import { z } from 'zod'; +import { VersionApproverSchema } from './versionApprover'; +import { SimpleLinkSchema } from './simpleLink'; + +export const UpdateVersionParametersSchema = z.object({ + /** The ID of the version. */ + id: z.string(), + /** If the expand option `approvers` is used, returns a list containing the approvers for this version. */ + approvers: z.array(VersionApproverSchema).optional(), + /** Indicates that the version is archived. Optional when creating or updating a version. */ + archived: z.boolean().optional(), + /** The description of the version. Optional when creating or updating a version. The maximum size is 16,384 bytes. */ + description: z.string().optional(), + /** If the expand option `driver` is used, returns the Atlassian account ID of the driver. */ + driver: z.string().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about version in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `operations` Returns the list of operations available for this version. + * - `issuesstatus` Returns the count of issues in this version for each of the status categories _to do_, _in + * progress_, _done_, and _unmapped_. The _unmapped_ property contains a count of issues with a status other than + * _to do_, _in progress_, and _done_. + * - `driver` Returns the Atlassian account ID of the version driver. + * - `approvers` Returns a list containing approvers for this version. + * + * Optional for create and update. + */ + expand: z.string().optional(), + /** The ID of the version. */ + id: z.string().optional(), + /** + * If the expand option `issuesstatus` is used, returns the count of issues in this version for each of the status + * categories _to do_, _in progress_, _done_, and _unmapped_. The _unmapped_ property contains a count of issues with + * a status other than _to do_, _in progress_, and _done_. + */ + issuesStatusForFixVersion: z.unknown().optional(), + /** + * The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not + * applicable when creating a version. Optional when updating a version. + */ + moveUnfixedIssuesTo: z.string().optional(), + /** + * The unique name of the version. Required when creating a version. Optional when updating a version. The maximum + * length is 255 characters. + */ + name: z.string().optional(), + /** If the expand option `operations` is used, returns the list of operations available for this version. */ + operations: z.array(SimpleLinkSchema).optional(), + /** Indicates that the version is overdue. */ + overdue: z.boolean().optional(), + /** Deprecated. Use `projectId`. */ + project: z.string().optional(), + /** + * The ID of the project to which this version is attached. Required when creating a version. Not applicable when + * updating a version. + */ + projectId: z.number().int().optional(), + /** + * The release date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a + * version. + */ + releaseDate: z.string().datetime().optional(), + /** + * Indicates that the version is released. If the version is released a request to release again is ignored. Not + * applicable when creating a version. Optional when updating a version. + */ + released: z.boolean().optional(), + /** The URL of the version. */ + self: z.string().optional(), + /** + * The start date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a + * version. + */ + startDate: z.string().datetime().optional(), + /** + * The date on which work on this version is expected to finish, expressed in the instance's _Day/Month/Year Format_ + * date format. + */ + userReleaseDate: z.string().optional(), + /** + * The date on which work on this version is expected to start, expressed in the instance's _Day/Month/Year Format_ + * date format. + */ + userStartDate: z.string().optional(), +}); + +export type UpdateVersionParameters = z.infer; diff --git a/src/version2/parameters/updateWorkflowMapping.ts b/src/version2/parameters/updateWorkflowMapping.ts deleted file mode 100644 index f753ed5606..0000000000 --- a/src/version2/parameters/updateWorkflowMapping.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypesWorkflowMapping } from '../models'; - -export interface UpdateWorkflowMapping extends IssueTypesWorkflowMapping { - /** The ID of the workflow scheme. */ - id: number; - /** The name of the workflow. */ - workflowName: string; -} diff --git a/src/version2/parameters/updateWorkflowMappingParameters.ts b/src/version2/parameters/updateWorkflowMappingParameters.ts new file mode 100644 index 0000000000..de92bba7a2 --- /dev/null +++ b/src/version2/parameters/updateWorkflowMappingParameters.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const UpdateWorkflowMappingParametersSchema = z.object({ + /** The ID of the workflow scheme. */ + id: z.number().int(), + /** The name of the workflow. */ + workflowName: z.string(), + /** Whether the workflow is the default workflow for the workflow scheme. */ + defaultMapping: z.boolean().optional(), + /** The list of issue type IDs. */ + issueTypes: z.array(z.string()).optional(), + /** + * Whether a draft workflow scheme is created or updated when updating an active workflow scheme. The draft is updated + * with the new workflow-issue types mapping. Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), + /** The name of the workflow. Optional if updating the workflow-issue types mapping. */ + workflow: z.string().optional(), +}); + +export type UpdateWorkflowMappingParameters = z.infer; diff --git a/src/version2/parameters/updateWorkflowScheme.ts b/src/version2/parameters/updateWorkflowScheme.ts deleted file mode 100644 index 10efe7e102..0000000000 --- a/src/version2/parameters/updateWorkflowScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { WorkflowScheme } from '../models'; - -export interface UpdateWorkflowScheme extends WorkflowScheme { - /** - * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the - * URL as `schemeId`. For example, _schemeId=10301_. - */ - id: number; -} diff --git a/src/version2/parameters/updateWorkflowSchemeDraft.ts b/src/version2/parameters/updateWorkflowSchemeDraft.ts deleted file mode 100644 index 0dc74ec262..0000000000 --- a/src/version2/parameters/updateWorkflowSchemeDraft.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { WorkflowScheme } from '../models'; - -export interface UpdateWorkflowSchemeDraft extends WorkflowScheme { - /** The ID of the active workflow scheme that the draft was created from. */ - id: number; -} diff --git a/src/version2/parameters/updateWorkflowSchemeDraftParameters.ts b/src/version2/parameters/updateWorkflowSchemeDraftParameters.ts new file mode 100644 index 0000000000..44141e5066 --- /dev/null +++ b/src/version2/parameters/updateWorkflowSchemeDraftParameters.ts @@ -0,0 +1,69 @@ +import { z } from 'zod'; + +export const UpdateWorkflowSchemeDraftParametersSchema = z.object({ + /** The ID of the active workflow scheme that the draft was created from. */ + id: z.number().int(), + /** + * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ + * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira + * Workflow (jira)_. + */ + defaultWorkflow: z.string().optional(), + /** The description of the workflow scheme. */ + description: z.string().optional(), + /** Whether the workflow scheme is a draft or not. */ + draft: z.boolean().optional(), + /** The ID of the workflow scheme. */ + id: z.number().int().optional(), + /** + * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an + * issue type can only be mapped to one workflow in a workflow scheme. + */ + issueTypeMappings: z.object({}).optional(), + /** The issue types available in Jira. */ + issueTypes: z.object({}).optional(), + /** + * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue + * type-project mappings only. This property does not apply to non-draft workflows. + */ + lastModified: z.string().optional(), + /** + * The user that last modified the draft workflow scheme. A modification is a change to the issue type-project + * mappings only. This property does not apply to non-draft workflows. + */ + lastModifiedUser: z.unknown().optional(), + /** + * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when + * creating a workflow scheme. + */ + name: z.string().optional(), + /** + * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The + * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. + */ + originalDefaultWorkflow: z.string().optional(), + /** + * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, + * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one + * workflow in a workflow scheme. + */ + originalIssueTypeMappings: z.object({}).optional(), + self: z.string().optional(), + /** + * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow + * scheme is a workflow scheme that is used by at least one project. The following examples show how this property + * works: + * + * - Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is + * updated. Otherwise, a draft workflow scheme is created. + * - Update an active workflow scheme with `updateDraftIfNeeded` set to `false`: An error is returned, as active + * workflow schemes cannot be updated. + * - Update an inactive workflow scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as + * inactive workflow schemes do not require drafts to update. + * + * Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), +}); + +export type UpdateWorkflowSchemeDraftParameters = z.infer; diff --git a/src/version2/parameters/updateWorkflowSchemeMappings.ts b/src/version2/parameters/updateWorkflowSchemeMappings.ts deleted file mode 100644 index 559c688f38..0000000000 --- a/src/version2/parameters/updateWorkflowSchemeMappings.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowSchemeUpdateRequiredMappingsRequest } from '../models'; - -export interface UpdateWorkflowSchemeMappings extends WorkflowSchemeUpdateRequiredMappingsRequest {} diff --git a/src/version2/parameters/updateWorkflowSchemeMappingsParameters.ts b/src/version2/parameters/updateWorkflowSchemeMappingsParameters.ts new file mode 100644 index 0000000000..30402f4015 --- /dev/null +++ b/src/version2/parameters/updateWorkflowSchemeMappingsParameters.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { WorkflowSchemeAssociationSchema } from './workflowSchemeAssociation'; + +export const UpdateWorkflowSchemeMappingsParametersSchema = z.object({ + /** + * 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: z.string().optional(), + /** The ID of the workflow scheme. */ + id: z.string(), + /** The new workflow to issue type mappings for this workflow scheme. */ + workflowsForIssueTypes: z.array(WorkflowSchemeAssociationSchema), +}); + +export type UpdateWorkflowSchemeMappingsParameters = z.infer; diff --git a/src/version2/parameters/updateWorkflowSchemeParameters.ts b/src/version2/parameters/updateWorkflowSchemeParameters.ts new file mode 100644 index 0000000000..e76989cbc9 --- /dev/null +++ b/src/version2/parameters/updateWorkflowSchemeParameters.ts @@ -0,0 +1,72 @@ +import { z } from 'zod'; + +export const UpdateWorkflowSchemeParametersSchema = z.object({ + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the + * URL as `schemeId`. For example, _schemeId=10301_. + */ + id: z.number().int(), + /** + * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ + * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira + * Workflow (jira)_. + */ + defaultWorkflow: z.string().optional(), + /** The description of the workflow scheme. */ + description: z.string().optional(), + /** Whether the workflow scheme is a draft or not. */ + draft: z.boolean().optional(), + /** The ID of the workflow scheme. */ + id: z.number().int().optional(), + /** + * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an + * issue type can only be mapped to one workflow in a workflow scheme. + */ + issueTypeMappings: z.object({}).optional(), + /** The issue types available in Jira. */ + issueTypes: z.object({}).optional(), + /** + * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue + * type-project mappings only. This property does not apply to non-draft workflows. + */ + lastModified: z.string().optional(), + /** + * The user that last modified the draft workflow scheme. A modification is a change to the issue type-project + * mappings only. This property does not apply to non-draft workflows. + */ + lastModifiedUser: z.unknown().optional(), + /** + * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when + * creating a workflow scheme. + */ + name: z.string().optional(), + /** + * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The + * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. + */ + originalDefaultWorkflow: z.string().optional(), + /** + * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, + * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one + * workflow in a workflow scheme. + */ + originalIssueTypeMappings: z.object({}).optional(), + self: z.string().optional(), + /** + * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow + * scheme is a workflow scheme that is used by at least one project. The following examples show how this property + * works: + * + * - Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is + * updated. Otherwise, a draft workflow scheme is created. + * - Update an active workflow scheme with `updateDraftIfNeeded` set to `false`: An error is returned, as active + * workflow schemes cannot be updated. + * - Update an inactive workflow scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as + * inactive workflow schemes do not require drafts to update. + * + * Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), +}); + +export type UpdateWorkflowSchemeParameters = z.infer; diff --git a/src/version2/parameters/updateWorkflowTransitionProperty.ts b/src/version2/parameters/updateWorkflowTransitionProperty.ts deleted file mode 100644 index 4bd0ca6210..0000000000 --- a/src/version2/parameters/updateWorkflowTransitionProperty.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { WorkflowTransitionProperty } from '../models'; - -export interface UpdateWorkflowTransitionProperty extends WorkflowTransitionProperty { - /** - * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown - * next to the transition. - */ - transitionId: number; - /** - * The key of the property being updated, also known as the name of the property. Set this to the same value as the - * `key` defined in the request body. - */ - key: string; - /** The name of the workflow that the transition belongs to. */ - workflowName: string; - /** - * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot - * be edited. - */ - workflowMode?: 'live' | 'draft' | string; -} diff --git a/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.ts b/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.ts deleted file mode 100644 index 3e39d344d5..0000000000 --- a/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowTransitionRulesUpdate } from '../models'; - -export interface UpdateWorkflowTransitionRuleConfigurations extends WorkflowTransitionRulesUpdate {} diff --git a/src/version2/parameters/updateWorkflowTransitionRuleConfigurationsParameters.ts b/src/version2/parameters/updateWorkflowTransitionRuleConfigurationsParameters.ts new file mode 100644 index 0000000000..6efe3bde73 --- /dev/null +++ b/src/version2/parameters/updateWorkflowTransitionRuleConfigurationsParameters.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { WorkflowTransitionRulesSchema } from './workflowTransitionRules'; + +export const UpdateWorkflowTransitionRuleConfigurationsParametersSchema = z.object({ + /** The list of workflows with transition rules to update. */ + workflows: z.array(WorkflowTransitionRulesSchema), +}); + +export type UpdateWorkflowTransitionRuleConfigurationsParameters = z.infer< + typeof UpdateWorkflowTransitionRuleConfigurationsParametersSchema +>; diff --git a/src/version2/parameters/updateWorkflows.ts b/src/version2/parameters/updateWorkflows.ts deleted file mode 100644 index 065ad897da..0000000000 --- a/src/version2/parameters/updateWorkflows.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { WorkflowUpdateRequest } from '../models'; - -export interface UpdateWorkflows extends WorkflowUpdateRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `workflows.usages` Returns the project and issue types that each workflow is associated with. `statuses.usages` - * Returns the project and issue types that each status is associated with. - */ - expand?: string; -} diff --git a/src/version2/parameters/updateWorkflowsParameters.ts b/src/version2/parameters/updateWorkflowsParameters.ts new file mode 100644 index 0000000000..0db6194b0d --- /dev/null +++ b/src/version2/parameters/updateWorkflowsParameters.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { WorkflowStatusUpdateSchema } from './workflowStatusUpdate'; +import { WorkflowUpdateSchema } from './workflowUpdate'; + +export const UpdateWorkflowsParametersSchema = z.object({ + /** The statuses to associate with the workflows. */ + statuses: z.array(WorkflowStatusUpdateSchema).optional(), + /** The details of the workflows to update. */ + workflows: z.array(WorkflowUpdateSchema).optional(), +}); + +export type UpdateWorkflowsParameters = z.infer; diff --git a/src/version2/parameters/updateWorklog.ts b/src/version2/parameters/updateWorklog.ts deleted file mode 100644 index bae45ca522..0000000000 --- a/src/version2/parameters/updateWorklog.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { Worklog } from '../models'; - -export interface UpdateWorklog extends Worklog { - /** The ID or key the issue. */ - issueIdOrKey: string; - /** The ID of the worklog. */ - id: string; - /** Whether users watching the issue are notified by email. */ - notifyUsers?: boolean; - /** - * Defines how to update the issue's time estimate, the options are: - * - * - `new` Sets the estimate to a specific value, defined in `newEstimate`. - * - `leave` Leaves the estimate unchanged. - * - `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or - * `timeSpentSeconds`. - */ - adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; - /** - * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For - * example, _2d_. Required when `adjustEstimate` is `new`. - */ - newEstimate?: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. - */ - expand?: string; - /** - * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue - * is closed. Connect and Forge app users with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version2/parameters/updateWorklogParameters.ts b/src/version2/parameters/updateWorklogParameters.ts new file mode 100644 index 0000000000..fcbc991901 --- /dev/null +++ b/src/version2/parameters/updateWorklogParameters.ts @@ -0,0 +1,74 @@ +import { z } from 'zod'; +import { EntityPropertySchema } from './entityProperty'; + +export const UpdateWorklogParametersSchema = z.object({ + /** The ID or key the issue. */ + issueIdOrKey: z.string(), + /** The ID of the worklog. */ + id: z.string(), + /** Whether users watching the issue are notified by email. */ + notifyUsers: z.boolean().optional(), + /** + * Defines how to update the issue's time estimate, the options are: + * + * - `new` Sets the estimate to a specific value, defined in `newEstimate`. + * - `leave` Leaves the estimate unchanged. + * - `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or + * `timeSpentSeconds`. + */ + adjustEstimate: z.enum(['new', 'leave', 'manual', 'auto']).optional(), + /** + * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For + * example, _2d_. Required when `adjustEstimate` is `new`. + */ + newEstimate: z.string().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. + */ + expand: z.string().optional(), + /** + * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue + * is closed. Connect and Forge app users with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag: z.boolean().optional(), + /** Details of the user who created the worklog. */ + author: z.unknown().optional(), + /** A comment about the worklog. Optional when creating or updating a worklog. */ + comment: z.string().optional(), + /** The datetime on which the worklog was created. */ + created: z.string().datetime().optional(), + /** The ID of the worklog record. */ + id: z.string().optional(), + /** The ID of the issue this worklog is for. */ + issueId: z.string().optional(), + /** Details of properties for the worklog. Optional when creating or updating a worklog. */ + properties: z.array(EntityPropertySchema).optional(), + /** The URL of the worklog item. */ + self: z.string().optional(), + /** + * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a + * worklog. + */ + started: z.string().datetime().optional(), + /** + * The time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a + * worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if + * `timeSpentSecond` is provided. + */ + timeSpent: z.string().optional(), + /** + * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. + * Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. + */ + timeSpentSeconds: z.number().int().optional(), + /** Details of the user who last updated the worklog. */ + updateAuthor: z.unknown().optional(), + /** The datetime on which the worklog was last updated. */ + updated: z.string().datetime().optional(), + /** Details about any restrictions in the visibility of the worklog. Optional when creating or updating a worklog. */ + visibility: z.unknown().optional(), +}); + +export type UpdateWorklogParameters = z.infer; diff --git a/src/version2/parameters/validateCreateWorkflows.ts b/src/version2/parameters/validateCreateWorkflows.ts deleted file mode 100644 index 2e6062c54e..0000000000 --- a/src/version2/parameters/validateCreateWorkflows.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ValidationOptionsForCreate, WorkflowCreateRequest } from '../models'; - -export interface ValidateCreateWorkflows { - payload: WorkflowCreateRequest; - validationOptions?: ValidationOptionsForCreate; -} diff --git a/src/version2/parameters/validateCreateWorkflowsParameters.ts b/src/version2/parameters/validateCreateWorkflowsParameters.ts new file mode 100644 index 0000000000..d98a9f3bed --- /dev/null +++ b/src/version2/parameters/validateCreateWorkflowsParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { WorkflowCreateRequestSchema } from './workflowCreateRequest'; +import { ValidationOptionsForCreateSchema } from './validationOptionsForCreate'; + +export const ValidateCreateWorkflowsParametersSchema = z.object({ + payload: WorkflowCreateRequestSchema, + validationOptions: ValidationOptionsForCreateSchema.optional(), +}); + +export type ValidateCreateWorkflowsParameters = z.infer; diff --git a/src/version2/parameters/validateProjectKey.ts b/src/version2/parameters/validateProjectKey.ts deleted file mode 100644 index 09598fbd1a..0000000000 --- a/src/version2/parameters/validateProjectKey.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface ValidateProjectKey { - /** The project key. */ - key?: string; -} diff --git a/src/version2/parameters/validateProjectKeyParameters.ts b/src/version2/parameters/validateProjectKeyParameters.ts new file mode 100644 index 0000000000..aef2fa2bab --- /dev/null +++ b/src/version2/parameters/validateProjectKeyParameters.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const ValidateProjectKeyParametersSchema = z.object({ + /** The project key. */ + key: z.string().optional(), +}); + +export type ValidateProjectKeyParameters = z.infer; diff --git a/src/version2/parameters/validateUpdateWorkflows.ts b/src/version2/parameters/validateUpdateWorkflows.ts deleted file mode 100644 index 5a578ea028..0000000000 --- a/src/version2/parameters/validateUpdateWorkflows.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ValidationOptionsForUpdate, WorkflowUpdateRequest } from '../models'; - -export interface ValidateUpdateWorkflows { - payload: WorkflowUpdateRequest; - validationOptions?: ValidationOptionsForUpdate; -} diff --git a/src/version2/parameters/validateUpdateWorkflowsParameters.ts b/src/version2/parameters/validateUpdateWorkflowsParameters.ts new file mode 100644 index 0000000000..ab19af075b --- /dev/null +++ b/src/version2/parameters/validateUpdateWorkflowsParameters.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { WorkflowUpdateRequestSchema } from './workflowUpdateRequest'; +import { ValidationOptionsForUpdateSchema } from './validationOptionsForUpdate'; + +export const ValidateUpdateWorkflowsParametersSchema = z.object({ + payload: WorkflowUpdateRequestSchema, + validationOptions: ValidationOptionsForUpdateSchema.optional(), +}); + +export type ValidateUpdateWorkflowsParameters = z.infer; diff --git a/src/version2/parameters/workflowCapabilities.ts b/src/version2/parameters/workflowCapabilities.ts deleted file mode 100644 index 57c9c17d0a..0000000000 --- a/src/version2/parameters/workflowCapabilities.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface WorkflowCapabilities { - workflowId?: string; - projectId?: string; - issueTypeId?: string; -} diff --git a/src/version2/parameters/workflowCapabilitiesParameters.ts b/src/version2/parameters/workflowCapabilitiesParameters.ts new file mode 100644 index 0000000000..62d3a49c4c --- /dev/null +++ b/src/version2/parameters/workflowCapabilitiesParameters.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export const WorkflowCapabilitiesParametersSchema = z.object({ + workflowId: z.string().optional(), + projectId: z.string().optional(), + issueTypeId: z.string().optional(), +}); + +export type WorkflowCapabilitiesParameters = z.infer; diff --git a/src/version2/parameters/workflowRuleSearch.ts b/src/version2/parameters/workflowRuleSearch.ts deleted file mode 100644 index 7380aa31d0..0000000000 --- a/src/version2/parameters/workflowRuleSearch.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { WorkflowRulesSearch } from '../models'; - -export interface WorkflowRuleSearch extends WorkflowRulesSearch { - /** The app migration transfer ID. */ - transferId: string; -} diff --git a/src/version2/parameters/workflowRuleSearchParameters.ts b/src/version2/parameters/workflowRuleSearchParameters.ts new file mode 100644 index 0000000000..34c126d7a9 --- /dev/null +++ b/src/version2/parameters/workflowRuleSearchParameters.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const WorkflowRuleSearchParametersSchema = z.object({ + /** The app migration transfer ID. */ + 'Atlassian-Transfer-Id': z.string(), + /** + * Use expand to include additional information in the response. This parameter accepts `transition` which, for each + * rule, returns information about the transition the rule is assigned to. + */ + expand: z.string().optional(), + /** The list of workflow rule IDs. */ + ruleIds: z.array(z.string()), + /** The workflow ID. */ + workflowEntityId: z.string(), +}); + +export type WorkflowRuleSearchParameters = z.infer; diff --git a/src/version2/permissionSchemes.ts b/src/version2/permissionSchemes.ts index ce0890680e..ae4d0b72b1 100644 --- a/src/version2/permissionSchemes.ts +++ b/src/version2/permissionSchemes.ts @@ -1,447 +1,249 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAllPermissionSchemesParameters } from './parameters/getAllPermissionSchemesParameters'; +import type { CreatePermissionSchemeParameters } from './parameters/createPermissionSchemeParameters'; +import type { DeletePermissionSchemeParameters } from './parameters/deletePermissionSchemeParameters'; +import type { GetPermissionSchemeParameters } from './parameters/getPermissionSchemeParameters'; +import type { UpdatePermissionSchemeParameters } from './parameters/updatePermissionSchemeParameters'; +import type { GetPermissionSchemeGrantsParameters } from './parameters/getPermissionSchemeGrantsParameters'; +import type { CreatePermissionGrantParameters } from './parameters/createPermissionGrantParameters'; +import type { DeletePermissionSchemeEntityParameters } from './parameters/deletePermissionSchemeEntityParameters'; +import type { GetPermissionSchemeGrantParameters } from './parameters/getPermissionSchemeGrantParameters'; export class PermissionSchemes { constructor(private client: Client) {} - /** - * Returns all permission schemes. - * - * ### About permission schemes and grants - * - * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a - * `permission`. - * - * #### Holder object - * - * The `holder` object contains information about the user or group being granted the permission. For example, the - * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the - * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and - * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. - * - * The `holder` object is defined by the following properties: - * - * - `type` Identifies the user or group (see the list of types below). - * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the - * `type`. For example, if the `type` is a group, then you need to specify the group name. - * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the - * group ID. For other `type` it has the same value as `parameter` - * - * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some - * types may not have a `parameter` or `value`): - * - * - `anyone` Grant for anonymous users. - * - `applicationRole` Grant for users with access to the specified application (application name, application name). - * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. - * - `assignee` Grant for the user currently assigned to an issue. - * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). - * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field - * ID, `value` : custom field ID). - * - `projectLead` Grant for a project lead. - * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). - * - `reporter` Grant for the user who reported the issue. - * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not - * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more - * information. - * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is - * deprecated and the account ID should be used, `value` : user ID). - * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : - * custom field ID). - * - * #### Built-in permissions - * - * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define - * custom permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information. - * - * **Administration permissions** - * - * - `ADMINISTER_PROJECTS` - * - `EDIT_WORKFLOW` - * - `EDIT_ISSUE_LAYOUT` - * - * **Project permissions** - * - * - `BROWSE_PROJECTS` - * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) - * - `SERVICEDESK_AGENT` (Jira Service Desk only) - * - `VIEW_DEV_TOOLS` (Jira Software only) - * - `VIEW_READONLY_WORKFLOW` - * - * **Issue permissions** - * - * - `ASSIGNABLE_USER` - * - `ASSIGN_ISSUES` - * - `CLOSE_ISSUES` - * - `CREATE_ISSUES` - * - `DELETE_ISSUES` - * - `EDIT_ISSUES` - * - `LINK_ISSUES` - * - `MODIFY_REPORTER` - * - `MOVE_ISSUES` - * - `RESOLVE_ISSUES` - * - `SCHEDULE_ISSUES` - * - `SET_ISSUE_SECURITY` - * - `TRANSITION_ISSUES` - * - * **Voters and watchers permissions** - * - * - `MANAGE_WATCHERS` - * - `VIEW_VOTERS_AND_WATCHERS` - * - * **Comments permissions** - * - * - `ADD_COMMENTS` - * - `DELETE_ALL_COMMENTS` - * - `DELETE_OWN_COMMENTS` - * - `EDIT_ALL_COMMENTS` - * - `EDIT_OWN_COMMENTS` - * - * **Attachments permissions** - * - * - `CREATE_ATTACHMENTS` - * - `DELETE_ALL_ATTACHMENTS` - * - `DELETE_OWN_ATTACHMENTS` - * - * **Time tracking permissions** - * - * - `DELETE_ALL_WORKLOGS` - * - `DELETE_OWN_WORKLOGS` - * - `EDIT_ALL_WORKLOGS` - * - `EDIT_OWN_WORKLOGS` - * - `WORK_ON_ISSUES` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * Returns all permission schemes. * + * + * - ### About permission schemes and grants + * - + * - A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a + * `permission`. + * - + * - #### Holder object + * - + * - The `holder` object contains information about the user or group being granted the permission. For example, the + * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the + * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` + * and the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. + * - + * - The `holder` object is defined by the following properties: + * - + * - - `type` Identifies the user or group (see the list of types below). + * - - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the + * `type`. For example, if the `type` is a group, then you need to specify the group name. + * - - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the + * group ID. For other `type` it has the same value as `parameter` + * - + * - The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some + * types may not have a `parameter` or `value`): + * - + * - - `anyone` Grant for anonymous users. + * - - `applicationRole` Grant for users with access to the specified application (application name, application name). + * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. + * - - `assignee` Grant for the user currently assigned to an issue. + * - - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). + * - - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field + * ID, `value` : custom field ID). + * - - `projectLead` Grant for a project lead. + * - - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). + * - - `reporter` Grant for the user who reported the issue. + * - - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not + * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more + * information. + * - - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is + * deprecated and the account ID should be used, `value` : user ID). + * - - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : + * custom field ID). + * - + * - #### Built-in permissions + * - + * - The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define + * custom permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information. + * - + * - **Administration permissions** + * - + * - - `ADMINISTER_PROJECTS` + * - - `EDIT_WORKFLOW` + * - - `EDIT_ISSUE_LAYOUT` + * - + * - **Project permissions** + * - + * - - `BROWSE_PROJECTS` + * - - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) + * - - `SERVICEDESK_AGENT` (Jira Service Desk only) + * - - `VIEW_DEV_TOOLS` (Jira Software only) + * - - `VIEW_READONLY_WORKFLOW` + * - + * - **Issue permissions** + * - + * - - `ASSIGNABLE_USER` + * - - `ASSIGN_ISSUES` + * - - `CLOSE_ISSUES` + * - - `CREATE_ISSUES` + * - - `DELETE_ISSUES` + * - - `EDIT_ISSUES` + * - - `LINK_ISSUES` + * - - `MODIFY_REPORTER` + * - - `MOVE_ISSUES` + * - - `RESOLVE_ISSUES` + * - - `SCHEDULE_ISSUES` + * - - `SET_ISSUE_SECURITY` + * - - `TRANSITION_ISSUES` + * - + * - **Voters and watchers permissions** + * - + * - - `MANAGE_WATCHERS` + * - - `VIEW_VOTERS_AND_WATCHERS` + * - + * - **Comments permissions** + * - + * - - `ADD_COMMENTS` + * - - `DELETE_ALL_COMMENTS` + * - - `DELETE_OWN_COMMENTS` + * - - `EDIT_ALL_COMMENTS` + * - - `EDIT_OWN_COMMENTS` + * - + * - **Attachments permissions** + * - + * - - `CREATE_ATTACHMENTS` + * - - `DELETE_ALL_ATTACHMENTS` + * - - `DELETE_OWN_ATTACHMENTS` + * - + * - **Time tracking permissions** + * - + * - - `DELETE_ALL_WORKLOGS` + * - - `DELETE_OWN_WORKLOGS` + * - - `EDIT_ALL_WORKLOGS` + * - - `EDIT_OWN_WORKLOGS` + * - - `WORK_ON_ISSUES` + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async getAllPermissionSchemes( - parameters: Parameters.GetAllPermissionSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns all permission schemes. - * - * ### About permission schemes and grants - * - * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a - * `permission`. - * - * #### Holder object - * - * The `holder` object contains information about the user or group being granted the permission. For example, the - * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the - * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and - * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. - * - * The `holder` object is defined by the following properties: - * - * - `type` Identifies the user or group (see the list of types below). - * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the - * `type`. For example, if the `type` is a group, then you need to specify the group name. - * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the - * group ID. For other `type` it has the same value as `parameter` - * - * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some - * types may not have a `parameter` or `value`): - * - * - `anyone` Grant for anonymous users. - * - `applicationRole` Grant for users with access to the specified application (application name, application name). - * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. - * - `assignee` Grant for the user currently assigned to an issue. - * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). - * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field - * ID, `value` : custom field ID). - * - `projectLead` Grant for a project lead. - * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). - * - `reporter` Grant for the user who reported the issue. - * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not - * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more - * information. - * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is - * deprecated and the account ID should be used, `value` : user ID). - * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : - * custom field ID). - * - * #### Built-in permissions - * - * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define - * custom permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information. - * - * **Administration permissions** - * - * - `ADMINISTER_PROJECTS` - * - `EDIT_WORKFLOW` - * - `EDIT_ISSUE_LAYOUT` - * - * **Project permissions** - * - * - `BROWSE_PROJECTS` - * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) - * - `SERVICEDESK_AGENT` (Jira Service Desk only) - * - `VIEW_DEV_TOOLS` (Jira Software only) - * - `VIEW_READONLY_WORKFLOW` - * - * **Issue permissions** - * - * - `ASSIGNABLE_USER` - * - `ASSIGN_ISSUES` - * - `CLOSE_ISSUES` - * - `CREATE_ISSUES` - * - `DELETE_ISSUES` - * - `EDIT_ISSUES` - * - `LINK_ISSUES` - * - `MODIFY_REPORTER` - * - `MOVE_ISSUES` - * - `RESOLVE_ISSUES` - * - `SCHEDULE_ISSUES` - * - `SET_ISSUE_SECURITY` - * - `TRANSITION_ISSUES` - * - * **Voters and watchers permissions** - * - * - `MANAGE_WATCHERS` - * - `VIEW_VOTERS_AND_WATCHERS` - * - * **Comments permissions** - * - * - `ADD_COMMENTS` - * - `DELETE_ALL_COMMENTS` - * - `DELETE_OWN_COMMENTS` - * - `EDIT_ALL_COMMENTS` - * - `EDIT_OWN_COMMENTS` - * - * **Attachments permissions** - * - * - `CREATE_ATTACHMENTS` - * - `DELETE_ALL_ATTACHMENTS` - * - `DELETE_OWN_ATTACHMENTS` - * - * **Time tracking permissions** - * - * - `DELETE_ALL_WORKLOGS` - * - `DELETE_OWN_WORKLOGS` - * - `EDIT_ALL_WORKLOGS` - * - `EDIT_OWN_WORKLOGS` - * - `WORK_ON_ISSUES` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllPermissionSchemes( - parameters?: Parameters.GetAllPermissionSchemes, - callback?: never, - ): Promise; - async getAllPermissionSchemes( - parameters?: Parameters.GetAllPermissionSchemes, - ): Promise { - const config: Request = { + async getAllPermissionSchemes(parameters: GetAllPermissionSchemesParameters) { + const request: Request = { url: '/rest/api/2/permissionscheme', method: 'GET', query: { - expand: parameters?.expand, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission - * grants. + * grants. * * - * **[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:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createPermissionScheme( - parameters: Parameters.CreatePermissionScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission - * grants. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionScheme( - parameters?: Parameters.CreatePermissionScheme, - callback?: never, - ): Promise; - async createPermissionScheme( - parameters?: Parameters.CreatePermissionScheme, - ): Promise { - const config: Request = { + async createPermissionScheme(parameters: CreatePermissionSchemeParameters) { + const request: Request = { url: '/rest/api/2/permissionscheme', method: 'POST', query: { - expand: parameters?.expand, + expand: parameters.expand, }, body: { - ...parameters, - expand: undefined, + description: parameters.description, + expand: parameters.expand, + id: parameters.id, + name: parameters.name, + permissions: parameters.permissions, + scope: parameters.scope, + self: parameters.self, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a permission scheme. + * Deletes a permission scheme. * * - * **[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:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme | string, - callback: Callback, - ): Promise; + async deletePermissionScheme(parameters: DeletePermissionSchemeParameters) { + const request: Request = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** - * Returns a permission scheme. + * Returns a permission scheme. * * - * **[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:** + * Permission to access Jira. */ - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme | string, - callback?: never, - ): Promise; - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme | string, - ): Promise { - const schemeId = typeof parameters === 'string' ? parameters : parameters.schemeId; - - const config: Request = { - url: `/rest/api/2/permissionscheme/${schemeId}`, + async getPermissionScheme(parameters: GetPermissionSchemeParameters) { + const request: Request = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, method: 'GET', query: { - expand: typeof parameters !== 'string' ? parameters.expand : undefined, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a permission scheme. Below are some important things to note when using this resource: - * - * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all - * existing_ grants. - * - If you want to update only the name and description, then do not send a permissions list in the request. - * - Sending an empty list will remove all permission grants from the permission scheme. - * - * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission - * grant](#api-rest-api-2-permissionscheme-schemeId-permission-post) or [Delete permission scheme - * entity](#api-rest-api-2-permissionscheme-schemeId-permission-permissionId-delete). - * - * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for - * more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback: Callback, - ): Promise; - /** - * Updates a permission scheme. Below are some important things to note when using this resource: - * - * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all - * existing_ grants. - * - If you want to update only the name and description, then do not send a permissions list in the request. - * - Sending an empty list will remove all permission grants from the permission scheme. - * - * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission - * grant](#api-rest-api-2-permissionscheme-schemeId-permission-post) or [Delete permission scheme - * entity](#api-rest-api-2-permissionscheme-schemeId-permission-permissionId-delete). - * - * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for - * more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Updates a permission scheme. Below are some important things to note when using this resource: * + * + * - - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all + * existing_ grants. + * - - If you want to update only the name and description, then do not send a permissions list in the request. + * - - Sending an empty list will remove all permission grants from the permission scheme. + * - + * - If you want to add or delete a permission grant instead of updating the whole list, see [Create permission + * grant](#api-rest-api-2-permissionscheme-schemeId-permission-post) or [Delete permission scheme + * entity](#api-rest-api-2-permissionscheme-schemeId-permission-permissionId-delete). + * - + * - See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for + * more details. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback?: never, - ): Promise; - async updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - ): Promise { - const config: Request = { + async updatePermissionScheme(parameters: UpdatePermissionSchemeParameters) { + const request: Request = { url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, method: 'PUT', query: { expand: parameters.expand, }, body: { - ...parameters, - schemeId: undefined, - expand: undefined, + description: parameters.description, + expand: parameters.expand, + id: parameters.id, + name: parameters.name, + permissions: parameters.permissions, + scope: parameters.scope, + self: parameters.self, }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deletePermissionScheme( - parameters: Parameters.DeletePermissionScheme, - callback: Callback, - ): Promise; - /** - * Deletes a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deletePermissionScheme(parameters: Parameters.DeletePermissionScheme, callback?: never): Promise; - async deletePermissionScheme(parameters: Parameters.DeletePermissionScheme): Promise { - const config: Request = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns all permission grants for a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback: Callback, - ): Promise; - /** - * Returns all permission grants for a permission scheme. + * Returns all permission grants for a permission scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback?: never, - ): Promise; - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - ): Promise { - const config: Request = { + async getPermissionSchemeGrants(parameters: GetPermissionSchemeGrantsParameters) { + const request: Request = { url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission`, method: 'GET', query: { @@ -449,33 +251,17 @@ export class PermissionSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a permission grant in a permission scheme. + * Creates a permission grant in a permission scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback: Callback, - ): Promise; - /** - * Creates a permission grant in a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback?: never, - ): Promise; - async createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - ): Promise { - const config: Request = { + async createPermissionGrant(parameters: CreatePermissionGrantParameters) { + const request: Request = { url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission`, method: 'POST', query: { @@ -489,71 +275,40 @@ export class PermissionSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a permission grant. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback: Callback, - ): Promise; - /** - * Returns a permission grant. + * Deletes a permission grant from a permission scheme. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more details. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback?: never, - ): Promise; - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - ): Promise { - const config: Request = { + async deletePermissionSchemeEntity(parameters: DeletePermissionSchemeEntityParameters) { + const request: Request = { url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, - method: 'GET', - query: { - expand: parameters.expand, - }, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * Returns a permission grant. * * - * **[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:** + * Permission to access Jira. */ - async deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback: Callback, - ): Promise; - /** - * Deletes a permission grant from a permission scheme. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback?: never, - ): Promise; - async deletePermissionSchemeEntity(parameters: Parameters.DeletePermissionSchemeEntity): Promise { - const config: Request = { + async getPermissionSchemeGrant(parameters: GetPermissionSchemeGrantParameters) { + const request: Request = { url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, - method: 'DELETE', + method: 'GET', + query: { + expand: parameters.expand, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/permissions.ts b/src/version2/permissions.ts index 9a1e888c9c..015bdb8628 100644 --- a/src/version2/permissions.ts +++ b/src/version2/permissions.ts @@ -1,255 +1,143 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetMyPermissionsParameters } from './parameters/getMyPermissionsParameters'; +import type { GetBulkPermissionsParameters } from './parameters/getBulkPermissionsParameters'; +import type { GetPermittedProjectsParameters } from './parameters/getPermittedProjectsParameters'; export class Permissions { constructor(private client: Client) {} - /** * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be - * obtained in a global, project, issue or comment context. - * - * The user is reported as having a project permission: - * - * - In the global context, if the user has the project permission in any project. - * - For a project, where the project permission is determined using issue data, if the user meets the permission's - * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. - * - For an issue, where a project permission is determined using issue data, if the user has the permission in the - * issue. Otherwise, if the user has the project permission in the project containing the issue. - * - For a comment, where the user has both the permission to browse the comment and the project permission for the - * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose - * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. - * - * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a - * project context but may not have the permission for any or all issues. For example, if Reporters have the - * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a - * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they - * would not have EDIT_ISSUES permission for that issue. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * obtained in a global, project, issue or comment context. * + * + * - The user is reported as having a project permission: + * - + * - - In the global context, if the user has the project permission in any project. + * - - For a project, where the project permission is determined using issue data, if the user meets the permission's + * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. + * - - For an issue, where a project permission is determined using issue data, if the user has the permission in the + * issue. Otherwise, if the user has the project permission in the project containing the issue. + * - - For a comment, where the user has both the permission to browse the comment and the project permission for the + * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose + * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. + * - + * - This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a + * project context but may not have the permission for any or all issues. For example, if Reporters have the + * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a + * project, because any user can be a reporter. However, if they are not the user who reported the issue queried + * they would not have EDIT_ISSUES permission for that issue. + * - + * - 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. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getMyPermissions( - parameters: Parameters.GetMyPermissions | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be - * obtained in a global, project, issue or comment context. - * - * The user is reported as having a project permission: - * - * - In the global context, if the user has the project permission in any project. - * - For a project, where the project permission is determined using issue data, if the user meets the permission's - * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. - * - For an issue, where a project permission is determined using issue data, if the user has the permission in the - * issue. Otherwise, if the user has the project permission in the project containing the issue. - * - For a comment, where the user has both the permission to browse the comment and the project permission for the - * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose - * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. - * - * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a - * project context but may not have the permission for any or all issues. For example, if Reporters have the - * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a - * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they - * would not have EDIT_ISSUES permission for that issue. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getMyPermissions( - parameters?: Parameters.GetMyPermissions, - callback?: never, - ): Promise; - async getMyPermissions(parameters?: Parameters.GetMyPermissions): Promise { - const config: Request = { + async getMyPermissions(parameters: GetMyPermissionsParameters) { + const request: Request = { url: '/rest/api/2/mypermissions', method: 'GET', query: { - projectKey: parameters?.projectKey, - projectId: parameters?.projectId, - issueKey: parameters?.issueKey, - issueId: parameters?.issueId, - permissions: parameters?.permissions, - projectUuid: parameters?.projectUuid, - projectConfigurationUuid: parameters?.projectConfigurationUuid, - commentId: parameters?.commentId, + projectKey: parameters.projectKey, + projectId: parameters.projectId, + issueKey: parameters.issueKey, + issueId: parameters.issueId, + permissions: parameters.permissions, + projectUuid: parameters.projectUuid, + projectConfigurationUuid: parameters.projectConfigurationUuid, + commentId: parameters.commentId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns all permissions, including: - * - * - Global permissions. - * - Project permissions. - * - Global permissions added by plugins. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * Returns all permissions, including: * + * + * - - Global permissions. + * - - Project permissions. + * - - Global permissions added by plugins. + * - + * - 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; - /** - * Returns all permissions, including: - * - * - Global permissions. - * - Project permissions. - * - Global permissions added by plugins. - * - * 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(): Promise { - const config: Request = { + async getAllPermissions() { + const request: Request = { url: '/rest/api/2/permissions', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns: - * - * - For a list of global permissions, the global permissions granted to a user. - * - For a list of project permissions and lists of projects and issues, for each project permission a list of the - * projects and issues a user can access or manipulate. - * - * If no account ID is provided, the operation returns details for the logged in user. - * - * Note that: - * - * - Invalid project and issue IDs are ignored. - * - A maximum of 1000 projects and 1000 issues can be checked. - * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and - * `projectPermissions.issues` are ignored. - * - Empty strings in `projectPermissions.permissions` are ignored. - * - * **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:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other - * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain - * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made - * using AP.request() in a browser. - */ - async getBulkPermissions( - parameters: Parameters.GetBulkPermissions | undefined, - callback: Callback, - ): Promise; - /** - * Returns: - * - * - For a list of global permissions, the global permissions granted to a user. - * - For a list of project permissions and lists of projects and issues, for each project permission a list of the - * projects and issues a user can access or manipulate. - * - * If no account ID is provided, the operation returns details for the logged in user. - * - * Note that: - * - * - Invalid project and issue IDs are ignored. - * - A maximum of 1000 projects and 1000 issues can be checked. - * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and - * `projectPermissions.issues` are ignored. - * - Empty strings in `projectPermissions.permissions` are ignored. - * - * **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:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other - * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain - * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made - * using AP.request() in a browser. + * Returns: * + * + * - - For a list of global permissions, the global permissions granted to a user. + * - - For a list of project permissions and lists of projects and issues, for each project permission a list of the + * projects and issues a user can access or manipulate. + * - + * - If no account ID is provided, the operation returns details for the logged in user. + * - + * - Note that: + * - + * - - Invalid project and issue IDs are ignored. + * - - A maximum of 1000 projects and 1000 issues can be checked. + * - - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and + * `projectPermissions.issues` are ignored. + * - - Empty strings in `projectPermissions.permissions` are ignored. + * - + * - **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:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for + * other users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain + * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made + * using AP.request() in a browser. */ - async getBulkPermissions( - parameters?: Parameters.GetBulkPermissions, - callback?: never, - ): Promise; - async getBulkPermissions( - parameters?: Parameters.GetBulkPermissions, - ): Promise { - const config: Request = { + async getBulkPermissions(parameters: GetBulkPermissionsParameters) { + const request: Request = { url: '/rest/api/2/permissions/check', method: 'POST', body: { - accountId: parameters?.accountId, - globalPermissions: parameters?.globalPermissions, - projectPermissions: parameters?.projectPermissions, + accountId: parameters.accountId, + globalPermissions: parameters.globalPermissions, + projectPermissions: parameters.projectPermissions, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns all the projects where the user is granted a list of project permissions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getPermittedProjects( - parameters: Parameters.GetPermittedProjects | undefined, - callback: Callback, - ): Promise; - /** - * Returns all the projects where the user is granted a list of project permissions. - * - * This operation can be accessed anonymously. + * Returns all the projects where the user is granted a list of project permissions. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getPermittedProjects( - parameters?: Parameters.GetPermittedProjects, - callback?: never, - ): Promise; - async getPermittedProjects( - parameters?: Parameters.GetPermittedProjects, - ): Promise { - const config: Request = { + async getPermittedProjects(parameters: GetPermittedProjectsParameters) { + const request: Request = { url: '/rest/api/2/permissions/project', method: 'POST', body: { - permissions: parameters?.permissions, + permissions: parameters.permissions, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/plans.ts b/src/version2/plans.ts index 03a8da429c..c093ae1c40 100644 --- a/src/version2/plans.ts +++ b/src/version2/plans.ts @@ -1,63 +1,45 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetPlansParameters } from './parameters/getPlansParameters'; +import type { CreatePlanParameters } from './parameters/createPlanParameters'; +import type { GetPlanParameters } from './parameters/getPlanParameters'; +import type { UpdatePlanParameters } from './parameters/updatePlanParameters'; +import type { ArchivePlanParameters } from './parameters/archivePlanParameters'; +import type { DuplicatePlanParameters } from './parameters/duplicatePlanParameters'; +import type { TrashPlanParameters } from './parameters/trashPlanParameters'; 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). + * - **[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): Promise { - const config: Request = { + async getPlans(parameters: GetPlansParameters) { + const request: Request = { url: '/rest/api/2/plans/plan', method: 'GET', query: { - includeTrashed: parameters?.includeTrashed, - includeArchived: parameters?.includeArchived, - cursor: parameters?.cursor, - maxResults: parameters?.maxResults, + includeTrashed: parameters.includeTrashed, + includeArchived: parameters.includeArchived, + cursor: parameters.cursor, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a plan. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPlan(parameters: Parameters.CreatePlan, callback: Callback): Promise; - /** - * Creates a plan. + * 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). + * - **[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): Promise { - const config: Request = { + async createPlan(parameters: CreatePlanParameters) { + const request: Request = { url: '/rest/api/2/plans/plan', method: 'POST', query: { @@ -75,25 +57,17 @@ export class Plans { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * 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). + * - **[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): Promise { - const config: Request = { + async getPlan(parameters: GetPlanParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}`, method: 'GET', query: { @@ -101,166 +75,97 @@ export class Plans { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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._ + * 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): Promise { - const config: Request = { + async updatePlan(parameters: UpdatePlanParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}`, method: 'PUT', query: { useGroupId: parameters.useGroupId, }, + body: parameters.body, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * 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). + * - **[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): Promise { - const config: Request = { + async archivePlan(parameters: ArchivePlanParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}/archive`, method: 'PUT', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Duplicates a plan. + * 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). + * - **[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): Promise { - const config: Request = { + async duplicatePlan(parameters: DuplicatePlanParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}/duplicate`, method: 'POST', body: { @@ -268,29 +173,21 @@ export class Plans { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * 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). + * - **[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): Promise { - const config: Request = { + async trashPlan(parameters: TrashPlanParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}/trash`, method: 'PUT', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/prioritySchemes.ts b/src/version2/prioritySchemes.ts index 4da5e7c40c..8ea35831b3 100644 --- a/src/version2/prioritySchemes.ts +++ b/src/version2/prioritySchemes.ts @@ -1,81 +1,50 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; -import { paramSerializer } from '../paramSerializer'; -import type { Paginated } from '../paginated'; +import type { GetPrioritySchemesParameters } from './parameters/getPrioritySchemesParameters'; +import type { CreatePrioritySchemeParameters } from './parameters/createPrioritySchemeParameters'; +import type { SuggestedPrioritiesForMappingsParameters } from './parameters/suggestedPrioritiesForMappingsParameters'; +import type { GetAvailablePrioritiesByPrioritySchemeParameters } from './parameters/getAvailablePrioritiesByPrioritySchemeParameters'; +import type { DeletePrioritySchemeParameters } from './parameters/deletePrioritySchemeParameters'; +import type { UpdatePrioritySchemeParameters } from './parameters/updatePrioritySchemeParameters'; +import type { GetPrioritiesByPrioritySchemeParameters } from './parameters/getPrioritiesByPrioritySchemeParameters'; +import type { GetProjectsByPrioritySchemeParameters } from './parameters/getProjectsByPrioritySchemeParameters'; 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. + * priority schemes. * * - * **[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:** + * 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, - ): Promise { - const config: Request = { + async getPrioritySchemes(parameters: GetPrioritySchemesParameters) { + const request: Request = { url: '/rest/api/2/priorityscheme', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - priorityId: paramSerializer('priorityId', parameters?.priorityId), - schemeId: paramSerializer('schemeId', parameters?.schemeId), - schemeName: parameters?.schemeName, - onlyDefault: parameters?.onlyDefault, - orderBy: parameters?.orderBy, - expand: parameters?.expand, + 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); + return this.client.sendRequest(request); } /** - * Creates a new priority scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPriorityScheme( - parameters: Parameters.CreatePriorityScheme, - callback: Callback, - ): Promise; - /** - * Creates a new priority scheme. + * 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). + * - **[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, - ): Promise { - const config: Request = { + async createPriorityScheme(parameters: CreatePrioritySchemeParameters) { + const request: Request = { url: '/rest/api/2/priorityscheme', method: 'POST', body: { @@ -88,75 +57,42 @@ export class PrioritySchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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. + * - **[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, - ): Promise { - const config: Request = { + async suggestedPrioritiesForMappings(parameters: SuggestedPrioritiesForMappingsParameters) { + const request: Request = { url: '/rest/api/2/priorityscheme/mappings', method: 'POST', body: { - maxResults: parameters?.maxResults, - priorities: parameters?.priorities, - projects: parameters?.projects, - schemeId: parameters?.schemeId, - startAt: parameters?.startAt, + maxResults: parameters.maxResults, + priorities: parameters.priorities, + projects: parameters.projects, + schemeId: parameters.schemeId, + startAt: parameters.startAt, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * priorities available for adding to a priority scheme. + * 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. + * - **[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, - ): Promise { - const config: Request = { + async getAvailablePrioritiesByPriorityScheme(parameters: GetAvailablePrioritiesByPrioritySchemeParameters) { + const request: Request = { url: '/rest/api/2/priorityscheme/priorities/available', method: 'GET', query: { @@ -168,33 +104,35 @@ export class PrioritySchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a priority scheme. This includes its details, the lists of priorities and projects in it + * Deletes a 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). + * - 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 updatePriorityScheme( - parameters: Parameters.UpdatePriorityScheme, - callback: Callback, - ): Promise; + async deletePriorityScheme(parameters: DeletePrioritySchemeParameters) { + const request: Request = { + url: `/rest/api/2/priorityscheme/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** - * Updates a priority scheme. This includes its details, the lists of priorities and projects in it + * 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). + * - **[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, - ): Promise { - const config: Request = { + async updatePriorityScheme(parameters: UpdatePrioritySchemeParameters) { + const request: Request = { url: `/rest/api/2/priorityscheme/${parameters.schemeId}`, method: 'PUT', body: { @@ -207,67 +145,18 @@ export class PrioritySchemes { }, }; - return this.client.sendRequest(config); - } - - /** - * 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): Promise { - const config: Request = { - url: `/rest/api/2/priorityscheme/${parameters.schemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * priorities by scheme. + * priorities by scheme. * * - * **[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:** + * 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, - ): Promise { - const config: Request = { + async getPrioritiesByPriorityScheme(parameters: GetPrioritiesByPrioritySchemeParameters) { + const request: Request = { url: `/rest/api/2/priorityscheme/${parameters.schemeId}/priorities`, method: 'GET', query: { @@ -276,45 +165,28 @@ export class PrioritySchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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. + * projects by scheme. * * - * **[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:** + * Permission to access Jira. */ - async getProjectsByPriorityScheme( - parameters: Parameters.GetProjectsByPriorityScheme, - callback?: never, - ): Promise; - async getProjectsByPriorityScheme( - parameters: Parameters.GetProjectsByPriorityScheme, - ): Promise { - const config: Request = { + async getProjectsByPriorityScheme(parameters: GetProjectsByPrioritySchemeParameters) { + const request: Request = { url: `/rest/api/2/priorityscheme/${parameters.schemeId}/projects`, method: 'GET', query: { startAt: parameters.startAt, maxResults: parameters.maxResults, - projectId: paramSerializer('projectId', parameters.projectId), + projectId: parameters.projectId, query: parameters.query, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectAvatars.ts b/src/version2/projectAvatars.ts index d1e8cb83e0..61c5ae1ac3 100644 --- a/src/version2/projectAvatars.ts +++ b/src/version2/projectAvatars.ts @@ -1,34 +1,23 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { UpdateProjectAvatarParameters } from './parameters/updateProjectAvatarParameters'; +import type { DeleteProjectAvatarParameters } from './parameters/deleteProjectAvatarParameters'; +import type { CreateProjectAvatarParameters } from './parameters/createProjectAvatarParameters'; +import type { GetAllProjectAvatarsParameters } from './parameters/getAllProjectAvatarsParameters'; export class ProjectAvatars { constructor(private client: Client) {} - /** - * Sets the avatar displayed for a project. - * - * Use [Load project avatar](#api-rest-api-2-project-projectIdOrKey-avatar2-post) to store avatars against the - * project, before using this operation to set the displayed avatar. + * Sets the avatar displayed 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). + * - Use [Load project avatar](#api-rest-api-2-project-projectIdOrKey-avatar2-post) to store avatars against the + * project, before using this operation to set the displayed avatar. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). */ - async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback: Callback): Promise; - /** - * Sets the avatar displayed for a project. - * - * Use [Load project avatar](#api-rest-api-2-project-projectIdOrKey-avatar2-post) to store avatars against the - * project, before using this operation to set the displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback?: never): Promise; - async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar): Promise { - const config: Request = { + async updateProjectAvatar(parameters: UpdateProjectAvatarParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar`, method: 'PUT', body: { @@ -42,123 +31,86 @@ export class ProjectAvatars { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. + * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). */ - async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback: Callback): Promise; - /** - * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback?: never): Promise; - async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar): Promise { - const config: Request = { + async deleteProjectAvatar(parameters: DeleteProjectAvatarParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar/${parameters.id}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Loads an avatar for a project. - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar use [Set project - * avatar](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-avatars/#api-rest-api-2-project-projectidorkey-avatar-put) - * to set it as the project's displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback: Callback, - ): Promise; - /** - * Loads an avatar for a project. - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar use [Set project - * avatar](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-avatars/#api-rest-api-2-project-projectidorkey-avatar-put) - * to set it as the project's displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + * Loads an avatar for a project. * + * + * - Specify the avatar's local file location in the body of the request. Also, include the following headers: + * - + * - - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * - + * - For example: + * - `curl --request POST ` + * - + * - `--user email@example.com: ` + * - + * - `--header 'X-Atlassian-Token: no-check' ` + * - + * - `--header 'Content-Type: image/< image_type>' ` + * - + * - `--data-binary "<@/path/to/file/with/your/avatar>" ` + * - + * - `--url 'https://your-domain.atlassian.net/rest/api/2/project/{projectIdOrKey}/avatar2'` + * - + * - The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * - + * - The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * - + * - After creating the avatar use [Set project + * avatar](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-avatars/#api-rest-api-2-project-projectidorkey-avatar-put) + * to set it as the project's displayed avatar. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). */ - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback?: never, - ): Promise; - async createProjectAvatar(parameters: Parameters.CreateProjectAvatar): Promise { - const config: Request = { + async createProjectAvatar(parameters: CreateProjectAvatarParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar2`, method: 'POST', - headers: { - 'X-Atlassian-Token': 'no-check', - 'Content-Type': parameters.mimeType, - }, query: { x: parameters.x, y: parameters.y, - size: parameters.size ?? 0, + size: parameters.size, }, - body: parameters.avatar, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns all project avatars, grouped by system and custom avatars. + * Returns all project avatars, grouped by system and custom avatars. * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars | string, - callback: Callback, - ): Promise; - /** - * Returns all project avatars, grouped by system and custom avatars. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ - async getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars | string, - callback?: never, - ): Promise; - async getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars | string, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}/avatars`, + async getAllProjectAvatars(parameters: GetAllProjectAvatarsParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatars`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectCategories.ts b/src/version2/projectCategories.ts index 266fbde6c0..9c1ccc5f77 100644 --- a/src/version2/projectCategories.ts +++ b/src/version2/projectCategories.ts @@ -1,59 +1,35 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { CreateProjectCategoryParameters } from './parameters/createProjectCategoryParameters'; +import type { RemoveProjectCategoryParameters } from './parameters/removeProjectCategoryParameters'; +import type { GetProjectCategoryByIdParameters } from './parameters/getProjectCategoryByIdParameters'; +import type { UpdateProjectCategoryParameters } from './parameters/updateProjectCategoryParameters'; export class ProjectCategories { constructor(private client: Client) {} - /** - * Returns all project categories. + * Returns all project categories. * * - * **[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:** + * Permission to access Jira. */ - async getAllProjectCategories(callback: Callback): Promise; - /** - * Returns all project categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllProjectCategories(callback?: never): Promise; - async getAllProjectCategories(): Promise { - const config: Request = { + async getAllProjectCategories() { + const request: Request = { url: '/rest/api/2/projectCategory', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a project category. + * Creates a project category. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback: Callback, - ): Promise; - /** - * Creates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback?: never, - ): Promise; - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - ): Promise { - const config: Request = { + async createProjectCategory(parameters: CreateProjectCategoryParameters) { + const request: Request = { url: '/rest/api/2/projectCategory', method: 'POST', body: { @@ -64,105 +40,57 @@ export class ProjectCategories { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a project category. + * Deletes a project category. * * - * **[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:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById | string, - callback: Callback, - ): Promise; + async removeProjectCategory(parameters: RemoveProjectCategoryParameters) { + const request: Request = { + url: `/rest/api/2/projectCategory/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** - * Returns a project category. + * Returns a project category. * * - * **[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:** + * Permission to access Jira. */ - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById | string, - callback?: never, - ): Promise; - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/projectCategory/${id}`, + async getProjectCategoryById(parameters: GetProjectCategoryByIdParameters) { + const request: Request = { + url: `/rest/api/2/projectCategory/${parameters.id}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback: Callback, - ): Promise; - /** - * Updates a project category. + * Updates a project category. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback?: never, - ): Promise; - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - ): Promise { - const config: Request = { + async updateProjectCategory(parameters: UpdateProjectCategoryParameters) { + const request: Request = { url: `/rest/api/2/projectCategory/${parameters.id}`, method: 'PUT', body: { - name: parameters.name, description: parameters.description, + id: parameters.id, + name: parameters.name, + self: parameters.self, }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeProjectCategory( - parameters: Parameters.RemoveProjectCategory | string, - callback: Callback, - ): Promise; - /** - * Deletes a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeProjectCategory( - parameters: Parameters.RemoveProjectCategory | string, - callback?: never, - ): Promise; - async removeProjectCategory(parameters: Parameters.RemoveProjectCategory | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/projectCategory/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectClassificationLevels.ts b/src/version2/projectClassificationLevels.ts index 68ff338d7f..f092eee7e3 100644 --- a/src/version2/projectClassificationLevels.ts +++ b/src/version2/projectClassificationLevels.ts @@ -1,118 +1,63 @@ -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { RemoveDefaultProjectClassificationParameters } from './parameters/removeDefaultProjectClassificationParameters'; +import type { GetDefaultProjectClassificationParameters } from './parameters/getDefaultProjectClassificationParameters'; +import type { UpdateDefaultProjectClassificationParameters } from './parameters/updateDefaultProjectClassificationParameters'; 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:** + * Remove the default data classification level for a project. * * - * - _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). + * - **[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 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, - ): Promise { - const config: Request = { + async removeDefaultProjectClassification(parameters: RemoveDefaultProjectClassificationParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/classification-level/default`, - method: 'GET', + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates the default data classification level for a project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Returns the default data classification for a project. * * - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[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 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, - ): Promise { - const config: Request = { + async getDefaultProjectClassification(parameters: GetDefaultProjectClassificationParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/classification-level/default`, - method: 'PUT', - body: { - id: parameters.id, - }, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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:** + * Updates the default data classification level for a project. * * - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[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, - ): Promise { - const config: Request = { + async updateDefaultProjectClassification(parameters: UpdateDefaultProjectClassificationParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/classification-level/default`, - method: 'DELETE', + method: 'PUT', + body: { + id: parameters.id, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectComponents.ts b/src/version2/projectComponents.ts index b3a3a646e8..0a4ca2e682 100644 --- a/src/version2/projectComponents.ts +++ b/src/version2/projectComponents.ts @@ -1,87 +1,53 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; -import type { Paginated } from '../paginated'; +import type { FindComponentsForProjectsParameters } from './parameters/findComponentsForProjectsParameters'; +import type { CreateComponentParameters } from './parameters/createComponentParameters'; +import type { DeleteComponentParameters } from './parameters/deleteComponentParameters'; +import type { GetComponentParameters } from './parameters/getComponentParameters'; +import type { UpdateComponentParameters } from './parameters/updateComponentParameters'; +import type { GetComponentRelatedIssuesParameters } from './parameters/getComponentRelatedIssuesParameters'; +import type { GetProjectComponentsPaginatedParameters } from './parameters/getProjectComponentsPaginatedParameters'; +import type { GetProjectComponentsParameters } from './parameters/getProjectComponentsParameters'; 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. + * components in a project, including global (Compass) components when applicable. * * - * **[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. + * - 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, - ): Promise { - const config: Request = { + async findComponentsForProjects(parameters: FindComponentsForProjectsParameters) { + const request: Request = { url: '/rest/api/2/component', method: 'GET', query: { - projectIdsOrKeys: parameters?.projectIdsOrKeys, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - orderBy: parameters?.orderBy, - query: parameters?.query, + projectIdsOrKeys: parameters.projectIdsOrKeys, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + orderBy: parameters.orderBy, + query: parameters.query, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the - * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createComponent( - parameters: Parameters.CreateComponent, - callback: Callback, - ): Promise; - /** - * Creates a component. Use components to provide containers for issues within a project. Use components to provide - * containers for issues within a project. - * - * This operation can be accessed anonymously. + * containers for issues within 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 in which the - * component is created or _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:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which + * the component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createComponent( - parameters: Parameters.CreateComponent, - callback?: never, - ): Promise; - async createComponent(parameters: Parameters.CreateComponent): Promise { - const config: Request = { + async createComponent(parameters: CreateComponentParameters) { + const request: Request = { url: '/rest/api/2/component', method: 'POST', body: { @@ -104,209 +70,120 @@ export class ProjectComponents { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a component. + * Deletes a component. * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getComponent( - parameters: Parameters.GetComponent | string, - callback: Callback, - ): Promise; + async deleteComponent(parameters: DeleteComponentParameters) { + const request: Request = { + url: `/rest/api/2/component/${parameters.id}`, + method: 'DELETE', + query: { + moveIssuesTo: parameters.moveIssuesTo, + }, + }; + + return this.client.sendRequest(request); + } + /** - * Returns a component. + * Returns a component. * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. */ - async getComponent( - parameters: Parameters.GetComponent | string, - callback?: never, - ): Promise; - async getComponent(parameters: Parameters.GetComponent | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/component/${id}`, + async getComponent(parameters: GetComponentParameters) { + const request: Request = { + url: `/rest/api/2/component/${parameters.id}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") - * the component lead is removed. - * - * This operation can be accessed anonymously. + * the component lead is removed. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateComponent( - parameters: Parameters.UpdateComponent, - callback: Callback, - ): Promise; - /** - * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") - * the component lead is removed. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateComponent( - parameters: Parameters.UpdateComponent, - callback?: never, - ): Promise; - async updateComponent(parameters: Parameters.UpdateComponent): Promise { - const config: Request = { + async updateComponent(parameters: UpdateComponentParameters) { + const request: Request = { url: `/rest/api/2/component/${parameters.id}`, method: 'PUT', body: { - name: parameters.name, + ari: parameters.ari, + assignee: parameters.assignee, + assigneeType: parameters.assigneeType, description: parameters.description, - leadUserName: parameters.leadUserName, + id: parameters.id, + isAssigneeTypeValid: parameters.isAssigneeTypeValid, + lead: parameters.lead, leadAccountId: parameters.leadAccountId, - assigneeType: parameters.assigneeType, + 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); - } - - /** - * Deletes a component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteComponent( - parameters: Parameters.DeleteComponent | string, - callback: Callback, - ): Promise; - /** - * Deletes a component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteComponent(parameters: Parameters.DeleteComponent | string, callback?: never): Promise; - async deleteComponent(parameters: Parameters.DeleteComponent | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/component/${id}`, - method: 'DELETE', - query: { - moveIssuesTo: typeof parameters !== 'string' ? parameters.moveIssuesTo : undefined, - }, - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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, - callback: Callback, - ): Promise; - /** - * 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` + * Returns the counts of issues assigned to the component. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - 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, - callback?: never, - ): Promise; - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/component/${id}/relatedIssueCounts`, + async getComponentRelatedIssues(parameters: GetComponentRelatedIssuesParameters) { + const request: Request = { + url: `/rest/api/2/component/${parameters.id}/relatedIssueCounts`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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 - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * components in a project. See the [Get project components](#api-rest-api-2-project-projectIdOrKey-components-get) - * resource if you want to get a full list of versions without pagination. - * - * 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 - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback?: never, - ): Promise; - async getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - ): Promise { - const config: Request = { + * 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 + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectComponentsPaginated(parameters: GetProjectComponentsPaginatedParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/component`, method: 'GET', query: { @@ -318,56 +195,31 @@ export class ProjectComponents { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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, - callback: Callback, - ): Promise; - /** - * Returns all components in a project. See the [Get project components - * paginated](#api-rest-api-2-project-projectIdOrKey-component-get) resource if you want to get a full list of - * components with pagination. - * - * 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, - callback?: never, - ): Promise; - async getProjectComponents( - parameters: Parameters.GetProjectComponents | string, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}/components`, + * 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: GetProjectComponentsParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/components`, method: 'GET', query: { - componentSource: typeof parameters !== 'string' ? parameters.componentSource : undefined, + componentSource: parameters.componentSource, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectEmail.ts b/src/version2/projectEmail.ts index 6b591f7592..a34a789e22 100644 --- a/src/version2/projectEmail.ts +++ b/src/version2/projectEmail.ts @@ -1,67 +1,36 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetProjectEmailParameters } from './parameters/getProjectEmailParameters'; +import type { UpdateProjectEmailParameters } from './parameters/updateProjectEmailParameters'; export class ProjectEmail { constructor(private client: Client) {} - - /** - * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback: Callback, - ): Promise; /** - * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ - async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback?: never, - ): Promise; - async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - ): Promise { - const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; - - const config: Request = { - url: `/rest/api/2/project/${projectId}/email`, + async getProjectEmail(parameters: GetProjectEmailParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectId}/email`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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:** - * _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; - /** - * 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. + * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission.](https://confluence.atlassian.com/x/yodKLg) + * - 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:** + * _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(parameters: Parameters.UpdateProjectEmail): Promise { - const config: Request = { + async updateProjectEmail(parameters: UpdateProjectEmailParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectId}/email`, method: 'PUT', body: { @@ -70,6 +39,6 @@ export class ProjectEmail { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectFeatures.ts b/src/version2/projectFeatures.ts index b8588b1d2c..a080b75b79 100644 --- a/src/version2/projectFeatures.ts +++ b/src/version2/projectFeatures.ts @@ -1,49 +1,23 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetFeaturesForProjectParameters } from './parameters/getFeaturesForProjectParameters'; +import type { ToggleFeatureForProjectParameters } from './parameters/toggleFeatureForProjectParameters'; export class ProjectFeatures { constructor(private client: Client) {} - - /** Returns the list of features for a project. */ - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback: Callback, - ): Promise; /** Returns the list of features for a project. */ - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback?: never, - ): Promise; - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}/features`, + async getFeaturesForProject(parameters: GetFeaturesForProjectParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/features`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** Sets the state of a project feature. */ - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback: Callback, - ): Promise; - /** Sets the state of a project feature. */ - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback?: never, - ): Promise; - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - ): Promise { - const config: Request = { + async toggleFeatureForProject(parameters: ToggleFeatureForProjectParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/features/${parameters.featureKey}`, method: 'PUT', body: { @@ -51,6 +25,6 @@ export class ProjectFeatures { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectKeyAndNameValidation.ts b/src/version2/projectKeyAndNameValidation.ts index ed78c70201..b6648cc7b3 100644 --- a/src/version2/projectKeyAndNameValidation.ts +++ b/src/version2/projectKeyAndNameValidation.ts @@ -1,111 +1,62 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { ValidateProjectKeyParameters } from './parameters/validateProjectKeyParameters'; +import type { GetValidProjectKeyParameters } from './parameters/getValidProjectKeyParameters'; +import type { GetValidProjectNameParameters } from './parameters/getValidProjectNameParameters'; export class ProjectKeyAndNameValidation { constructor(private client: Client) {} - - /** - * Validates a project key by confirming the key is a valid string and not in use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async validateProjectKey( - parameters: Parameters.ValidateProjectKey | string | undefined, - callback: Callback, - ): Promise; /** - * Validates a project key by confirming the key is a valid string and not in use. + * Validates a project key by confirming the key is a valid string and not in use. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async validateProjectKey( - parameters?: Parameters.ValidateProjectKey | string, - callback?: never, - ): Promise; - async validateProjectKey( - parameters?: Parameters.ValidateProjectKey | string, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters?.key; - - const config: Request = { + async validateProjectKey(parameters: ValidateProjectKeyParameters) { + const request: Request = { url: '/rest/api/2/projectvalidate/key', method: 'GET', query: { - key, + key: parameters.key, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. + * * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getValidProjectKey( - parameters: Parameters.GetValidProjectKey | string | undefined, - callback: Callback, - ): Promise; - /** - * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getValidProjectKey( - parameters?: Parameters.GetValidProjectKey | string, - callback?: never, - ): Promise; - async getValidProjectKey(parameters?: Parameters.GetValidProjectKey | string): Promise { - const key = typeof parameters === 'string' ? parameters : parameters?.key; - - const config: Request = { + async getValidProjectKey(parameters: GetValidProjectKeyParameters) { + const request: Request = { url: '/rest/api/2/projectvalidate/validProjectKey', method: 'GET', query: { - key, + key: parameters.key, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a - * sequence number. If a valid project name cannot be generated, a 404 response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback: Callback, - ): Promise; - /** - * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in - * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a - * sequence number. If a valid project name cannot be generated, a 404 response is returned. + * sequence number. If a valid project name cannot be generated, a 404 response is returned. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback?: never, - ): Promise; - async getValidProjectName(parameters: Parameters.GetValidProjectName | string): Promise { - const name = typeof parameters === 'string' ? parameters : parameters.name; - - const config: Request = { + async getValidProjectName(parameters: GetValidProjectNameParameters) { + const request: Request = { url: '/rest/api/2/projectvalidate/validProjectName', method: 'GET', query: { - name, + name: parameters.name, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectPermissionSchemes.ts b/src/version2/projectPermissionSchemes.ts index 1ffceeb86c..466511d3bf 100644 --- a/src/version2/projectPermissionSchemes.ts +++ b/src/version2/projectPermissionSchemes.ts @@ -1,111 +1,56 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetProjectIssueSecuritySchemeParameters } from './parameters/getProjectIssueSecuritySchemeParameters'; +import type { GetAssignedPermissionSchemeParameters } from './parameters/getAssignedPermissionSchemeParameters'; +import type { AssignPermissionSchemeParameters } from './parameters/assignPermissionSchemeParameters'; +import type { GetSecurityLevelsForProjectParameters } from './parameters/getSecurityLevelsForProjectParameters'; export class ProjectPermissionSchemes { constructor(private client: Client) {} - - /** - * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or the _Administer Projects_ - * [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback: Callback, - ): Promise; /** - * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with the project. + * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with the project. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or the _Administer Projects_ - * [project permission](https://confluence.atlassian.com/x/yodKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or the _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg). */ - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback?: never, - ): Promise; - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: Request = { - url: `/rest/api/2/project/${projectKeyOrId}/issuesecuritylevelscheme`, + async getProjectIssueSecurityScheme(parameters: GetProjectIssueSecuritySchemeParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectKeyOrId}/issuesecuritylevelscheme`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with the project. + * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with the project. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg). */ - async getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback: Callback, - ): Promise; - /** - * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback?: never, - ): Promise; - async getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: Request = { - url: `/rest/api/2/project/${projectKeyOrId}/permissionscheme`, + async getAssignedPermissionScheme(parameters: GetAssignedPermissionSchemeParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectKeyOrId}/permissionscheme`, method: 'GET', query: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Assigns a permission scheme with a project. See [Managing project - * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. + * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) */ - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback: Callback, - ): Promise; - /** - * Assigns a permission scheme with a project. See [Managing project - * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - */ - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback?: never, - ): Promise; - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - ): Promise { - const config: Request = { + async assignPermissionScheme(parameters: AssignPermissionSchemeParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectKeyOrId}/permissionscheme`, method: 'PUT', query: { @@ -116,49 +61,26 @@ export class ProjectPermissionSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has - * access to. - * - * This operation can be accessed anonymously. + * access to. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security - * levels are only returned for authenticated user with _Set Issue Security_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security + * levels are only returned for authenticated user with _Set Issue Security_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. */ - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback: Callback, - ): Promise; - /** - * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has - * access to. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security - * levels are only returned for authenticated user with _Set Issue Security_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. - */ - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback?: never, - ): Promise; - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: Request = { - url: `/rest/api/2/project/${projectKeyOrId}/securitylevel`, + async getSecurityLevelsForProject(parameters: GetSecurityLevelsForProjectParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectKeyOrId}/securitylevel`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectProperties.ts b/src/version2/projectProperties.ts index 144d137959..9f9a50d1f4 100644 --- a/src/version2/projectProperties.ts +++ b/src/version2/projectProperties.ts @@ -1,164 +1,92 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetProjectPropertyKeysParameters } from './parameters/getProjectPropertyKeysParameters'; +import type { DeleteProjectPropertyParameters } from './parameters/deleteProjectPropertyParameters'; +import type { GetProjectPropertyParameters } from './parameters/getProjectPropertyParameters'; +import type { SetProjectPropertyParameters } from './parameters/setProjectPropertyParameters'; export class ProjectProperties { constructor(private client: Client) {} - /** * Returns all [project * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys for the project. - * - * This operation can be accessed anonymously. + * keys for the 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. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ - async getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns all [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys for the project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback?: never, - ): Promise; - async getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}/properties`, + async getProjectPropertyKeys(parameters: GetProjectPropertyKeysParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the value of a [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. - */ - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. + * Deletes the + * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * from a project. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. */ - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback?: never, - ): Promise; - async getProjectProperty(parameters: Parameters.GetProjectProperty): Promise { - const config: Request = { + async deleteProjectProperty(parameters: DeleteProjectPropertyParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'GET', + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the value of the [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * You can use project properties to store custom data against the project. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the property is created. - */ - async setProjectProperty( - parameters: Parameters.SetProjectProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of the [project + * Returns the value of a [project * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * You can use project properties to store custom data against the project. + * * * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the property is created. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * property. */ - async setProjectProperty(parameters: Parameters.SetProjectProperty, callback?: never): Promise; - async setProjectProperty(parameters: Parameters.SetProjectProperty): Promise { - const config: Request = { + async getProjectProperty(parameters: GetProjectPropertyParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - body: parameters.propertyValue, + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes the - * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * from a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. - */ - async deleteProjectProperty( - parameters: Parameters.DeleteProjectProperty, - callback: Callback, - ): Promise; - /** - * Deletes the - * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * from a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. + * Sets the value of the [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * You can use project properties to store custom data against the project. * + * + * - The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the property is + * created. */ - async deleteProjectProperty(parameters: Parameters.DeleteProjectProperty, callback?: never): Promise; - async deleteProjectProperty(parameters: Parameters.DeleteProjectProperty): Promise { - const config: Request = { + async setProjectProperty(parameters: SetProjectPropertyParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', + method: 'PUT', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectRoleActors.ts b/src/version2/projectRoleActors.ts index a2d69330bb..900ff9ece4 100644 --- a/src/version2/projectRoleActors.ts +++ b/src/version2/projectRoleActors.ts @@ -1,243 +1,147 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { DeleteActorParameters } from './parameters/deleteActorParameters'; +import type { AddActorUsersParameters } from './parameters/addActorUsersParameters'; +import type { SetActorsParameters } from './parameters/setActorsParameters'; +import type { DeleteProjectRoleActorsFromRoleParameters } from './parameters/deleteProjectRoleActorsFromRoleParameters'; +import type { GetProjectRoleActorsForRoleParameters } from './parameters/getProjectRoleActorsForRoleParameters'; +import type { AddProjectRoleActorsToRoleParameters } from './parameters/addProjectRoleActorsToRoleParameters'; export class ProjectRoleActors { constructor(private client: Client) {} - /** - * Adds actors to a project role for the project. - * - * To replace all actors for the project, use [Set actors for project - * role](#api-rest-api-2-project-projectIdOrKey-role-id-put). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Deletes actors from a project role for the project. * + * + * - To remove default actors from the project role, use [Delete default actors from project + * role](#api-rest-api-2-role-id-actors-delete). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async addActorUsers( - parameters: Parameters.AddActorUsers, - callback: Callback, - ): Promise; + async deleteActor(parameters: DeleteActorParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'DELETE', + query: { + user: parameters.user, + group: parameters.group, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(request); + } + /** - * Adds actors to a project role for the project. - * - * To replace all actors for the project, use [Set actors for project - * role](#api-rest-api-2-project-projectIdOrKey-role-id-put). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Adds actors to a project role for the project. * + * + * - To replace all actors for the project, use [Set actors for project + * role](#api-rest-api-2-project-projectIdOrKey-role-id-put). + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async addActorUsers(parameters: Parameters.AddActorUsers, callback?: never): Promise; - async addActorUsers(parameters: Parameters.AddActorUsers): Promise { - const config: Request = { + async addActorUsers(parameters: AddActorUsersParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, method: 'POST', body: { - user: parameters.user, group: parameters.group, groupId: parameters.groupId, + user: parameters.user, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the actors for a project role for a project, replacing all existing actors. - * - * To add actors to the project without overwriting the existing list, use [Add actors to project - * role](#api-rest-api-2-project-projectIdOrKey-role-id-post). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Sets the actors for a project role for a project, replacing all existing actors. * + * + * - To add actors to the project without overwriting the existing list, use [Add actors to project + * role](#api-rest-api-2-project-projectIdOrKey-role-id-post). + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setActors(parameters: Parameters.SetActors, callback: Callback): Promise; - /** - * Sets the actors for a project role for a project, replacing all existing actors. - * - * To add actors to the project without overwriting the existing list, use [Add actors to project - * role](#api-rest-api-2-project-projectIdOrKey-role-id-post). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setActors(parameters: Parameters.SetActors, callback?: never): Promise; - async setActors(parameters: Parameters.SetActors): Promise { - const config: Request = { + async setActors(parameters: SetActorsParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, method: 'PUT', body: { categorisedActors: parameters.categorisedActors, + id: parameters.id, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes actors from a project role for the project. - * - * To remove default actors from the project role, use [Delete default actors from project - * role](#api-rest-api-2-role-id-actors-delete). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteActor(parameters: Parameters.DeleteActor, callback: Callback): Promise; - /** - * Deletes actors from a project role for the project. - * - * To remove default actors from the project role, use [Delete default actors from project - * role](#api-rest-api-2-role-id-actors-delete). - * - * This operation can be accessed anonymously. + * Deletes the [default actors](#api-rest-api-2-resolution-get) from a project role. You may delete a group or user, + * but you cannot delete a group and a user in the same request. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Changing a project role's default actors does not affect project role members for projects already created. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteActor(parameters: Parameters.DeleteActor, callback?: never): Promise; - async deleteActor(parameters: Parameters.DeleteActor): Promise { - const config: Request = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + async deleteProjectRoleActorsFromRole(parameters: DeleteProjectRoleActorsFromRoleParameters) { + const request: Request = { + url: `/rest/api/2/role/${parameters.id}/actors`, method: 'DELETE', query: { user: parameters.user, - group: parameters.group, groupId: parameters.groupId, + group: parameters.group, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the [default actors](#api-rest-api-2-resolution-get) for the project role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback: Callback, - ): Promise; - /** - * Returns the [default actors](#api-rest-api-2-resolution-get) for the project role. + * Returns the [default actors](#api-rest-api-2-resolution-get) for the project role. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback?: never, - ): Promise; - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/role/${id}/actors`, + async getProjectRoleActorsForRole(parameters: GetProjectRoleActorsForRoleParameters) { + const request: Request = { + url: `/rest/api/2/role/${parameters.id}/actors`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Adds [default actors](#api-rest-api-2-resolution-get) to a role. You may add groups or users, but you cannot add - * groups and users in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback: Callback, - ): Promise; - /** - * Adds [default actors](#api-rest-api-2-resolution-get) to a role. You may add groups or users, but you cannot add - * groups and users in the same request. + * groups and users in the same request. * * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Changing a project role's default actors does not affect project role members for projects already created. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback?: never, - ): Promise; - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - ): Promise { - const config: Request = { + async addProjectRoleActorsToRole(parameters: AddProjectRoleActorsToRoleParameters) { + const request: Request = { url: `/rest/api/2/role/${parameters.id}/actors`, method: 'POST', body: { - user: parameters.user, - groupId: parameters.groupId, group: parameters.group, - }, - }; - - return this.client.sendRequest(config); - } - - /** - * Deletes the [default actors](#api-rest-api-2-resolution-get) from a project role. You may delete a group or user, - * but you cannot delete a group and a user in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback: Callback, - ): Promise; - /** - * Deletes the [default actors](#api-rest-api-2-resolution-get) from a project role. You may delete a group or user, - * but you cannot delete a group and a user in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback?: never, - ): Promise; - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - ): Promise { - const config: Request = { - url: `/rest/api/2/role/${parameters.id}/actors`, - method: 'DELETE', - query: { - user: parameters.user, groupId: parameters.groupId, - group: parameters.group, + user: parameters.user, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectRoles.ts b/src/version2/projectRoles.ts index 50c9211ddc..ab2085adaf 100644 --- a/src/version2/projectRoles.ts +++ b/src/version2/projectRoles.ts @@ -1,96 +1,55 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetProjectRolesParameters } from './parameters/getProjectRolesParameters'; +import type { GetProjectRoleParameters } from './parameters/getProjectRoleParameters'; +import type { GetProjectRoleDetailsParameters } from './parameters/getProjectRoleDetailsParameters'; +import type { CreateProjectRoleParameters } from './parameters/createProjectRoleParameters'; +import type { DeleteProjectRoleParameters } from './parameters/deleteProjectRoleParameters'; +import type { GetProjectRoleByIdParameters } from './parameters/getProjectRoleByIdParameters'; +import type { PartialUpdateProjectRoleParameters } from './parameters/partialUpdateProjectRoleParameters'; +import type { FullyUpdateProjectRoleParameters } from './parameters/fullyUpdateProjectRoleParameters'; 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 - * returning the name and self URL for each role. - * - * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project - * roles](#api-rest-api-2-role-get) for more information. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site - * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - callback: Callback, - ): Promise; /** * Returns a list of [project * roles](https://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. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site - * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - callback?: never, - ): Promise; - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}/role`, + * returning the name and self URL for each role. * + * + * - Note that all project roles are shared with all projects in Jira Cloud. See [Get all project + * roles](#api-rest-api-2-role-get) for more information. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site + * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoles(parameters: GetProjectRolesParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/role`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a project role's details and actors associated with the project. The list of actors is sorted by display - * name. - * - * To check whether a user belongs to a role based on their group memberships, use [Get - * user](#api-rest-api-2-user-get) with the `groups` expand parameter selected. Then check whether the user keys and - * groups match with the actors returned for the project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRole( - parameters: Parameters.GetProjectRole, - callback: Callback, - ): Promise; - /** - * Returns a project role's details and actors associated with the project. The list of actors is sorted by display - * name. - * - * To check whether a user belongs to a role based on their group memberships, use [Get - * user](#api-rest-api-2-user-get) with the `groups` expand parameter selected. Then check whether the user keys and - * groups match with the actors returned for the project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRole(parameters: Parameters.GetProjectRole, callback?: never): Promise; - async getProjectRole(parameters: Parameters.GetProjectRole): Promise { - const config: Request = { + * name. * + * + * - To check whether a user belongs to a role based on their group memberships, use [Get + * user](#api-rest-api-2-user-get) with the `groups` expand parameter selected. Then check whether the user keys and + * groups match with the actors returned for the project. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRole(parameters: GetProjectRoleParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, method: 'GET', query: { @@ -98,161 +57,86 @@ export class ProjectRoles { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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. + * the details for each role. Note that the list of project roles is common to all projects. * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - callback: Callback, - ): Promise; - /** - * Returns all [project roles](https://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. - * - * **[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. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - callback?: never, - ): Promise; - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}/roledetails`, + async getProjectRoleDetails(parameters: GetProjectRoleDetailsParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/roledetails`, method: 'GET', query: { - currentMember: typeof parameters !== 'string' ? parameters.currentMember : undefined, - excludeConnectAddons: typeof parameters !== 'string' ? parameters.excludeConnectAddons : undefined, + currentMember: parameters.currentMember, + excludeConnectAddons: parameters.excludeConnectAddons, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Gets a list of all project roles, complete with project role details and default actors. - * - * ### About project roles - * - * [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 - * levels](#api-rest-api-2-issuesecurityschemes-get), [comment visibility](#api-rest-api-2-comment-list-post), and - * workflow conditions. - * - * #### Members and actors - * - * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated - * with a project role. - * - * Actors may be set as [default - * members](https://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 - * actors can be removed at the project level later if desired. - * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default - * actors. This enables you to assign a user to different roles in different projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllProjectRoles(callback: Callback): Promise; - /** - * Gets a list of all project roles, complete with project role details and default actors. - * - * ### About project roles - * - * [Project roles](https://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 - * levels](#api-rest-api-2-issuesecurityschemes-get), [comment visibility](#api-rest-api-2-comment-list-post), and - * workflow conditions. - * - * #### Members and actors - * - * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated - * with a project role. - * - * Actors may be set as [default - * members](https://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 - * actors can be removed at the project level later if desired. - * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default - * actors. This enables you to assign a user to different roles in different projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllProjectRoles(callback?: never): Promise; - async getAllProjectRoles(): Promise { - const config: Request = { + * Gets a list of all project roles, complete with project role details and default actors. * + * + * - ### About project roles + * - + * - [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 + * levels](#api-rest-api-2-issuesecurityschemes-get), [comment visibility](#api-rest-api-2-comment-list-post), and + * workflow conditions. + * - + * - #### Members and actors + * - + * - In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated + * with a project role. + * - + * - Actors may be set as [default + * members](https://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 + * actors can be removed at the project level later if desired. + * - - Actors: Users and groups that are associated with a project role for a project, which may differ from the default + * actors. This enables you to assign a user to different roles in different projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllProjectRoles() { + const request: Request = { url: '/rest/api/2/role', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Creates a new project role with no [default actors](#api-rest-api-2-resolution-get). You can use the [Add default * actors to project role](#api-rest-api-2-role-id-actors-post) operation to add default actors to the project role - * after creating it. - * - * _Note that although a new project role is available to all projects upon creation, any default actors that are - * associated with the project role are not added to projects that existed prior to the role being created._< - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback: Callback, - ): Promise; - /** - * Creates a new project role with no [default actors](#api-rest-api-2-resolution-get). You can use the [Add default - * actors to project role](#api-rest-api-2-role-id-actors-post) operation to add default actors to the project role - * after creating it. + * after creating it. * * - * _Note that although a new project role is available to all projects upon creation, any default actors that are - * associated with the project role are not added to projects that existed prior to the role being created._< - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Note that although a new project role is available to all projects upon creation, any default actors that are + * associated with the project role are not added to projects that existed prior to the role being created._< + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback?: never, - ): Promise; - async createProjectRole(parameters: Parameters.CreateProjectRole): Promise { - const config: Request = { + async createProjectRole(parameters: CreateProjectRoleParameters) { + const request: Request = { url: '/rest/api/2/role', method: 'POST', body: { @@ -261,74 +145,55 @@ export class ProjectRoles { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Gets the project role details and the default actors associated with the role. The list of default actors is sorted - * by display name. + * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in + * use. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback: Callback, - ): Promise; + async deleteProjectRole(parameters: DeleteProjectRoleParameters) { + const request: Request = { + url: `/rest/api/2/role/${parameters.id}`, + method: 'DELETE', + query: { + swap: parameters.swap, + }, + }; + + return this.client.sendRequest(request); + } + /** * Gets the project role details and the default actors associated with the role. The list of default actors is sorted - * by display name. + * by display name. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback?: never, - ): Promise; - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/role/${id}`, + async getProjectRoleById(parameters: GetProjectRoleByIdParameters) { + const request: Request = { + url: `/rest/api/2/role/${parameters.id}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates either the project role's name or its description. - * - * You cannot update both the name and description at the same time using this operation. If you send a request with a - * name and a description only the name is updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback: Callback, - ): Promise; - /** - * Updates either the project role's name or its description. + * Updates either the project role's name or its description. * * - * You cannot update both the name and description at the same time using this operation. If you send a request with a - * name and a description only the name is updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - You cannot update both the name and description at the same time using this operation. If you send a request with a + * name and a description only the name is updated. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback?: never, - ): Promise; - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - ): Promise { - const config: Request = { + async partialUpdateProjectRole(parameters: PartialUpdateProjectRoleParameters) { + const request: Request = { url: `/rest/api/2/role/${parameters.id}`, method: 'POST', body: { @@ -337,33 +202,17 @@ export class ProjectRoles { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates the project role's name and description. You must include both a name and a description in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback: Callback, - ): Promise; - /** - * Updates the project role's name and description. You must include both a name and a description in the request. + * Updates the project role's name and description. You must include both a name and a description in the request. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback?: never, - ): Promise; - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - ): Promise { - const config: Request = { + async fullyUpdateProjectRole(parameters: FullyUpdateProjectRoleParameters) { + const request: Request = { url: `/rest/api/2/role/${parameters.id}`, method: 'PUT', body: { @@ -372,39 +221,6 @@ export class ProjectRoles { }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in - * use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRole( - parameters: Parameters.DeleteProjectRole | string, - callback: Callback, - ): Promise; - /** - * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in - * use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRole(parameters: Parameters.DeleteProjectRole | string, callback?: never): Promise; - async deleteProjectRole(parameters: Parameters.DeleteProjectRole | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/role/${id}`, - method: 'DELETE', - query: { - swap: typeof parameters !== 'string' ? parameters.swap : undefined, - }, - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectTemplates.ts b/src/version2/projectTemplates.ts index 699933bdbd..d63d84e300 100644 --- a/src/version2/projectTemplates.ts +++ b/src/version2/projectTemplates.ts @@ -1,67 +1,123 @@ -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { CreateProjectWithCustomTemplateParameters } from './parameters/createProjectWithCustomTemplateParameters'; +import type { EditTemplateParameters } from './parameters/editTemplateParameters'; +import type { LiveTemplateParameters } from './parameters/liveTemplateParameters'; +import type { RemoveTemplateParameters } from './parameters/removeTemplateParameters'; +import type { SaveTemplateParameters } from './parameters/saveTemplateParameters'; export class ProjectTemplates { constructor(private client: Client) {} - /** - * Creates a project based on a custom template provided in the request. - * - * The request body should contain the project details and the capabilities that comprise the project: - * - * - `details` - represents the project details settings - * - `template` - represents a list of capabilities responsible for creating specific parts of a project - * - * A capability is defined as a unit of configuration for the project you want to create. - * - * This operation is: + * Creates a project based on a custom template provided in the request. * * - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `Location` link in the response header to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * _**Note: This API is only supported for Jira Enterprise edition.**_ + * - The request body should contain the project details and the capabilities that comprise the project: + * - + * - - `details` - represents the project details settings + * - - `template` - represents a list of capabilities responsible for creating specific parts of a project + * - + * - A capability is defined as a unit of configuration for the project you want to create. + * - + * - This operation is: + * - + * - - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `Location` link in the response header to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * - + * - _**Note: This API is only supported for Jira Enterprise edition.**_ */ - async createProjectWithCustomTemplate( - parameters: Parameters.CreateProjectWithCustomTemplate | undefined, - callback: Callback, - ): Promise; + async createProjectWithCustomTemplate(parameters: CreateProjectWithCustomTemplateParameters) { + const request: Request = { + url: '/rest/api/2/project-template', + method: 'POST', + body: { + details: parameters.details, + template: parameters.template, + }, + }; + + return this.client.sendRequest(request); + } + /** - * Creates a project based on a custom template provided in the request. - * - * The request body should contain the project details and the capabilities that comprise the project: + * Edit custom template * * - * - `details` - represents the project details settings - * - `template` - represents a list of capabilities responsible for creating specific parts of a project - * - * A capability is defined as a unit of configuration for the project you want to create. + * - This API endpoint allows you to edit an existing customised template. + * - + * - _**Note: Custom Templates are only supported for Jira Enterprise edition.**_ + */ + async editTemplate(parameters: EditTemplateParameters) { + const request: Request = { + url: '/rest/api/2/project-template/edit-template', + method: 'PUT', + body: { + templateDescription: parameters.templateDescription, + templateGenerationOptions: parameters.templateGenerationOptions, + templateKey: parameters.templateKey, + templateName: parameters.templateName, + }, + }; + + return this.client.sendRequest(request); + } + + /** + * Get custom template * * - * This operation is: + * - This API endpoint allows you to get a live custom project template details by either templateKey or projectId + * - + * - _**Note: Custom Templates are only supported for Jira Enterprise edition.**_ + */ + async liveTemplate(parameters: LiveTemplateParameters) { + const request: Request = { + url: '/rest/api/2/project-template/live-template', + method: 'GET', + query: { + projectId: parameters.projectId, + templateKey: parameters.templateKey, + }, + }; + + return this.client.sendRequest(request); + } + + /** + * Remove custom template * * - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `Location` link in the response header to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * - This API endpoint allows you to remove a specified customised template + * - + * - _**Note: Custom Templates are only supported for Jira Enterprise edition.**_ + */ + async removeTemplate(parameters: RemoveTemplateParameters) { + const request: Request = { + url: '/rest/api/2/project-template/remove-template', + method: 'DELETE', + query: { + templateKey: parameters.templateKey, + }, + }; + + return this.client.sendRequest(request); + } + + /** + * Save custom template * * - * _**Note: This API is only supported for Jira Enterprise edition.**_ + * - This API endpoint allows you to save a customised template + * - + * - _**Note: Custom Templates are only supported for Jira Enterprise edition.**_ */ - async createProjectWithCustomTemplate( - parameters?: Parameters.CreateProjectWithCustomTemplate, - callback?: never, - ): Promise; - async createProjectWithCustomTemplate( - parameters?: Parameters.CreateProjectWithCustomTemplate, - ): Promise { - const config: Request = { - url: '/rest/api/2/project-template', + async saveTemplate(parameters: SaveTemplateParameters) { + const request: Request = { + url: '/rest/api/2/project-template/save-template', method: 'POST', body: { - details: parameters?.details, - template: parameters?.template, + templateDescription: parameters.templateDescription, + templateFromProjectRequest: parameters.templateFromProjectRequest, + templateName: parameters.templateName, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectTypes.ts b/src/version2/projectTypes.ts index ee178cfefd..e8ccfca23e 100644 --- a/src/version2/projectTypes.ts +++ b/src/version2/projectTypes.ts @@ -1,117 +1,65 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetProjectTypeByKeyParameters } from './parameters/getProjectTypeByKeyParameters'; +import type { GetAccessibleProjectTypeByKeyParameters } from './parameters/getAccessibleProjectTypeByKeyParameters'; export class ProjectTypes { constructor(private client: Client) {} - /** * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid - * license for each type. - * - * This operation can be accessed anonymously. + * license for each type. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getAllProjectTypes(callback: Callback): Promise; - /** - * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid - * license for each type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllProjectTypes(callback?: never): Promise; - async getAllProjectTypes(): Promise { - const config: Request = { + async getAllProjectTypes() { + const request: Request = { url: '/rest/api/2/project/type', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ - async getAllAccessibleProjectTypes(callback: Callback): Promise; - /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ - async getAllAccessibleProjectTypes(callback?: never): Promise; - async getAllAccessibleProjectTypes(): Promise { - const config: Request = { + async getAllAccessibleProjectTypes() { + const request: Request = { url: '/rest/api/2/project/type/accessible', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback: Callback, - ): Promise; - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback?: never, - ): Promise; - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - ): Promise { - const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; - - const config: Request = { - url: `/rest/api/2/project/type/${projectTypeKey}`, + async getProjectTypeByKey(parameters: GetProjectTypeByKeyParameters) { + const request: Request = { + url: `/rest/api/2/project/type/${parameters.projectTypeKey}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback: Callback, - ): Promise; - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback?: never, - ): Promise; - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - ): Promise { - const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; - - const config: Request = { - url: `/rest/api/2/project/type/${projectTypeKey}/accessible`, + async getAccessibleProjectTypeByKey(parameters: GetAccessibleProjectTypeByKeyParameters) { + const request: Request = { + url: `/rest/api/2/project/type/${parameters.projectTypeKey}/accessible`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projectVersions.ts b/src/version2/projectVersions.ts index 12031f7233..5deb5a4c87 100644 --- a/src/version2/projectVersions.ts +++ b/src/version2/projectVersions.ts @@ -1,127 +1,82 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetProjectVersionsPaginatedParameters } from './parameters/getProjectVersionsPaginatedParameters'; +import type { GetProjectVersionsParameters } from './parameters/getProjectVersionsParameters'; +import type { CreateVersionParameters } from './parameters/createVersionParameters'; +import type { GetVersionParameters } from './parameters/getVersionParameters'; +import type { UpdateVersionParameters } from './parameters/updateVersionParameters'; +import type { MergeVersionsParameters } from './parameters/mergeVersionsParameters'; +import type { MoveVersionParameters } from './parameters/moveVersionParameters'; +import type { GetVersionRelatedIssuesParameters } from './parameters/getVersionRelatedIssuesParameters'; +import type { GetRelatedWorkParameters } from './parameters/getRelatedWorkParameters'; +import type { CreateRelatedWorkParameters } from './parameters/createRelatedWorkParameters'; +import type { UpdateRelatedWorkParameters } from './parameters/updateRelatedWorkParameters'; +import type { DeleteAndReplaceVersionParameters } from './parameters/deleteAndReplaceVersionParameters'; +import type { GetVersionUnresolvedIssuesParameters } from './parameters/getVersionUnresolvedIssuesParameters'; +import type { DeleteRelatedWorkParameters } from './parameters/deleteRelatedWorkParameters'; export class ProjectVersions { constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * versions in a project. See the [Get project versions](#api-rest-api-2-project-projectIdOrKey-versions-get) resource - * if you want to get a full list of versions without pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback: Callback, - ): Promise; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all * versions in a project. See the [Get project versions](#api-rest-api-2-project-projectIdOrKey-versions-get) resource - * if you want to get a full list of versions without pagination. - * - * This operation can be accessed anonymously. + * if you want to get a full list of versions without pagination. * * - * **[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. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ - async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback?: never, - ): Promise; - async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}/version`, + async getProjectVersionsPaginated(parameters: GetProjectVersionsPaginatedParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/version`, method: 'GET', query: { - 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, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + orderBy: parameters.orderBy, + query: parameters.query, + status: parameters.status, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns all versions in a project. The response is not paginated. Use [Get project versions * paginated](#api-rest-api-2-project-projectIdOrKey-version-get) if you want to get the versions in a project with - * pagination. + * pagination. * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ - async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback: Callback, - ): Promise; - /** - * Returns all versions in a project. The response is not paginated. Use [Get project versions - * paginated](#api-rest-api-2-project-projectIdOrKey-version-get) if you want to get the versions in a project with - * pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback?: never, - ): Promise; - async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}/versions`, + async getProjectVersions(parameters: GetProjectVersionsParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/versions`, method: 'GET', query: { - expand: typeof parameters !== 'string' ? parameters.expand : undefined, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project the version is added to. - */ - async createVersion(parameters: Parameters.CreateVersion, callback: Callback): Promise; - /** - * Creates a project version. - * - * This operation can be accessed anonymously. + * Creates a project version. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project the version is added to. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the version is added to. */ - async createVersion(parameters: Parameters.CreateVersion, callback?: never): Promise; - async createVersion(parameters: Parameters.CreateVersion): Promise { - const config: Request = { + async createVersion(parameters: CreateVersionParameters) { + const request: Request = { url: '/rest/api/2/version', method: 'POST', body: { @@ -136,6 +91,7 @@ export class ProjectVersions { name: parameters.name, operations: parameters.operations, overdue: parameters.overdue, + project: parameters.project, projectId: parameters.projectId, releaseDate: parameters.releaseDate, released: parameters.released, @@ -146,143 +102,101 @@ export class ProjectVersions { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. - */ - async getVersion( - parameters: Parameters.GetVersion | string, - callback: Callback, - ): Promise; - /** - * Returns a project version. - * - * This operation can be accessed anonymously. + * Returns a project version. * * - * **[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. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * version. */ - async getVersion(parameters: Parameters.GetVersion | string, callback?: never): Promise; - async getVersion(parameters: Parameters.GetVersion | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/version/${id}`, + async getVersion(parameters: GetVersionParameters) { + const request: Request = { + url: `/rest/api/2/version/${parameters.id}`, method: 'GET', query: { - expand: typeof parameters !== 'string' ? parameters.expand : undefined, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async updateVersion(parameters: Parameters.UpdateVersion, callback: Callback): Promise; - /** - * Updates a project version. - * - * This operation can be accessed anonymously. + * Updates a project version. * * - * **[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. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. */ - async updateVersion(parameters: Parameters.UpdateVersion, callback?: never): Promise; - async updateVersion(parameters: Parameters.UpdateVersion): Promise { - const config: Request = { + async updateVersion(parameters: UpdateVersionParameters) { + const request: Request = { url: `/rest/api/2/version/${parameters.id}`, method: 'PUT', body: { approvers: parameters.approvers, + archived: parameters.archived, + description: parameters.description, driver: parameters.driver, expand: parameters.expand, - description: parameters.description, + id: parameters.id, + issuesStatusForFixVersion: parameters.issuesStatusForFixVersion, + moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, name: parameters.name, - archived: parameters.archived, + operations: parameters.operations, + overdue: parameters.overdue, + project: parameters.project, + projectId: parameters.projectId, + releaseDate: parameters.releaseDate, released: parameters.released, + self: parameters.self, startDate: parameters.startDate, - releaseDate: parameters.releaseDate, - projectId: parameters.projectId, - moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, + userReleaseDate: parameters.userReleaseDate, + userStartDate: parameters.userStartDate, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any - * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. - * - * Consider using [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) instead. This resource - * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async mergeVersions(parameters: Parameters.MergeVersions, callback: Callback): Promise; - /** - * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any - * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. - * - * Consider using [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) instead. This resource - * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. * + * + * - Consider using [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) instead. This resource + * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. */ - async mergeVersions(parameters: Parameters.MergeVersions, callback?: never): Promise; - async mergeVersions(parameters: Parameters.MergeVersions): Promise { - const config: Request = { + async mergeVersions(parameters: MergeVersionsParameters) { + const request: Request = { url: `/rest/api/2/version/${parameters.id}/mergeto/${parameters.moveIssuesTo}`, method: 'PUT', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. - * - * This operation can be accessed anonymously. + * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. */ - async moveVersion(parameters: Parameters.MoveVersion, callback: Callback): Promise; - /** - * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async moveVersion(parameters: Parameters.MoveVersion, callback?: never): Promise; - async moveVersion(parameters: Parameters.MoveVersion): Promise { - const config: Request = { + async moveVersion(parameters: MoveVersionParameters) { + const request: Request = { url: `/rest/api/2/version/${parameters.id}/move`, method: 'POST', body: { @@ -291,119 +205,61 @@ export class ProjectVersions { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the following counts for a version: - * - * - Number of issues where the `fixVersion` is set to the version. - * - Number of issues where the `affectedVersion` is set to the version. - * - Number of issues where a version custom field is set to the version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. + * Returns the following counts for a version: * + * + * - - Number of issues where the `fixVersion` is set to the version. + * - - Number of issues where the `affectedVersion` is set to the version. + * - - Number of issues where a version custom field is set to the version. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. */ - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback: Callback, - ): Promise; - /** - * Returns the following counts for a version: - * - * - Number of issues where the `fixVersion` is set to the version. - * - Number of issues where the `affectedVersion` is set to the version. - * - Number of issues where a version custom field is set to the version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback?: never, - ): Promise; - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/version/${id}/relatedIssueCounts`, + async getVersionRelatedIssues(parameters: GetVersionRelatedIssuesParameters) { + const request: Request = { + url: `/rest/api/2/version/${parameters.id}/relatedIssueCounts`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * Returns related work items for the given version id. * * - * **[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. + * - 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): Promise { - const config: Request = { + async getRelatedWork(parameters: GetRelatedWorkParameters) { + const request: Request = { url: `/rest/api/2/version/${parameters.id}/relatedwork`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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. + * 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): Promise { - const config: Request = { + async createRelatedWork(parameters: CreateRelatedWorkParameters) { + const request: Request = { url: `/rest/api/2/version/${parameters.id}/relatedwork`, method: 'POST', body: { @@ -415,41 +271,22 @@ export class ProjectVersions { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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. + * 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): Promise { - const config: Request = { + async updateRelatedWork(parameters: UpdateRelatedWorkParameters) { + const request: Request = { url: `/rest/api/2/version/${parameters.id}/relatedwork`, method: 'PUT', body: { @@ -461,46 +298,26 @@ export class ProjectVersions { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a project version. - * - * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, - * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of - * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are - * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version - * being deleted. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + * Deletes a project version. * + * + * - Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, + * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of + * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are + * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the + * version being deleted. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. */ - async deleteAndReplaceVersion( - parameters: Parameters.DeleteAndReplaceVersion, - callback: Callback, - ): Promise; - /** - * Deletes a project version. - * - * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, - * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of - * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are - * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version - * being deleted. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async deleteAndReplaceVersion(parameters: Parameters.DeleteAndReplaceVersion, callback?: never): Promise; - async deleteAndReplaceVersion(parameters: Parameters.DeleteAndReplaceVersion): Promise { - const config: Request = { + async deleteAndReplaceVersion(parameters: DeleteAndReplaceVersionParameters) { + const request: Request = { url: `/rest/api/2/version/${parameters.id}/removeAndSwap`, method: 'POST', body: { @@ -510,74 +327,42 @@ export class ProjectVersions { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns counts of the issues and unresolved issues for the project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback: Callback, - ): Promise; - /** - * Returns counts of the issues and unresolved issues for the project version. - * - * This operation can be accessed anonymously. + * Returns counts of the issues and unresolved issues for the project version. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. */ - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback?: never, - ): Promise; - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/version/${id}/unresolvedIssueCount`, + async getVersionUnresolvedIssues(parameters: GetVersionUnresolvedIssuesParameters) { + const request: Request = { + url: `/rest/api/2/version/${parameters.id}/unresolvedIssueCount`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * 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): Promise { - const config: Request = { + async deleteRelatedWork(parameters: DeleteRelatedWorkParameters) { + const request: Request = { url: `/rest/api/2/version/${parameters.versionId}/relatedwork/${parameters.relatedWorkId}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/projects.ts b/src/version2/projects.ts index b16d96edb9..f52ed2aebb 100644 --- a/src/version2/projects.ts +++ b/src/version2/projects.ts @@ -1,68 +1,77 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { CreateProjectParameters } from './parameters/createProjectParameters'; +import type { GetRecentParameters } from './parameters/getRecentParameters'; +import type { SearchProjectsParameters } from './parameters/searchProjectsParameters'; +import type { DeleteProjectParameters } from './parameters/deleteProjectParameters'; +import type { GetProjectParameters } from './parameters/getProjectParameters'; +import type { UpdateProjectParameters } from './parameters/updateProjectParameters'; +import type { ArchiveProjectParameters } from './parameters/archiveProjectParameters'; +import type { DeleteProjectAsynchronouslyParameters } from './parameters/deleteProjectAsynchronouslyParameters'; +import type { RestoreParameters } from './parameters/restoreParameters'; +import type { GetAllStatusesParameters } from './parameters/getAllStatusesParameters'; +import type { GetHierarchyParameters } from './parameters/getHierarchyParameters'; +import type { GetNotificationSchemeForProjectParameters } from './parameters/getNotificationSchemeForProjectParameters'; export class Projects { constructor(private client: Client) {} - - /** - * Creates a project based on a project type template, as shown in the following table: - * - * | Project Type Key | Project Template Key | - * | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | - * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-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: - * - * - Jira Core, the default, enables `business` projects. - * - Jira Service Management enables `service_desk` projects. - * - Jira Software enables `software` projects. - * - * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the - * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > - * **Apps** > **Finding new apps**. For more information, see [ Managing - * add-ons](https://confluence.atlassian.com/x/S31NLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProject( - parameters: Parameters.CreateProject, - callback: Callback, - ): Promise; /** - * Creates a project based on a project type template, as shown in the following table: - * - * | Project Type Key | Project Template Key | - * | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | - * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-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: - * - * - Jira Core, the default, enables `business` projects. - * - Jira Service Management enables `service_desk` projects. - * - Jira Software enables `software` projects. - * - * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the - * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > - * **Apps** > **Finding new apps**. For more information, see [ Managing - * add-ons](https://confluence.atlassian.com/x/S31NLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * 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-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: + * - + * - - Jira Core, the default, enables `business` projects. + * - - Jira Service Management enables `service_desk` projects. + * - - Jira Software enables `software` projects. + * - + * - To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the + * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > + * **Apps** > **Finding new apps**. For more information, see [ Managing + * add-ons](https://confluence.atlassian.com/x/S31NLg). + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createProject( - parameters: Parameters.CreateProject, - callback?: never, - ): Promise; - async createProject(parameters: Parameters.CreateProject): Promise { - const config: Request = { + async createProject(parameters: CreateProjectParameters) { + const request: Request = { url: '/rest/api/2/project', method: 'POST', body: { @@ -75,6 +84,7 @@ export class Projects { issueTypeScheme: parameters.issueTypeScheme, issueTypeScreenScheme: parameters.issueTypeScreenScheme, key: parameters.key, + lead: parameters.lead, leadAccountId: parameters.leadAccountId, name: parameters.name, notificationScheme: parameters.notificationScheme, @@ -86,168 +96,126 @@ export class Projects { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getRecent( - parameters: Parameters.GetRecent | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * - + * - - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getRecent(parameters?: Parameters.GetRecent, callback?: never): Promise; - async getRecent(parameters?: Parameters.GetRecent): Promise { - const config: Request = { + async getRecent(parameters: GetRecentParameters) { + const request: Request = { url: '/rest/api/2/project/recent', method: 'GET', query: { - expand: parameters?.expand, - properties: parameters?.properties, + expand: parameters.expand, + properties: parameters.properties, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * projects visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjects( - parameters: Parameters.SearchProjects | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * projects visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * projects visible to the user. * + * + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * - + * - - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async searchProjects(parameters?: Parameters.SearchProjects, callback?: never): Promise; - async searchProjects(parameters?: Parameters.SearchProjects): Promise { - const config: Request = { + async searchProjects(parameters: SearchProjectsParameters) { + const request: Request = { url: '/rest/api/2/project/search', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - orderBy: parameters?.orderBy, - id: parameters?.id, - keys: parameters?.keys, - query: parameters?.query, - typeKey: parameters?.typeKey, - categoryId: parameters?.categoryId, - action: parameters?.action, - expand: parameters?.expand, - status: parameters?.status, - properties: parameters?.properties, - propertyQuery: parameters?.propertyQuery, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + orderBy: parameters.orderBy, + id: parameters.id, + keys: parameters.keys, + query: parameters.query, + typeKey: parameters.typeKey, + categoryId: parameters.categoryId, + action: parameters.action, + expand: parameters.expand, + status: parameters.status, + properties: parameters.properties, + propertyQuery: parameters.propertyQuery, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. - * - * This operation can be accessed anonymously. + * Deletes 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. + * - You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. + * To restore a project, use the Jira UI. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getProject( - parameters: Parameters.GetProject | string, - callback: Callback, - ): Promise; + async deleteProject(parameters: DeleteProjectParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}`, + method: 'DELETE', + query: { + enableUndo: parameters.enableUndo, + }, + }; + + return this.client.sendRequest(request); + } + /** - * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. + * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ - async getProject(parameters: Parameters.GetProject | string, callback?: never): Promise; - async getProject(parameters: Parameters.GetProject | string): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}`, + async getProject(parameters: GetProjectParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}`, method: 'GET', query: { - expand: typeof parameters !== 'string' ? parameters.expand : undefined, - properties: typeof parameters !== 'string' ? parameters.properties : undefined, + expand: parameters.expand, + properties: parameters.properties, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. - * - * All parameters are optional in the body of the request. Schemes will only be updated if they are included in the - * request, any omitted schemes will be left unchanged. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). is only needed when changing the - * schemes or project key. Otherwise you will only need _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) - */ - async updateProject(parameters: Parameters.UpdateProject, callback: Callback): Promise; - /** - * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. - * - * All parameters are optional in the body of the request. Schemes will only be updated if they are included in the - * request, any omitted schemes will be left unchanged. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). is only needed when changing the - * schemes or project key. Otherwise you will only need _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) + * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. * + * + * - All parameters are optional in the body of the request. Schemes will only be updated if they are included in the + * request, any omitted schemes will be left unchanged. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). is only needed when changing + * the schemes or project key. Otherwise you will only need _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) */ - async updateProject(parameters: Parameters.UpdateProject, callback?: never): Promise; - async updateProject(parameters: Parameters.UpdateProject): Promise { - const config: Request = { + async updateProject(parameters: UpdateProjectParameters) { + const request: Request = { url: `/rest/api/2/project/${parameters.projectIdOrKey}`, method: 'PUT', query: { @@ -260,282 +228,132 @@ 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); - } - - /** - * Deletes a project. - * - * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. - * To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProject(parameters: Parameters.DeleteProject | string, callback: Callback): Promise; - /** - * Deletes a project. - * - * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. - * To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProject(parameters: Parameters.DeleteProject | string, callback?: never): Promise; - async deleteProject(parameters: Parameters.DeleteProject | string): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}`, - method: 'DELETE', - query: { - enableUndo: typeof parameters !== 'string' ? parameters.enableUndo : undefined, - }, - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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. + * and then delete it. To restore a project, use the Jira UI. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async archiveProject(parameters: Parameters.ArchiveProject | string, callback: Callback): Promise; - /** - * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project - * and then delete it. To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async archiveProject(parameters: Parameters.ArchiveProject | string, callback?: never): Promise; - async archiveProject(parameters: Parameters.ArchiveProject | string): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}/archive`, + async archiveProject(parameters: ArchiveProjectParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/archive`, method: 'POST', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a project asynchronously. - * - * This operation is: - * - * - Transactional, that is, if part of the delete fails the project is not deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback: Callback, - ): Promise; - /** - * Deletes a project asynchronously. - * - * This operation is: - * - * - Transactional, that is, if part of the delete fails the project is not deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Deletes a project asynchronously. * + * + * - This operation is: + * - + * - - Transactional, that is, if part of the delete fails the project is not deleted. + * - - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback?: never, - ): Promise; - async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}/delete`, + async deleteProjectAsynchronously(parameters: DeleteProjectAsynchronouslyParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/delete`, method: 'POST', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Restores a project that has been archived or placed in the Jira recycle bin. + * Restores a project that has been archived or placed in the Jira recycle bin. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg)for Company managed projects. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project for Team managed projects. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg)for Company managed projects. + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project for Team managed projects. */ - async restore(parameters: Parameters.Restore | string, callback: Callback): Promise; - /** - * Restores a project that has been archived or placed in the Jira recycle bin. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg)for Company managed projects. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project for Team managed projects. - */ - async restore(parameters: Parameters.Restore | string, callback?: never): Promise; - async restore(parameters: Parameters.Restore | string): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}/restore`, + async restore(parameters: RestoreParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/restore`, method: 'POST', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of - * valid issue types and each issue type has a set of valid statuses. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback: Callback, - ): Promise; - /** - * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of - * valid issue types and each issue type has a set of valid statuses. + * valid issue types and each issue type has a set of valid statuses. * * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ - async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback?: never, - ): Promise; - async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: Request = { - url: `/rest/api/2/project/${projectIdOrKey}/statuses`, + async getAllStatuses(parameters: GetAllStatusesParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/statuses`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Get the issue type hierarchy for a next-gen project. - * - * The issue type hierarchy for a project consists of: - * - * - _Epic_ at level 1 (optional). - * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these - * issue types are used to break down the content of an epic. - * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. - * Issues based on a level -1 issue type must have a parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback: Callback, - ): Promise; - /** - * Get the issue type hierarchy for a next-gen project. - * - * The issue type hierarchy for a project consists of: - * - * - _Epic_ at level 1 (optional). - * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these - * issue types are used to break down the content of an epic. - * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. - * Issues based on a level -1 issue type must have a parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * Get the issue type hierarchy for a next-gen project. * + * + * - The issue type hierarchy for a project consists of: + * - + * - - _Epic_ at level 1 (optional). + * - - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these + * issue types are used to break down the content of an epic. + * - - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. + * Issues based on a level -1 issue type must have a parent issue. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. */ - async getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback?: never, - ): Promise; - async getHierarchy( - parameters: Parameters.GetHierarchy | string, - ): Promise { - const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; - - const config: Request = { - url: `/rest/api/2/project/${projectId}/hierarchy`, + async getHierarchy(parameters: GetHierarchyParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectId}/hierarchy`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Gets a [notification scheme](https://confluence.atlassian.com/x/8YdKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject | string, - callback: Callback, - ): Promise; - /** - * Gets a [notification scheme](https://confluence.atlassian.com/x/8YdKLg) associated with the project. + * Gets a [notification scheme](https://confluence.atlassian.com/x/8YdKLg) associated with the project. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg). */ - async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject | string, - callback?: never, - ): Promise; - async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject | string, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: Request = { - url: `/rest/api/2/project/${projectKeyOrId}/notificationscheme`, + async getNotificationSchemeForProject(parameters: GetNotificationSchemeForProjectParameters) { + const request: Request = { + url: `/rest/api/2/project/${parameters.projectKeyOrId}/notificationscheme`, method: 'GET', query: { - expand: typeof parameters !== 'string' ? parameters.expand : undefined, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/models/actorInput.ts b/src/version2/schemas/actorInput.ts similarity index 75% rename from src/version2/models/actorInput.ts rename to src/version2/schemas/actorInput.ts index 8a28e8b5a9..24353bd1e4 100644 --- a/src/version2/models/actorInput.ts +++ b/src/version2/schemas/actorInput.ts @@ -1,19 +1,23 @@ -export interface ActorInput { +import { z } from 'zod'; + +export const ActorInputSchema = z.object({ /** * The name of the group to add as a default actor. This parameter cannot be used with the `groupId` parameter. As a * group's name can change,use of `groupId` is recommended. This parameter accepts a comma-separated list. For * example, `"group":["project-admin", "jira-developers"]`. */ - group?: string[]; + group: z.array(z.string()).optional(), /** * The ID of the group to add as a default actor. This parameter cannot be used with the `group` parameter This * parameter accepts a comma-separated list. For example, `"groupId":["77f6ab39-e755-4570-a6ae-2d7a8df0bcb8", * "0c011f85-69ed-49c4-a801-3b18d0f771bc"]`. */ - groupId?: string[]; + groupId: z.array(z.string()).optional(), /** * The account IDs of the users to add as default actors. This parameter accepts a comma-separated list. For example, * `"user":["5b10a2844c20165700ede21g", "5b109f2e9729b51b54dc274d"]`. */ - user?: string[]; -} + user: z.array(z.string()).optional(), +}); + +export type ActorInput = z.infer; diff --git a/src/version2/schemas/actorsMap.ts b/src/version2/schemas/actorsMap.ts new file mode 100644 index 0000000000..f6bc488769 --- /dev/null +++ b/src/version2/schemas/actorsMap.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const ActorsMapSchema = z.object({ + /** + * The name of the group to add. This parameter cannot be used with the `groupId` parameter. As a group's name can + * change, use of `groupId` is recommended. + */ + group: z.array(z.string()).optional(), + /** The ID of the group to add. This parameter cannot be used with the `group` parameter. */ + groupId: z.array(z.string()).optional(), + /** The user account ID of the user to add. */ + user: z.array(z.string()).optional(), +}); + +export type ActorsMap = z.infer; diff --git a/src/version2/schemas/addAtlassianTeamRequest.ts b/src/version2/schemas/addAtlassianTeamRequest.ts new file mode 100644 index 0000000000..0693dbfeb4 --- /dev/null +++ b/src/version2/schemas/addAtlassianTeamRequest.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const AddAtlassianTeamRequestSchema = z.object({ + /** The capacity for the Atlassian team. */ + capacity: z.number().optional(), + /** The Atlassian team ID. */ + id: z.string(), + /** The ID of the issue source for the Atlassian team. */ + issueSourceId: z.number().int().optional(), + /** The planning style for the Atlassian team. This must be "Scrum" or "Kanban". */ + planningStyle: z.enum(['Scrum', 'Kanban']), + /** The sprint length for the Atlassian team. */ + sprintLength: z.number().int().optional(), +}); + +export type AddAtlassianTeamRequest = z.infer; diff --git a/src/version2/schemas/addField.ts b/src/version2/schemas/addField.ts new file mode 100644 index 0000000000..b4e1ec72e4 --- /dev/null +++ b/src/version2/schemas/addField.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const AddFieldSchema = z.object({ + /** The ID of the field to add. */ + fieldId: z.string(), +}); + +export type AddField = z.infer; diff --git a/src/version2/schemas/addGroup.ts b/src/version2/schemas/addGroup.ts new file mode 100644 index 0000000000..292211837d --- /dev/null +++ b/src/version2/schemas/addGroup.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const AddGroupSchema = z.object({ + /** The name of the group. */ + name: z.string(), +}); + +export type AddGroup = z.infer; diff --git a/src/version2/schemas/addNotificationsDetails.ts b/src/version2/schemas/addNotificationsDetails.ts new file mode 100644 index 0000000000..29acf171af --- /dev/null +++ b/src/version2/schemas/addNotificationsDetails.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { NotificationSchemeEventDetailsSchema } from './notificationSchemeEventDetails'; + +/** Details of notifications which should be added to the notification scheme. */ +export const AddNotificationsDetailsSchema = z.object({ + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents: z.array(NotificationSchemeEventDetailsSchema), +}); + +export type AddNotificationsDetails = z.infer; diff --git a/src/version2/schemas/addSecuritySchemeLevelsRequest.ts b/src/version2/schemas/addSecuritySchemeLevelsRequest.ts new file mode 100644 index 0000000000..2899190a0c --- /dev/null +++ b/src/version2/schemas/addSecuritySchemeLevelsRequest.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { SecuritySchemeLevelSchema } from './securitySchemeLevel'; + +export const AddSecuritySchemeLevelsRequestSchema = z.object({ + /** The list of scheme levels which should be added to the security scheme. */ + levels: z.array(SecuritySchemeLevelSchema).optional(), +}); + +export type AddSecuritySchemeLevelsRequest = z.infer; diff --git a/src/version2/schemas/announcementBannerConfiguration.ts b/src/version2/schemas/announcementBannerConfiguration.ts new file mode 100644 index 0000000000..46b8d82ac3 --- /dev/null +++ b/src/version2/schemas/announcementBannerConfiguration.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Announcement banner configuration. */ +export const AnnouncementBannerConfigurationSchema = z.object({ + /** Hash of the banner data. The client detects updates by comparing hash IDs. */ + hashId: z.string().optional(), + /** Flag indicating if the announcement banner can be dismissed by the user. */ + isDismissible: z.boolean().optional(), + /** Flag indicating if the announcement banner is enabled or not. */ + isEnabled: z.boolean().optional(), + /** The text on the announcement banner. */ + message: z.string().optional(), + /** Visibility of the announcement banner. */ + visibility: z.enum(['PUBLIC', 'PRIVATE']).optional(), +}); + +export type AnnouncementBannerConfiguration = z.infer; diff --git a/src/version2/schemas/announcementBannerConfigurationUpdate.ts b/src/version2/schemas/announcementBannerConfigurationUpdate.ts new file mode 100644 index 0000000000..deff3080ab --- /dev/null +++ b/src/version2/schemas/announcementBannerConfigurationUpdate.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Configuration of the announcement banner. */ +export const AnnouncementBannerConfigurationUpdateSchema = z.object({ + /** Flag indicating if the announcement banner can be dismissed by the user. */ + isDismissible: z.boolean().optional(), + /** Flag indicating if the announcement banner is enabled or not. */ + isEnabled: z.boolean().optional(), + /** The text on the announcement banner. */ + message: z.string().optional(), + /** Visibility of the announcement banner. Can be public or private. */ + visibility: z.string().optional(), +}); + +export type AnnouncementBannerConfigurationUpdate = z.infer; diff --git a/src/version2/schemas/appWorkflowTransitionRule.ts b/src/version2/schemas/appWorkflowTransitionRule.ts new file mode 100644 index 0000000000..3ca8fe8e8a --- /dev/null +++ b/src/version2/schemas/appWorkflowTransitionRule.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { RuleConfigurationSchema } from './ruleConfiguration'; + +/** A workflow transition rule. */ +export const AppWorkflowTransitionRuleSchema = z.object({ + configuration: RuleConfigurationSchema, + /** The ID of the transition rule. */ + id: z.string(), + /** The key of the rule, as defined in the Connect or the Forge app descriptor. */ + key: z.string(), + transition: z.unknown().optional(), +}); + +export type AppWorkflowTransitionRule = z.infer; diff --git a/src/version2/schemas/application.ts b/src/version2/schemas/application.ts new file mode 100644 index 0000000000..30ac9801e1 --- /dev/null +++ b/src/version2/schemas/application.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** The application the linked item is in. */ +export const ApplicationSchema = z.object({ + /** + * The name of the application. Used in conjunction with the (remote) object icon title to display a tooltip for the + * link's icon. The tooltip takes the format "[application name] icon title". Blank items are excluded from the + * tooltip title. If both items are blank, the icon tooltop displays as "Web Link". Grouping and sorting of links may + * place links without an application name last. + */ + name: z.string().optional(), + /** The name-spaced type of the application, used by registered rendering apps. */ + type: z.string().optional(), +}); + +export type Application = z.infer; diff --git a/src/version2/schemas/applicationProperty.ts b/src/version2/schemas/applicationProperty.ts new file mode 100644 index 0000000000..e13be0d7d0 --- /dev/null +++ b/src/version2/schemas/applicationProperty.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; + +/** Details of an application property. */ +export const ApplicationPropertySchema = z.object({ + /** The allowed values, if applicable. */ + allowedValues: z.array(z.string()).optional(), + /** The default value of the application property. */ + defaultValue: z.string().optional(), + /** The description of the application property. */ + desc: z.string().optional(), + example: z.string().optional(), + /** The ID of the application property. The ID and key are the same. */ + id: z.string().optional(), + /** The key of the application property. The ID and key are the same. */ + key: z.string().optional(), + /** The name of the application property. */ + name: z.string().optional(), + /** The data type of the application property. */ + type: z.string().optional(), + /** The new value. */ + value: z.string().optional(), +}); + +export type ApplicationProperty = z.infer; diff --git a/src/version2/schemas/applicationRole.ts b/src/version2/schemas/applicationRole.ts new file mode 100644 index 0000000000..80c35d3c5e --- /dev/null +++ b/src/version2/schemas/applicationRole.ts @@ -0,0 +1,41 @@ +import { z } from 'zod'; +import { GroupNameSchema } from './groupName'; + +/** Details of an application role. */ +export const ApplicationRoleSchema = z.object({ + /** + * The groups that are granted default access for this application role. As a group's name can change, use of + * `defaultGroupsDetails` is recommended to identify a groups. + */ + defaultGroups: z.array(z.string()).optional(), + /** The groups that are granted default access for this application role. */ + defaultGroupsDetails: z.array(GroupNameSchema).optional(), + /** Deprecated. */ + defined: z.boolean().optional(), + /** The groups associated with the application role. */ + groupDetails: z.array(GroupNameSchema).optional(), + /** + * The groups associated with the application role. As a group's name can change, use of `groupDetails` is recommended + * to identify a groups. + */ + groups: z.array(z.string()).optional(), + hasUnlimitedSeats: z.boolean().optional(), + /** The key of the application role. */ + key: z.string().optional(), + /** The display name of the application role. */ + name: z.string().optional(), + /** The maximum count of users on your license. */ + numberOfSeats: z.number().int().optional(), + /** Indicates if the application role belongs to Jira platform (`jira-core`). */ + platform: z.boolean().optional(), + /** The count of users remaining on your license. */ + remainingSeats: z.number().int().optional(), + /** Determines whether this application role should be selected by default on user creation. */ + selectedByDefault: z.boolean().optional(), + /** The number of users counting against your license. */ + userCount: z.number().int().optional(), + /** The [type of users](https://confluence.atlassian.com/x/lRW3Ng) being counted against your license. */ + userCountDescription: z.string().optional(), +}); + +export type ApplicationRole = z.infer; diff --git a/src/version2/schemas/approvalConfiguration.ts b/src/version2/schemas/approvalConfiguration.ts new file mode 100644 index 0000000000..e3daf7df75 --- /dev/null +++ b/src/version2/schemas/approvalConfiguration.ts @@ -0,0 +1,33 @@ +import { z } from 'zod'; + +/** The approval configuration of a status within a workflow. Applies only to Jira Service Management approvals. */ +export const ApprovalConfigurationSchema = z.object({ + /** Whether the approval configuration is active. */ + active: z.enum(['true', 'false']), + /** + * 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: z.enum(['number', 'percent', 'numberPerPrincipal']), + /** + * 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: z.string(), + /** A list of roles that should be excluded as possible approvers. */ + exclude: z.array(z.enum(['assignee', 'reporter'])).optional(), + /** The custom field ID of the "Approvers" or "Approver Groups" field. */ + fieldId: z.string(), + /** + * The custom field ID of the field used to pre-populate the Approver field. Only supports the "Affected Services" + * field. + */ + prePopulatedFieldId: z.string().optional(), + /** The numeric ID of the transition to be executed if the request is approved. */ + transitionApproved: z.string(), + /** The numeric ID of the transition to be executed if the request is declined. */ + transitionRejected: z.string(), +}); + +export type ApprovalConfiguration = z.infer; diff --git a/src/version2/schemas/archiveIssueAsyncRequest.ts b/src/version2/schemas/archiveIssueAsyncRequest.ts new file mode 100644 index 0000000000..eff9fcbceb --- /dev/null +++ b/src/version2/schemas/archiveIssueAsyncRequest.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const ArchiveIssueAsyncRequestSchema = z.object({ + jql: z.string().optional(), +}); + +export type ArchiveIssueAsyncRequest = z.infer; diff --git a/src/version2/schemas/archivedIssuesFilterRequest.ts b/src/version2/schemas/archivedIssuesFilterRequest.ts new file mode 100644 index 0000000000..2a0b9061b7 --- /dev/null +++ b/src/version2/schemas/archivedIssuesFilterRequest.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; +import { DateRangeFilterRequestSchema } from './dateRangeFilterRequest'; + +/** Details of a filter for exporting archived issues. */ +export const ArchivedIssuesFilterRequestSchema = z.object({ + /** List archived issues archived by a specified account ID. */ + archivedBy: z.array(z.string()).optional(), + archivedDateRange: DateRangeFilterRequestSchema.optional(), + /** List archived issues with a specified issue type ID. */ + issueTypes: z.array(z.string()).optional(), + /** List archived issues with a specified project key. */ + projects: z.array(z.string()).optional(), + /** List archived issues where the reporter is a specified account ID. */ + reporters: z.array(z.string()).optional(), +}); + +export type ArchivedIssuesFilterRequest = z.infer; diff --git a/src/version2/schemas/associateFieldConfigurationsWithIssueTypesRequest.ts b/src/version2/schemas/associateFieldConfigurationsWithIssueTypesRequest.ts new file mode 100644 index 0000000000..275fcb95d9 --- /dev/null +++ b/src/version2/schemas/associateFieldConfigurationsWithIssueTypesRequest.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { FieldConfigurationToIssueTypeMappingSchema } from './fieldConfigurationToIssueTypeMapping'; + +/** Details of a field configuration to issue type mappings. */ +export const AssociateFieldConfigurationsWithIssueTypesRequestSchema = z.object({ + /** Field configuration to issue type mappings. */ + mappings: z.array(FieldConfigurationToIssueTypeMappingSchema), +}); + +export type AssociateFieldConfigurationsWithIssueTypesRequest = z.infer< + typeof AssociateFieldConfigurationsWithIssueTypesRequestSchema +>; diff --git a/src/version2/schemas/associateSecuritySchemeWithProjectDetails.ts b/src/version2/schemas/associateSecuritySchemeWithProjectDetails.ts new file mode 100644 index 0000000000..7fa4726f95 --- /dev/null +++ b/src/version2/schemas/associateSecuritySchemeWithProjectDetails.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { OldToNewSecurityLevelMappingsBeanSchema } from './oldToNewSecurityLevelMappingsBean'; + +/** Issue security scheme, project, and remapping details. */ +export const AssociateSecuritySchemeWithProjectDetailsSchema = z.object({ + /** The list of scheme levels which should be remapped to new levels of the issue security scheme. */ + oldToNewSecurityLevelMappings: z.array(OldToNewSecurityLevelMappingsBeanSchema).optional(), + /** The ID of the project. */ + projectId: z.string(), + /** The ID of the issue security scheme. Providing null will clear the association with the issue security scheme. */ + schemeId: z.string(), +}); + +export type AssociateSecuritySchemeWithProjectDetails = z.infer; diff --git a/src/version2/schemas/associatedItemBean.ts b/src/version2/schemas/associatedItemBean.ts new file mode 100644 index 0000000000..45975a0f8d --- /dev/null +++ b/src/version2/schemas/associatedItemBean.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details of an item associated with the changed record. */ +export const AssociatedItemBeanSchema = z.object({ + /** The ID of the associated record. */ + id: z.string().optional(), + /** The name of the associated record. */ + name: z.string().optional(), + /** The ID of the associated parent record. */ + parentId: z.string().optional(), + /** The name of the associated parent record. */ + parentName: z.string().optional(), + /** The type of the associated record. */ + typeName: z.string().optional(), +}); + +export type AssociatedItemBean = z.infer; diff --git a/src/version2/schemas/associationContextObject.ts b/src/version2/schemas/associationContextObject.ts new file mode 100644 index 0000000000..3ce58382ef --- /dev/null +++ b/src/version2/schemas/associationContextObject.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** Field association for example PROJECT_ID. */ +export const AssociationContextObjectSchema = z.object({ + identifier: z.object({}).optional(), + type: z.string(), +}); + +export type AssociationContextObject = z.infer; diff --git a/src/version2/schemas/attachment.ts b/src/version2/schemas/attachment.ts new file mode 100644 index 0000000000..f81738f173 --- /dev/null +++ b/src/version2/schemas/attachment.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; + +/** Details about an attachment. */ +export const AttachmentSchema = z.object({ + /** Details of the user who added the attachment. */ + author: z.unknown().optional(), + /** The content of the attachment. */ + content: z.string().optional(), + /** The datetime the attachment was created. */ + created: z.string().datetime().optional(), + /** The file name of the attachment. */ + filename: z.string().optional(), + /** The ID of the attachment. */ + id: z.string().optional(), + /** The MIME type of the attachment. */ + mimeType: z.string().optional(), + /** The URL of the attachment details response. */ + self: z.string().optional(), + /** The size of the attachment. */ + size: z.number().int().optional(), + /** The URL of a thumbnail representing the attachment. */ + thumbnail: z.string().optional(), +}); + +export type Attachment = z.infer; diff --git a/src/version2/schemas/attachmentArchive.ts b/src/version2/schemas/attachmentArchive.ts new file mode 100644 index 0000000000..00662b41fe --- /dev/null +++ b/src/version2/schemas/attachmentArchive.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { AttachmentArchiveEntrySchema } from './attachmentArchiveEntry'; + +export const AttachmentArchiveSchema = z.object({ + entries: z.array(AttachmentArchiveEntrySchema).optional(), + moreAvailable: z.boolean().optional(), + totalEntryCount: z.number().int().optional(), + totalNumberOfEntriesAvailable: z.number().int().optional(), +}); + +export type AttachmentArchive = z.infer; diff --git a/src/version2/schemas/attachmentArchiveEntry.ts b/src/version2/schemas/attachmentArchiveEntry.ts new file mode 100644 index 0000000000..caa82f2f93 --- /dev/null +++ b/src/version2/schemas/attachmentArchiveEntry.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const AttachmentArchiveEntrySchema = z.object({ + abbreviatedName: z.string().optional(), + entryIndex: z.number().int().optional(), + mediaType: z.string().optional(), + name: z.string().optional(), + size: z.number().int().optional(), +}); + +export type AttachmentArchiveEntry = z.infer; diff --git a/src/version2/schemas/attachmentArchiveImpl.ts b/src/version2/schemas/attachmentArchiveImpl.ts new file mode 100644 index 0000000000..879c2a7869 --- /dev/null +++ b/src/version2/schemas/attachmentArchiveImpl.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { AttachmentArchiveEntrySchema } from './attachmentArchiveEntry'; + +export const AttachmentArchiveImplSchema = z.object({ + /** The list of the items included in the archive. */ + entries: z.array(AttachmentArchiveEntrySchema).optional(), + /** The number of items in the archive. */ + totalEntryCount: z.number().int().optional(), +}); + +export type AttachmentArchiveImpl = z.infer; diff --git a/src/version2/schemas/attachmentArchiveItemReadable.ts b/src/version2/schemas/attachmentArchiveItemReadable.ts new file mode 100644 index 0000000000..4f759fc9cc --- /dev/null +++ b/src/version2/schemas/attachmentArchiveItemReadable.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Metadata for an item in an attachment archive. */ +export const AttachmentArchiveItemReadableSchema = z.object({ + /** The position of the item within the archive. */ + index: z.number().int().optional(), + /** The label for the archive item. */ + label: z.string().optional(), + /** The MIME type of the archive item. */ + mediaType: z.string().optional(), + /** The path of the archive item. */ + path: z.string().optional(), + /** The size of the archive item. */ + size: z.string().optional(), +}); + +export type AttachmentArchiveItemReadable = z.infer; diff --git a/src/version2/schemas/attachmentArchiveMetadataReadable.ts b/src/version2/schemas/attachmentArchiveMetadataReadable.ts new file mode 100644 index 0000000000..c94d446177 --- /dev/null +++ b/src/version2/schemas/attachmentArchiveMetadataReadable.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { AttachmentArchiveItemReadableSchema } from './attachmentArchiveItemReadable'; + +/** Metadata for an archive (for example a zip) and its contents. */ +export const AttachmentArchiveMetadataReadableSchema = z.object({ + /** The list of the items included in the archive. */ + entries: z.array(AttachmentArchiveItemReadableSchema).optional(), + /** The ID of the attachment. */ + id: z.number().int().optional(), + /** The MIME type of the attachment. */ + mediaType: z.string().optional(), + /** The name of the archive file. */ + name: z.string().optional(), + /** The number of items included in the archive. */ + totalEntryCount: z.number().int().optional(), +}); + +export type AttachmentArchiveMetadataReadable = z.infer; diff --git a/src/version2/schemas/attachmentMetadata.ts b/src/version2/schemas/attachmentMetadata.ts new file mode 100644 index 0000000000..f4d2e0aa6f --- /dev/null +++ b/src/version2/schemas/attachmentMetadata.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +/** Metadata for an issue attachment. */ +export const AttachmentMetadataSchema = z.object({ + /** Details of the user who attached the file. */ + author: z.unknown().optional(), + /** The URL of the attachment. */ + content: z.string().optional(), + /** The datetime the attachment was created. */ + created: z.string().datetime().optional(), + /** The name of the attachment file. */ + filename: z.string().optional(), + /** The ID of the attachment. */ + id: z.number().int().optional(), + /** The MIME type of the attachment. */ + mimeType: z.string().optional(), + /** Additional properties of the attachment. */ + properties: z.object({}).optional(), + /** The URL of the attachment metadata details. */ + self: z.string().optional(), + /** The size of the attachment. */ + size: z.number().int().optional(), + /** The URL of a thumbnail representing the attachment. */ + thumbnail: z.string().optional(), +}); + +export type AttachmentMetadata = z.infer; diff --git a/src/version2/schemas/attachmentSettings.ts b/src/version2/schemas/attachmentSettings.ts new file mode 100644 index 0000000000..2d0f84abf8 --- /dev/null +++ b/src/version2/schemas/attachmentSettings.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of the instance's attachment settings. */ +export const AttachmentSettingsSchema = z.object({ + /** Whether the ability to add attachments is enabled. */ + enabled: z.boolean().optional(), + /** The maximum size of attachments permitted, in bytes. */ + uploadLimit: z.number().int().optional(), +}); + +export type AttachmentSettings = z.infer; diff --git a/src/version2/schemas/auditRecordBean.ts b/src/version2/schemas/auditRecordBean.ts new file mode 100644 index 0000000000..f091de9c36 --- /dev/null +++ b/src/version2/schemas/auditRecordBean.ts @@ -0,0 +1,33 @@ +import { z } from 'zod'; +import { AssociatedItemBeanSchema } from './associatedItemBean'; +import { ChangedValueBeanSchema } from './changedValueBean'; + +/** An audit record. */ +export const AuditRecordBeanSchema = z.object({ + /** The list of items associated with the changed record. */ + associatedItems: z.array(AssociatedItemBeanSchema).optional(), + /** Deprecated, use `authorAccountId` instead. The key of the user who created the audit record. */ + authorKey: z.string().optional(), + /** + * The category of the audit record. For a list of these categories, see the help article [Auditing in Jira + * applications](https://confluence.atlassian.com/x/noXKM). + */ + category: z.string().optional(), + /** The list of values changed in the record event. */ + changedValues: z.array(ChangedValueBeanSchema).optional(), + /** The date and time on which the audit record was created. */ + created: z.string().datetime().optional(), + /** The description of the audit record. */ + description: z.string().optional(), + /** The event the audit record originated from. */ + eventSource: z.string().optional(), + /** The ID of the audit record. */ + id: z.number().int().optional(), + objectItem: AssociatedItemBeanSchema.optional(), + /** The URL of the computer where the creation of the audit record was initiated. */ + remoteAddress: z.string().optional(), + /** The summary of the audit record. */ + summary: z.string().optional(), +}); + +export type AuditRecordBean = z.infer; diff --git a/src/version2/schemas/auditRecords.ts b/src/version2/schemas/auditRecords.ts new file mode 100644 index 0000000000..611e6a0b32 --- /dev/null +++ b/src/version2/schemas/auditRecords.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { AuditRecordBeanSchema } from './auditRecordBean'; + +/** Container for a list of audit records. */ +export const AuditRecordsSchema = z.object({ + /** The requested or default limit on the number of audit items to be returned. */ + limit: z.number().int().optional(), + /** The number of audit items skipped before the first item in this list. */ + offset: z.number().int().optional(), + /** The list of audit items. */ + records: z.array(AuditRecordBeanSchema).optional(), + /** The total number of audit items returned. */ + total: z.number().int().optional(), +}); + +export type AuditRecords = z.infer; diff --git a/src/version2/schemas/autoCompleteSuggestion.ts b/src/version2/schemas/autoCompleteSuggestion.ts new file mode 100644 index 0000000000..e69e7b51fe --- /dev/null +++ b/src/version2/schemas/autoCompleteSuggestion.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** A field auto-complete suggestion. */ +export const AutoCompleteSuggestionSchema = z.object({ + /** + * The display name of a suggested item. If `fieldValue` or `predicateValue` are provided, the matching text is + * highlighted with the HTML bold tag. + */ + displayName: z.string().optional(), + /** The value of a suggested item. */ + value: z.string().optional(), +}); + +export type AutoCompleteSuggestion = z.infer; diff --git a/src/version2/schemas/autoCompleteSuggestions.ts b/src/version2/schemas/autoCompleteSuggestions.ts new file mode 100644 index 0000000000..0d6326eec5 --- /dev/null +++ b/src/version2/schemas/autoCompleteSuggestions.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { AutoCompleteSuggestionSchema } from './autoCompleteSuggestion'; + +/** The results from a JQL query. */ +export const AutoCompleteSuggestionsSchema = z.object({ + /** The list of suggested item. */ + results: z.array(AutoCompleteSuggestionSchema).optional(), +}); + +export type AutoCompleteSuggestions = z.infer; diff --git a/src/version2/schemas/availableDashboardGadget.ts b/src/version2/schemas/availableDashboardGadget.ts new file mode 100644 index 0000000000..c9c393f40d --- /dev/null +++ b/src/version2/schemas/availableDashboardGadget.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The details of the available dashboard gadget. */ +export const AvailableDashboardGadgetSchema = z.object({ + /** The module key of the gadget type. */ + moduleKey: z.string().optional(), + /** The title of the gadget. */ + title: z.string(), + /** The URI of the gadget type. */ + uri: z.string().optional(), +}); + +export type AvailableDashboardGadget = z.infer; diff --git a/src/version2/schemas/availableDashboardGadgetsResponse.ts b/src/version2/schemas/availableDashboardGadgetsResponse.ts new file mode 100644 index 0000000000..b15a1394c7 --- /dev/null +++ b/src/version2/schemas/availableDashboardGadgetsResponse.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { AvailableDashboardGadgetSchema } from './availableDashboardGadget'; + +/** The list of available gadgets. */ +export const AvailableDashboardGadgetsResponseSchema = z.object({ + /** The list of available gadgets. */ + gadgets: z.array(AvailableDashboardGadgetSchema), +}); + +export type AvailableDashboardGadgetsResponse = z.infer; diff --git a/src/version2/schemas/availableWorkflowConnectRule.ts b/src/version2/schemas/availableWorkflowConnectRule.ts new file mode 100644 index 0000000000..faeb12daf4 --- /dev/null +++ b/src/version2/schemas/availableWorkflowConnectRule.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; + +/** The Connect provided ecosystem rules available. */ +export const AvailableWorkflowConnectRuleSchema = z.object({ + /** The add-on providing the rule. */ + addonKey: z.string().optional(), + /** The URL creation path segment defined in the Connect module. */ + createUrl: z.string().optional(), + /** The rule description. */ + description: z.string().optional(), + /** The URL edit path segment defined in the Connect module. */ + editUrl: z.string().optional(), + /** The module providing the rule. */ + moduleKey: z.string().optional(), + /** The rule name. */ + name: z.string().optional(), + /** The rule key. */ + ruleKey: z.string().optional(), + /** The rule type. */ + ruleType: z.enum(['Condition', 'Validator', 'Function', 'Screen']).optional(), + /** The URL view path segment defined in the Connect module. */ + viewUrl: z.string().optional(), +}); + +export type AvailableWorkflowConnectRule = z.infer; diff --git a/src/version2/schemas/availableWorkflowForgeRule.ts b/src/version2/schemas/availableWorkflowForgeRule.ts new file mode 100644 index 0000000000..a45d7d8649 --- /dev/null +++ b/src/version2/schemas/availableWorkflowForgeRule.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** The Forge provided ecosystem rules available. */ +export const AvailableWorkflowForgeRuleSchema = z.object({ + /** The rule description. */ + description: z.string().optional(), + /** The unique ARI of the forge rule type. */ + id: z.string().optional(), + /** The rule name. */ + name: z.string().optional(), + /** The rule key. */ + ruleKey: z.string().optional(), + /** The rule type. */ + ruleType: z.enum(['Condition', 'Validator', 'Function', 'Screen']).optional(), +}); + +export type AvailableWorkflowForgeRule = z.infer; diff --git a/src/version2/schemas/availableWorkflowSystemRule.ts b/src/version2/schemas/availableWorkflowSystemRule.ts new file mode 100644 index 0000000000..4a70726bd1 --- /dev/null +++ b/src/version2/schemas/availableWorkflowSystemRule.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +/** The Atlassian provided system rules available. */ +export const AvailableWorkflowSystemRuleSchema = z.object({ + /** The rule description. */ + description: z.string(), + /** List of rules that conflict with this one. */ + incompatibleRuleKeys: z.array(z.string()), + /** Whether the rule can be added added to an initial transition. */ + isAvailableForInitialTransition: z.boolean(), + /** Whether the rule is visible. */ + isVisible: z.boolean(), + /** The rule name. */ + name: z.string(), + /** The rule key. */ + ruleKey: z.string(), + /** The rule type. */ + ruleType: z.enum(['Condition', 'Validator', 'Function', 'Screen']), +}); + +export type AvailableWorkflowSystemRule = z.infer; diff --git a/src/version2/schemas/availableWorkflowTriggerTypes.ts b/src/version2/schemas/availableWorkflowTriggerTypes.ts new file mode 100644 index 0000000000..4b16759e25 --- /dev/null +++ b/src/version2/schemas/availableWorkflowTriggerTypes.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The list of available trigger types. */ +export const AvailableWorkflowTriggerTypesSchema = z.object({ + /** The description of the trigger rule. */ + description: z.string().optional(), + /** The name of the trigger rule. */ + name: z.string().optional(), + /** The type identifier of trigger rule. */ + type: z.string().optional(), +}); + +export type AvailableWorkflowTriggerTypes = z.infer; diff --git a/src/version2/schemas/availableWorkflowTriggers.ts b/src/version2/schemas/availableWorkflowTriggers.ts new file mode 100644 index 0000000000..1966a8252b --- /dev/null +++ b/src/version2/schemas/availableWorkflowTriggers.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { AvailableWorkflowTriggerTypesSchema } from './availableWorkflowTriggerTypes'; + +/** The trigger rules available. */ +export const AvailableWorkflowTriggersSchema = z.object({ + /** The list of available trigger types. */ + availableTypes: z.array(AvailableWorkflowTriggerTypesSchema), + /** The rule key of the rule. */ + ruleKey: z.string(), +}); + +export type AvailableWorkflowTriggers = z.infer; diff --git a/src/version2/schemas/avatar.ts b/src/version2/schemas/avatar.ts new file mode 100644 index 0000000000..70bd5502bf --- /dev/null +++ b/src/version2/schemas/avatar.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; + +/** Details of an avatar. */ +export const AvatarSchema = z.object({ + /** The file name of the avatar icon. Returned for system avatars. */ + fileName: z.string().optional(), + /** The ID of the avatar. */ + id: z.string(), + /** Whether the avatar can be deleted. */ + isDeletable: z.boolean().optional(), + /** Whether the avatar is used in Jira. For example, shown as a project's avatar. */ + isSelected: z.boolean().optional(), + /** Whether the avatar is a system avatar. */ + isSystemAvatar: z.boolean().optional(), + /** + * The owner of the avatar. For a system avatar the owner is null (and nothing is returned). For non-system avatars + * this is the appropriate identifier, such as the ID for a project or the account ID for a user. + */ + owner: z.string().optional(), + /** The list of avatar icon URLs. */ + urls: z.object({}).optional(), +}); + +export type Avatar = z.infer; diff --git a/src/version2/schemas/avatarUrlsBean.ts b/src/version2/schemas/avatarUrlsBean.ts new file mode 100644 index 0000000000..f7696140d6 --- /dev/null +++ b/src/version2/schemas/avatarUrlsBean.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const AvatarUrlsBeanSchema = z.object({ + /** The URL of the item's 16x16 pixel avatar. */ + '16x16': z.string().optional(), + /** The URL of the item's 24x24 pixel avatar. */ + '24x24': z.string().optional(), + /** The URL of the item's 32x32 pixel avatar. */ + '32x32': z.string().optional(), + /** The URL of the item's 48x48 pixel avatar. */ + '48x48': z.string().optional(), +}); + +export type AvatarUrlsBean = z.infer; diff --git a/src/version2/schemas/avatars.ts b/src/version2/schemas/avatars.ts new file mode 100644 index 0000000000..8e192bb7f8 --- /dev/null +++ b/src/version2/schemas/avatars.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { AvatarSchema } from './avatar'; + +/** Details about system and custom avatars. */ +export const AvatarsSchema = z.object({ + /** Custom avatars list. */ + custom: z.array(AvatarSchema).optional(), + /** System avatars list. */ + system: z.array(AvatarSchema).optional(), +}); + +export type Avatars = z.infer; diff --git a/src/version2/schemas/boardColumnPayload.ts b/src/version2/schemas/boardColumnPayload.ts new file mode 100644 index 0000000000..53a7bae924 --- /dev/null +++ b/src/version2/schemas/boardColumnPayload.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** The payload for creating a board column */ +export const BoardColumnPayloadSchema = z.object({ + /** The maximum issue constraint for the column */ + maximumIssueConstraint: z.number().int().optional(), + /** The minimum issue constraint for the column */ + minimumIssueConstraint: z.number().int().optional(), + /** The name of the column */ + name: z.string().optional(), + /** The status IDs for the column */ + statusIds: z.array(ProjectCreateResourceIdentifierSchema).optional(), +}); + +export type BoardColumnPayload = z.infer; diff --git a/src/version2/schemas/boardFeaturePayload.ts b/src/version2/schemas/boardFeaturePayload.ts new file mode 100644 index 0000000000..9aeafe526b --- /dev/null +++ b/src/version2/schemas/boardFeaturePayload.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The payload for setting a board feature */ +export const BoardFeaturePayloadSchema = z.object({ + /** The key of the feature */ + featureKey: z.enum(['ESTIMATION', 'SPRINTS']).optional(), + /** Whether the feature should be turned on or off */ + state: z.boolean().optional(), +}); + +export type BoardFeaturePayload = z.infer; diff --git a/src/version2/schemas/boardPayload.ts b/src/version2/schemas/boardPayload.ts new file mode 100644 index 0000000000..a47eea7143 --- /dev/null +++ b/src/version2/schemas/boardPayload.ts @@ -0,0 +1,38 @@ +import { z } from 'zod'; +import { CardLayoutSchema } from './cardLayout'; +import { CardLayoutFieldSchema } from './cardLayoutField'; +import { BoardColumnPayloadSchema } from './boardColumnPayload'; +import { BoardFeaturePayloadSchema } from './boardFeaturePayload'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; +import { QuickFilterPayloadSchema } from './quickFilterPayload'; +import { SwimlanesPayloadSchema } from './swimlanesPayload'; +import { WorkingDaysConfigSchema } from './workingDaysConfig'; + +/** The payload for creating a board */ +export const BoardPayloadSchema = z.object({ + /** + * Takes in a JQL string to create a new filter. If no value is provided, it'll default to a JQL filter for the + * project creating + */ + boardFilterJQL: z.string().optional(), + /** Card color settings of the board */ + cardColorStrategy: z.enum(['ISSUE_TYPE', 'REQUEST_TYPE', 'ASSIGNEE', 'PRIORITY', 'NONE', 'CUSTOM']).optional(), + cardLayout: CardLayoutSchema.optional(), + /** Card layout settings of the board */ + cardLayouts: z.array(CardLayoutFieldSchema).optional(), + /** The columns of the board */ + columns: z.array(BoardColumnPayloadSchema).optional(), + /** Feature settings for the board */ + features: z.array(BoardFeaturePayloadSchema).optional(), + /** The name of the board */ + name: z.string().optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), + /** The quick filters for the board. */ + quickFilters: z.array(QuickFilterPayloadSchema).optional(), + /** Whether sprints are supported on the board */ + supportsSprint: z.boolean().optional(), + swimlanes: SwimlanesPayloadSchema.optional(), + workingDaysConfig: WorkingDaysConfigSchema.optional(), +}); + +export type BoardPayload = z.infer; diff --git a/src/version2/schemas/boardsPayload.ts b/src/version2/schemas/boardsPayload.ts new file mode 100644 index 0000000000..bc3949278f --- /dev/null +++ b/src/version2/schemas/boardsPayload.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { BoardPayloadSchema } from './boardPayload'; + +export const BoardsPayloadSchema = z.object({ + /** The boards to be associated with the project. */ + boards: z.array(BoardPayloadSchema).optional(), +}); + +export type BoardsPayload = z.infer; diff --git a/src/version2/schemas/bulkChangeOwnerDetails.ts b/src/version2/schemas/bulkChangeOwnerDetails.ts new file mode 100644 index 0000000000..fcbf4ec797 --- /dev/null +++ b/src/version2/schemas/bulkChangeOwnerDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details for changing owners of shareable entities */ +export const BulkChangeOwnerDetailsSchema = z.object({ + /** Whether the name is fixed automatically if it's duplicated after changing owner. */ + autofixName: z.boolean(), + /** The account id of the new owner. */ + newOwner: z.string(), +}); + +export type BulkChangeOwnerDetails = z.infer; diff --git a/src/version2/schemas/bulkChangelogRequestBean.ts b/src/version2/schemas/bulkChangelogRequestBean.ts new file mode 100644 index 0000000000..d4c5a0d9a4 --- /dev/null +++ b/src/version2/schemas/bulkChangelogRequestBean.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Request bean for bulk changelog retrieval */ +export const BulkChangelogRequestBeanSchema = z.object({ + /** List of field IDs to filter changelogs */ + fieldIds: z.array(z.string()).optional(), + /** List of issue IDs/keys to fetch changelogs for */ + issueIdsOrKeys: z.array(z.string()), + /** The maximum number of items to return per page */ + maxResults: z.number().int().optional(), + /** The cursor for pagination */ + nextPageToken: z.string().optional(), +}); + +export type BulkChangelogRequestBean = z.infer; diff --git a/src/version2/schemas/bulkChangelogResponseBean.ts b/src/version2/schemas/bulkChangelogResponseBean.ts new file mode 100644 index 0000000000..44d97487c7 --- /dev/null +++ b/src/version2/schemas/bulkChangelogResponseBean.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { IssueChangeLogSchema } from './issueChangeLog'; + +/** A page of changelogs which is designed to handle multiple issues */ +export const BulkChangelogResponseBeanSchema = z.object({ + /** The list of issues changelogs. */ + issueChangeLogs: z.array(IssueChangeLogSchema).optional(), + /** + * Continuation token to fetch the next page. If this result represents the last or the only page, this token will be + * null. + */ + nextPageToken: z.string().optional(), +}); + +export type BulkChangelogResponseBean = z.infer; diff --git a/src/version2/schemas/bulkContextualConfiguration.ts b/src/version2/schemas/bulkContextualConfiguration.ts new file mode 100644 index 0000000000..2afe5128cc --- /dev/null +++ b/src/version2/schemas/bulkContextualConfiguration.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details of the contextual configuration for a custom field. */ +export const BulkContextualConfigurationSchema = z.object({ + /** The field configuration. */ + configuration: z.unknown().optional(), + /** The ID of the custom field. */ + customFieldId: z.string(), + /** The ID of the field context the configuration is associated with. */ + fieldContextId: z.string(), + /** The ID of the configuration. */ + id: z.string(), + /** The field value schema. */ + schema: z.unknown().optional(), +}); + +export type BulkContextualConfiguration = z.infer; diff --git a/src/version2/schemas/bulkCustomFieldOptionCreateRequest.ts b/src/version2/schemas/bulkCustomFieldOptionCreateRequest.ts new file mode 100644 index 0000000000..06d4704ee2 --- /dev/null +++ b/src/version2/schemas/bulkCustomFieldOptionCreateRequest.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { CustomFieldOptionCreateSchema } from './customFieldOptionCreate'; + +/** Details of the options to create for a custom field. */ +export const BulkCustomFieldOptionCreateRequestSchema = z.object({ + /** Details of options to create. */ + options: z.array(CustomFieldOptionCreateSchema).optional(), +}); + +export type BulkCustomFieldOptionCreateRequest = z.infer; diff --git a/src/version2/schemas/bulkCustomFieldOptionUpdateRequest.ts b/src/version2/schemas/bulkCustomFieldOptionUpdateRequest.ts new file mode 100644 index 0000000000..a58a33fa1c --- /dev/null +++ b/src/version2/schemas/bulkCustomFieldOptionUpdateRequest.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { CustomFieldOptionUpdateSchema } from './customFieldOptionUpdate'; + +/** Details of the options to update for a custom field. */ +export const BulkCustomFieldOptionUpdateRequestSchema = z.object({ + /** Details of the options to update. */ + options: z.array(CustomFieldOptionUpdateSchema).optional(), +}); + +export type BulkCustomFieldOptionUpdateRequest = z.infer; diff --git a/src/version2/schemas/bulkEditActionError.ts b/src/version2/schemas/bulkEditActionError.ts new file mode 100644 index 0000000000..c94f8ac46f --- /dev/null +++ b/src/version2/schemas/bulkEditActionError.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Errors of bulk edit action. */ +export const BulkEditActionErrorSchema = z.object({ + /** The error messages. */ + errorMessages: z.array(z.string()), + /** The errors. */ + errors: z.object({}), +}); + +export type BulkEditActionError = z.infer; diff --git a/src/version2/schemas/bulkEditShareableEntityRequest.ts b/src/version2/schemas/bulkEditShareableEntityRequest.ts new file mode 100644 index 0000000000..cb0a7a8503 --- /dev/null +++ b/src/version2/schemas/bulkEditShareableEntityRequest.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details of a request to bulk edit shareable entity. */ +export const BulkEditShareableEntityRequestSchema = z.object({ + /** Allowed action for bulk edit shareable entity */ + action: z.enum(['changeOwner', 'changePermission', 'addPermission', 'removePermission']), + /** The details of change owner action. */ + changeOwnerDetails: z.unknown().optional(), + /** The id list of shareable entities to be changed. */ + entityIds: z.array(z.number().int()), + /** Whether the actions are executed by users with Administer Jira global permission. */ + extendAdminPermissions: z.boolean().optional(), + /** The permission details to be changed. */ + permissionDetails: z.unknown().optional(), +}); + +export type BulkEditShareableEntityRequest = z.infer; diff --git a/src/version2/schemas/bulkEditShareableEntityResponse.ts b/src/version2/schemas/bulkEditShareableEntityResponse.ts new file mode 100644 index 0000000000..218a0f869c --- /dev/null +++ b/src/version2/schemas/bulkEditShareableEntityResponse.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of a request to bulk edit shareable entity. */ +export const BulkEditShareableEntityResponseSchema = z.object({ + /** Allowed action for bulk edit shareable entity */ + action: z.enum(['changeOwner', 'changePermission', 'addPermission', 'removePermission']), + /** The mapping dashboard id to errors if any. */ + entityErrors: z.object({}).optional(), +}); + +export type BulkEditShareableEntityResponse = z.infer; diff --git a/src/version2/schemas/bulkFetchIssueRequestBean.ts b/src/version2/schemas/bulkFetchIssueRequestBean.ts new file mode 100644 index 0000000000..84984b63d7 --- /dev/null +++ b/src/version2/schemas/bulkFetchIssueRequestBean.ts @@ -0,0 +1,53 @@ +import { z } from 'zod'; + +export const BulkFetchIssueRequestBeanSchema = z.object({ + /** + * 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: z.array(z.string()).optional(), + /** + * 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: z.array(z.string()).optional(), + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys: z.boolean().optional(), + /** An array of issue IDs or issue keys to fetch. You can mix issue IDs and keys in the same query. */ + issueIdsOrKeys: z.array(z.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: z.array(z.string()).optional(), +}); + +export type BulkFetchIssueRequestBean = z.infer; diff --git a/src/version2/schemas/bulkIssueIsWatching.ts b/src/version2/schemas/bulkIssueIsWatching.ts new file mode 100644 index 0000000000..f2a84a247c --- /dev/null +++ b/src/version2/schemas/bulkIssueIsWatching.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** A container for the watch status of a list of issues. */ +export const BulkIssueIsWatchingSchema = z.object({ + /** The map of issue ID to boolean watch status. */ + issuesIsWatching: z.object({}).optional(), +}); + +export type BulkIssueIsWatching = z.infer; diff --git a/src/version2/schemas/bulkIssuePropertyUpdateRequest.ts b/src/version2/schemas/bulkIssuePropertyUpdateRequest.ts new file mode 100644 index 0000000000..529c512cc8 --- /dev/null +++ b/src/version2/schemas/bulkIssuePropertyUpdateRequest.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +/** Bulk issue property update request details. */ +export const BulkIssuePropertyUpdateRequestSchema = z.object({ + /** + * EXPERIMENTAL. The Jira expression to calculate the value of the property. The value of the expression must be an + * object that can be converted to JSON, such as a number, boolean, string, list, or map. The context variables + * available to the expression are `issue` and `user`. Issues for which the expression returns a value whose JSON + * representation is longer than 32768 characters are ignored. + */ + expression: z.string().optional(), + /** The bulk operation filter. */ + filter: z.unknown().optional(), + /** + * The value of the property. The value must be a [valid](https://tools.ietf.org/html/rfc4627), non-empty JSON blob. + * The maximum length is 32768 characters. + */ + value: z.unknown().optional(), +}); + +export type BulkIssuePropertyUpdateRequest = z.infer; diff --git a/src/version2/schemas/bulkIssueResults.ts b/src/version2/schemas/bulkIssueResults.ts new file mode 100644 index 0000000000..4eda12d27e --- /dev/null +++ b/src/version2/schemas/bulkIssueResults.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; +import { IssueErrorSchema } from './issueError'; +import { IssueBeanSchema } from './issueBean'; + +/** The list of requested issues & fields. */ +export const BulkIssueResultsSchema = z.object({ + /** + * 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: z.array(IssueErrorSchema).optional(), + /** The list of issues. */ + issues: z.array(IssueBeanSchema).optional(), +}); + +export type BulkIssueResults = z.infer; diff --git a/src/version2/schemas/bulkOperationErrorResult.ts b/src/version2/schemas/bulkOperationErrorResult.ts new file mode 100644 index 0000000000..e9ca06aefb --- /dev/null +++ b/src/version2/schemas/bulkOperationErrorResult.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { ErrorCollectionSchema } from './errorCollection'; + +export const BulkOperationErrorResultSchema = z.object({ + elementErrors: ErrorCollectionSchema.optional(), + failedElementNumber: z.number().int().optional(), + status: z.number().int().optional(), +}); + +export type BulkOperationErrorResult = z.infer; diff --git a/src/version2/schemas/bulkPermissionGrants.ts b/src/version2/schemas/bulkPermissionGrants.ts new file mode 100644 index 0000000000..f16c3e0454 --- /dev/null +++ b/src/version2/schemas/bulkPermissionGrants.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { BulkProjectPermissionGrantsSchema } from './bulkProjectPermissionGrants'; + +/** Details of global and project permissions granted to the user. */ +export const BulkPermissionGrantsSchema = z.object({ + /** List of permissions granted to the user. */ + globalPermissions: z.array(z.string()), + /** List of project permissions and the projects and issues those permissions provide access to. */ + projectPermissions: z.array(BulkProjectPermissionGrantsSchema), +}); + +export type BulkPermissionGrants = z.infer; diff --git a/src/version2/schemas/bulkPermissionsRequestBean.ts b/src/version2/schemas/bulkPermissionsRequestBean.ts new file mode 100644 index 0000000000..227a00da19 --- /dev/null +++ b/src/version2/schemas/bulkPermissionsRequestBean.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { BulkProjectPermissionsSchema } from './bulkProjectPermissions'; + +/** Details of global permissions to look up and project permissions with associated projects and issues to look up. */ +export const BulkPermissionsRequestBeanSchema = z.object({ + /** The account ID of a user. */ + accountId: z.string().optional(), + /** Global permissions to look up. */ + globalPermissions: z.array(z.string()).optional(), + /** Project permissions with associated projects and issues to look up. */ + projectPermissions: z.array(BulkProjectPermissionsSchema).optional(), +}); + +export type BulkPermissionsRequestBean = z.infer; diff --git a/src/version2/schemas/bulkProjectPermissionGrants.ts b/src/version2/schemas/bulkProjectPermissionGrants.ts new file mode 100644 index 0000000000..531f5f796f --- /dev/null +++ b/src/version2/schemas/bulkProjectPermissionGrants.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** List of project permissions and the projects and issues those permissions grant access to. */ +export const BulkProjectPermissionGrantsSchema = z.object({ + /** IDs of the issues the user has the permission for. */ + issues: z.array(z.number().int()), + /** A project permission, */ + permission: z.string(), + /** IDs of the projects the user has the permission for. */ + projects: z.array(z.number().int()), +}); + +export type BulkProjectPermissionGrants = z.infer; diff --git a/src/version2/schemas/bulkProjectPermissions.ts b/src/version2/schemas/bulkProjectPermissions.ts new file mode 100644 index 0000000000..33248da601 --- /dev/null +++ b/src/version2/schemas/bulkProjectPermissions.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of project permissions and associated issues and projects to look up. */ +export const BulkProjectPermissionsSchema = z.object({ + /** List of issue IDs. */ + issues: z.array(z.number().int()).optional(), + /** List of project permissions. */ + permissions: z.array(z.string()), + /** List of project IDs. */ + projects: z.array(z.number().int()).optional(), +}); + +export type BulkProjectPermissions = z.infer; diff --git a/src/version2/schemas/bulkRedactionRequest.ts b/src/version2/schemas/bulkRedactionRequest.ts new file mode 100644 index 0000000000..0ed742c72a --- /dev/null +++ b/src/version2/schemas/bulkRedactionRequest.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; +import { SingleRedactionRequestSchema } from './singleRedactionRequest'; + +export const BulkRedactionRequestSchema = z.object({ + redactions: z.array(SingleRedactionRequestSchema).optional(), +}); + +export type BulkRedactionRequest = z.infer; diff --git a/src/version2/schemas/bulkRedactionResponse.ts b/src/version2/schemas/bulkRedactionResponse.ts new file mode 100644 index 0000000000..39c107162f --- /dev/null +++ b/src/version2/schemas/bulkRedactionResponse.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { SingleRedactionResponseSchema } from './singleRedactionResponse'; + +export const BulkRedactionResponseSchema = z.object({ + /** Result for requested redactions */ + results: z.array(SingleRedactionResponseSchema), +}); + +export type BulkRedactionResponse = z.infer; diff --git a/src/version2/schemas/cardLayout.ts b/src/version2/schemas/cardLayout.ts new file mode 100644 index 0000000000..5ab82c72bf --- /dev/null +++ b/src/version2/schemas/cardLayout.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** Card layout configuration. */ +export const CardLayoutSchema = z.object({ + /** Whether to show days in column */ + showDaysInColumn: z.boolean().optional(), +}); + +export type CardLayout = z.infer; diff --git a/src/version2/schemas/cardLayoutField.ts b/src/version2/schemas/cardLayoutField.ts new file mode 100644 index 0000000000..532d83206c --- /dev/null +++ b/src/version2/schemas/cardLayoutField.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Card layout settings of the board */ +export const CardLayoutFieldSchema = z.object({ + fieldId: z.string().optional(), + id: z.number().int().optional(), + mode: z.enum(['PLAN', 'WORK']).optional(), + position: z.number().int().optional(), +}); + +export type CardLayoutField = z.infer; diff --git a/src/version2/schemas/changeDetails.ts b/src/version2/schemas/changeDetails.ts new file mode 100644 index 0000000000..a06d90c472 --- /dev/null +++ b/src/version2/schemas/changeDetails.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +/** A change item. */ +export const ChangeDetailsSchema = z.object({ + /** The name of the field changed. */ + field: z.string().optional(), + /** The ID of the field changed. */ + fieldId: z.string().optional(), + /** The type of the field changed. */ + fieldtype: z.string().optional(), + /** The details of the original value. */ + from: z.string().optional(), + /** The details of the original value as a string. */ + fromString: z.string().optional(), + /** The details of the new value. */ + to: z.string().optional(), + /** The details of the new value as a string. */ + toString: z.string().optional(), +}); + +export type ChangeDetails = z.infer; diff --git a/src/version2/schemas/changeFilterOwner.ts b/src/version2/schemas/changeFilterOwner.ts new file mode 100644 index 0000000000..3bab7f6d5a --- /dev/null +++ b/src/version2/schemas/changeFilterOwner.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The account ID of the new owner. */ +export const ChangeFilterOwnerSchema = z.object({ + /** The account ID of the new owner. */ + accountId: z.string(), +}); + +export type ChangeFilterOwner = z.infer; diff --git a/src/version2/schemas/changedValueBean.ts b/src/version2/schemas/changedValueBean.ts new file mode 100644 index 0000000000..ace509d31c --- /dev/null +++ b/src/version2/schemas/changedValueBean.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of names changed in the record event. */ +export const ChangedValueBeanSchema = z.object({ + /** The value of the field before the change. */ + changedFrom: z.string().optional(), + /** The value of the field after the change. */ + changedTo: z.string().optional(), + /** The name of the field changed. */ + fieldName: z.string().optional(), +}); + +export type ChangedValueBean = z.infer; diff --git a/src/version2/schemas/changedWorklog.ts b/src/version2/schemas/changedWorklog.ts new file mode 100644 index 0000000000..5c3d243437 --- /dev/null +++ b/src/version2/schemas/changedWorklog.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { EntityPropertySchema } from './entityProperty'; + +/** Details of a changed worklog. */ +export const ChangedWorklogSchema = z.object({ + /** Details of properties associated with the change. */ + properties: z.array(EntityPropertySchema).optional(), + /** The datetime of the change. */ + updatedTime: z.number().int().optional(), + /** The ID of the worklog. */ + worklogId: z.number().int().optional(), +}); + +export type ChangedWorklog = z.infer; diff --git a/src/version2/schemas/changedWorklogs.ts b/src/version2/schemas/changedWorklogs.ts new file mode 100644 index 0000000000..07adca009b --- /dev/null +++ b/src/version2/schemas/changedWorklogs.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { ChangedWorklogSchema } from './changedWorklog'; + +/** List of changed worklogs. */ +export const ChangedWorklogsSchema = z.object({ + lastPage: z.boolean().optional(), + /** The URL of the next list of changed worklogs. */ + nextPage: z.string().optional(), + /** The URL of this changed worklogs list. */ + self: z.string().optional(), + /** The datetime of the first worklog item in the list. */ + since: z.number().int().optional(), + /** The datetime of the last worklog item in the list. */ + until: z.number().int().optional(), + /** Changed worklog list. */ + values: z.array(ChangedWorklogSchema).optional(), +}); + +export type ChangedWorklogs = z.infer; diff --git a/src/version2/schemas/changelog.ts b/src/version2/schemas/changelog.ts new file mode 100644 index 0000000000..e3c0dca4a4 --- /dev/null +++ b/src/version2/schemas/changelog.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { ChangeDetailsSchema } from './changeDetails'; + +/** A log of changes made to issue fields. Changelogs related to workflow associations are currently being deprecated. */ +export const ChangelogSchema = z.object({ + /** The user who made the change. */ + author: z.unknown().optional(), + /** The date on which the change took place. */ + created: z.string().datetime().optional(), + /** The history metadata associated with the changed. */ + historyMetadata: z.unknown().optional(), + /** The ID of the changelog. */ + id: z.string().optional(), + /** The list of items changed. */ + items: z.array(ChangeDetailsSchema).optional(), +}); + +export type Changelog = z.infer; diff --git a/src/version2/schemas/columnItem.ts b/src/version2/schemas/columnItem.ts new file mode 100644 index 0000000000..05b0f5a03f --- /dev/null +++ b/src/version2/schemas/columnItem.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of an issue navigator column item. */ +export const ColumnItemSchema = z.object({ + /** The issue navigator column label. */ + label: z.string().optional(), + /** The issue navigator column value. */ + value: z.string().optional(), +}); + +export type ColumnItem = z.infer; diff --git a/src/version2/schemas/columnRequestBody.ts b/src/version2/schemas/columnRequestBody.ts new file mode 100644 index 0000000000..95b7384066 --- /dev/null +++ b/src/version2/schemas/columnRequestBody.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const ColumnRequestBodySchema = z.object({ + columns: z.array(z.string()).optional(), +}); + +export type ColumnRequestBody = z.infer; diff --git a/src/version2/schemas/comment.ts b/src/version2/schemas/comment.ts new file mode 100644 index 0000000000..e3d5a7c0da --- /dev/null +++ b/src/version2/schemas/comment.ts @@ -0,0 +1,44 @@ +import { z } from 'zod'; +import { EntityPropertySchema } from './entityProperty'; + +/** A comment. */ +export const CommentSchema = z.object({ + /** The ID of the user who created the comment. */ + author: z.unknown().optional(), + /** The comment text. */ + body: z.string().optional(), + /** The date and time at which the comment was created. */ + created: z.string().datetime().optional(), + /** The ID of the comment. */ + id: z.string().optional(), + /** + * Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external + * emails to be added as comments on + * issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for + * information on setting up this feature. + */ + jsdAuthorCanSeeRequest: z.boolean().optional(), + /** + * Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud + * Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk + * project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its + * visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request + * comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) + * operation. + */ + jsdPublic: z.boolean().optional(), + /** A list of comment properties. Optional on create and update. */ + properties: z.array(EntityPropertySchema).optional(), + /** The rendered version of the comment. */ + renderedBody: z.string().optional(), + /** The URL of the comment. */ + self: z.string().optional(), + /** The ID of the user who updated the comment last. */ + updateAuthor: z.unknown().optional(), + /** The date and time at which the comment was updated last. */ + updated: z.string().datetime().optional(), + /** The group or role to which this comment is visible. Optional on create and update. */ + visibility: z.unknown().optional(), +}); + +export type Comment = z.infer; diff --git a/src/version2/schemas/componentIssuesCount.ts b/src/version2/schemas/componentIssuesCount.ts new file mode 100644 index 0000000000..202d8f4ab7 --- /dev/null +++ b/src/version2/schemas/componentIssuesCount.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Count of issues assigned to a component. */ +export const ComponentIssuesCountSchema = z.object({ + /** The count of issues assigned to a component. */ + issueCount: z.number().int().optional(), + /** The URL for this count of issues for a component. */ + self: z.string().optional(), +}); + +export type ComponentIssuesCount = z.infer; diff --git a/src/version2/schemas/componentJsonBean.ts b/src/version2/schemas/componentJsonBean.ts new file mode 100644 index 0000000000..37056c3713 --- /dev/null +++ b/src/version2/schemas/componentJsonBean.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const ComponentJsonBeanSchema = z.object({ + ari: z.string().optional(), + description: z.string().optional(), + id: z.string().optional(), + metadata: z.object({}).optional(), + name: z.string().optional(), + self: z.string().optional(), +}); + +export type ComponentJsonBean = z.infer; diff --git a/src/version2/schemas/componentWithIssueCount.ts b/src/version2/schemas/componentWithIssueCount.ts new file mode 100644 index 0000000000..34ee1855dc --- /dev/null +++ b/src/version2/schemas/componentWithIssueCount.ts @@ -0,0 +1,61 @@ +import { z } from 'zod'; + +/** Details about a component with a count of the issues it contains. */ +export const ComponentWithIssueCountSchema = z.object({ + /** + * The details of the user associated with `assigneeType`, if any. See `realAssignee` for details of the user assigned + * to issues created with this component. + */ + assignee: z.unknown().optional(), + /** + * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` + * for details on how the type of the user, and hence the user, assigned to issues is determined. Takes the following + * values: + * + * - `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the + * component is in. + * - `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for the component. + * - `UNASSIGNED` an assignee is not set for issues created with this component. + * - `PROJECT_DEFAULT` the assignee to any issues created with this component is nominally the default assignee for the + * project that the component is in. + */ + assigneeType: z.enum(['PROJECT_DEFAULT', 'COMPONENT_LEAD', 'PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** The description for the component. */ + description: z.string().optional(), + /** The unique identifier for the component. */ + id: z.string().optional(), + /** + * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but + * the component lead is not set, then `false` is returned. + */ + isAssigneeTypeValid: z.boolean().optional(), + /** Count of issues for the component. */ + issueCount: z.number().int().optional(), + /** The user details for the component's lead user. */ + lead: z.unknown().optional(), + /** The name for the component. */ + name: z.string().optional(), + /** The key of the project to which the component is assigned. */ + project: z.string().optional(), + /** Not used. */ + projectId: z.number().int().optional(), + /** The user assigned to issues created with this component, when `assigneeType` does not identify a valid assignee. */ + realAssignee: z.unknown().optional(), + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set + * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This + * property is set to one of the following values: + * + * - `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in + * the project that the component is in. + * - `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component lead has permission to be assigned + * issues in the project that the component is in. + * - `UNASSIGNED` when `assigneeType` is `UNASSIGNED` and Jira is configured to allow unassigned issues. + * - `PROJECT_DEFAULT` when none of the preceding cases are true. + */ + realAssigneeType: z.enum(['PROJECT_DEFAULT', 'COMPONENT_LEAD', 'PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** The URL for this count of the issues contained in the component. */ + self: z.string().optional(), +}); + +export type ComponentWithIssueCount = z.infer; diff --git a/src/version2/schemas/compoundClause.ts b/src/version2/schemas/compoundClause.ts new file mode 100644 index 0000000000..a70f1eb253 --- /dev/null +++ b/src/version2/schemas/compoundClause.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; +import { JqlQueryClauseSchema } 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 const CompoundClauseSchema = z.object({ + /** The list of nested clauses. */ + clauses: z.array(JqlQueryClauseSchema), + /** The operator between the clauses. */ + operator: z.enum(['and', 'or', 'not']), +}); + +export type CompoundClause = z.infer; diff --git a/src/version2/schemas/conditionGroupConfiguration.ts b/src/version2/schemas/conditionGroupConfiguration.ts new file mode 100644 index 0000000000..12f112e63a --- /dev/null +++ b/src/version2/schemas/conditionGroupConfiguration.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { ConditionGroupConfigurationSchema } from './conditionGroupConfiguration'; +import { WorkflowRuleConfigurationSchema } from './workflowRuleConfiguration'; + +/** The conditions group associated with the transition. */ +export const ConditionGroupConfigurationSchema = z.object({ + /** The nested conditions of the condition group. */ + conditionGroups: z.array(ConditionGroupConfigurationSchema).optional(), + /** The rules for this condition. */ + conditions: z.array(WorkflowRuleConfigurationSchema).optional(), + /** + * Determines how the conditions in the group are evaluated. Accepts either `ANY` or `ALL`. If `ANY` is used, at least + * one condition in the group must be true for the group to evaluate to true. If `ALL` is used, all conditions in the + * group must be true for the group to evaluate to true. + */ + operation: z.enum(['ANY', 'ALL']).optional(), +}); + +export type ConditionGroupConfiguration = z.infer; diff --git a/src/version2/schemas/conditionGroupPayload.ts b/src/version2/schemas/conditionGroupPayload.ts new file mode 100644 index 0000000000..862e2aadf4 --- /dev/null +++ b/src/version2/schemas/conditionGroupPayload.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { ConditionGroupPayloadSchema } from './conditionGroupPayload'; +import { RulePayloadSchema } from './rulePayload'; + +/** The payload for creating a condition group in a workflow */ +export const ConditionGroupPayloadSchema = z.object({ + /** The nested conditions of the condition group. */ + conditionGroup: z.array(ConditionGroupPayloadSchema).optional(), + /** The rules for this condition. */ + conditions: z.array(RulePayloadSchema).optional(), + /** + * Determines how the conditions in the group are evaluated. Accepts either `ANY` or `ALL`. If `ANY` is used, at least + * one condition in the group must be true for the group to evaluate to true. If `ALL` is used, all conditions in the + * group must be true for the group to evaluate to true. + */ + operation: z.enum(['ANY', 'ALL']).optional(), +}); + +export type ConditionGroupPayload = z.infer; diff --git a/src/version2/schemas/conditionGroupUpdate.ts b/src/version2/schemas/conditionGroupUpdate.ts new file mode 100644 index 0000000000..7df53f13dd --- /dev/null +++ b/src/version2/schemas/conditionGroupUpdate.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { ConditionGroupUpdateSchema } from './conditionGroupUpdate'; +import { WorkflowRuleConfigurationSchema } from './workflowRuleConfiguration'; + +/** The conditions group associated with the transition. */ +export const ConditionGroupUpdateSchema = z.object({ + /** The nested conditions of the condition group. */ + conditionGroups: z.array(ConditionGroupUpdateSchema).optional(), + /** The rules for this condition. */ + conditions: z.array(WorkflowRuleConfigurationSchema).optional(), + /** + * Determines how the conditions in the group are evaluated. Accepts either `ANY` or `ALL`. If `ANY` is used, at least + * one condition in the group must be true for the group to evaluate to true. If `ALL` is used, all conditions in the + * group must be true for the group to evaluate to true. + */ + operation: z.enum(['ANY', 'ALL']), +}); + +export type ConditionGroupUpdate = z.infer; diff --git a/src/version2/schemas/configuration.ts b/src/version2/schemas/configuration.ts new file mode 100644 index 0000000000..8cd011b506 --- /dev/null +++ b/src/version2/schemas/configuration.ts @@ -0,0 +1,32 @@ +import { z } from 'zod'; + +/** Details about the configuration of Jira. */ +export const ConfigurationSchema = z.object({ + /** Whether the ability to add attachments to issues is enabled. */ + attachmentsEnabled: z.boolean().optional(), + /** Whether the ability to link issues is enabled. */ + issueLinkingEnabled: z.boolean().optional(), + /** Whether the ability to create subtasks for issues is enabled. */ + subTasksEnabled: z.boolean().optional(), + /** The configuration of time tracking. */ + timeTrackingConfiguration: z.unknown().optional(), + /** Whether the ability to track time is enabled. This property is deprecated. */ + timeTrackingEnabled: z.boolean().optional(), + /** + * Whether the ability to create unassigned issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + unassignedIssuesAllowed: z.boolean().optional(), + /** + * Whether the ability for users to vote on issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + votingEnabled: z.boolean().optional(), + /** + * Whether the ability for users to watch issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + watchingEnabled: z.boolean().optional(), +}); + +export type Configuration = z.infer; diff --git a/src/version2/schemas/configurationsListParameters.ts b/src/version2/schemas/configurationsListParameters.ts new file mode 100644 index 0000000000..63a8aea1bd --- /dev/null +++ b/src/version2/schemas/configurationsListParameters.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** List of custom fields identifiers which will be used to filter configurations */ +export const ConfigurationsListParametersSchema = z.object({ + /** List of IDs or keys of the custom fields. It can be a mix of IDs and keys in the same query. */ + fieldIdsOrKeys: z.array(z.string()), +}); + +export type ConfigurationsListParameters = z.infer; diff --git a/src/version2/schemas/connectCustomFieldValue.ts b/src/version2/schemas/connectCustomFieldValue.ts new file mode 100644 index 0000000000..a0e86091ab --- /dev/null +++ b/src/version2/schemas/connectCustomFieldValue.ts @@ -0,0 +1,44 @@ +import { z } from 'zod'; + +/** A list of custom field details. */ +export const ConnectCustomFieldValueSchema = z + .object({ + /** The type of custom field. */ + _type: z.enum([ + 'StringIssueField', + 'NumberIssueField', + 'RichTextIssueField', + 'SingleSelectIssueField', + 'MultiSelectIssueField', + 'TextIssueField', + ]), + /** The custom field ID. */ + fieldID: z.number().int(), + /** The issue ID. */ + issueID: z.number().int(), + /** The value of number type custom field when `_type` is `NumberIssueField`. */ + number: z.number().optional(), + /** + * The value of single select and multiselect custom field type when `_type` is `SingleSelectIssueField` or + * `MultiSelectIssueField`. + */ + optionID: z.string().optional(), + /** The value of richText type custom field when `_type` is `RichTextIssueField`. */ + richText: z.string().optional(), + /** The value of string type custom field when `_type` is `StringIssueField`. */ + string: z.string().optional(), + /** The value of of text custom field type when `_type` is `TextIssueField`. */ + text: z.string().optional(), + }) + .transform(val => ({ + type: val['_type'], + fieldID: val['fieldID'], + issueID: val['issueID'], + number: val['number'], + optionID: val['optionID'], + richText: val['richText'], + string: val['string'], + text: val['text'], + })); + +export type ConnectCustomFieldValue = z.infer; diff --git a/src/version2/schemas/connectCustomFieldValues.ts b/src/version2/schemas/connectCustomFieldValues.ts new file mode 100644 index 0000000000..e0bb245f04 --- /dev/null +++ b/src/version2/schemas/connectCustomFieldValues.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { ConnectCustomFieldValueSchema } from './connectCustomFieldValue'; + +/** Details of updates for a custom field. */ +export const ConnectCustomFieldValuesSchema = z.object({ + /** The list of custom field update details. */ + updateValueList: z.array(ConnectCustomFieldValueSchema).optional(), +}); + +export type ConnectCustomFieldValues = z.infer; diff --git a/src/version2/schemas/connectModule.ts b/src/version2/schemas/connectModule.ts new file mode 100644 index 0000000000..f7dbfd9ac2 --- /dev/null +++ b/src/version2/schemas/connectModule.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** + * A [Connect module](https://developer.atlassian.com/cloud/jira/platform/about-jira-modules/) in the same format as in + * the + * + * - [app descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). + */ +export const ConnectModuleSchema = z.object({}); + +export type ConnectModule = z.infer; diff --git a/src/version2/schemas/connectModules.ts b/src/version2/schemas/connectModules.ts new file mode 100644 index 0000000000..49e8ff6173 --- /dev/null +++ b/src/version2/schemas/connectModules.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { ConnectModuleSchema } from './connectModule'; + +export const ConnectModulesSchema = z.object({ + /** + * A list of app modules in the same format as the `modules` property in the [app + * descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). + */ + modules: z.array(ConnectModuleSchema), +}); + +export type ConnectModules = z.infer; diff --git a/src/version2/schemas/connectWorkflowTransitionRule.ts b/src/version2/schemas/connectWorkflowTransitionRule.ts new file mode 100644 index 0000000000..5548ebcc98 --- /dev/null +++ b/src/version2/schemas/connectWorkflowTransitionRule.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { RuleConfigurationSchema } from './ruleConfiguration'; +import { WorkflowTransitionSchema } from './workflowTransition'; + +/** A workflow transition rule. */ +export const ConnectWorkflowTransitionRuleSchema = z.object({ + configuration: RuleConfigurationSchema, + /** The ID of the transition rule. */ + id: z.string(), + /** The key of the rule, as defined in the Connect app descriptor. */ + key: z.string(), + transition: WorkflowTransitionSchema.optional(), +}); + +export type ConnectWorkflowTransitionRule = z.infer; diff --git a/src/version2/schemas/containerForProjectFeatures.ts b/src/version2/schemas/containerForProjectFeatures.ts new file mode 100644 index 0000000000..a5c67b2180 --- /dev/null +++ b/src/version2/schemas/containerForProjectFeatures.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { ProjectFeatureSchema } from './projectFeature'; + +/** The list of features on a project. */ +export const ContainerForProjectFeaturesSchema = z.object({ + /** The project features. */ + features: z.array(ProjectFeatureSchema).optional(), +}); + +export type ContainerForProjectFeatures = z.infer; diff --git a/src/version2/schemas/containerForRegisteredWebhooks.ts b/src/version2/schemas/containerForRegisteredWebhooks.ts new file mode 100644 index 0000000000..4d01668762 --- /dev/null +++ b/src/version2/schemas/containerForRegisteredWebhooks.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { RegisteredWebhookSchema } from './registeredWebhook'; + +/** Container for a list of registered webhooks. Webhook details are returned in the same order as the request. */ +export const ContainerForRegisteredWebhooksSchema = z.object({ + /** A list of registered webhooks. */ + webhookRegistrationResult: z.array(RegisteredWebhookSchema).optional(), +}); + +export type ContainerForRegisteredWebhooks = z.infer; diff --git a/src/version2/schemas/containerForWebhookIDs.ts b/src/version2/schemas/containerForWebhookIDs.ts new file mode 100644 index 0000000000..8d58a59514 --- /dev/null +++ b/src/version2/schemas/containerForWebhookIDs.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** Container for a list of webhook IDs. */ +export const ContainerForWebhookIDsSchema = z.object({ + /** A list of webhook IDs. */ + webhookIds: z.array(z.number().int()), +}); + +export type ContainerForWebhookIDs = z.infer; diff --git a/src/version2/schemas/containerOfWorkflowSchemeAssociations.ts b/src/version2/schemas/containerOfWorkflowSchemeAssociations.ts new file mode 100644 index 0000000000..8b847250b3 --- /dev/null +++ b/src/version2/schemas/containerOfWorkflowSchemeAssociations.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { WorkflowSchemeAssociationsSchema } from './workflowSchemeAssociations'; + +/** A container for a list of workflow schemes together with the projects they are associated with. */ +export const ContainerOfWorkflowSchemeAssociationsSchema = z.object({ + /** A list of workflow schemes together with projects they are associated with. */ + values: z.array(WorkflowSchemeAssociationsSchema), +}); + +export type ContainerOfWorkflowSchemeAssociations = z.infer; diff --git a/src/version2/schemas/contentItem.ts b/src/version2/schemas/contentItem.ts new file mode 100644 index 0000000000..ed66a57e48 --- /dev/null +++ b/src/version2/schemas/contentItem.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; + +/** Represents the content to redact */ +export const ContentItemSchema = z.object({ + /** + * The ID of the content entity. + * + * - For redacting an issue field, this will be the field ID (e.g., summary, customfield_10000). + * - For redacting a comment, this will be the comment ID. + * - For redacting a worklog, this will be the worklog ID. + */ + entityId: z.string(), + /** + * The type of the entity to redact; It will be one of the following: + * + * - **issuefieldvalue** - To redact in issue fields + * - **issue-comment** - To redact in issue comments. + * - **issue-worklog** - To redact in issue worklogs + */ + entityType: z.enum(['issuefieldvalue', 'issue-comment', 'issue-worklog']), + /** This would be the issue ID */ + id: z.string(), +}); + +export type ContentItem = z.infer; diff --git a/src/version2/schemas/context.ts b/src/version2/schemas/context.ts new file mode 100644 index 0000000000..5ee590af78 --- /dev/null +++ b/src/version2/schemas/context.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** A context. */ +export const ContextSchema = z.object({ + /** The ID of the context. */ + id: z.number().int().optional(), + /** The name of the context. */ + name: z.string().optional(), + /** The scope of the context. */ + scope: z.unknown().optional(), +}); + +export type Context = z.infer; diff --git a/src/version2/schemas/contextForProjectAndIssueType.ts b/src/version2/schemas/contextForProjectAndIssueType.ts new file mode 100644 index 0000000000..17af77ba13 --- /dev/null +++ b/src/version2/schemas/contextForProjectAndIssueType.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The project and issue type mapping with a matching custom field context. */ +export const ContextForProjectAndIssueTypeSchema = z.object({ + /** The ID of the custom field context. */ + contextId: z.string(), + /** The ID of the issue type. */ + issueTypeId: z.string(), + /** The ID of the project. */ + projectId: z.string(), +}); + +export type ContextForProjectAndIssueType = z.infer; diff --git a/src/version2/schemas/contextualConfiguration.ts b/src/version2/schemas/contextualConfiguration.ts new file mode 100644 index 0000000000..e698d4fdf0 --- /dev/null +++ b/src/version2/schemas/contextualConfiguration.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Details of the contextual configuration for a custom field. */ +export const ContextualConfigurationSchema = z.object({ + /** The field configuration. */ + configuration: z.unknown().optional(), + /** The ID of the field context the configuration is associated with. */ + fieldContextId: z.string(), + /** The ID of the configuration. */ + id: z.string(), + /** The field value schema. */ + schema: z.unknown().optional(), +}); + +export type ContextualConfiguration = z.infer; diff --git a/src/version2/schemas/convertedJQLQueries.ts b/src/version2/schemas/convertedJQLQueries.ts new file mode 100644 index 0000000000..64df3d1b36 --- /dev/null +++ b/src/version2/schemas/convertedJQLQueries.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { JQLQueryWithUnknownUsersSchema } from './jQLQueryWithUnknownUsers'; + +/** The converted JQL queries. */ +export const ConvertedJQLQueriesSchema = z.object({ + /** List of queries containing user information that could not be mapped to an existing user */ + queriesWithUnknownUsers: z.array(JQLQueryWithUnknownUsersSchema).optional(), + /** The list of converted query strings with account IDs in place of user identifiers. */ + queryStrings: z.array(z.string()).optional(), +}); + +export type ConvertedJQLQueries = z.infer; diff --git a/src/version2/schemas/createCrossProjectReleaseRequest.ts b/src/version2/schemas/createCrossProjectReleaseRequest.ts new file mode 100644 index 0000000000..4bbc1eff41 --- /dev/null +++ b/src/version2/schemas/createCrossProjectReleaseRequest.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const CreateCrossProjectReleaseRequestSchema = z.object({ + /** The cross-project release name. */ + name: z.string(), + /** The IDs of the releases to include in the cross-project release. */ + releaseIds: z.array(z.number().int()).optional(), +}); + +export type CreateCrossProjectReleaseRequest = z.infer; diff --git a/src/version2/schemas/createCustomFieldContext.ts b/src/version2/schemas/createCustomFieldContext.ts new file mode 100644 index 0000000000..5ed97bb885 --- /dev/null +++ b/src/version2/schemas/createCustomFieldContext.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** The details of a created custom field context. */ +export const CreateCustomFieldContextSchema = z.object({ + /** The description of the context. */ + description: z.string().optional(), + /** The ID of the context. */ + id: z.string().optional(), + /** The list of issue types IDs for the context. If the list is empty, the context refers to all issue types. */ + issueTypeIds: z.array(z.string()).optional(), + /** The name of the context. */ + name: z.string(), + /** The list of project IDs associated with the context. If the list is empty, the context is global. */ + projectIds: z.array(z.string()).optional(), +}); + +export type CreateCustomFieldContext = z.infer; diff --git a/src/version2/schemas/createCustomFieldRequest.ts b/src/version2/schemas/createCustomFieldRequest.ts new file mode 100644 index 0000000000..bcf2f80de8 --- /dev/null +++ b/src/version2/schemas/createCustomFieldRequest.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const CreateCustomFieldRequestSchema = z.object({ + /** The custom field ID. */ + customFieldId: z.number().int(), + /** Allows filtering issues based on their values for the custom field. */ + filter: z.boolean().optional(), +}); + +export type CreateCustomFieldRequest = z.infer; diff --git a/src/version2/schemas/createDateFieldRequest.ts b/src/version2/schemas/createDateFieldRequest.ts new file mode 100644 index 0000000000..0713d823d8 --- /dev/null +++ b/src/version2/schemas/createDateFieldRequest.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const CreateDateFieldRequestSchema = z.object({ + /** A date custom field ID. This is required if the type is "DateCustomField". */ + dateCustomFieldId: z.number().int().optional(), + /** The date field type. This must be "DueDate", "TargetStartDate", "TargetEndDate" or "DateCustomField". */ + type: z.enum(['DueDate', 'TargetStartDate', 'TargetEndDate', 'DateCustomField']), +}); + +export type CreateDateFieldRequest = z.infer; diff --git a/src/version2/schemas/createExclusionRulesRequest.ts b/src/version2/schemas/createExclusionRulesRequest.ts new file mode 100644 index 0000000000..9ab91837b8 --- /dev/null +++ b/src/version2/schemas/createExclusionRulesRequest.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +export const CreateExclusionRulesRequestSchema = z.object({ + /** The IDs of the issues to exclude from the plan. */ + issueIds: z.array(z.number().int()).optional(), + /** The IDs of the issue types to exclude from the plan. */ + issueTypeIds: z.array(z.number().int()).optional(), + /** Issues completed this number of days ago will be excluded from the plan. */ + numberOfDaysToShowCompletedIssues: z.number().int().optional(), + /** The IDs of the releases to exclude from the plan. */ + releaseIds: z.array(z.number().int()).optional(), + /** The IDs of the work status categories to exclude from the plan. */ + workStatusCategoryIds: z.array(z.number().int()).optional(), + /** The IDs of the work statuses to exclude from the plan. */ + workStatusIds: z.array(z.number().int()).optional(), +}); + +export type CreateExclusionRulesRequest = z.infer; diff --git a/src/version2/schemas/createIssueSecuritySchemeDetails.ts b/src/version2/schemas/createIssueSecuritySchemeDetails.ts new file mode 100644 index 0000000000..41d1342cc7 --- /dev/null +++ b/src/version2/schemas/createIssueSecuritySchemeDetails.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { SecuritySchemeLevelSchema } from './securitySchemeLevel'; + +/** Issue security scheme and it's details */ +export const CreateIssueSecuritySchemeDetailsSchema = z.object({ + /** The description of the issue security scheme. */ + description: z.string().optional(), + /** The list of scheme levels which should be added to the security scheme. */ + levels: z.array(SecuritySchemeLevelSchema).optional(), + /** The name of the issue security scheme. Must be unique (case-insensitive). */ + name: z.string(), +}); + +export type CreateIssueSecuritySchemeDetails = z.infer; diff --git a/src/version2/schemas/createIssueSourceRequest.ts b/src/version2/schemas/createIssueSourceRequest.ts new file mode 100644 index 0000000000..b281f20d71 --- /dev/null +++ b/src/version2/schemas/createIssueSourceRequest.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const CreateIssueSourceRequestSchema = z.object({ + /** The issue source type. This must be "Board", "Project" or "Filter". */ + type: z.enum(['Board', 'Project', '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: z.number().int(), +}); + +export type CreateIssueSourceRequest = z.infer; diff --git a/src/version2/schemas/createNotificationSchemeDetails.ts b/src/version2/schemas/createNotificationSchemeDetails.ts new file mode 100644 index 0000000000..1842964b04 --- /dev/null +++ b/src/version2/schemas/createNotificationSchemeDetails.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { NotificationSchemeEventDetailsSchema } from './notificationSchemeEventDetails'; + +/** Details of an notification scheme. */ +export const CreateNotificationSchemeDetailsSchema = z.object({ + /** The description of the notification scheme. */ + description: z.string().optional(), + /** The name of the notification scheme. Must be unique (case-insensitive). */ + name: z.string(), + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents: z.array(NotificationSchemeEventDetailsSchema).optional(), +}); + +export type CreateNotificationSchemeDetails = z.infer; diff --git a/src/version2/schemas/createPermissionHolderRequest.ts b/src/version2/schemas/createPermissionHolderRequest.ts new file mode 100644 index 0000000000..4a087d6b58 --- /dev/null +++ b/src/version2/schemas/createPermissionHolderRequest.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const CreatePermissionHolderRequestSchema = z.object({ + /** The permission holder type. This must be "Group" or "AccountId". */ + type: z.enum(['Group', 'AccountId']), + /** + * 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: z.string(), +}); + +export type CreatePermissionHolderRequest = z.infer; diff --git a/src/version2/schemas/createPermissionRequest.ts b/src/version2/schemas/createPermissionRequest.ts new file mode 100644 index 0000000000..ec4640701c --- /dev/null +++ b/src/version2/schemas/createPermissionRequest.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const CreatePermissionRequestSchema = z.object({ + /** The permission holder. */ + holder: z.unknown(), + /** The permission type. This must be "View" or "Edit". */ + type: z.enum(['View', 'Edit']), +}); + +export type CreatePermissionRequest = z.infer; diff --git a/src/version2/schemas/createPlanOnlyTeamRequest.ts b/src/version2/schemas/createPlanOnlyTeamRequest.ts new file mode 100644 index 0000000000..bbc79d1ba1 --- /dev/null +++ b/src/version2/schemas/createPlanOnlyTeamRequest.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +export const CreatePlanOnlyTeamRequestSchema = z.object({ + /** The capacity for the plan-only team. */ + capacity: z.number().optional(), + /** The ID of the issue source for the plan-only team. */ + issueSourceId: z.number().int().optional(), + /** The account IDs of the plan-only team members. */ + memberAccountIds: z.array(z.string()).optional(), + /** The plan-only team name. */ + name: z.string(), + /** The planning style for the plan-only team. This must be "Scrum" or "Kanban". */ + planningStyle: z.enum(['Scrum', 'Kanban']), + /** The sprint length for the plan-only team. */ + sprintLength: z.number().int().optional(), +}); + +export type CreatePlanOnlyTeamRequest = z.infer; diff --git a/src/version2/schemas/createPlanRequest.ts b/src/version2/schemas/createPlanRequest.ts new file mode 100644 index 0000000000..6b634ce6fa --- /dev/null +++ b/src/version2/schemas/createPlanRequest.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; +import { CreateCrossProjectReleaseRequestSchema } from './createCrossProjectReleaseRequest'; +import { CreateCustomFieldRequestSchema } from './createCustomFieldRequest'; +import { CreateIssueSourceRequestSchema } from './createIssueSourceRequest'; +import { CreatePermissionRequestSchema } from './createPermissionRequest'; + +export const CreatePlanRequestSchema = z.object({ + /** The cross-project releases to include in the plan. */ + crossProjectReleases: z.array(CreateCrossProjectReleaseRequestSchema).optional(), + /** The custom fields for the plan. */ + customFields: z.array(CreateCustomFieldRequestSchema).optional(), + /** The exclusion rules for the plan. */ + exclusionRules: z.unknown().optional(), + /** The issue sources to include in the plan. */ + issueSources: z.array(CreateIssueSourceRequestSchema), + /** The account ID of the plan lead. */ + leadAccountId: z.string().optional(), + /** The plan name. */ + name: z.string(), + /** The permissions for the plan. */ + permissions: z.array(CreatePermissionRequestSchema).optional(), + /** The scheduling settings for the plan. */ + scheduling: z.unknown(), +}); + +export type CreatePlanRequest = z.infer; diff --git a/src/version2/schemas/createPriorityDetails.ts b/src/version2/schemas/createPriorityDetails.ts new file mode 100644 index 0000000000..5561e2cfd3 --- /dev/null +++ b/src/version2/schemas/createPriorityDetails.ts @@ -0,0 +1,46 @@ +import { z } from 'zod'; + +/** Details of an issue priority. */ +export const CreatePriorityDetailsSchema = z.object({ + /** + * 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: z.number().int().optional(), + /** The description of the priority. */ + description: z.string().optional(), + /** + * 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. + */ + iconUrl: z + .enum([ + '/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', + ]) + .optional(), + /** The name of the priority. Must be unique. */ + name: z.string(), + /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ + statusColor: z.string(), +}); + +export type CreatePriorityDetails = z.infer; diff --git a/src/version2/schemas/createPrioritySchemeDetails.ts b/src/version2/schemas/createPrioritySchemeDetails.ts new file mode 100644 index 0000000000..cc1b3798e9 --- /dev/null +++ b/src/version2/schemas/createPrioritySchemeDetails.ts @@ -0,0 +1,40 @@ +import { z } from 'zod'; + +/** Details of a new priority scheme */ +export const CreatePrioritySchemeDetailsSchema = z.object({ + /** The ID of the default priority for the priority scheme. */ + defaultPriorityId: z.number().int(), + /** The description of the priority scheme. */ + description: z.string().optional(), + /** + * Instructions to migrate the priorities of issues. + * + * `in` mappings are used to migrate the priorities of issues to priorities used within the priority scheme. + * + * `out` mappings are used to migrate the priorities of issues to priorities not used within the priority scheme. + * + * - When **priorities** are **added** to the new priority scheme, no mapping needs to be provided as the new priorities + * are not used by any issues. + * - When **priorities** are **removed** from the new priority scheme, no mapping needs to be provided as the removed + * priorities are not used by any issues. + * - When **projects** are **added** to the priority scheme, the priorities of issues in those projects might need to be + * migrated to new priorities used by the priority scheme. This can occur when the current scheme does not use all + * the priorities in the project(s)' priority scheme(s). + * + * - An `in` mapping must be provided for each of these priorities. + * - When **projects** are **removed** from the priority scheme, no mapping needs to be provided as the removed projects + * are not using the priorities of the new priority scheme. + * + * For more information on `in` and `out` mappings, see the child properties documentation for the `PriorityMapping` + * object below. + */ + mappings: z.unknown().optional(), + /** The name of the priority scheme. Must be unique. */ + name: z.string(), + /** The IDs of priorities in the scheme. */ + priorityIds: z.array(z.number().int()), + /** The IDs of projects that will use the priority scheme. */ + projectIds: z.array(z.number().int()).optional(), +}); + +export type CreatePrioritySchemeDetails = z.infer; diff --git a/src/version2/schemas/createProjectDetails.ts b/src/version2/schemas/createProjectDetails.ts new file mode 100644 index 0000000000..dc7d5176a4 --- /dev/null +++ b/src/version2/schemas/createProjectDetails.ts @@ -0,0 +1,140 @@ +import { z } from 'zod'; + +/** Details about the project. */ +export const CreateProjectDetailsSchema = z.object({ + /** The default assignee when creating issues for this project. */ + assigneeType: z.enum(['PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** An integer value for the project's avatar. */ + avatarId: z.number().int().optional(), + /** + * 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. + */ + categoryId: z.number().int().optional(), + /** A brief description of the project. */ + description: z.string().optional(), + /** + * The ID of the field configuration scheme for the project. Use the [Get all field configuration + * schemes](#api-rest-api-2-fieldconfigurationscheme-get) operation to get a list of field configuration scheme IDs. + * If you specify the field configuration scheme you cannot specify the project template key. + */ + fieldConfigurationScheme: z.number().int().optional(), + /** + * 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 + * scheme IDs. + */ + issueSecurityScheme: z.number().int().optional(), + /** + * The ID of the issue type scheme for the project. Use the [Get all issue type + * schemes](#api-rest-api-2-issuetypescheme-get) operation to get a list of issue type scheme IDs. If you specify the + * issue type scheme you cannot specify the project template key. + */ + issueTypeScheme: z.number().int().optional(), + /** + * The ID of the issue type screen scheme for the project. Use the [Get all issue type screen + * schemes](#api-rest-api-2-issuetypescreenscheme-get) operation to get a list of issue type screen scheme IDs. If you + * specify the issue type screen scheme you cannot specify the project template key. + */ + issueTypeScreenScheme: z.number().int().optional(), + /** + * 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. + */ + key: z.string(), + /** + * This parameter is deprecated because of privacy changes. Use `leadAccountId` instead. See the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. The user name of the project lead. Either `lead` or `leadAccountId` must be set when creating a + * project. Cannot be provided with `leadAccountId`. + */ + lead: z.string().optional(), + /** + * The account ID of the project lead. Either `lead` or `leadAccountId` must be set when creating a project. Cannot be + * provided with `lead`. + */ + leadAccountId: z.string().optional(), + /** The name of the project. */ + name: z.string(), + /** + * 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: z.number().int().optional(), + /** + * 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. + */ + permissionScheme: z.number().int().optional(), + /** + * A predefined configuration for a project. The type of the `projectTemplateKey` must match with the type of the + * `projectTypeKey`. + */ + projectTemplateKey: z + .enum([ + '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', + 'com.pyxis.greenhopper.jira:gh-cross-team-template', + 'com.pyxis.greenhopper.jira:gh-cross-team-planning-template', + 'com.atlassian.servicedesk:simplified-it-service-management', + 'com.atlassian.servicedesk:simplified-it-service-management-basic', + 'com.atlassian.servicedesk:simplified-it-service-management-operations', + 'com.atlassian.servicedesk:simplified-general-service-desk', + 'com.atlassian.servicedesk:simplified-general-service-desk-it', + 'com.atlassian.servicedesk:simplified-general-service-desk-business', + 'com.atlassian.servicedesk:simplified-internal-service-desk', + 'com.atlassian.servicedesk:simplified-external-service-desk', + 'com.atlassian.servicedesk:simplified-hr-service-desk', + 'com.atlassian.servicedesk:simplified-facilities-service-desk', + 'com.atlassian.servicedesk:simplified-legal-service-desk', + 'com.atlassian.servicedesk:simplified-marketing-service-desk', + 'com.atlassian.servicedesk:simplified-finance-service-desk', + 'com.atlassian.servicedesk:simplified-analytics-service-desk', + 'com.atlassian.servicedesk:simplified-design-service-desk', + 'com.atlassian.servicedesk:simplified-sales-service-desk', + 'com.atlassian.servicedesk:simplified-halp-service-desk', + 'com.atlassian.servicedesk:simplified-blank-project-it', + 'com.atlassian.servicedesk:simplified-blank-project-business', + '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', + '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-', + ]) + .optional(), + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes), which + * defines the application-specific feature set. If you don't specify the project template you have to specify the + * project type. + */ + projectTypeKey: z.enum(['software', 'service_desk', 'business']).optional(), + /** A link to information about this project, such as project documentation */ + url: z.string().optional(), + /** + * The ID of the workflow scheme for the project. Use the [Get all workflow + * schemes](#api-rest-api-2-workflowscheme-get) operation to get a list of workflow scheme IDs. If you specify the + * workflow scheme you cannot specify the project template key. + */ + workflowScheme: z.number().int().optional(), +}); + +export type CreateProjectDetails = z.infer; diff --git a/src/version2/schemas/createResolutionDetails.ts b/src/version2/schemas/createResolutionDetails.ts new file mode 100644 index 0000000000..5bd6b97b48 --- /dev/null +++ b/src/version2/schemas/createResolutionDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of an issue resolution. */ +export const CreateResolutionDetailsSchema = z.object({ + /** The description of the resolution. */ + description: z.string().optional(), + /** The name of the resolution. Must be unique (case-insensitive). */ + name: z.string(), +}); + +export type CreateResolutionDetails = z.infer; diff --git a/src/version2/schemas/createSchedulingRequest.ts b/src/version2/schemas/createSchedulingRequest.ts new file mode 100644 index 0000000000..88dc011e49 --- /dev/null +++ b/src/version2/schemas/createSchedulingRequest.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const CreateSchedulingRequestSchema = z.object({ + /** The dependencies for the plan. This must be "Sequential" or "Concurrent". */ + dependencies: z.enum(['Sequential', 'Concurrent']).optional(), + /** The end date field for the plan. */ + endDate: z.unknown().optional(), + /** The estimation unit for the plan. This must be "StoryPoints", "Days" or "Hours". */ + estimation: z.enum(['StoryPoints', 'Days', 'Hours']), + /** The inferred dates for the plan. This must be "None", "SprintDates" or "ReleaseDates". */ + inferredDates: z.enum(['None', 'SprintDates', 'ReleaseDates']).optional(), + /** The start date field for the plan. */ + startDate: z.unknown().optional(), +}); + +export type CreateSchedulingRequest = z.infer; diff --git a/src/version2/schemas/createUiModificationDetails.ts b/src/version2/schemas/createUiModificationDetails.ts new file mode 100644 index 0000000000..fdf97b059a --- /dev/null +++ b/src/version2/schemas/createUiModificationDetails.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { UiModificationContextDetailsSchema } from './uiModificationContextDetails'; + +/** The details of a UI modification. */ +export const CreateUiModificationDetailsSchema = z.object({ + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts: z.array(UiModificationContextDetailsSchema).optional(), + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data: z.string().optional(), + /** The description of the UI modification. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the UI modification. The maximum length is 255 characters. */ + name: z.string(), +}); + +export type CreateUiModificationDetails = z.infer; diff --git a/src/version2/schemas/createUpdateRoleRequestBean.ts b/src/version2/schemas/createUpdateRoleRequestBean.ts new file mode 100644 index 0000000000..fcd124f504 --- /dev/null +++ b/src/version2/schemas/createUpdateRoleRequestBean.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const CreateUpdateRoleRequestBeanSchema = z.object({ + /** + * A description of the project role. Required when fully updating a project role. Optional when creating or partially + * updating a project role. + */ + description: z.string().optional(), + /** + * The name of the project role. Must be unique. Cannot begin or end with whitespace. The maximum length is 255 + * characters. Required when creating a project role. Optional when partially updating a project role. + */ + name: z.string().optional(), +}); + +export type CreateUpdateRoleRequestBean = z.infer; diff --git a/src/version2/schemas/createWorkflowCondition.ts b/src/version2/schemas/createWorkflowCondition.ts new file mode 100644 index 0000000000..f4216b1fbe --- /dev/null +++ b/src/version2/schemas/createWorkflowCondition.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { CreateWorkflowConditionSchema } from './createWorkflowCondition'; + +/** A workflow transition condition. */ +export const CreateWorkflowConditionSchema = z.object({ + /** The list of workflow conditions. */ + conditions: z.array(CreateWorkflowConditionSchema).optional(), + /** EXPERIMENTAL. The configuration of the transition rule. */ + configuration: z.object({}).optional(), + /** The compound condition operator. */ + operator: z.enum(['AND', 'OR']).optional(), + /** The type of the transition rule. */ + type: z.string().optional(), +}); + +export type CreateWorkflowCondition = z.infer; diff --git a/src/version2/schemas/createWorkflowDetails.ts b/src/version2/schemas/createWorkflowDetails.ts new file mode 100644 index 0000000000..dd30be3e51 --- /dev/null +++ b/src/version2/schemas/createWorkflowDetails.ts @@ -0,0 +1,35 @@ +import { z } from 'zod'; +import { CreateWorkflowStatusDetailsSchema } from './createWorkflowStatusDetails'; +import { CreateWorkflowTransitionDetailsSchema } from './createWorkflowTransitionDetails'; + +/** The details of a workflow. */ +export const CreateWorkflowDetailsSchema = z.object({ + /** The description of the workflow. The maximum length is 1000 characters. */ + description: z.string().optional(), + /** + * The name of the workflow. The name must be unique. The maximum length is 255 characters. Characters can be + * separated by a whitespace but the name cannot start or end with a whitespace. + */ + name: z.string(), + /** + * The statuses of the workflow. Any status that does not include a transition is added to the workflow without a + * transition. + */ + statuses: z.array(CreateWorkflowStatusDetailsSchema), + /** + * The transitions of the workflow. For the request to be valid, these transitions must: + * + * - Include one _initial_ transition. + * - Not use the same name for a _global_ and _directed_ transition. + * - Have a unique name for each _global_ transition. + * - Have a unique 'to' status for each _global_ transition. + * - Have unique names for each transition from a status. + * - Not have a 'from' status on _initial_ and _global_ transitions. + * - Have a 'from' status on _directed_ transitions. + * + * All the transition statuses must be included in `statuses`. + */ + transitions: z.array(CreateWorkflowTransitionDetailsSchema), +}); + +export type CreateWorkflowDetails = z.infer; diff --git a/src/version2/schemas/createWorkflowStatusDetails.ts b/src/version2/schemas/createWorkflowStatusDetails.ts new file mode 100644 index 0000000000..4e06bee055 --- /dev/null +++ b/src/version2/schemas/createWorkflowStatusDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The details of a transition status. */ +export const CreateWorkflowStatusDetailsSchema = z.object({ + /** The ID of the status. */ + id: z.string(), + /** The properties of the status. */ + properties: z.object({}).optional(), +}); + +export type CreateWorkflowStatusDetails = z.infer; diff --git a/src/version2/schemas/createWorkflowTransitionDetails.ts b/src/version2/schemas/createWorkflowTransitionDetails.ts new file mode 100644 index 0000000000..45e44b511c --- /dev/null +++ b/src/version2/schemas/createWorkflowTransitionDetails.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +/** The details of a workflow transition. */ +export const CreateWorkflowTransitionDetailsSchema = z.object({ + /** The description of the transition. The maximum length is 1000 characters. */ + description: z.string().optional(), + /** The statuses the transition can start from. */ + from: z.array(z.string()).optional(), + /** The name of the transition. The maximum length is 60 characters. */ + name: z.string(), + /** The properties of the transition. */ + properties: z.object({}).optional(), + /** The rules of the transition. */ + rules: z.unknown().optional(), + /** The screen of the transition. */ + screen: z.unknown().optional(), + /** The status the transition goes to. */ + to: z.string(), + /** The type of the transition. */ + type: z.enum(['global', 'initial', 'directed']), +}); + +export type CreateWorkflowTransitionDetails = z.infer; diff --git a/src/version2/schemas/createWorkflowTransitionRule.ts b/src/version2/schemas/createWorkflowTransitionRule.ts new file mode 100644 index 0000000000..9329f4edda --- /dev/null +++ b/src/version2/schemas/createWorkflowTransitionRule.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** A workflow transition rule. */ +export const CreateWorkflowTransitionRuleSchema = z.object({ + /** EXPERIMENTAL. The configuration of the transition rule. */ + configuration: z.object({}).optional(), + /** The type of the transition rule. */ + type: z.string(), +}); + +export type CreateWorkflowTransitionRule = z.infer; diff --git a/src/version2/schemas/createWorkflowTransitionRulesDetails.ts b/src/version2/schemas/createWorkflowTransitionRulesDetails.ts new file mode 100644 index 0000000000..79f4cf2851 --- /dev/null +++ b/src/version2/schemas/createWorkflowTransitionRulesDetails.ts @@ -0,0 +1,75 @@ +import { z } from 'zod'; +import { CreateWorkflowTransitionRuleSchema } from './createWorkflowTransitionRule'; + +/** The details of a workflow transition rules. */ +export const CreateWorkflowTransitionRulesDetailsSchema = z.object({ + /** The workflow conditions. */ + conditions: z.unknown().optional(), + /** + * The workflow post functions. + * + * **Note:** The default post functions are always added to the _initial_ transition, as in: + * + * "postFunctions": [ + * { + * "type": "IssueCreateFunction" + * }, + * { + * "type": "IssueReindexFunction" + * }, + * { + * "type": "FireIssueEventFunction", + * "configuration": { + * "event": { + * "id": "1", + * "name": "issue_created" + * } + * } + * } + * ] + * + * **Note:** The default post functions are always added to the _global_ and _directed_ transitions, as in: + * + * "postFunctions": [ + * { + * "type": "UpdateIssueStatusFunction" + * }, + * { + * "type": "CreateCommentFunction" + * }, + * { + * "type": "GenerateChangeHistoryFunction" + * }, + * { + * "type": "IssueReindexFunction" + * }, + * { + * "type": "FireIssueEventFunction", + * "configuration": { + * "event": { + * "id": "13", + * "name": "issue_generic" + * } + * } + * } + * ] + */ + postFunctions: z.array(CreateWorkflowTransitionRuleSchema).optional(), + /** + * The workflow validators. + * + * **Note:** The default permission validator is always added to the _initial_ transition, as in: + * + * "validators": [ + * { + * "type": "PermissionValidator", + * "configuration": { + * "permissionKey": "CREATE_ISSUES" + * } + * } + * ] + */ + validators: z.array(CreateWorkflowTransitionRuleSchema).optional(), +}); + +export type CreateWorkflowTransitionRulesDetails = z.infer; diff --git a/src/version2/schemas/createWorkflowTransitionScreenDetails.ts b/src/version2/schemas/createWorkflowTransitionScreenDetails.ts new file mode 100644 index 0000000000..27c0c5f46e --- /dev/null +++ b/src/version2/schemas/createWorkflowTransitionScreenDetails.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The details of a transition screen. */ +export const CreateWorkflowTransitionScreenDetailsSchema = z.object({ + /** The ID of the screen. */ + id: z.string(), +}); + +export type CreateWorkflowTransitionScreenDetails = z.infer; diff --git a/src/version2/schemas/createdIssue.ts b/src/version2/schemas/createdIssue.ts new file mode 100644 index 0000000000..3ceb53022e --- /dev/null +++ b/src/version2/schemas/createdIssue.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details about a created issue or subtask. */ +export const CreatedIssueSchema = z.object({ + /** The ID of the created issue or subtask. */ + id: z.string().optional(), + /** The key of the created issue or subtask. */ + key: z.string().optional(), + /** The URL of the created issue or subtask. */ + self: z.string().optional(), + /** The response code and messages related to any requested transition. */ + transition: z.unknown().optional(), + /** The response code and messages related to any requested watchers. */ + watchers: z.unknown().optional(), +}); + +export type CreatedIssue = z.infer; diff --git a/src/version2/schemas/createdIssues.ts b/src/version2/schemas/createdIssues.ts new file mode 100644 index 0000000000..61c3ca4e8b --- /dev/null +++ b/src/version2/schemas/createdIssues.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { BulkOperationErrorResultSchema } from './bulkOperationErrorResult'; +import { CreatedIssueSchema } from './createdIssue'; + +/** Details about the issues created and the errors for requests that failed. */ +export const CreatedIssuesSchema = z.object({ + /** Error details for failed issue creation requests. */ + errors: z.array(BulkOperationErrorResultSchema).optional(), + /** Details of the issues created. */ + issues: z.array(CreatedIssueSchema).optional(), +}); + +export type CreatedIssues = z.infer; diff --git a/src/version2/schemas/customContextVariable.ts b/src/version2/schemas/customContextVariable.ts new file mode 100644 index 0000000000..3cf14af265 --- /dev/null +++ b/src/version2/schemas/customContextVariable.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const CustomContextVariableSchema = z.object({ + /** Type of custom context variable. */ + type: z.string(), +}); + +export type CustomContextVariable = z.infer; diff --git a/src/version2/schemas/customFieldConfigurations.ts b/src/version2/schemas/customFieldConfigurations.ts new file mode 100644 index 0000000000..1e880da21c --- /dev/null +++ b/src/version2/schemas/customFieldConfigurations.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { ContextualConfigurationSchema } from './contextualConfiguration'; + +/** Details of configurations for a custom field. */ +export const CustomFieldConfigurationsSchema = z.object({ + /** The list of custom field configuration details. */ + configurations: z.array(ContextualConfigurationSchema), +}); + +export type CustomFieldConfigurations = z.infer; diff --git a/src/version2/schemas/customFieldContext.ts b/src/version2/schemas/customFieldContext.ts new file mode 100644 index 0000000000..12a37eeedb --- /dev/null +++ b/src/version2/schemas/customFieldContext.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** The details of a custom field context. */ +export const CustomFieldContextSchema = z.object({ + /** The description of the context. */ + description: z.string(), + /** The ID of the context. */ + id: z.string(), + /** Whether the context apply to all issue types. */ + isAnyIssueType: z.boolean(), + /** Whether the context is global. */ + isGlobalContext: z.boolean(), + /** The name of the context. */ + name: z.string(), +}); + +export type CustomFieldContext = z.infer; diff --git a/src/version2/schemas/customFieldContextDefaultValue.ts b/src/version2/schemas/customFieldContextDefaultValue.ts new file mode 100644 index 0000000000..7737150530 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValue.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const CustomFieldContextDefaultValueSchema = z.object({}); + +export type CustomFieldContextDefaultValue = z.infer; diff --git a/src/version2/schemas/customFieldContextDefaultValueCascadingOption.ts b/src/version2/schemas/customFieldContextDefaultValueCascadingOption.ts new file mode 100644 index 0000000000..cf82ff54cd --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueCascadingOption.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** The default value for a cascading select custom field. */ +export const CustomFieldContextDefaultValueCascadingOptionSchema = z.object({ + /** The ID of the default cascading option. */ + cascadingOptionId: z.string().optional(), + /** The ID of the context. */ + contextId: z.string(), + /** The ID of the default option. */ + optionId: z.string(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueCascadingOption = z.infer< + typeof CustomFieldContextDefaultValueCascadingOptionSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueDate.ts b/src/version2/schemas/customFieldContextDefaultValueDate.ts new file mode 100644 index 0000000000..e807c547e0 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueDate.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** The default value for a Date custom field. */ +export const CustomFieldContextDefaultValueDateSchema = z.object({ + /** The default date in ISO format. Ignored if `useCurrent` is true. */ + date: z.string().optional(), + type: z.string(), + /** Whether to use the current date. */ + useCurrent: z.boolean().optional(), +}); + +export type CustomFieldContextDefaultValueDate = z.infer; diff --git a/src/version2/schemas/customFieldContextDefaultValueDateTime.ts b/src/version2/schemas/customFieldContextDefaultValueDateTime.ts new file mode 100644 index 0000000000..5e0d55e854 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueDateTime.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** The default value for a date time custom field. */ +export const CustomFieldContextDefaultValueDateTimeSchema = z.object({ + /** The default date-time in ISO format. Ignored if `useCurrent` is true. */ + dateTime: z.string().optional(), + type: z.string(), + /** Whether to use the current date. */ + useCurrent: z.boolean().optional(), +}); + +export type CustomFieldContextDefaultValueDateTime = z.infer; diff --git a/src/version2/schemas/customFieldContextDefaultValueFloat.ts b/src/version2/schemas/customFieldContextDefaultValueFloat.ts new file mode 100644 index 0000000000..c9e1d975f8 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueFloat.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +/** Default value for a float (number) custom field. */ +export const CustomFieldContextDefaultValueFloatSchema = z.object({ + /** The default floating-point number. */ + number: z.number(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueFloat = z.infer; diff --git a/src/version2/schemas/customFieldContextDefaultValueForgeDateTimeField.ts b/src/version2/schemas/customFieldContextDefaultValueForgeDateTimeField.ts new file mode 100644 index 0000000000..e66c2534a7 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueForgeDateTimeField.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** The default value for a Forge date time custom field. */ +export const CustomFieldContextDefaultValueForgeDateTimeFieldSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + /** The default date-time in ISO format. Ignored if `useCurrent` is true. */ + dateTime: z.string().optional(), + type: z.string(), + /** Whether to use the current date. */ + useCurrent: z.boolean().optional(), +}); + +export type CustomFieldContextDefaultValueForgeDateTimeField = z.infer< + typeof CustomFieldContextDefaultValueForgeDateTimeFieldSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueForgeGroupField.ts b/src/version2/schemas/customFieldContextDefaultValueForgeGroupField.ts new file mode 100644 index 0000000000..ab2dddab89 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueForgeGroupField.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** The default value for a Forge group custom field. */ +export const CustomFieldContextDefaultValueForgeGroupFieldSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + /** The ID of the the default group. */ + groupId: z.string(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueForgeGroupField = z.infer< + typeof CustomFieldContextDefaultValueForgeGroupFieldSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueForgeMultiGroupField.ts b/src/version2/schemas/customFieldContextDefaultValueForgeMultiGroupField.ts new file mode 100644 index 0000000000..87911894b0 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueForgeMultiGroupField.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** The default value for a Forge collection of groups custom field. */ +export const CustomFieldContextDefaultValueForgeMultiGroupFieldSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + /** The IDs of the default groups. */ + groupIds: z.array(z.string()), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueForgeMultiGroupField = z.infer< + typeof CustomFieldContextDefaultValueForgeMultiGroupFieldSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueForgeMultiStringField.ts b/src/version2/schemas/customFieldContextDefaultValueForgeMultiStringField.ts new file mode 100644 index 0000000000..bc0448816e --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueForgeMultiStringField.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** The default text for a Forge collection of strings custom field. */ +export const CustomFieldContextDefaultValueForgeMultiStringFieldSchema = z.object({ + type: z.string(), + /** List of string values. The maximum length for a value is 254 characters. */ + values: z.array(z.string()).optional(), +}); + +export type CustomFieldContextDefaultValueForgeMultiStringField = z.infer< + typeof CustomFieldContextDefaultValueForgeMultiStringFieldSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueForgeMultiUserField.ts b/src/version2/schemas/customFieldContextDefaultValueForgeMultiUserField.ts new file mode 100644 index 0000000000..8a33b114ae --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueForgeMultiUserField.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** Defaults for a Forge collection of users custom field. */ +export const CustomFieldContextDefaultValueForgeMultiUserFieldSchema = z.object({ + /** The IDs of the default users. */ + accountIds: z.array(z.string()), + /** The ID of the context. */ + contextId: z.string(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueForgeMultiUserField = z.infer< + typeof CustomFieldContextDefaultValueForgeMultiUserFieldSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueForgeNumberField.ts b/src/version2/schemas/customFieldContextDefaultValueForgeNumberField.ts new file mode 100644 index 0000000000..23720ebf79 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueForgeNumberField.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** Default value for a Forge number custom field. */ +export const CustomFieldContextDefaultValueForgeNumberFieldSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + /** The default floating-point number. */ + number: z.number(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueForgeNumberField = z.infer< + typeof CustomFieldContextDefaultValueForgeNumberFieldSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueForgeObjectField.ts b/src/version2/schemas/customFieldContextDefaultValueForgeObjectField.ts new file mode 100644 index 0000000000..852184d150 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueForgeObjectField.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** The default value for a Forge object custom field. */ +export const CustomFieldContextDefaultValueForgeObjectFieldSchema = z.object({ + /** The default JSON object. */ + object: z.object({}).optional(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueForgeObjectField = z.infer< + typeof CustomFieldContextDefaultValueForgeObjectFieldSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueForgeStringField.ts b/src/version2/schemas/customFieldContextDefaultValueForgeStringField.ts new file mode 100644 index 0000000000..d7f23c1384 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueForgeStringField.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** The default text for a Forge string custom field. */ +export const CustomFieldContextDefaultValueForgeStringFieldSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + /** The default text. The maximum length is 254 characters. */ + text: z.string().optional(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueForgeStringField = z.infer< + typeof CustomFieldContextDefaultValueForgeStringFieldSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueForgeUserField.ts b/src/version2/schemas/customFieldContextDefaultValueForgeUserField.ts new file mode 100644 index 0000000000..439c3f2a64 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueForgeUserField.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { UserFilterSchema } from './userFilter'; + +/** Defaults for a Forge user custom field. */ +export const CustomFieldContextDefaultValueForgeUserFieldSchema = z.object({ + /** The ID of the default user. */ + accountId: z.string(), + /** The ID of the context. */ + contextId: z.string(), + type: z.string(), + userFilter: UserFilterSchema, +}); + +export type CustomFieldContextDefaultValueForgeUserField = z.infer< + typeof CustomFieldContextDefaultValueForgeUserFieldSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueLabels.ts b/src/version2/schemas/customFieldContextDefaultValueLabels.ts new file mode 100644 index 0000000000..6cefbc7d09 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueLabels.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +/** Default value for a labels custom field. */ +export const CustomFieldContextDefaultValueLabelsSchema = z.object({ + /** The default labels value. */ + labels: z.array(z.string()), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueLabels = z.infer; diff --git a/src/version2/schemas/customFieldContextDefaultValueMultiUserPicker.ts b/src/version2/schemas/customFieldContextDefaultValueMultiUserPicker.ts new file mode 100644 index 0000000000..89b7585515 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueMultiUserPicker.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** The default value for a User Picker (multiple) custom field. */ +export const CustomFieldContextDefaultValueMultiUserPickerSchema = z.object({ + /** The IDs of the default users. */ + accountIds: z.array(z.string()), + /** The ID of the context. */ + contextId: z.string(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueMultiUserPicker = z.infer< + typeof CustomFieldContextDefaultValueMultiUserPickerSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueMultipleGroupPicker.ts b/src/version2/schemas/customFieldContextDefaultValueMultipleGroupPicker.ts new file mode 100644 index 0000000000..818131e5e5 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueMultipleGroupPicker.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** The default value for a multiple group picker custom field. */ +export const CustomFieldContextDefaultValueMultipleGroupPickerSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + /** The IDs of the default groups. */ + groupIds: z.array(z.string()), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueMultipleGroupPicker = z.infer< + typeof CustomFieldContextDefaultValueMultipleGroupPickerSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueMultipleOption.ts b/src/version2/schemas/customFieldContextDefaultValueMultipleOption.ts new file mode 100644 index 0000000000..293330b10b --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueMultipleOption.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** The default value for a multi-select custom field. */ +export const CustomFieldContextDefaultValueMultipleOptionSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + /** The list of IDs of the default options. */ + optionIds: z.array(z.string()), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueMultipleOption = z.infer< + typeof CustomFieldContextDefaultValueMultipleOptionSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueMultipleVersionPicker.ts b/src/version2/schemas/customFieldContextDefaultValueMultipleVersionPicker.ts new file mode 100644 index 0000000000..d38973f3c9 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueMultipleVersionPicker.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** The default value for a multiple version picker custom field. */ +export const CustomFieldContextDefaultValueMultipleVersionPickerSchema = z.object({ + type: z.string(), + /** The IDs of the default versions. */ + versionIds: z.array(z.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: z.string().optional(), +}); + +export type CustomFieldContextDefaultValueMultipleVersionPicker = z.infer< + typeof CustomFieldContextDefaultValueMultipleVersionPickerSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueProject.ts b/src/version2/schemas/customFieldContextDefaultValueProject.ts new file mode 100644 index 0000000000..fd8e1306d7 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueProject.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** The default value for a project custom field. */ +export const CustomFieldContextDefaultValueProjectSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + /** The ID of the default project. */ + projectId: z.string(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueProject = z.infer; diff --git a/src/version2/schemas/customFieldContextDefaultValueReadOnly.ts b/src/version2/schemas/customFieldContextDefaultValueReadOnly.ts new file mode 100644 index 0000000000..6d6562c329 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueReadOnly.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +/** The default text for a read only custom field. */ +export const CustomFieldContextDefaultValueReadOnlySchema = z.object({ + /** The default text. The maximum length is 255 characters. */ + text: z.string().optional(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueReadOnly = z.infer; diff --git a/src/version2/schemas/customFieldContextDefaultValueSingleGroupPicker.ts b/src/version2/schemas/customFieldContextDefaultValueSingleGroupPicker.ts new file mode 100644 index 0000000000..06267ae0a9 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueSingleGroupPicker.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** The default value for a group picker custom field. */ +export const CustomFieldContextDefaultValueSingleGroupPickerSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + /** The ID of the the default group. */ + groupId: z.string(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueSingleGroupPicker = z.infer< + typeof CustomFieldContextDefaultValueSingleGroupPickerSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueSingleOption.ts b/src/version2/schemas/customFieldContextDefaultValueSingleOption.ts new file mode 100644 index 0000000000..aba59d0b40 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueSingleOption.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** The default value for a single select custom field. */ +export const CustomFieldContextDefaultValueSingleOptionSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + /** The ID of the default option. */ + optionId: z.string(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueSingleOption = z.infer< + typeof CustomFieldContextDefaultValueSingleOptionSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueSingleVersionPicker.ts b/src/version2/schemas/customFieldContextDefaultValueSingleVersionPicker.ts new file mode 100644 index 0000000000..796e6add4e --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueSingleVersionPicker.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** The default value for a version picker custom field. */ +export const CustomFieldContextDefaultValueSingleVersionPickerSchema = z.object({ + type: z.string(), + /** The ID of the default version. */ + versionId: z.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: z.string().optional(), +}); + +export type CustomFieldContextDefaultValueSingleVersionPicker = z.infer< + typeof CustomFieldContextDefaultValueSingleVersionPickerSchema +>; diff --git a/src/version2/schemas/customFieldContextDefaultValueTextArea.ts b/src/version2/schemas/customFieldContextDefaultValueTextArea.ts new file mode 100644 index 0000000000..2249076d13 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueTextArea.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +/** The default text for a text area custom field. */ +export const CustomFieldContextDefaultValueTextAreaSchema = z.object({ + /** The default text. The maximum length is 32767 characters. */ + text: z.string().optional(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueTextArea = z.infer; diff --git a/src/version2/schemas/customFieldContextDefaultValueTextField.ts b/src/version2/schemas/customFieldContextDefaultValueTextField.ts new file mode 100644 index 0000000000..03f457cb49 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueTextField.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +/** The default text for a text custom field. */ +export const CustomFieldContextDefaultValueTextFieldSchema = z.object({ + /** The default text. The maximum length is 254 characters. */ + text: z.string().optional(), + type: z.string(), +}); + +export type CustomFieldContextDefaultValueTextField = z.infer; diff --git a/src/version2/schemas/customFieldContextDefaultValueURL.ts b/src/version2/schemas/customFieldContextDefaultValueURL.ts new file mode 100644 index 0000000000..0dcba1f527 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueURL.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** The default value for a URL custom field. */ +export const CustomFieldContextDefaultValueURLSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + type: z.string(), + /** The default URL. */ + url: z.string(), +}); + +export type CustomFieldContextDefaultValueURL = z.infer; diff --git a/src/version2/schemas/customFieldContextDefaultValueUpdate.ts b/src/version2/schemas/customFieldContextDefaultValueUpdate.ts new file mode 100644 index 0000000000..92a51be284 --- /dev/null +++ b/src/version2/schemas/customFieldContextDefaultValueUpdate.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { CustomFieldContextDefaultValueSchema } from './customFieldContextDefaultValue'; + +/** Default values to update. */ +export const CustomFieldContextDefaultValueUpdateSchema = z.object({ + defaultValues: z.array(CustomFieldContextDefaultValueSchema).optional(), +}); + +export type CustomFieldContextDefaultValueUpdate = z.infer; diff --git a/src/version2/schemas/customFieldContextOption.ts b/src/version2/schemas/customFieldContextOption.ts new file mode 100644 index 0000000000..2222a4ee28 --- /dev/null +++ b/src/version2/schemas/customFieldContextOption.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Details of the custom field options for a context. */ +export const CustomFieldContextOptionSchema = z.object({ + /** Whether the option is disabled. */ + disabled: z.boolean(), + /** The ID of the custom field option. */ + id: z.string(), + /** For cascading options, the ID of the custom field option containing the cascading option. */ + optionId: z.string().optional(), + /** The value of the custom field option. */ + value: z.string(), +}); + +export type CustomFieldContextOption = z.infer; diff --git a/src/version2/schemas/customFieldContextProjectMapping.ts b/src/version2/schemas/customFieldContextProjectMapping.ts new file mode 100644 index 0000000000..6eb51a1074 --- /dev/null +++ b/src/version2/schemas/customFieldContextProjectMapping.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of a context to project association. */ +export const CustomFieldContextProjectMappingSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + /** Whether context is global. */ + isGlobalContext: z.boolean().optional(), + /** The ID of the project. */ + projectId: z.string().optional(), +}); + +export type CustomFieldContextProjectMapping = z.infer; diff --git a/src/version2/schemas/customFieldContextSingleUserPickerDefaults.ts b/src/version2/schemas/customFieldContextSingleUserPickerDefaults.ts new file mode 100644 index 0000000000..2dc9551312 --- /dev/null +++ b/src/version2/schemas/customFieldContextSingleUserPickerDefaults.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { UserFilterSchema } from './userFilter'; + +/** Defaults for a User Picker (single) custom field. */ +export const CustomFieldContextSingleUserPickerDefaultsSchema = z.object({ + /** The ID of the default user. */ + accountId: z.string(), + /** The ID of the context. */ + contextId: z.string(), + type: z.string(), + userFilter: UserFilterSchema, +}); + +export type CustomFieldContextSingleUserPickerDefaults = z.infer< + typeof CustomFieldContextSingleUserPickerDefaultsSchema +>; diff --git a/src/version2/schemas/customFieldContextUpdateDetails.ts b/src/version2/schemas/customFieldContextUpdateDetails.ts new file mode 100644 index 0000000000..a786cb818f --- /dev/null +++ b/src/version2/schemas/customFieldContextUpdateDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of a custom field context. */ +export const CustomFieldContextUpdateDetailsSchema = z.object({ + /** The description of the custom field context. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the custom field context. The name must be unique. The maximum length is 255 characters. */ + name: z.string().optional(), +}); + +export type CustomFieldContextUpdateDetails = z.infer; diff --git a/src/version2/schemas/customFieldCreatedContextOptionsList.ts b/src/version2/schemas/customFieldCreatedContextOptionsList.ts new file mode 100644 index 0000000000..2422b77a23 --- /dev/null +++ b/src/version2/schemas/customFieldCreatedContextOptionsList.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { CustomFieldContextOptionSchema } from './customFieldContextOption'; + +/** A list of custom field options for a context. */ +export const CustomFieldCreatedContextOptionsListSchema = z.object({ + /** The created custom field options. */ + options: z.array(CustomFieldContextOptionSchema).optional(), +}); + +export type CustomFieldCreatedContextOptionsList = z.infer; diff --git a/src/version2/schemas/customFieldDefinitionJsonBean.ts b/src/version2/schemas/customFieldDefinitionJsonBean.ts new file mode 100644 index 0000000000..64f5d1e17e --- /dev/null +++ b/src/version2/schemas/customFieldDefinitionJsonBean.ts @@ -0,0 +1,107 @@ +import { z } from 'zod'; + +export const CustomFieldDefinitionJsonBeanSchema = z.object({ + /** The description of the custom field, which is displayed in Jira. */ + description: z.string().optional(), + /** The name of the custom field, which is displayed in Jira. This is not the unique identifier. */ + name: z.string(), + /** + * The searcher defines the way the field is searched in Jira. For example, + * _com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher_. The search UI (basic search and JQL + * search) will display different operations and values for the field, based on the field searcher. You must specify a + * searcher that is valid for the field type, as listed below (abbreviated values shown): + * + * - `cascadingselect`: `cascadingselectsearcher` + * - `datepicker`: `daterange` + * - `datetime`: `datetimerange` + * - `float`: `exactnumber` or `numberrange` + * - `grouppicker`: `grouppickersearcher` + * - `importid`: `exactnumber` or `numberrange` + * - `labels`: `labelsearcher` + * - `multicheckboxes`: `multiselectsearcher` + * - `multigrouppicker`: `multiselectsearcher` + * - `multiselect`: `multiselectsearcher` + * - `multiuserpicker`: `userpickergroupsearcher` + * - `multiversion`: `versionsearcher` + * - `project`: `projectsearcher` + * - `radiobuttons`: `multiselectsearcher` + * - `readonlyfield`: `textsearcher` + * - `select`: `multiselectsearcher` + * - `textarea`: `textsearcher` + * - `textfield`: `textsearcher` + * - `url`: `exacttextsearcher` + * - `userpicker`: `userpickergroupsearcher` + * - `version`: `versionsearcher` + * + * If no searcher is provided, the field isn't searchable. However, [Forge custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-) + * have a searcher set automatically, so are always searchable. + */ + searcherKey: z + .enum([ + 'com.atlassian.jira.plugin.system.customfieldtypes:cascadingselectsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:daterange', + 'com.atlassian.jira.plugin.system.customfieldtypes:datetimerange', + 'com.atlassian.jira.plugin.system.customfieldtypes:exactnumber', + 'com.atlassian.jira.plugin.system.customfieldtypes:exacttextsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:numberrange', + 'com.atlassian.jira.plugin.system.customfieldtypes:projectsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:textsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:versionsearcher', + ]) + .optional(), + /** + * The type of the custom field. These built-in custom field types are available: + * + * - `cascadingselect`: Enables values to be selected from two levels of select lists (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect`) + * - `datepicker`: Stores a date using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:datepicker`) + * - `datetime`: Stores a date with a time component (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:datetime`) + * - `float`: Stores and validates a numeric (floating point) input (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:float`) + * - `grouppicker`: Stores a user group using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker`) + * - `importid`: A read-only field that stores the ID the issue had in the system it was imported from (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:importid`) + * - `labels`: Stores labels (value: `com.atlassian.jira.plugin.system.customfieldtypes:labels`) + * - `multicheckboxes`: Stores multiple values using checkboxes (value: ``) + * - `multigrouppicker`: Stores multiple user groups using a picker control (value: ``) + * - `multiselect`: Stores multiple values using a select list (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes`) + * - `multiuserpicker`: Stores multiple users using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker`) + * - `multiversion`: Stores multiple versions from the versions available in a project using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multiversion`) + * - `project`: Stores a project from a list of projects that the user is permitted to view (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:project`) + * - `radiobuttons`: Stores a value using radio buttons (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons`) + * - `readonlyfield`: Stores a read-only text value, which can only be populated via the API (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield`) + * - `select`: Stores a value from a configurable list of options (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:select`) + * - `textarea`: Stores a long text string using a multiline text area (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:textarea`) + * - `textfield`: Stores a text string using a single-line text box (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:textfield`) + * - `url`: Stores a URL (value: `com.atlassian.jira.plugin.system.customfieldtypes:url`) + * - `userpicker`: Stores a user using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:userpicker`) + * - `version`: Stores a version using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:version`) + * + * To create a field based on a [Forge custom field + * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-), + * use the ID of the Forge custom field type as the value. For example, + * `ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key`. + */ + type: z.string(), +}); + +export type CustomFieldDefinitionJsonBean = z.infer; diff --git a/src/version2/schemas/customFieldOption.ts b/src/version2/schemas/customFieldOption.ts new file mode 100644 index 0000000000..d3b39ac777 --- /dev/null +++ b/src/version2/schemas/customFieldOption.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of a custom option for a field. */ +export const CustomFieldOptionSchema = z.object({ + /** The URL of these custom field option details. */ + self: z.string().optional(), + /** The value of the custom field option. */ + value: z.string().optional(), +}); + +export type CustomFieldOption = z.infer; diff --git a/src/version2/schemas/customFieldOptionCreate.ts b/src/version2/schemas/customFieldOptionCreate.ts new file mode 100644 index 0000000000..fd734f3dbe --- /dev/null +++ b/src/version2/schemas/customFieldOptionCreate.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of a custom field option to create. */ +export const CustomFieldOptionCreateSchema = z.object({ + /** Whether the option is disabled. */ + disabled: z.boolean().optional(), + /** For cascading options, the ID of a parent option. */ + optionId: z.string().optional(), + /** The value of the custom field option. */ + value: z.string(), +}); + +export type CustomFieldOptionCreate = z.infer; diff --git a/src/version2/schemas/customFieldOptionUpdate.ts b/src/version2/schemas/customFieldOptionUpdate.ts new file mode 100644 index 0000000000..89f9cde9c1 --- /dev/null +++ b/src/version2/schemas/customFieldOptionUpdate.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of a custom field option for a context. */ +export const CustomFieldOptionUpdateSchema = z.object({ + /** Whether the option is disabled. */ + disabled: z.boolean().optional(), + /** The ID of the custom field option. */ + id: z.string(), + /** The value of the custom field option. */ + value: z.string().optional(), +}); + +export type CustomFieldOptionUpdate = z.infer; diff --git a/src/version2/schemas/customFieldPayload.ts b/src/version2/schemas/customFieldPayload.ts new file mode 100644 index 0000000000..5c1b03c4a0 --- /dev/null +++ b/src/version2/schemas/customFieldPayload.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** + * Defines the payload for the custom field definitions. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/#api-rest-api-3-field-post + */ +export const CustomFieldPayloadSchema = z.object({ + /** The type of the custom field */ + cfType: z.string().optional(), + /** The description of the custom field */ + description: z.string().optional(), + /** The name of the custom field */ + name: z.string().optional(), + /** + * The strategy to use when there is a conflict with an existing custom field. FAIL - Fail execution, this always + * needs to be unique; USE - Use the existing entity and ignore new entity parameters + */ + onConflict: z.enum(['FAIL', 'USE', 'NEW']).optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), + /** The searcher key of the custom field */ + searcherKey: z.string().optional(), +}); + +export type CustomFieldPayload = z.infer; diff --git a/src/version2/schemas/customFieldReplacement.ts b/src/version2/schemas/customFieldReplacement.ts new file mode 100644 index 0000000000..2bea2d0e54 --- /dev/null +++ b/src/version2/schemas/customFieldReplacement.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details about the replacement for a deleted version. */ +export const CustomFieldReplacementSchema = z.object({ + /** The ID of the custom field in which to replace the version number. */ + customFieldId: z.number().int().optional(), + /** The version number to use as a replacement for the deleted version. */ + moveTo: z.number().int().optional(), +}); + +export type CustomFieldReplacement = z.infer; diff --git a/src/version2/schemas/customFieldUpdatedContextOptionsList.ts b/src/version2/schemas/customFieldUpdatedContextOptionsList.ts new file mode 100644 index 0000000000..490146109e --- /dev/null +++ b/src/version2/schemas/customFieldUpdatedContextOptionsList.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { CustomFieldOptionUpdateSchema } from './customFieldOptionUpdate'; + +/** A list of custom field options for a context. */ +export const CustomFieldUpdatedContextOptionsListSchema = z.object({ + /** The updated custom field options. */ + options: z.array(CustomFieldOptionUpdateSchema).optional(), +}); + +export type CustomFieldUpdatedContextOptionsList = z.infer; diff --git a/src/version2/schemas/customFieldValueUpdate.ts b/src/version2/schemas/customFieldValueUpdate.ts new file mode 100644 index 0000000000..d1b519c0a6 --- /dev/null +++ b/src/version2/schemas/customFieldValueUpdate.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +/** A list of issue IDs and the value to update a custom field to. */ +export const CustomFieldValueUpdateSchema = z.object({ + /** The list of issue IDs. */ + issueIds: z.array(z.number().int()), + /** + * The value for the custom field. The value must be compatible with the [custom field + * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/#data-types) as + * follows: + * + * - `string` the value must be a string. + * - `number` the value must be a number. + * - `datetime` the value must be a string that represents a date in the ISO format or the simplified extended ISO + * format. For example, `"2023-01-18T12:00:00-03:00"` or `"2023-01-18T12:00:00.000Z"`. However, the milliseconds + * part is ignored. + * - `user` the value must be an object that contains the `accountId` field. + * - `group` the value must be an object that contains the group `name` or `groupId` field. Because group names can + * change, we recommend using `groupId`. + * + * A list of appropriate values must be provided if the field is of the `list` [collection + * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/#collection-types). + */ + value: z.unknown(), +}); + +export type CustomFieldValueUpdate = z.infer; diff --git a/src/version2/schemas/customFieldValueUpdateDetails.ts b/src/version2/schemas/customFieldValueUpdateDetails.ts new file mode 100644 index 0000000000..39b389b802 --- /dev/null +++ b/src/version2/schemas/customFieldValueUpdateDetails.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { CustomFieldValueUpdateSchema } from './customFieldValueUpdate'; + +/** Details of updates for a custom field. */ +export const CustomFieldValueUpdateDetailsSchema = z.object({ + /** The list of custom field update details. */ + updates: z.array(CustomFieldValueUpdateSchema).optional(), +}); + +export type CustomFieldValueUpdateDetails = z.infer; diff --git a/src/version2/schemas/customTemplateOptions.ts b/src/version2/schemas/customTemplateOptions.ts new file mode 100644 index 0000000000..f91001ce1f --- /dev/null +++ b/src/version2/schemas/customTemplateOptions.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const CustomTemplateOptionsSchema = z.object({ + /** + * Enable screen delegated admin support for the template. This means screen and associated schemes will be copied + * rather than referenced. + */ + enableScreenDelegatedAdminSupport: z.boolean().optional(), + /** + * Enable workflow delegated admin support for the template. This means workflows and workflow schemes will be copied + * rather than referenced. + */ + enableWorkflowDelegatedAdminSupport: z.boolean().optional(), +}); + +export type CustomTemplateOptions = z.infer; diff --git a/src/version2/schemas/customTemplateRequestDTO.ts b/src/version2/schemas/customTemplateRequestDTO.ts new file mode 100644 index 0000000000..3db26b652a --- /dev/null +++ b/src/version2/schemas/customTemplateRequestDTO.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; +import { BoardsPayloadSchema } from './boardsPayload'; +import { FieldCapabilityPayloadSchema } from './fieldCapabilityPayload'; +import { IssueTypeProjectCreatePayloadSchema } from './issueTypeProjectCreatePayload'; +import { NotificationSchemePayloadSchema } from './notificationSchemePayload'; +import { PermissionPayloadDTOSchema } from './permissionPayloadDTO'; +import { ProjectPayloadSchema } from './projectPayload'; +import { RolesCapabilityPayloadSchema } from './rolesCapabilityPayload'; +import { ScopePayloadSchema } from './scopePayload'; +import { SecuritySchemePayloadSchema } from './securitySchemePayload'; +import { WorkflowCapabilityPayloadSchema } from './workflowCapabilityPayload'; + +/** The specific request object for creating a project with template. */ +export const CustomTemplateRequestDTOSchema = z.object({ + boards: BoardsPayloadSchema.optional(), + field: FieldCapabilityPayloadSchema.optional(), + issueType: IssueTypeProjectCreatePayloadSchema.optional(), + notification: NotificationSchemePayloadSchema.optional(), + permissionScheme: PermissionPayloadDTOSchema.optional(), + project: ProjectPayloadSchema.optional(), + role: RolesCapabilityPayloadSchema.optional(), + scope: ScopePayloadSchema.optional(), + security: SecuritySchemePayloadSchema.optional(), + workflow: WorkflowCapabilityPayloadSchema.optional(), +}); + +export type CustomTemplateRequestDTO = z.infer; diff --git a/src/version2/schemas/customTemplatesProjectDetails.ts b/src/version2/schemas/customTemplatesProjectDetails.ts new file mode 100644 index 0000000000..9cce6adbe6 --- /dev/null +++ b/src/version2/schemas/customTemplatesProjectDetails.ts @@ -0,0 +1,43 @@ +import { z } from 'zod'; + +/** Project Details */ +export const CustomTemplatesProjectDetailsSchema = z.object({ + /** The access level of the project. Only used by team-managed project */ + accessLevel: z.enum(['open', 'limited', 'private', 'free']).optional(), + /** Additional properties of the project */ + additionalProperties: z.object({}).optional(), + /** The default assignee when creating issues in the project */ + assigneeType: z.enum(['PROJECT_DEFAULT', 'COMPONENT_LEAD', 'PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** + * The ID of the project's avatar. Use the [Get project avatars](#api-rest-api-3-project-projectIdOrKey-avatar-get) + * operation to list the available avatars in a project. + */ + avatarId: z.number().int().optional(), + /** + * 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. + */ + categoryId: z.number().int().optional(), + /** Brief description of the project */ + description: z.string().optional(), + /** Whether components are enabled for the project. Only used by company-managed project */ + enableComponents: z.boolean().optional(), + /** + * 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. + */ + key: z.string().optional(), + /** The default language for the project */ + language: z.string().optional(), + /** + * The account ID of the project lead. Either `lead` or `leadAccountId` must be set when creating a project. Cannot be + * provided with `lead`. + */ + leadAccountId: z.string().optional(), + /** Name of the project */ + name: z.string().optional(), + /** A link to information about this project, such as project documentation */ + url: z.string().optional(), +}); + +export type CustomTemplatesProjectDetails = z.infer; diff --git a/src/version2/schemas/dashboard.ts b/src/version2/schemas/dashboard.ts new file mode 100644 index 0000000000..9ff66dab10 --- /dev/null +++ b/src/version2/schemas/dashboard.ts @@ -0,0 +1,35 @@ +import { z } from 'zod'; +import { SharePermissionSchema } from './sharePermission'; + +/** Details of a dashboard. */ +export const DashboardSchema = z.object({ + /** The automatic refresh interval for the dashboard in milliseconds. */ + automaticRefreshMs: z.number().int().optional(), + description: z.string().optional(), + /** The details of any edit share permissions for the dashboard. */ + editPermissions: z.array(SharePermissionSchema).optional(), + /** The ID of the dashboard. */ + id: z.string().optional(), + /** Whether the dashboard is selected as a favorite by the user. */ + isFavourite: z.boolean().optional(), + /** Whether the current user has permission to edit the dashboard. */ + isWritable: z.boolean().optional(), + /** The name of the dashboard. */ + name: z.string().optional(), + /** The owner of the dashboard. */ + owner: z.unknown().optional(), + /** The number of users who have this dashboard as a favorite. */ + popularity: z.number().int().optional(), + /** The rank of this dashboard. */ + rank: z.number().int().optional(), + /** The URL of these dashboard details. */ + self: z.string().optional(), + /** The details of any view share permissions for the dashboard. */ + sharePermissions: z.array(SharePermissionSchema).optional(), + /** Whether the current dashboard is system dashboard. */ + systemDashboard: z.boolean().optional(), + /** The URL of the dashboard. */ + view: z.string().optional(), +}); + +export type Dashboard = z.infer; diff --git a/src/version2/schemas/dashboardDetails.ts b/src/version2/schemas/dashboardDetails.ts new file mode 100644 index 0000000000..f00f2545f4 --- /dev/null +++ b/src/version2/schemas/dashboardDetails.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { SharePermissionSchema } from './sharePermission'; + +/** Details of a dashboard. */ +export const DashboardDetailsSchema = z.object({ + /** The description of the dashboard. */ + description: z.string().optional(), + /** The edit permissions for the dashboard. */ + editPermissions: z.array(SharePermissionSchema), + /** The name of the dashboard. */ + name: z.string(), + /** The share permissions for the dashboard. */ + sharePermissions: z.array(SharePermissionSchema), +}); + +export type DashboardDetails = z.infer; diff --git a/src/version2/schemas/dashboardGadget.ts b/src/version2/schemas/dashboardGadget.ts new file mode 100644 index 0000000000..27c4aae28a --- /dev/null +++ b/src/version2/schemas/dashboardGadget.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** Details of a gadget. */ +export const DashboardGadgetSchema = z.object({ + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color: z.enum(['blue', 'red', 'yellow', 'green', 'cyan', 'purple', 'gray', 'white']), + /** The ID of the gadget instance. */ + id: z.number().int(), + /** The module key of the gadget type. */ + moduleKey: z.string().optional(), + /** The position of the gadget. */ + position: z.unknown(), + /** The title of the gadget. */ + title: z.string(), + /** The URI of the gadget type. */ + uri: z.string().optional(), +}); + +export type DashboardGadget = z.infer; diff --git a/src/version2/schemas/dashboardGadgetPosition.ts b/src/version2/schemas/dashboardGadgetPosition.ts new file mode 100644 index 0000000000..a2edfca00d --- /dev/null +++ b/src/version2/schemas/dashboardGadgetPosition.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** Details of a gadget position. */ +export const DashboardGadgetPositionSchema = z + .object({ + 'The column position of the gadget.': z.number().int(), + 'The row position of the gadget.': z.number().int(), + }) + .transform(val => ({ + theColumnPositionOfTheGadget: val['The column position of the gadget.'], + theRowPositionOfTheGadget: val['The row position of the gadget.'], + })); + +export type DashboardGadgetPosition = z.infer; diff --git a/src/version2/schemas/dashboardGadgetResponse.ts b/src/version2/schemas/dashboardGadgetResponse.ts new file mode 100644 index 0000000000..a7e774a6ef --- /dev/null +++ b/src/version2/schemas/dashboardGadgetResponse.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { DashboardGadgetSchema } from './dashboardGadget'; + +/** The list of gadgets on the dashboard. */ +export const DashboardGadgetResponseSchema = z.object({ + /** The list of gadgets. */ + gadgets: z.array(DashboardGadgetSchema), +}); + +export type DashboardGadgetResponse = z.infer; diff --git a/src/version2/schemas/dashboardGadgetSettings.ts b/src/version2/schemas/dashboardGadgetSettings.ts new file mode 100644 index 0000000000..c115b6b567 --- /dev/null +++ b/src/version2/schemas/dashboardGadgetSettings.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; + +/** Details of the settings for a dashboard gadget. */ +export const DashboardGadgetSettingsSchema = z.object({ + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color: z.string().optional(), + /** + * Whether to ignore the validation of module key and URI. For example, when a gadget is created that is a part of an + * application that isn't installed. + */ + ignoreUriAndModuleKeyValidation: z.boolean().optional(), + /** The module key of the gadget type. Can't be provided with `uri`. */ + moduleKey: z.string().optional(), + /** + * The position of the gadget. When the gadget is placed into the position, other gadgets in the same column are moved + * down to accommodate it. + */ + position: z.unknown().optional(), + /** The title of the gadget. */ + title: z.string().optional(), + /** The URI of the gadget type. Can't be provided with `moduleKey`. */ + uri: z.string().optional(), +}); + +export type DashboardGadgetSettings = z.infer; diff --git a/src/version2/schemas/dashboardGadgetUpdateRequest.ts b/src/version2/schemas/dashboardGadgetUpdateRequest.ts new file mode 100644 index 0000000000..264c1aa6f2 --- /dev/null +++ b/src/version2/schemas/dashboardGadgetUpdateRequest.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The details of the gadget to update. */ +export const DashboardGadgetUpdateRequestSchema = z.object({ + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color: z.string().optional(), + /** The position of the gadget. */ + position: z.unknown().optional(), + /** The title of the gadget. */ + title: z.string().optional(), +}); + +export type DashboardGadgetUpdateRequest = z.infer; diff --git a/src/version2/schemas/dataClassificationLevelsBean.ts b/src/version2/schemas/dataClassificationLevelsBean.ts new file mode 100644 index 0000000000..2aef1b1423 --- /dev/null +++ b/src/version2/schemas/dataClassificationLevelsBean.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { DataClassificationTagBeanSchema } from './dataClassificationTagBean'; + +/** The data classification. */ +export const DataClassificationLevelsBeanSchema = z.object({ + /** The data classifications. */ + classifications: z.array(DataClassificationTagBeanSchema).optional(), +}); + +export type DataClassificationLevelsBean = z.infer; diff --git a/src/version2/schemas/dataClassificationTagBean.ts b/src/version2/schemas/dataClassificationTagBean.ts new file mode 100644 index 0000000000..9b5c3c55e4 --- /dev/null +++ b/src/version2/schemas/dataClassificationTagBean.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +/** The data classification. */ +export const DataClassificationTagBeanSchema = z.object({ + /** The color of the data classification object. */ + color: z.string().optional(), + /** The description of the data classification object. */ + description: z.string().optional(), + /** The guideline of the data classification object. */ + guideline: z.string().optional(), + /** The ID of the data classification object. */ + id: z.string(), + /** The name of the data classification object. */ + name: z.string().optional(), + /** The rank of the data classification object. */ + rank: z.number().int().optional(), + /** The status of the data classification object. */ + status: z.string(), +}); + +export type DataClassificationTagBean = z.infer; diff --git a/src/version2/schemas/dateRangeFilterRequest.ts b/src/version2/schemas/dateRangeFilterRequest.ts new file mode 100644 index 0000000000..7a441d5105 --- /dev/null +++ b/src/version2/schemas/dateRangeFilterRequest.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** List issues archived within a specified date range. */ +export const DateRangeFilterRequestSchema = z.object({ + /** List issues archived after a specified date, passed in the YYYY-MM-DD format. */ + dateAfter: z.string(), + /** List issues archived before a specified date provided in the YYYY-MM-DD format. */ + dateBefore: z.string(), +}); + +export type DateRangeFilterRequest = z.infer; diff --git a/src/version2/schemas/defaultLevelValue.ts b/src/version2/schemas/defaultLevelValue.ts new file mode 100644 index 0000000000..4cdb920629 --- /dev/null +++ b/src/version2/schemas/defaultLevelValue.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** Details of scheme and new default level. */ +export const DefaultLevelValueSchema = z.object({ + /** + * The ID of the issue security level to set as default for the specified scheme. Providing null will reset the + * default level. + */ + defaultLevelId: z.string(), + /** The ID of the issue security scheme to set default level for. */ + issueSecuritySchemeId: z.string(), +}); + +export type DefaultLevelValue = z.infer; diff --git a/src/version2/schemas/defaultShareScope.ts b/src/version2/schemas/defaultShareScope.ts new file mode 100644 index 0000000000..393630af2f --- /dev/null +++ b/src/version2/schemas/defaultShareScope.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Details of the scope of the default sharing for new filters and dashboards. */ +export const DefaultShareScopeSchema = z.object({ + /** + * The scope of the default sharing for new filters and dashboards: + * + * - `AUTHENTICATED` Shared with all logged-in users. + * - `GLOBAL` Shared with all logged-in users. This shows as `AUTHENTICATED` in the response. + * - `PRIVATE` Not shared with any users. + */ + scope: z.enum(['GLOBAL', 'AUTHENTICATED', 'PRIVATE']), +}); + +export type DefaultShareScope = z.infer; diff --git a/src/version2/schemas/defaultWorkflow.ts b/src/version2/schemas/defaultWorkflow.ts new file mode 100644 index 0000000000..cb038c93ff --- /dev/null +++ b/src/version2/schemas/defaultWorkflow.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** Details about the default workflow. */ +export const DefaultWorkflowSchema = z.object({ + /** + * Whether a draft workflow scheme is created or updated when updating an active workflow scheme. The draft is updated + * with the new default workflow. Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), + /** The name of the workflow to set as the default workflow. */ + workflow: z.string(), +}); + +export type DefaultWorkflow = z.infer; diff --git a/src/version2/schemas/defaultWorkflowEditorResponse.ts b/src/version2/schemas/defaultWorkflowEditorResponse.ts new file mode 100644 index 0000000000..eeaa1fdd18 --- /dev/null +++ b/src/version2/schemas/defaultWorkflowEditorResponse.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const DefaultWorkflowEditorResponseSchema = z.object({ + value: z.enum(['NEW', 'LEGACY']).optional(), +}); + +export type DefaultWorkflowEditorResponse = z.infer; diff --git a/src/version2/schemas/deleteAndReplaceVersionBean.ts b/src/version2/schemas/deleteAndReplaceVersionBean.ts new file mode 100644 index 0000000000..f2ff0a11ed --- /dev/null +++ b/src/version2/schemas/deleteAndReplaceVersionBean.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { CustomFieldReplacementSchema } from './customFieldReplacement'; + +export const DeleteAndReplaceVersionBeanSchema = z.object({ + /** + * An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the + * deleted version. + */ + customFieldReplacementList: z.array(CustomFieldReplacementSchema).optional(), + /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. */ + moveAffectedIssuesTo: z.number().int().optional(), + /** The ID of the version to update `fixVersion` to when the field contains the deleted version. */ + moveFixIssuesTo: z.number().int().optional(), +}); + +export type DeleteAndReplaceVersionBean = z.infer; diff --git a/src/version2/schemas/deprecatedWorkflow.ts b/src/version2/schemas/deprecatedWorkflow.ts new file mode 100644 index 0000000000..fa0172ea2b --- /dev/null +++ b/src/version2/schemas/deprecatedWorkflow.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; + +/** Details about a workflow. */ +export const DeprecatedWorkflowSchema = z.object({ + default: z.boolean().optional(), + /** The description of the workflow. */ + description: z.string().optional(), + /** The datetime the workflow was last modified. */ + lastModifiedDate: z.string().optional(), + /** + * 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: z.string().optional(), + /** The account ID of the user that last modified the workflow. */ + lastModifiedUserAccountId: z.string().optional(), + /** The name of the workflow. */ + name: z.string().optional(), + /** The scope where this workflow applies */ + scope: z.unknown().optional(), + /** The number of steps included in the workflow. */ + steps: z.number().int().optional(), +}); + +export type DeprecatedWorkflow = z.infer; diff --git a/src/version2/schemas/detailedErrorCollection.ts b/src/version2/schemas/detailedErrorCollection.ts new file mode 100644 index 0000000000..99447c718e --- /dev/null +++ b/src/version2/schemas/detailedErrorCollection.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const DetailedErrorCollectionSchema = z.object({ + /** Map of objects representing additional details for an error */ + details: z.object({}).optional(), + /** The list of error messages produced by this operation. For example, "input parameter 'key' must be provided" */ + errorMessages: z.array(z.string()).optional(), + /** + * 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: z.object({}).optional(), +}); + +export type DetailedErrorCollection = z.infer; diff --git a/src/version2/schemas/documentVersion.ts b/src/version2/schemas/documentVersion.ts new file mode 100644 index 0000000000..68204c5f4f --- /dev/null +++ b/src/version2/schemas/documentVersion.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The current version details of this workflow scheme. */ +export const DocumentVersionSchema = z.object({ + /** The version UUID. */ + id: z.string().optional(), + /** The version number. */ + versionNumber: z.number().int().optional(), +}); + +export type DocumentVersion = z.infer; diff --git a/src/version2/schemas/duplicatePlanRequest.ts b/src/version2/schemas/duplicatePlanRequest.ts new file mode 100644 index 0000000000..b296181108 --- /dev/null +++ b/src/version2/schemas/duplicatePlanRequest.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const DuplicatePlanRequestSchema = z.object({ + /** The plan name. */ + name: z.string(), +}); + +export type DuplicatePlanRequest = z.infer; diff --git a/src/version2/schemas/editTemplateRequest.ts b/src/version2/schemas/editTemplateRequest.ts new file mode 100644 index 0000000000..7c6e342e99 --- /dev/null +++ b/src/version2/schemas/editTemplateRequest.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { CustomTemplateOptionsSchema } from './customTemplateOptions'; + +/** Request to edit a custom template */ +export const EditTemplateRequestSchema = z.object({ + /** The description of the template */ + templateDescription: z.string().optional(), + templateGenerationOptions: CustomTemplateOptionsSchema.optional(), + /** The unique identifier of the template */ + templateKey: z.string().optional(), + /** The name of the template */ + templateName: z.string().optional(), +}); + +export type EditTemplateRequest = z.infer; diff --git a/src/version2/schemas/entityProperty.ts b/src/version2/schemas/entityProperty.ts new file mode 100644 index 0000000000..af12001cd0 --- /dev/null +++ b/src/version2/schemas/entityProperty.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** + * An entity property, for more information see [Entity + * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/). + */ +export const EntityPropertySchema = z.object({ + /** The key of the property. Required on create and update. */ + key: z.string().optional(), + /** The value of the property. Required on create and update. */ + value: z.unknown().optional(), +}); + +export type EntityProperty = z.infer; diff --git a/src/version2/schemas/entityPropertyDetails.ts b/src/version2/schemas/entityPropertyDetails.ts new file mode 100644 index 0000000000..44b5159ac8 --- /dev/null +++ b/src/version2/schemas/entityPropertyDetails.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const EntityPropertyDetailsSchema = z.object({ + /** The entity property ID. */ + entityId: z.number(), + /** The entity property key. */ + key: z.string(), + /** The new value of the entity property. */ + value: z.string(), +}); + +export type EntityPropertyDetails = z.infer; diff --git a/src/version2/schemas/error.ts b/src/version2/schemas/error.ts new file mode 100644 index 0000000000..742f0e8eaf --- /dev/null +++ b/src/version2/schemas/error.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export const ErrorSchema = z.object({ + count: z.number().int().optional(), + issueIdsOrKeys: z.array(z.string()).optional(), + message: z.string().optional(), +}); + +export type Error = z.infer; diff --git a/src/version2/schemas/errorCollection.ts b/src/version2/schemas/errorCollection.ts new file mode 100644 index 0000000000..9b97f935bb --- /dev/null +++ b/src/version2/schemas/errorCollection.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Error messages from an operation. */ +export const ErrorCollectionSchema = z.object({ + /** The list of error messages produced by this operation. For example, "input parameter 'key' must be provided" */ + errorMessages: z.array(z.string()).optional(), + /** + * 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: z.object({}).optional(), + status: z.number().int().optional(), +}); + +export type ErrorCollection = z.infer; diff --git a/src/version2/schemas/errorCollections.ts b/src/version2/schemas/errorCollections.ts new file mode 100644 index 0000000000..9c5b9f1d84 --- /dev/null +++ b/src/version2/schemas/errorCollections.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const ErrorCollectionsSchema = z.object({}); + +export type ErrorCollections = z.infer; diff --git a/src/version2/schemas/errorMessage.ts b/src/version2/schemas/errorMessage.ts new file mode 100644 index 0000000000..b9db285773 --- /dev/null +++ b/src/version2/schemas/errorMessage.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const ErrorMessageSchema = z.object({ + /** The error message. */ + message: z.string(), +}); + +export type ErrorMessage = z.infer; diff --git a/src/version2/schemas/errors.ts b/src/version2/schemas/errors.ts new file mode 100644 index 0000000000..0b3b4d1703 --- /dev/null +++ b/src/version2/schemas/errors.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { ErrorSchema } from './error'; + +export const ErrorsSchema = z.object({ + issueIsSubtask: ErrorSchema.optional(), + issuesInArchivedProjects: ErrorSchema.optional(), + issuesInUnlicensedProjects: ErrorSchema.optional(), + issuesNotFound: ErrorSchema.optional(), + userDoesNotHavePermission: ErrorSchema.optional(), +}); + +export type Errors = z.infer; diff --git a/src/version2/schemas/eventNotification.ts b/src/version2/schemas/eventNotification.ts new file mode 100644 index 0000000000..ef25ae9f15 --- /dev/null +++ b/src/version2/schemas/eventNotification.ts @@ -0,0 +1,61 @@ +import { z } from 'zod'; + +/** Details about a notification associated with an event. */ +export const EventNotificationSchema = z.object({ + /** The email address. */ + emailAddress: z.string().optional(), + /** Expand options that include additional event notification details in the response. */ + expand: z.string().optional(), + /** The custom user or group field. */ + field: z.unknown().optional(), + /** The specified group. */ + group: z.unknown().optional(), + /** The ID of the notification. */ + id: z.number().int().optional(), + /** Identifies the recipients of the notification. */ + notificationType: z + .enum([ + 'CurrentAssignee', + 'Reporter', + 'CurrentUser', + 'ProjectLead', + 'ComponentLead', + 'User', + 'Group', + 'ProjectRole', + 'EmailAddress', + 'AllWatchers', + 'UserCustomField', + 'GroupCustomField', + ]) + .optional(), + /** + * As a group's name can change, use of `recipient` is recommended. The identifier associated with the + * `notificationType` value that defines the receiver of the notification, where the receiver isn't implied by + * `notificationType` value. So, when `notificationType` is: + * + * - `User` The `parameter` is the user account ID. + * - `Group` The `parameter` is the group name. + * - `ProjectRole` The `parameter` is the project role ID. + * - `UserCustomField` The `parameter` is the ID of the custom field. + * - `GroupCustomField` The `parameter` is the ID of the custom field. + */ + parameter: z.string().optional(), + /** The specified project role. */ + projectRole: z.unknown().optional(), + /** + * The identifier associated with the `notificationType` value that defines the receiver of the notification, where + * the receiver isn't implied by the `notificationType` value. So, when `notificationType` is: + * + * - `User`, `recipient` is the user account ID. + * - `Group`, `recipient` is the group ID. + * - `ProjectRole`, `recipient` is the project role ID. + * - `UserCustomField`, `recipient` is the ID of the custom field. + * - `GroupCustomField`, `recipient` is the ID of the custom field. + */ + recipient: z.string().optional(), + /** The specified user. */ + user: z.unknown().optional(), +}); + +export type EventNotification = z.infer; diff --git a/src/version2/schemas/expandPrioritySchemeBean.ts b/src/version2/schemas/expandPrioritySchemeBean.ts new file mode 100644 index 0000000000..996503279b --- /dev/null +++ b/src/version2/schemas/expandPrioritySchemeBean.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** A priority scheme with less fields to be used in for an API expand response. */ +export const ExpandPrioritySchemeBeanSchema = z.object({ + /** The ID of the priority scheme. */ + id: z.string().optional(), + /** The name of the priority scheme. */ + name: z.string().optional(), + /** The URL of the priority scheme. */ + self: z.string().optional(), +}); + +export type ExpandPrioritySchemeBean = z.infer; diff --git a/src/version2/schemas/expandPrioritySchemePage.ts b/src/version2/schemas/expandPrioritySchemePage.ts new file mode 100644 index 0000000000..ecdbe0ba42 --- /dev/null +++ b/src/version2/schemas/expandPrioritySchemePage.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export const ExpandPrioritySchemePageSchema = z.object({ + maxResults: z.number().int().optional(), + startAt: z.number().int().optional(), + total: z.number().int().optional(), +}); + +export type ExpandPrioritySchemePage = z.infer; diff --git a/src/version2/schemas/exportArchivedIssuesTaskProgressResponse.ts b/src/version2/schemas/exportArchivedIssuesTaskProgressResponse.ts new file mode 100644 index 0000000000..3b4ee8be08 --- /dev/null +++ b/src/version2/schemas/exportArchivedIssuesTaskProgressResponse.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The response for status request for a running/completed export task. */ +export const ExportArchivedIssuesTaskProgressResponseSchema = z.object({ + fileUrl: z.string().optional(), + payload: z.string().optional(), + progress: z.number().int().optional(), + status: z.string().optional(), + submittedTime: z.string().datetime().optional(), + taskId: z.string().optional(), +}); + +export type ExportArchivedIssuesTaskProgressResponse = z.infer; diff --git a/src/version2/schemas/failedWebhook.ts b/src/version2/schemas/failedWebhook.ts new file mode 100644 index 0000000000..1f471d6f9e --- /dev/null +++ b/src/version2/schemas/failedWebhook.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Details about a failed webhook. */ +export const FailedWebhookSchema = z.object({ + /** The webhook body. */ + body: z.string().optional(), + /** The time the webhook was added to the list of failed webhooks (that is, the time of the last failed retry). */ + failureTime: z.number().int(), + /** The webhook ID, as sent in the `X-Atlassian-Webhook-Identifier` header with the webhook. */ + id: z.string(), + /** The original webhook destination. */ + url: z.string(), +}); + +export type FailedWebhook = z.infer; diff --git a/src/version2/schemas/failedWebhooks.ts b/src/version2/schemas/failedWebhooks.ts new file mode 100644 index 0000000000..0fe23f0058 --- /dev/null +++ b/src/version2/schemas/failedWebhooks.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; +import { FailedWebhookSchema } from './failedWebhook'; + +/** A page of failed webhooks. */ +export const FailedWebhooksSchema = z.object({ + /** + * The maximum number of items on the page. If the list of values is shorter than this number, then there are no more + * pages. + */ + maxResults: z.number().int(), + /** + * The URL to the next page of results. Present only if the request returned at least one result.The next page may be + * empty at the time of receiving the response, but new failed webhooks may appear in time. You can save the URL to + * the next page and query for new results periodically (for example, every hour). + */ + next: z.string().optional(), + /** The list of webhooks. */ + values: z.array(FailedWebhookSchema), +}); + +export type FailedWebhooks = z.infer; diff --git a/src/version2/schemas/field.ts b/src/version2/schemas/field.ts new file mode 100644 index 0000000000..54cd3471c0 --- /dev/null +++ b/src/version2/schemas/field.ts @@ -0,0 +1,35 @@ +import { z } from 'zod'; +import { FieldLastUsedSchema } from './fieldLastUsed'; +import { JsonTypeBeanSchema } from './jsonTypeBean'; + +/** Details of a field. */ +export const FieldSchema = z.object({ + /** Number of contexts where the field is used. */ + contextsCount: z.number().int().optional(), + /** The description of the field. */ + description: z.string().optional(), + /** The ID of the field. */ + id: z.string(), + /** Whether the field is locked. */ + isLocked: z.boolean().optional(), + /** Whether the field is shown on screen or not. */ + isUnscreenable: z.boolean().optional(), + /** The key of the field. */ + key: z.string().optional(), + lastUsed: FieldLastUsedSchema.optional(), + /** The name of the field. */ + name: z.string(), + /** Number of projects where the field is used. */ + projectsCount: z.number().int().optional(), + schema: JsonTypeBeanSchema, + /** Number of screens where the field is used. */ + screensCount: z.number().int().optional(), + /** The searcher key of the field. Returned for custom fields. */ + searcherKey: z.string().optional(), + /** The stable ID of the field. */ + stableId: z.string().optional(), + /** The display name of the field type */ + typeDisplayName: z.string().optional(), +}); + +export type Field = z.infer; diff --git a/src/version2/schemas/fieldAssociationsRequest.ts b/src/version2/schemas/fieldAssociationsRequest.ts new file mode 100644 index 0000000000..ce88ac2dbd --- /dev/null +++ b/src/version2/schemas/fieldAssociationsRequest.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { AssociationContextObjectSchema } from './associationContextObject'; +import { FieldIdentifierObjectSchema } from './fieldIdentifierObject'; + +/** Details of field associations with projects. */ +export const FieldAssociationsRequestSchema = z.object({ + /** Contexts to associate/unassociate the fields with. */ + associationContexts: z.array(AssociationContextObjectSchema), + /** Fields to associate/unassociate with projects. */ + fields: z.array(FieldIdentifierObjectSchema), +}); + +export type FieldAssociationsRequest = z.infer; diff --git a/src/version2/schemas/fieldCapabilityPayload.ts b/src/version2/schemas/fieldCapabilityPayload.ts new file mode 100644 index 0000000000..e19c2b11ca --- /dev/null +++ b/src/version2/schemas/fieldCapabilityPayload.ts @@ -0,0 +1,38 @@ +import { z } from 'zod'; +import { CustomFieldPayloadSchema } from './customFieldPayload'; +import { FieldLayoutSchemePayloadSchema } from './fieldLayoutSchemePayload'; +import { FieldLayoutPayloadSchema } from './fieldLayoutPayload'; +import { IssueLayoutPayloadSchema } from './issueLayoutPayload'; +import { IssueTypeScreenSchemePayloadSchema } from './issueTypeScreenSchemePayload'; +import { ScreenSchemePayloadSchema } from './screenSchemePayload'; +import { ScreenPayloadSchema } from './screenPayload'; + +/** + * Defines the payload for the fields, screens, screen schemes, issue type screen schemes, field layouts, and field + * layout schemes + */ +export const FieldCapabilityPayloadSchema = z.object({ + /** + * The custom field definitions. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/#api-rest-api-3-field-post + */ + customFieldDefinitions: z.array(CustomFieldPayloadSchema).optional(), + fieldLayoutScheme: FieldLayoutSchemePayloadSchema.optional(), + /** The field layouts configuration. */ + fieldLayouts: z.array(FieldLayoutPayloadSchema).optional(), + /** The issue layouts configuration */ + issueLayouts: z.array(IssueLayoutPayloadSchema).optional(), + issueTypeScreenScheme: IssueTypeScreenSchemePayloadSchema.optional(), + /** + * The screen schemes See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-schemes/#api-rest-api-3-screenscheme-post + */ + screenScheme: z.array(ScreenSchemePayloadSchema).optional(), + /** + * The screens. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screens/#api-rest-api-3-screens-post + */ + screens: z.array(ScreenPayloadSchema).optional(), +}); + +export type FieldCapabilityPayload = z.infer; diff --git a/src/version2/schemas/fieldChangedClause.ts b/src/version2/schemas/fieldChangedClause.ts new file mode 100644 index 0000000000..f704840be6 --- /dev/null +++ b/src/version2/schemas/fieldChangedClause.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { JqlQueryFieldSchema } from './jqlQueryField'; +import { JqlQueryClauseTimePredicateSchema } 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 const FieldChangedClauseSchema = z.object({ + field: JqlQueryFieldSchema, + /** The operator applied to the field. */ + operator: z.enum(['changed']), + /** The list of time predicates. */ + predicates: z.array(JqlQueryClauseTimePredicateSchema), +}); + +export type FieldChangedClause = z.infer; diff --git a/src/version2/schemas/fieldConfiguration.ts b/src/version2/schemas/fieldConfiguration.ts new file mode 100644 index 0000000000..59d370ebf9 --- /dev/null +++ b/src/version2/schemas/fieldConfiguration.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Details of a field configuration. */ +export const FieldConfigurationSchema = z.object({ + /** The description of the field configuration. */ + description: z.string(), + /** The ID of the field configuration. */ + id: z.number().int(), + /** Whether the field configuration is the default. */ + isDefault: z.boolean().optional(), + /** The name of the field configuration. */ + name: z.string(), +}); + +export type FieldConfiguration = z.infer; diff --git a/src/version2/schemas/fieldConfigurationDetails.ts b/src/version2/schemas/fieldConfigurationDetails.ts new file mode 100644 index 0000000000..2eba1fb246 --- /dev/null +++ b/src/version2/schemas/fieldConfigurationDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of a field configuration. */ +export const FieldConfigurationDetailsSchema = z.object({ + /** The description of the field configuration. */ + description: z.string().optional(), + /** The name of the field configuration. Must be unique. */ + name: z.string(), +}); + +export type FieldConfigurationDetails = z.infer; diff --git a/src/version2/schemas/fieldConfigurationIssueTypeItem.ts b/src/version2/schemas/fieldConfigurationIssueTypeItem.ts new file mode 100644 index 0000000000..93870b17e1 --- /dev/null +++ b/src/version2/schemas/fieldConfigurationIssueTypeItem.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** The field configuration for an issue type. */ +export const FieldConfigurationIssueTypeItemSchema = z.object({ + /** The ID of the field configuration. */ + fieldConfigurationId: z.string(), + /** The ID of the field configuration scheme. */ + fieldConfigurationSchemeId: z.string(), + /** + * The ID of the issue type or _default_. When set to _default_ this field configuration issue type item applies to + * all issue types without a field configuration. + */ + issueTypeId: z.string(), +}); + +export type FieldConfigurationIssueTypeItem = z.infer; diff --git a/src/version2/schemas/fieldConfigurationItem.ts b/src/version2/schemas/fieldConfigurationItem.ts new file mode 100644 index 0000000000..b5714ccac5 --- /dev/null +++ b/src/version2/schemas/fieldConfigurationItem.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** A field within a field configuration. */ +export const FieldConfigurationItemSchema = z.object({ + /** The description of the field within the field configuration. */ + description: z.string().optional(), + /** The ID of the field within the field configuration. */ + id: z.string(), + /** Whether the field is hidden in the field configuration. */ + isHidden: z.boolean().optional(), + /** Whether the field is required in the field configuration. */ + isRequired: z.boolean().optional(), + /** The renderer type for the field within the field configuration. */ + renderer: z.string().optional(), +}); + +export type FieldConfigurationItem = z.infer; diff --git a/src/version2/schemas/fieldConfigurationItemsDetails.ts b/src/version2/schemas/fieldConfigurationItemsDetails.ts new file mode 100644 index 0000000000..63a80891a6 --- /dev/null +++ b/src/version2/schemas/fieldConfigurationItemsDetails.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { FieldConfigurationItemSchema } from './fieldConfigurationItem'; + +/** Details of field configuration items. */ +export const FieldConfigurationItemsDetailsSchema = z.object({ + /** Details of fields in a field configuration. */ + fieldConfigurationItems: z.array(FieldConfigurationItemSchema), +}); + +export type FieldConfigurationItemsDetails = z.infer; diff --git a/src/version2/schemas/fieldConfigurationScheme.ts b/src/version2/schemas/fieldConfigurationScheme.ts new file mode 100644 index 0000000000..ab7231a9e3 --- /dev/null +++ b/src/version2/schemas/fieldConfigurationScheme.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of a field configuration scheme. */ +export const FieldConfigurationSchemeSchema = z.object({ + /** The description of the field configuration scheme. */ + description: z.string().optional(), + /** The ID of the field configuration scheme. */ + id: z.string(), + /** The name of the field configuration scheme. */ + name: z.string(), +}); + +export type FieldConfigurationScheme = z.infer; diff --git a/src/version2/schemas/fieldConfigurationSchemeProjectAssociation.ts b/src/version2/schemas/fieldConfigurationSchemeProjectAssociation.ts new file mode 100644 index 0000000000..520bda7400 --- /dev/null +++ b/src/version2/schemas/fieldConfigurationSchemeProjectAssociation.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** Associated field configuration scheme and project. */ +export const FieldConfigurationSchemeProjectAssociationSchema = z.object({ + /** + * The ID of the field configuration scheme. If the field configuration scheme ID is `null`, the operation assigns the + * default field configuration scheme. + */ + fieldConfigurationSchemeId: z.string().optional(), + /** The ID of the project. */ + projectId: z.string(), +}); + +export type FieldConfigurationSchemeProjectAssociation = z.infer< + typeof FieldConfigurationSchemeProjectAssociationSchema +>; diff --git a/src/version2/schemas/fieldConfigurationSchemeProjects.ts b/src/version2/schemas/fieldConfigurationSchemeProjects.ts new file mode 100644 index 0000000000..bed068529c --- /dev/null +++ b/src/version2/schemas/fieldConfigurationSchemeProjects.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { FieldConfigurationSchemeSchema } from './fieldConfigurationScheme'; + +/** Project list with assigned field configuration schema. */ +export const FieldConfigurationSchemeProjectsSchema = z.object({ + fieldConfigurationScheme: FieldConfigurationSchemeSchema.optional(), + /** The IDs of projects using the field configuration scheme. */ + projectIds: z.array(z.string()), +}); + +export type FieldConfigurationSchemeProjects = z.infer; diff --git a/src/version2/schemas/fieldConfigurationToIssueTypeMapping.ts b/src/version2/schemas/fieldConfigurationToIssueTypeMapping.ts new file mode 100644 index 0000000000..4ed8f9c31a --- /dev/null +++ b/src/version2/schemas/fieldConfigurationToIssueTypeMapping.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** The field configuration to issue type mapping. */ +export const FieldConfigurationToIssueTypeMappingSchema = z.object({ + /** The ID of the field configuration. */ + fieldConfigurationId: z.string(), + /** + * The ID of the issue type or _default_. When set to _default_ this field configuration issue type item applies to + * all issue types without a field configuration. An issue type can be included only once in a request. + */ + issueTypeId: z.string(), +}); + +export type FieldConfigurationToIssueTypeMapping = z.infer; diff --git a/src/version2/schemas/fieldCreateMetadata.ts b/src/version2/schemas/fieldCreateMetadata.ts new file mode 100644 index 0000000000..172cda36c8 --- /dev/null +++ b/src/version2/schemas/fieldCreateMetadata.ts @@ -0,0 +1,29 @@ +import { z } from 'zod'; + +/** The metadata describing an issue field for createmeta. */ +export const FieldCreateMetadataSchema = z.object({ + /** The list of values allowed in the field. */ + allowedValues: z.array(z.unknown()).optional(), + /** The URL that can be used to automatically complete the field. */ + autoCompleteUrl: z.string().optional(), + /** The configuration properties. */ + configuration: z.object({}).optional(), + /** The default value of the field. */ + defaultValue: z.unknown().optional(), + /** The field id. */ + fieldId: z.string(), + /** Whether the field has a default value. */ + hasDefaultValue: z.boolean().optional(), + /** The key of the field. */ + key: z.string(), + /** The name of the field. */ + name: z.string(), + /** The list of operations that can be performed on the field. */ + operations: z.array(z.string()), + /** Whether the field is required. */ + required: z.boolean(), + /** The data type of the field. */ + schema: z.unknown(), +}); + +export type FieldCreateMetadata = z.infer; diff --git a/src/version2/schemas/fieldDetails.ts b/src/version2/schemas/fieldDetails.ts new file mode 100644 index 0000000000..f29bccde32 --- /dev/null +++ b/src/version2/schemas/fieldDetails.ts @@ -0,0 +1,30 @@ +import { z } from 'zod'; + +/** Details about a field. */ +export const FieldDetailsSchema = z.object({ + /** + * The names that can be used to reference the field in an advanced search. For more information, see [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ). + */ + clauseNames: z.array(z.string()).optional(), + /** Whether the field is a custom field. */ + custom: z.boolean().optional(), + /** The ID of the field. */ + id: z.string().optional(), + /** The key of the field. */ + key: z.string().optional(), + /** The name of the field. */ + name: z.string().optional(), + /** Whether the field can be used as a column on the issue navigator. */ + navigable: z.boolean().optional(), + /** Whether the content of the field can be used to order lists. */ + orderable: z.boolean().optional(), + /** The data schema for the field. */ + schema: z.unknown().optional(), + /** The scope of the field. */ + scope: z.unknown().optional(), + /** Whether the content of the field can be searched. */ + searchable: z.boolean().optional(), +}); + +export type FieldDetails = z.infer; diff --git a/src/version2/schemas/fieldIdIdentifier.ts b/src/version2/schemas/fieldIdIdentifier.ts new file mode 100644 index 0000000000..74517b5bef --- /dev/null +++ b/src/version2/schemas/fieldIdIdentifier.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const FieldIdIdentifierSchema = z.object({}); + +export type FieldIdIdentifier = z.infer; diff --git a/src/version2/schemas/fieldIdentifierObject.ts b/src/version2/schemas/fieldIdentifierObject.ts new file mode 100644 index 0000000000..f731487e81 --- /dev/null +++ b/src/version2/schemas/fieldIdentifierObject.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** Identifier for a field for example FIELD_ID. */ +export const FieldIdentifierObjectSchema = z.object({ + identifier: z.object({}).optional(), + type: z.string(), +}); + +export type FieldIdentifierObject = z.infer; diff --git a/src/version2/schemas/fieldLastUsed.ts b/src/version2/schemas/fieldLastUsed.ts new file mode 100644 index 0000000000..d2d1a6443b --- /dev/null +++ b/src/version2/schemas/fieldLastUsed.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Information about the most recent use of a field. */ +export const FieldLastUsedSchema = z.object({ + /** + * Last used value type: + * + * - _TRACKED_: field is tracked and a last used date is available. + * - _NOT_TRACKED_: field is not tracked, last used date is not available. + * - _NO_INFORMATION_: field is tracked, but no last used date is available. + */ + type: z.enum(['TRACKED', 'NOT_TRACKED', 'NO_INFORMATION']).optional(), + /** The date when the value of the field last changed. */ + value: z.string().datetime().optional(), +}); + +export type FieldLastUsed = z.infer; diff --git a/src/version2/schemas/fieldLayoutConfiguration.ts b/src/version2/schemas/fieldLayoutConfiguration.ts new file mode 100644 index 0000000000..e7c9800d5d --- /dev/null +++ b/src/version2/schemas/fieldLayoutConfiguration.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** + * Defines the payload for the field layout configuration. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-field-configurations/#api-rest-api-3-fieldconfiguration-post + */ +export const FieldLayoutConfigurationSchema = z.object({ + /** Whether to show the field */ + field: z.boolean().optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), + /** Whether the field is required */ + required: z.boolean().optional(), +}); + +export type FieldLayoutConfiguration = z.infer; diff --git a/src/version2/schemas/fieldLayoutPayload.ts b/src/version2/schemas/fieldLayoutPayload.ts new file mode 100644 index 0000000000..5b72ad2237 --- /dev/null +++ b/src/version2/schemas/fieldLayoutPayload.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; +import { FieldLayoutConfigurationSchema } from './fieldLayoutConfiguration'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** + * Defines the payload for the field layouts. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-field-configurations/#api-group-issue-field-configurations" + * + * - Fieldlayout is what users would see as "Field Configuration" in Jira's UI - + * https://support.atlassian.com/jira-cloud-administration/docs/manage-issue-field-configurations/ + */ +export const FieldLayoutPayloadSchema = z.object({ + /** + * The field layout configuration. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-field-configurations/#api-rest-api-3-fieldconfiguration-post + */ + configuration: z.array(FieldLayoutConfigurationSchema).optional(), + /** The description of the field layout */ + description: z.string().optional(), + /** The name of the field layout */ + name: z.string().optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), +}); + +export type FieldLayoutPayload = z.infer; diff --git a/src/version2/schemas/fieldLayoutSchemePayload.ts b/src/version2/schemas/fieldLayoutSchemePayload.ts new file mode 100644 index 0000000000..be9fa65683 --- /dev/null +++ b/src/version2/schemas/fieldLayoutSchemePayload.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** + * Defines the payload for the field layout schemes. See "Field Configuration Scheme" - + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-field-configurations/#api-rest-api-3-fieldconfigurationscheme-post + * https://support.atlassian.com/jira-cloud-administration/docs/configure-a-field-configuration-scheme/ + */ +export const FieldLayoutSchemePayloadSchema = z.object({ + defaultFieldLayout: ProjectCreateResourceIdentifierSchema.optional(), + /** The description of the field layout scheme */ + description: z.string().optional(), + /** + * There is a default configuration "fieldlayout" that is applied to all issue types using this scheme that don't have + * an explicit mapping users can create (or re-use existing) configurations for other issue types and map them to this + * scheme + */ + explicitMappings: z.object({}).optional(), + /** The name of the field layout scheme */ + name: z.string().optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), +}); + +export type FieldLayoutSchemePayload = z.infer; diff --git a/src/version2/schemas/fieldMetadata.ts b/src/version2/schemas/fieldMetadata.ts new file mode 100644 index 0000000000..c2eaacdcae --- /dev/null +++ b/src/version2/schemas/fieldMetadata.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +/** The metadata describing an issue field. */ +export const FieldMetadataSchema = z.object({ + /** The list of values allowed in the field. */ + allowedValues: z.array(z.unknown()).optional(), + /** The URL that can be used to automatically complete the field. */ + autoCompleteUrl: z.string().optional(), + /** The configuration properties. */ + configuration: z.object({}).optional(), + /** The default value of the field. */ + defaultValue: z.unknown().optional(), + /** Whether the field has a default value. */ + hasDefaultValue: z.boolean().optional(), + /** The key of the field. */ + key: z.string(), + /** The name of the field. */ + name: z.string(), + /** The list of operations that can be performed on the field. */ + operations: z.array(z.string()), + /** Whether the field is required. */ + required: z.boolean(), + /** The data type of the field. */ + schema: z.unknown(), +}); + +export type FieldMetadata = z.infer; diff --git a/src/version2/schemas/fieldReferenceData.ts b/src/version2/schemas/fieldReferenceData.ts new file mode 100644 index 0000000000..c2af9c74b6 --- /dev/null +++ b/src/version2/schemas/fieldReferenceData.ts @@ -0,0 +1,36 @@ +import { z } from 'zod'; + +/** Details of a field that can be used in advanced searches. */ +export const FieldReferenceDataSchema = z.object({ + /** Whether the field provide auto-complete suggestions. */ + auto: z.enum(['true', 'false']).optional(), + /** If the item is a custom field, the ID of the custom field. */ + cfid: z.string().optional(), + /** Whether this field has been deprecated. */ + deprecated: z.enum(['true', 'false']).optional(), + /** The searcher key of the field, only passed when the field is deprecated. */ + deprecatedSearcherKey: z.string().optional(), + /** + * The display name contains the following: + * + * - For system fields, the field name. For example, `Summary`. + * - For collapsed custom fields, the field name followed by a hyphen and then the field name and field type. For + * example, `Component - Component[Dropdown]`. + * - For other custom fields, the field name followed by a hyphen and then the custom field ID. For example, `Component + * + * - Cf[10061]`. + */ + displayName: z.string().optional(), + /** The valid search operators for the field. */ + operators: z.array(z.string()).optional(), + /** Whether the field can be used in a query's `ORDER BY` clause. */ + orderable: z.enum(['true', 'false']).optional(), + /** Whether the content of this field can be searched. */ + searchable: z.enum(['true', 'false']).optional(), + /** The data types of items in the field. */ + types: z.array(z.string()).optional(), + /** The field identifier. */ + value: z.string().optional(), +}); + +export type FieldReferenceData = z.infer; diff --git a/src/version2/schemas/fieldUpdateOperation.ts b/src/version2/schemas/fieldUpdateOperation.ts new file mode 100644 index 0000000000..ab356fea72 --- /dev/null +++ b/src/version2/schemas/fieldUpdateOperation.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details of an operation to perform on a field. */ +export const FieldUpdateOperationSchema = z.object({ + /** The value to add to the field. */ + add: z.unknown().optional(), + /** The field value to copy from another issue. */ + copy: z.unknown().optional(), + /** The value to edit in the field. */ + edit: z.unknown().optional(), + /** The value to removed from the field. */ + remove: z.unknown().optional(), + /** The value to set in the field. */ + set: z.unknown().optional(), +}); + +export type FieldUpdateOperation = z.infer; diff --git a/src/version2/schemas/fieldValueClause.ts b/src/version2/schemas/fieldValueClause.ts new file mode 100644 index 0000000000..fd960475c8 --- /dev/null +++ b/src/version2/schemas/fieldValueClause.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { JqlQueryFieldSchema } from './jqlQueryField'; +import { JqlQueryClauseOperandSchema } from './jqlQueryClauseOperand'; + +/** A clause that asserts the current value of a field. For example, `summary ~ test`. */ +export const FieldValueClauseSchema = z.object({ + field: JqlQueryFieldSchema, + operand: JqlQueryClauseOperandSchema, + /** The operator between the field and operand. */ + operator: z.enum(['=', '!=', '>', '<', '>=', '<=', 'in', 'not in', '~', '~=', 'is', 'is not']), +}); + +export type FieldValueClause = z.infer; diff --git a/src/version2/schemas/fieldWasClause.ts b/src/version2/schemas/fieldWasClause.ts new file mode 100644 index 0000000000..b7911d31e1 --- /dev/null +++ b/src/version2/schemas/fieldWasClause.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; +import { JqlQueryFieldSchema } from './jqlQueryField'; +import { JqlQueryClauseOperandSchema } from './jqlQueryClauseOperand'; +import { JqlQueryClauseTimePredicateSchema } 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 const FieldWasClauseSchema = z.object({ + field: JqlQueryFieldSchema, + operand: JqlQueryClauseOperandSchema, + /** The operator between the field and operand. */ + operator: z.enum(['was', 'was in', 'was not in', 'was not']), + /** The list of time predicates. */ + predicates: z.array(JqlQueryClauseTimePredicateSchema), +}); + +export type FieldWasClause = z.infer; diff --git a/src/version2/schemas/fields.ts b/src/version2/schemas/fields.ts new file mode 100644 index 0000000000..c5e9c0e15a --- /dev/null +++ b/src/version2/schemas/fields.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { IssueTypeDetailsSchema } from './issueTypeDetails'; + +/** Key fields from the linked issue. */ +export const FieldsSchema = z.object({ + /** The assignee of the linked issue. */ + assignee: z.unknown().optional(), + /** The type of the linked issue. */ + issueType: z.unknown().optional(), + /** The type of the linked issue. */ + issuetype: IssueTypeDetailsSchema.optional(), + /** The priority of the linked issue. */ + priority: z.unknown().optional(), + /** The status of the linked issue. */ + status: z.unknown().optional(), + /** The summary description of the linked issue. */ + summary: z.string().optional(), + /** The time tracking of the linked issue. */ + timetracking: z.unknown().optional(), +}); + +export type Fields = z.infer; diff --git a/src/version2/schemas/filter.ts b/src/version2/schemas/filter.ts new file mode 100644 index 0000000000..8a4f7a43dd --- /dev/null +++ b/src/version2/schemas/filter.ts @@ -0,0 +1,55 @@ +import { z } from 'zod'; +import { SharePermissionSchema } from './sharePermission'; + +/** Details about a filter. */ +export const FilterSchema = z.object({ + /** + * [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: z.string().datetime().optional(), + /** A description of the filter. */ + description: z.string().optional(), + /** The groups and projects that can edit the filter. */ + editPermissions: z.array(SharePermissionSchema).optional(), + /** Whether the filter is selected as a favorite. */ + favourite: z.boolean().optional(), + /** The count of how many users have selected this filter as a favorite, including the filter owner. */ + favouritedCount: z.number().int().optional(), + /** The unique identifier for the filter. */ + id: z.string().optional(), + /** The JQL query for the filter. For example, _project = SSP AND issuetype = Bug_. */ + jql: z.string().optional(), + /** The name of the filter. Must be unique. */ + name: z.string(), + /** + * The user who owns the filter. This is defaulted to the creator of the filter, however Jira administrators can + * change the owner of a shared filter in the admin settings. + */ + owner: z.unknown().optional(), + /** + * A URL to view the filter results in Jira, using the [Search for issues using + * JQL](#api-rest-api-2-filter-search-get) operation with the filter's JQL string to return the filter results. For + * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. + */ + searchUrl: z.string().optional(), + /** The URL of the filter. */ + self: z.string().optional(), + /** The groups and projects that the filter is shared with. */ + sharePermissions: z.array(SharePermissionSchema).optional(), + /** + * A paginated list of the users that the filter is shared with. This includes users that are members of the groups or + * can browse the projects that the filter is shared with. + */ + sharedUsers: z.unknown().optional(), + /** A paginated list of the users that are subscribed to the filter. */ + subscriptions: z.unknown().optional(), + /** + * A URL to view the filter results in Jira, using the ID of the filter. For example, + * _https://your-domain.atlassian.net/issues/?filter=10100_. + */ + viewUrl: z.string().optional(), +}); + +export type Filter = z.infer; diff --git a/src/version2/schemas/filterDetails.ts b/src/version2/schemas/filterDetails.ts new file mode 100644 index 0000000000..9820c98824 --- /dev/null +++ b/src/version2/schemas/filterDetails.ts @@ -0,0 +1,59 @@ +import { z } from 'zod'; +import { SharePermissionSchema } from './sharePermission'; +import { FilterSubscriptionSchema } from './filterSubscription'; + +/** Details of a filter. */ +export const FilterDetailsSchema = z.object({ + /** + * [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: z.string().datetime().optional(), + /** The description of the filter. */ + description: z.string().optional(), + /** + * The groups and projects that can edit the filter. This can be specified when updating a filter, but not when + * creating a filter. + */ + editPermissions: z.array(SharePermissionSchema).optional(), + /** Expand options that include additional filter details in the response. */ + expand: z.string().optional(), + /** Whether the filter is selected as a favorite by any users, not including the filter owner. */ + favourite: z.boolean().optional(), + /** The count of how many users have selected this filter as a favorite, including the filter owner. */ + favouritedCount: z.number().int().optional(), + /** The unique identifier for the filter. */ + id: z.string().optional(), + /** The JQL query for the filter. For example, _project = SSP AND issuetype = Bug_. */ + jql: z.string().optional(), + /** The name of the filter. */ + name: z.string(), + /** + * The user who owns the filter. Defaults to the creator of the filter, however, Jira administrators can change the + * owner of a shared filter in the admin settings. + */ + owner: z.unknown().optional(), + /** + * A URL to view the filter results in Jira, using the [Search for issues using + * JQL](#api-rest-api-2-filter-search-get) operation with the filter's JQL string to return the filter results. For + * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. + */ + searchUrl: z.string().optional(), + /** The URL of the filter. */ + self: z.string().optional(), + /** + * The groups and projects that the filter is shared with. This can be specified when updating a filter, but not when + * creating a filter. + */ + sharePermissions: z.array(SharePermissionSchema).optional(), + /** The users that are subscribed to the filter. */ + subscriptions: z.array(FilterSubscriptionSchema).optional(), + /** + * A URL to view the filter results in Jira, using the ID of the filter. For example, + * _https://your-domain.atlassian.net/issues/?filter=10100_. + */ + viewUrl: z.string().optional(), +}); + +export type FilterDetails = z.infer; diff --git a/src/version2/schemas/filterSubscription.ts b/src/version2/schemas/filterSubscription.ts new file mode 100644 index 0000000000..45771ba8cc --- /dev/null +++ b/src/version2/schemas/filterSubscription.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of a user or group subscribing to a filter. */ +export const FilterSubscriptionSchema = z.object({ + /** The group subscribing to filter. */ + group: z.unknown().optional(), + /** The ID of the filter subscription. */ + id: z.number().int().optional(), + /** The user subscribing to filter. */ + user: z.unknown().optional(), +}); + +export type FilterSubscription = z.infer; diff --git a/src/version2/schemas/filterSubscriptionsList.ts b/src/version2/schemas/filterSubscriptionsList.ts new file mode 100644 index 0000000000..e3dd585e7f --- /dev/null +++ b/src/version2/schemas/filterSubscriptionsList.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; +import { FilterSubscriptionSchema } from './filterSubscription'; + +/** A paginated list of subscriptions to a filter. */ +export const FilterSubscriptionsListSchema = z + .object({ + /** The index of the last item returned on the page. */ + 'end-index': z.number().int().optional(), + /** The list of items. */ + items: z.array(FilterSubscriptionSchema).optional(), + /** The maximum number of results that could be on the page. */ + 'max-results': z.number().int().optional(), + /** The number of items on the page. */ + size: z.number().int().optional(), + /** The index of the first item returned on the page. */ + 'start-index': z.number().int().optional(), + }) + .transform(val => ({ + endIndex: val['end-index'], + items: val['items'], + maxResults: val['max-results'], + size: val['size'], + startIndex: val['start-index'], + })); + +export type FilterSubscriptionsList = z.infer; diff --git a/src/version2/schemas/foundGroup.ts b/src/version2/schemas/foundGroup.ts new file mode 100644 index 0000000000..7d931afc33 --- /dev/null +++ b/src/version2/schemas/foundGroup.ts @@ -0,0 +1,32 @@ +import { z } from 'zod'; +import { GroupLabelSchema } from './groupLabel'; + +/** A group found in a search. */ +export const FoundGroupSchema = z.object({ + /** Avatar url for the group/team if present. */ + avatarUrl: z.string().optional(), + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. + */ + groupId: z.string().optional(), + /** The group name with the matched query string highlighted with the HTML bold tag. */ + html: z.string().optional(), + labels: z.array(GroupLabelSchema).optional(), + /** + * Describes who/how the team is managed. The possible values are * external - when team is synced from an external + * directory like SCIM or HRIS, and team members cannot be modified. * admins - when a team is managed by an admin + * (team members can only be modified by admins). * team-members - managed by existing team members, new members need + * to be invited to join. * open - anyone can join or modify this team. + */ + managedBy: z.enum(['EXTERNAL', 'ADMINS', 'TEAM_MEMBERS', 'OPEN']).optional(), + /** The name of the group. The name of a group is mutable, to reliably identify a group use ``groupId`.` */ + name: z.string().optional(), + /** + * Describes the type of group. The possible values are * team-collaboration - A platform team managed in people + * directory. * userbase-group - a group of users created in adminhub. * admin-oversight - currently unused. + */ + usageType: z.enum(['USERBASE_GROUP', 'TEAM_COLLABORATION', 'ADMIN_OVERSIGHT']).optional(), +}); + +export type FoundGroup = z.infer; diff --git a/src/version2/schemas/foundGroups.ts b/src/version2/schemas/foundGroups.ts new file mode 100644 index 0000000000..72e4a6a5ef --- /dev/null +++ b/src/version2/schemas/foundGroups.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { FoundGroupSchema } from './foundGroup'; + +/** + * The list of groups found in a search, including header text (Showing X of Y matching groups) and total of matched + * groups. + */ +export const FoundGroupsSchema = z.object({ + groups: z.array(FoundGroupSchema).optional(), + /** Header text indicating the number of groups in the response and the total number of groups found in the search. */ + header: z.string().optional(), + /** The total number of groups found in the search. */ + total: z.number().int().optional(), +}); + +export type FoundGroups = z.infer; diff --git a/src/version2/schemas/foundUsers.ts b/src/version2/schemas/foundUsers.ts new file mode 100644 index 0000000000..f43fe7e966 --- /dev/null +++ b/src/version2/schemas/foundUsers.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { UserPickerUserSchema } from './userPickerUser'; + +/** + * The list of users found in a search, including header text (Showing X of Y matching users) and total of matched + * users. + */ +export const FoundUsersSchema = z.object({ + /** Header text indicating the number of users in the response and the total number of users found in the search. */ + header: z.string().optional(), + /** The total number of users found in the search. */ + total: z.number().int().optional(), + users: z.array(UserPickerUserSchema).optional(), +}); + +export type FoundUsers = z.infer; diff --git a/src/version2/schemas/foundUsersAndGroups.ts b/src/version2/schemas/foundUsersAndGroups.ts new file mode 100644 index 0000000000..01b156f122 --- /dev/null +++ b/src/version2/schemas/foundUsersAndGroups.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { FoundGroupsSchema } from './foundGroups'; +import { FoundUsersSchema } from './foundUsers'; + +/** List of users and groups found in a search. */ +export const FoundUsersAndGroupsSchema = z.object({ + groups: FoundGroupsSchema.optional(), + users: FoundUsersSchema.optional(), +}); + +export type FoundUsersAndGroups = z.infer; diff --git a/src/version2/schemas/fromLayoutPayload.ts b/src/version2/schemas/fromLayoutPayload.ts new file mode 100644 index 0000000000..c74f3aa3d8 --- /dev/null +++ b/src/version2/schemas/fromLayoutPayload.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** The payload for the layout details for the start end of a transition */ +export const FromLayoutPayloadSchema = z.object({ + /** The port that the transition can be made from */ + fromPort: z.number().int().optional(), + status: ProjectCreateResourceIdentifierSchema.optional(), + /** The port that the transition goes to */ + toPortOverride: z.number().int().optional(), +}); + +export type FromLayoutPayload = z.infer; diff --git a/src/version2/schemas/functionOperand.ts b/src/version2/schemas/functionOperand.ts new file mode 100644 index 0000000000..c3a016c8bf --- /dev/null +++ b/src/version2/schemas/functionOperand.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** + * An operand that is a function. See [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/dwiiLQ) for more information about JQL functions. + */ +export const FunctionOperandSchema = z.object({ + /** The list of function arguments. */ + arguments: z.array(z.string()), + /** Encoded operand, which can be used directly in a JQL query. */ + encodedOperand: z.string().optional(), + /** The name of the function. */ + function: z.string(), +}); + +export type FunctionOperand = z.infer; diff --git a/src/version2/schemas/functionReferenceData.ts b/src/version2/schemas/functionReferenceData.ts new file mode 100644 index 0000000000..56a1df069d --- /dev/null +++ b/src/version2/schemas/functionReferenceData.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details of functions that can be used in advanced searches. */ +export const FunctionReferenceDataSchema = z.object({ + /** The display name of the function. */ + displayName: z.string().optional(), + /** Whether the function can take a list of arguments. */ + isList: z.enum(['true', 'false']).optional(), + /** Whether the function supports both single and list value operators. */ + supportsListAndSingleValueOperators: z.enum(['true', 'false']).optional(), + /** The data types returned by the function. */ + types: z.array(z.string()).optional(), + /** The function identifier. */ + value: z.string().optional(), +}); + +export type FunctionReferenceData = z.infer; diff --git a/src/version2/schemas/getAtlassianTeamResponse.ts b/src/version2/schemas/getAtlassianTeamResponse.ts new file mode 100644 index 0000000000..34537541f4 --- /dev/null +++ b/src/version2/schemas/getAtlassianTeamResponse.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const GetAtlassianTeamResponseSchema = z.object({ + /** The capacity for the Atlassian team. */ + capacity: z.number().optional(), + /** The Atlassian team ID. */ + id: z.string(), + /** The ID of the issue source for the Atlassian team. */ + issueSourceId: z.number().int().optional(), + /** The planning style for the Atlassian team. This is "Scrum" or "Kanban". */ + planningStyle: z.enum(['Scrum', 'Kanban']), + /** The sprint length for the Atlassian team. */ + sprintLength: z.number().int().optional(), +}); + +export type GetAtlassianTeamResponse = z.infer; diff --git a/src/version2/schemas/getCrossProjectReleaseResponse.ts b/src/version2/schemas/getCrossProjectReleaseResponse.ts new file mode 100644 index 0000000000..0b36d97ed5 --- /dev/null +++ b/src/version2/schemas/getCrossProjectReleaseResponse.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetCrossProjectReleaseResponseSchema = z.object({ + /** The cross-project release name. */ + name: z.string().optional(), + /** The IDs of the releases included in the cross-project release. */ + releaseIds: z.array(z.number().int()).optional(), +}); + +export type GetCrossProjectReleaseResponse = z.infer; diff --git a/src/version2/schemas/getCustomFieldResponse.ts b/src/version2/schemas/getCustomFieldResponse.ts new file mode 100644 index 0000000000..8af9fd695f --- /dev/null +++ b/src/version2/schemas/getCustomFieldResponse.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetCustomFieldResponseSchema = z.object({ + /** The custom field ID. */ + customFieldId: z.number().int(), + /** Allows filtering issues based on their values for the custom field. */ + filter: z.boolean().optional(), +}); + +export type GetCustomFieldResponse = z.infer; diff --git a/src/version2/schemas/getDateFieldResponse.ts b/src/version2/schemas/getDateFieldResponse.ts new file mode 100644 index 0000000000..fb5f0b6965 --- /dev/null +++ b/src/version2/schemas/getDateFieldResponse.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetDateFieldResponseSchema = z.object({ + /** A date custom field ID. This is returned if the type is "DateCustomField". */ + dateCustomFieldId: z.number().int().optional(), + /** The date field type. This is "DueDate", "TargetStartDate", "TargetEndDate" or "DateCustomField". */ + type: z.enum(['DueDate', 'TargetStartDate', 'TargetEndDate', 'DateCustomField']), +}); + +export type GetDateFieldResponse = z.infer; diff --git a/src/version2/schemas/getExclusionRulesResponse.ts b/src/version2/schemas/getExclusionRulesResponse.ts new file mode 100644 index 0000000000..bc8212a071 --- /dev/null +++ b/src/version2/schemas/getExclusionRulesResponse.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +export const GetExclusionRulesResponseSchema = z.object({ + /** The IDs of the issues excluded from the plan. */ + issueIds: z.array(z.number().int()).optional(), + /** The IDs of the issue types excluded from the plan. */ + issueTypeIds: z.array(z.number().int()).optional(), + /** Issues completed this number of days ago are excluded from the plan. */ + numberOfDaysToShowCompletedIssues: z.number().int(), + /** The IDs of the releases excluded from the plan. */ + releaseIds: z.array(z.number().int()).optional(), + /** The IDs of the work status categories excluded from the plan. */ + workStatusCategoryIds: z.array(z.number().int()).optional(), + /** The IDs of the work statuses excluded from the plan. */ + workStatusIds: z.array(z.number().int()).optional(), +}); + +export type GetExclusionRulesResponse = z.infer; diff --git a/src/version2/schemas/getIssueSourceResponse.ts b/src/version2/schemas/getIssueSourceResponse.ts new file mode 100644 index 0000000000..b2ecc59d4b --- /dev/null +++ b/src/version2/schemas/getIssueSourceResponse.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const GetIssueSourceResponseSchema = z.object({ + /** The issue source type. This is "Board", "Project" or "Filter". */ + type: z.enum(['Board', 'Project', 'Filter', 'Custom']), + /** + * 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: z.number().int(), +}); + +export type GetIssueSourceResponse = z.infer; diff --git a/src/version2/schemas/getPermissionHolderResponse.ts b/src/version2/schemas/getPermissionHolderResponse.ts new file mode 100644 index 0000000000..682b7401a5 --- /dev/null +++ b/src/version2/schemas/getPermissionHolderResponse.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const GetPermissionHolderResponseSchema = z.object({ + /** The permission holder type. This is "Group" or "AccountId". */ + type: z.enum(['Group', 'AccountId']), + /** + * The permission holder value. This is a group name if the type is "Group" or an account ID if the type is + * "AccountId". + */ + value: z.string(), +}); + +export type GetPermissionHolderResponse = z.infer; diff --git a/src/version2/schemas/getPermissionResponse.ts b/src/version2/schemas/getPermissionResponse.ts new file mode 100644 index 0000000000..c28f8fbbcc --- /dev/null +++ b/src/version2/schemas/getPermissionResponse.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const GetPermissionResponseSchema = z.object({ + /** The permission holder. */ + holder: z.unknown(), + /** The permission type. This is "View" or "Edit". */ + type: z.enum(['View', 'Edit']), +}); + +export type GetPermissionResponse = z.infer; diff --git a/src/version2/schemas/getPlanOnlyTeamResponse.ts b/src/version2/schemas/getPlanOnlyTeamResponse.ts new file mode 100644 index 0000000000..2fa4f43bc2 --- /dev/null +++ b/src/version2/schemas/getPlanOnlyTeamResponse.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +export const GetPlanOnlyTeamResponseSchema = z.object({ + /** The capacity for the plan-only team. */ + capacity: z.number().optional(), + /** The plan-only team ID. */ + id: z.number().int(), + /** The ID of the issue source for the plan-only team. */ + issueSourceId: z.number().int().optional(), + /** The account IDs of the plan-only team members. */ + memberAccountIds: z.array(z.string()).optional(), + /** The plan-only team name. */ + name: z.string(), + /** The planning style for the plan-only team. This is "Scrum" or "Kanban". */ + planningStyle: z.enum(['Scrum', 'Kanban']), + /** The sprint length for the plan-only team. */ + sprintLength: z.number().int().optional(), +}); + +export type GetPlanOnlyTeamResponse = z.infer; diff --git a/src/version2/schemas/getPlanResponse.ts b/src/version2/schemas/getPlanResponse.ts new file mode 100644 index 0000000000..30b233bb3c --- /dev/null +++ b/src/version2/schemas/getPlanResponse.ts @@ -0,0 +1,32 @@ +import { z } from 'zod'; +import { GetCrossProjectReleaseResponseSchema } from './getCrossProjectReleaseResponse'; +import { GetCustomFieldResponseSchema } from './getCustomFieldResponse'; +import { GetIssueSourceResponseSchema } from './getIssueSourceResponse'; +import { GetPermissionResponseSchema } from './getPermissionResponse'; + +export const GetPlanResponseSchema = z.object({ + /** The cross-project releases included in the plan. */ + crossProjectReleases: z.array(GetCrossProjectReleaseResponseSchema).optional(), + /** The custom fields for the plan. */ + customFields: z.array(GetCustomFieldResponseSchema).optional(), + /** The exclusion rules for the plan. */ + exclusionRules: z.unknown().optional(), + /** The plan ID. */ + id: z.number().int(), + /** The issue sources included in the plan. */ + issueSources: z.array(GetIssueSourceResponseSchema).optional(), + /** The date when the plan was last saved in UTC. */ + lastSaved: z.string().optional(), + /** The account ID of the plan lead. */ + leadAccountId: z.string().optional(), + /** The plan name. */ + name: z.string().optional(), + /** The permissions for the plan. */ + permissions: z.array(GetPermissionResponseSchema).optional(), + /** The scheduling settings for the plan. */ + scheduling: z.unknown(), + /** The plan status. This is "Active", "Trashed" or "Archived". */ + status: z.enum(['Active', 'Trashed', 'Archived']), +}); + +export type GetPlanResponse = z.infer; diff --git a/src/version2/schemas/getPlanResponseForPage.ts b/src/version2/schemas/getPlanResponseForPage.ts new file mode 100644 index 0000000000..48ebc7760a --- /dev/null +++ b/src/version2/schemas/getPlanResponseForPage.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; +import { GetIssueSourceResponseSchema } from './getIssueSourceResponse'; + +export const GetPlanResponseForPageSchema = z.object({ + /** The plan ID. */ + id: z.string(), + /** The issue sources included in the plan. */ + issueSources: z.array(GetIssueSourceResponseSchema).optional(), + /** The plan name. */ + name: z.string(), + /** Default scenario ID. */ + scenarioId: z.string(), + /** The plan status. This is "Active", "Trashed" or "Archived". */ + status: z.enum(['Active', 'Trashed', 'Archived']), +}); + +export type GetPlanResponseForPage = z.infer; diff --git a/src/version2/schemas/getSchedulingResponse.ts b/src/version2/schemas/getSchedulingResponse.ts new file mode 100644 index 0000000000..2e93a3d280 --- /dev/null +++ b/src/version2/schemas/getSchedulingResponse.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const GetSchedulingResponseSchema = z.object({ + /** The dependencies for the plan. This is "Sequential" or "Concurrent". */ + dependencies: z.enum(['Sequential', 'Concurrent']), + /** The end date field for the plan. */ + endDate: z.unknown(), + /** The estimation unit for the plan. This is "StoryPoints", "Days" or "Hours". */ + estimation: z.enum(['StoryPoints', 'Days', 'Hours']), + /** The inferred dates for the plan. This is "None", "SprintDates" or "ReleaseDates". */ + inferredDates: z.enum(['None', 'SprintDates', 'ReleaseDates']), + /** The start date field for the plan. */ + startDate: z.unknown(), +}); + +export type GetSchedulingResponse = z.infer; diff --git a/src/version2/schemas/getTeamResponseForPage.ts b/src/version2/schemas/getTeamResponseForPage.ts new file mode 100644 index 0000000000..0ff3b73351 --- /dev/null +++ b/src/version2/schemas/getTeamResponseForPage.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GetTeamResponseForPageSchema = z.object({ + /** The team ID. */ + id: z.string(), + /** The team name. This is returned if the type is "PlanOnly". */ + name: z.string().optional(), + /** The team type. This is "PlanOnly" or "Atlassian". */ + type: z.enum(['PlanOnly', 'Atlassian']), +}); + +export type GetTeamResponseForPage = z.infer; diff --git a/src/version2/schemas/globalScopeBean.ts b/src/version2/schemas/globalScopeBean.ts new file mode 100644 index 0000000000..752529feae --- /dev/null +++ b/src/version2/schemas/globalScopeBean.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const GlobalScopeBeanSchema = z.object({ + /** + * Defines the behavior of the option in the global context.If notSelectable is set, the option cannot be set as the + * field's value. This is useful for archiving an option that has previously been selected but shouldn't be used + * anymore.If defaultValue is set, the option is selected by default. + */ + attributes: z.array(z.enum(['notSelectable', 'defaultValue'])).optional(), +}); + +export type GlobalScopeBean = z.infer; diff --git a/src/version2/schemas/group.ts b/src/version2/schemas/group.ts new file mode 100644 index 0000000000..bff011dc0c --- /dev/null +++ b/src/version2/schemas/group.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +export const GroupSchema = z.object({ + /** Expand options that include additional group details in the response. */ + expand: z.string().optional(), + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. + */ + groupId: z.string().optional(), + /** The name of group. */ + name: z.string().optional(), + /** The URL for these group details. */ + self: z.string().optional(), + /** + * A paginated list of the users that are members of the group. A maximum of 50 users is returned in the list, to + * access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 50 + * users, use`?expand=users[51:100]`. + */ + users: z.unknown().optional(), +}); + +export type Group = z.infer; diff --git a/src/version2/schemas/groupDetails.ts b/src/version2/schemas/groupDetails.ts new file mode 100644 index 0000000000..5b553f028a --- /dev/null +++ b/src/version2/schemas/groupDetails.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** Details about a group. */ +export const GroupDetailsSchema = z.object({ + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. + */ + groupId: z.string().optional(), + /** The name of the group. */ + name: z.string().optional(), +}); + +export type GroupDetails = z.infer; diff --git a/src/version2/schemas/groupLabel.ts b/src/version2/schemas/groupLabel.ts new file mode 100644 index 0000000000..55072055c4 --- /dev/null +++ b/src/version2/schemas/groupLabel.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** A group label. */ +export const GroupLabelSchema = z.object({ + /** The group label name. */ + text: z.string().optional(), + /** The title of the group label. */ + title: z.string().optional(), + /** The type of the group label. */ + type: z.enum(['ADMIN', 'SINGLE', 'MULTIPLE']).optional(), +}); + +export type GroupLabel = z.infer; diff --git a/src/version2/schemas/groupName.ts b/src/version2/schemas/groupName.ts new file mode 100644 index 0000000000..6ad8cae25a --- /dev/null +++ b/src/version2/schemas/groupName.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** Details about a group. */ +export const GroupNameSchema = z.object({ + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. + */ + groupId: z.string().optional(), + /** The name of group. */ + name: z.string().optional(), + /** The URL for these group details. */ + self: z.string().optional(), +}); + +export type GroupName = z.infer; diff --git a/src/version2/schemas/healthCheckResult.ts b/src/version2/schemas/healthCheckResult.ts new file mode 100644 index 0000000000..86fe765768 --- /dev/null +++ b/src/version2/schemas/healthCheckResult.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Jira instance health check results. Deprecated and no longer returned. */ +export const HealthCheckResultSchema = z.object({ + /** The description of the Jira health check item. */ + description: z.string().optional(), + /** The name of the Jira health check item. */ + name: z.string().optional(), + /** Whether the Jira health check item passed or failed. */ + passed: z.boolean().optional(), +}); + +export type HealthCheckResult = z.infer; diff --git a/src/version2/schemas/hierarchy.ts b/src/version2/schemas/hierarchy.ts new file mode 100644 index 0000000000..62b19237d5 --- /dev/null +++ b/src/version2/schemas/hierarchy.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { SimplifiedHierarchyLevelSchema } from './simplifiedHierarchyLevel'; + +/** The project issue type hierarchy. */ +export const HierarchySchema = z.object({ + /** + * The ID of the base 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/). + */ + baseLevelId: z.number().int().optional(), + /** Details about the hierarchy level. */ + levels: z.array(SimplifiedHierarchyLevelSchema).optional(), +}); + +export type Hierarchy = z.infer; diff --git a/src/version2/schemas/historyMetadata.ts b/src/version2/schemas/historyMetadata.ts new file mode 100644 index 0000000000..52813cdc4d --- /dev/null +++ b/src/version2/schemas/historyMetadata.ts @@ -0,0 +1,29 @@ +import { z } from 'zod'; + +/** Details of issue history metadata. */ +export const HistoryMetadataSchema = z.object({ + /** The activity described in the history record. */ + activityDescription: z.string().optional(), + /** The key of the activity described in the history record. */ + activityDescriptionKey: z.string().optional(), + /** Details of the user whose action created the history record. */ + actor: z.unknown().optional(), + /** Details of the cause that triggered the creation the history record. */ + cause: z.unknown().optional(), + /** The description of the history record. */ + description: z.string().optional(), + /** The description key of the history record. */ + descriptionKey: z.string().optional(), + /** The description of the email address associated the history record. */ + emailDescription: z.string().optional(), + /** The description key of the email address associated the history record. */ + emailDescriptionKey: z.string().optional(), + /** Additional arbitrary information about the history record. */ + extraData: z.object({}).optional(), + /** Details of the system that generated the history record. */ + generator: z.unknown().optional(), + /** The type of the history record. */ + type: z.string().optional(), +}); + +export type HistoryMetadata = z.infer; diff --git a/src/version2/schemas/historyMetadataParticipant.ts b/src/version2/schemas/historyMetadataParticipant.ts new file mode 100644 index 0000000000..3e13282a8d --- /dev/null +++ b/src/version2/schemas/historyMetadataParticipant.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** Details of user or system associated with a issue history metadata item. */ +export const HistoryMetadataParticipantSchema = z.object({ + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl: z.string().optional(), + /** The display name of the user or system associated with a history record. */ + displayName: z.string().optional(), + /** The key of the display name of the user or system associated with a history record. */ + displayNameKey: z.string().optional(), + /** The ID of the user or system associated with a history record. */ + id: z.string().optional(), + /** The type of the user or system associated with a history record. */ + type: z.string().optional(), + /** The URL of the user or system associated with a history record. */ + url: z.string().optional(), +}); + +export type HistoryMetadataParticipant = z.infer; diff --git a/src/version2/schemas/icon.ts b/src/version2/schemas/icon.ts new file mode 100644 index 0000000000..cb9afe4c40 --- /dev/null +++ b/src/version2/schemas/icon.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; + +/** + * An icon. If no icon is defined: * + * + * - - For a status icon, no status icon displays in Jira. + * - - For the remote object icon, the default link icon displays in Jira. + */ +export const IconSchema = z.object({ + /** The URL of the tooltip, used only for a status icon. If not set, the status icon in Jira is not clickable. */ + link: z.string().optional(), + /** + * The title of the icon. This is used as follows: + * + * - For a status icon it is used as a tooltip on the icon. If not set, the status icon doesn't display a tooltip in + * Jira. + * - For the remote object icon it is used in conjunction with the application name to display a tooltip for the link's + * icon. The tooltip takes the format "[application name] icon title". Blank itemsare excluded from the tooltip + * title. If both items are blank, the icon tooltop displays as "Web Link". + */ + title: z.string().optional(), + /** The URL of an icon that displays at 16x16 pixel in Jira. */ + url16x16: z.string().optional(), +}); + +export type Icon = z.infer; diff --git a/src/version2/schemas/iconBean.ts b/src/version2/schemas/iconBean.ts new file mode 100644 index 0000000000..9a7daa846f --- /dev/null +++ b/src/version2/schemas/iconBean.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** An icon. */ +export const IconBeanSchema = z.object({ + /** The URL of the tooltip, used only for a status icon. */ + link: z.string().optional(), + /** The title of the icon, for use as a tooltip on the icon. */ + title: z.string().optional(), + /** The URL of a 16x16 pixel icon. */ + url16x16: z.string().optional(), +}); + +export type IconBean = z.infer; diff --git a/src/version2/schemas/idBean.ts b/src/version2/schemas/idBean.ts new file mode 100644 index 0000000000..cbbf38f199 --- /dev/null +++ b/src/version2/schemas/idBean.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const IdBeanSchema = z.object({ + /** + * The ID of the permission scheme to associate with the project. Use the [Get all permission + * schemes](#api-rest-api-2-permissionscheme-get) resource to get a list of permission scheme IDs. + */ + id: z.number().int(), +}); + +export type IdBean = z.infer; diff --git a/src/version2/schemas/idOrKeyBean.ts b/src/version2/schemas/idOrKeyBean.ts new file mode 100644 index 0000000000..b2c5a4cb33 --- /dev/null +++ b/src/version2/schemas/idOrKeyBean.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const IdOrKeyBeanSchema = z.object({ + /** The ID of the referenced item. */ + id: z.number().int().optional(), + /** The key of the referenced item. */ + key: z.string().optional(), +}); + +export type IdOrKeyBean = z.infer; diff --git a/src/version2/schemas/includedFields.ts b/src/version2/schemas/includedFields.ts new file mode 100644 index 0000000000..ba00e252dd --- /dev/null +++ b/src/version2/schemas/includedFields.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export const IncludedFieldsSchema = z.object({ + actuallyIncluded: z.array(z.string()).optional(), + excluded: z.array(z.string()).optional(), + included: z.array(z.string()).optional(), +}); + +export type IncludedFields = z.infer; diff --git a/src/version2/schemas/inputStreamSource.ts b/src/version2/schemas/inputStreamSource.ts new file mode 100644 index 0000000000..4266ac09b5 --- /dev/null +++ b/src/version2/schemas/inputStreamSource.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const InputStreamSourceSchema = z.object({ + inputStream: z.object({}).optional(), +}); + +export type InputStreamSource = z.infer; diff --git a/src/version2/schemas/issueArchivalSyncRequest.ts b/src/version2/schemas/issueArchivalSyncRequest.ts new file mode 100644 index 0000000000..9a2b53bae9 --- /dev/null +++ b/src/version2/schemas/issueArchivalSyncRequest.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +/** List of Issue Ids Or Keys that are to be archived or unarchived */ +export const IssueArchivalSyncRequestSchema = z.object({ + issueIdsOrKeys: z.array(z.string()).optional(), +}); + +export type IssueArchivalSyncRequest = z.infer; diff --git a/src/version2/schemas/issueArchivalSyncResponse.ts b/src/version2/schemas/issueArchivalSyncResponse.ts new file mode 100644 index 0000000000..5437f4a911 --- /dev/null +++ b/src/version2/schemas/issueArchivalSyncResponse.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { ErrorsSchema } from './errors'; + +/** Number of archived/unarchived issues and list of errors that occurred during the action, if any. */ +export const IssueArchivalSyncResponseSchema = z.object({ + errors: ErrorsSchema.optional(), + numberOfIssuesUpdated: z.number().int().optional(), +}); + +export type IssueArchivalSyncResponse = z.infer; diff --git a/src/version2/schemas/issueBean.ts b/src/version2/schemas/issueBean.ts new file mode 100644 index 0000000000..3eecf73634 --- /dev/null +++ b/src/version2/schemas/issueBean.ts @@ -0,0 +1,37 @@ +import { z } from 'zod'; +import { IncludedFieldsSchema } from './includedFields'; +import { IssueTransitionSchema } from './issueTransition'; + +/** Details about an issue. */ +export const IssueBeanSchema = z.object({ + /** Details of changelogs associated with the issue. */ + changelog: z.unknown().optional(), + /** The metadata for the fields on the issue that can be amended. */ + editmeta: z.unknown().optional(), + /** Expand options that include additional issue details in the response. */ + expand: z.string().optional(), + fields: z.object({}).optional(), + fieldsToInclude: IncludedFieldsSchema.optional(), + /** The ID of the issue. */ + id: z.string().optional(), + /** The key of the issue. */ + key: z.string().optional(), + /** The ID and name of each field present on the issue. */ + names: z.object({}).optional(), + /** The operations that can be performed on the issue. */ + operations: z.unknown().optional(), + /** Details of the issue properties identified in the request. */ + properties: z.object({}).optional(), + /** The rendered value of each field present on the issue. */ + renderedFields: z.object({}).optional(), + /** The schema describing each field present on the issue. */ + schema: z.object({}).optional(), + /** The URL of the issue details. */ + self: z.string().optional(), + /** The transitions that can be performed on the issue. */ + transitions: z.array(IssueTransitionSchema).optional(), + /** The versions of each field on the issue. */ + versionedRepresentations: z.object({}).optional(), +}); + +export type IssueBean = z.infer; diff --git a/src/version2/schemas/issueChangeLog.ts b/src/version2/schemas/issueChangeLog.ts new file mode 100644 index 0000000000..2b60585ca4 --- /dev/null +++ b/src/version2/schemas/issueChangeLog.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { ChangelogSchema } from './changelog'; + +/** List of changelogs that belong to single issue */ +export const IssueChangeLogSchema = z.object({ + /** List of changelogs that belongs to given issueId. */ + changeHistories: z.array(ChangelogSchema).optional(), + /** The ID of the issue. */ + issueId: z.string().optional(), +}); + +export type IssueChangeLog = z.infer; diff --git a/src/version2/schemas/issueChangelogIds.ts b/src/version2/schemas/issueChangelogIds.ts new file mode 100644 index 0000000000..b21ffd170b --- /dev/null +++ b/src/version2/schemas/issueChangelogIds.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** A list of changelog IDs. */ +export const IssueChangelogIdsSchema = z.object({ + /** The list of changelog IDs. */ + changelogIds: z.array(z.number().int()), +}); + +export type IssueChangelogIds = z.infer; diff --git a/src/version2/schemas/issueCommentListRequestBean.ts b/src/version2/schemas/issueCommentListRequestBean.ts new file mode 100644 index 0000000000..71c4a0ba48 --- /dev/null +++ b/src/version2/schemas/issueCommentListRequestBean.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const IssueCommentListRequestBeanSchema = z.object({ + /** The list of comment IDs. A maximum of 1000 IDs can be specified. */ + ids: z.array(z.number().int()), +}); + +export type IssueCommentListRequestBean = z.infer; diff --git a/src/version2/schemas/issueContextVariable.ts b/src/version2/schemas/issueContextVariable.ts new file mode 100644 index 0000000000..8ec19bae99 --- /dev/null +++ b/src/version2/schemas/issueContextVariable.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** + * An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) specified by ID + * or key. All the fields of the issue object are available in the Jira expression. + */ +export const IssueContextVariableSchema = z.object({ + /** The issue ID. */ + id: z.number().int().optional(), + /** The issue key. */ + key: z.string().optional(), + /** Type of custom context variable. */ + type: z.string(), +}); + +export type IssueContextVariable = z.infer; diff --git a/src/version2/schemas/issueCreateMetadata.ts b/src/version2/schemas/issueCreateMetadata.ts new file mode 100644 index 0000000000..bf2139e4a5 --- /dev/null +++ b/src/version2/schemas/issueCreateMetadata.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { ProjectIssueCreateMetadataSchema } from './projectIssueCreateMetadata'; + +/** The wrapper for the issue creation metadata for a list of projects. */ +export const IssueCreateMetadataSchema = z.object({ + /** Expand options that include additional project details in the response. */ + expand: z.string().optional(), + /** List of projects and their issue creation metadata. */ + projects: z.array(ProjectIssueCreateMetadataSchema).optional(), +}); + +export type IssueCreateMetadata = z.infer; diff --git a/src/version2/schemas/issueEntityProperties.ts b/src/version2/schemas/issueEntityProperties.ts new file mode 100644 index 0000000000..d189ed54db --- /dev/null +++ b/src/version2/schemas/issueEntityProperties.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** + * Lists of issues and entity properties. See [Entity + * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. + */ +export const IssueEntityPropertiesSchema = z.object({ + /** A list of entity property IDs. */ + entitiesIds: z.array(z.number().int()).optional(), + /** A list of entity property keys and values. */ + properties: z.object({}).optional(), +}); + +export type IssueEntityProperties = z.infer; diff --git a/src/version2/schemas/issueEntityPropertiesForMultiUpdate.ts b/src/version2/schemas/issueEntityPropertiesForMultiUpdate.ts new file mode 100644 index 0000000000..d0a37d4e37 --- /dev/null +++ b/src/version2/schemas/issueEntityPropertiesForMultiUpdate.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** + * An issue ID with entity property values. See [Entity + * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. + */ +export const IssueEntityPropertiesForMultiUpdateSchema = z.object({ + /** The ID of the issue. */ + issueID: z.number().int().optional(), + /** Entity properties to set on the issue. The maximum length of an issue property value is 32768 characters. */ + properties: z.object({}).optional(), +}); + +export type IssueEntityPropertiesForMultiUpdate = z.infer; diff --git a/src/version2/schemas/issueError.ts b/src/version2/schemas/issueError.ts new file mode 100644 index 0000000000..fa36b8e902 --- /dev/null +++ b/src/version2/schemas/issueError.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Describes the error that occurred when retrieving data for a particular issue. */ +export const IssueErrorSchema = z.object({ + /** The error that occurred when fetching this issue. */ + errorMessage: z.string().optional(), + /** The ID of the issue. */ + id: z.string().optional(), +}); + +export type IssueError = z.infer; diff --git a/src/version2/schemas/issueEvent.ts b/src/version2/schemas/issueEvent.ts new file mode 100644 index 0000000000..aaa575deb6 --- /dev/null +++ b/src/version2/schemas/issueEvent.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details about an issue event. */ +export const IssueEventSchema = z.object({ + /** The ID of the event. */ + id: z.number().int().optional(), + /** The name of the event. */ + name: z.string().optional(), +}); + +export type IssueEvent = z.infer; diff --git a/src/version2/schemas/issueFieldOption.ts b/src/version2/schemas/issueFieldOption.ts new file mode 100644 index 0000000000..b06eb3cafd --- /dev/null +++ b/src/version2/schemas/issueFieldOption.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; +import { IssueFieldOptionConfigurationSchema } from './issueFieldOptionConfiguration'; + +/** Details of the options for a select list issue field. */ +export const IssueFieldOptionSchema = z.object({ + config: IssueFieldOptionConfigurationSchema.optional(), + /** The unique identifier for the option. This is only unique within the select field's set of options. */ + id: z.number().int(), + /** + * The properties of the object, as arbitrary key-value pairs. These properties can be searched using JQL, if the + * extractions (see [Issue Field Option Property + * Index](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/)) are defined + * in the descriptor for the issue field module. + */ + properties: z.object({}).optional(), + /** The option's name, which is displayed in Jira. */ + value: z.string(), +}); + +export type IssueFieldOption = z.infer; diff --git a/src/version2/schemas/issueFieldOptionConfiguration.ts b/src/version2/schemas/issueFieldOptionConfiguration.ts new file mode 100644 index 0000000000..763d586297 --- /dev/null +++ b/src/version2/schemas/issueFieldOptionConfiguration.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** Details of the projects the option is available in. */ +export const IssueFieldOptionConfigurationSchema = z.object({ + /** DEPRECATED */ + attributes: z.array(z.enum(['notSelectable', 'defaultValue'])).optional(), + /** + * Defines the projects that the option is available in. If the scope is not defined, then the option is available in + * all projects. + */ + scope: z.unknown().optional(), +}); + +export type IssueFieldOptionConfiguration = z.infer; diff --git a/src/version2/schemas/issueFieldOptionCreateBean.ts b/src/version2/schemas/issueFieldOptionCreateBean.ts new file mode 100644 index 0000000000..1e01df2f47 --- /dev/null +++ b/src/version2/schemas/issueFieldOptionCreateBean.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { IssueFieldOptionConfigurationSchema } from './issueFieldOptionConfiguration'; + +export const IssueFieldOptionCreateBeanSchema = z.object({ + config: IssueFieldOptionConfigurationSchema.optional(), + /** + * The properties of the option as arbitrary key-value pairs. These properties can be searched using JQL, if the + * extractions (see https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/) + * are defined in the descriptor for the issue field module. + */ + properties: z.object({}).optional(), + /** The option's name, which is displayed in Jira. */ + value: z.string(), +}); + +export type IssueFieldOptionCreateBean = z.infer; diff --git a/src/version2/schemas/issueFieldOptionScopeBean.ts b/src/version2/schemas/issueFieldOptionScopeBean.ts new file mode 100644 index 0000000000..68dd0ddce2 --- /dev/null +++ b/src/version2/schemas/issueFieldOptionScopeBean.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; +import { ProjectScopeBeanSchema } from './projectScopeBean'; + +export const IssueFieldOptionScopeBeanSchema = z.object({ + /** + * Defines the behavior of the option within the global context. If this property is set, even if set to an empty + * object, then the option is available in all projects. + */ + global: z.unknown().optional(), + /** DEPRECATED */ + projects: z.array(z.number().int()).optional(), + /** + * Defines the projects in which the option is available and the behavior of the option within each project. Specify + * one object per project. The behavior of the option in a project context overrides the behavior in the global + * context. + */ + projects2: z.array(ProjectScopeBeanSchema).optional(), +}); + +export type IssueFieldOptionScopeBean = z.infer; diff --git a/src/version2/schemas/issueFilterForBulkPropertyDelete.ts b/src/version2/schemas/issueFilterForBulkPropertyDelete.ts new file mode 100644 index 0000000000..1bce6ae445 --- /dev/null +++ b/src/version2/schemas/issueFilterForBulkPropertyDelete.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Bulk operation filter details. */ +export const IssueFilterForBulkPropertyDeleteSchema = z.object({ + /** The value of properties to perform the bulk operation on. */ + currentValue: z.unknown().optional(), + /** List of issues to perform the bulk delete operation on. */ + entityIds: z.array(z.number().int()).optional(), +}); + +export type IssueFilterForBulkPropertyDelete = z.infer; diff --git a/src/version2/schemas/issueFilterForBulkPropertySet.ts b/src/version2/schemas/issueFilterForBulkPropertySet.ts new file mode 100644 index 0000000000..1652f1a4ee --- /dev/null +++ b/src/version2/schemas/issueFilterForBulkPropertySet.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Bulk operation filter details. */ +export const IssueFilterForBulkPropertySetSchema = z.object({ + /** The value of properties to perform the bulk operation on. */ + currentValue: z.unknown().optional(), + /** List of issues to perform the bulk operation on. */ + entityIds: z.array(z.number().int()).optional(), + /** Whether the bulk operation occurs only when the property is present on or absent from an issue. */ + hasProperty: z.boolean().optional(), +}); + +export type IssueFilterForBulkPropertySet = z.infer; diff --git a/src/version2/schemas/issueLayoutItemPayload.ts b/src/version2/schemas/issueLayoutItemPayload.ts new file mode 100644 index 0000000000..de72b5a472 --- /dev/null +++ b/src/version2/schemas/issueLayoutItemPayload.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** Defines the payload to configure the issue layout item for a project. */ +export const IssueLayoutItemPayloadSchema = z.object({ + itemKey: ProjectCreateResourceIdentifierSchema.optional(), + /** The item section type */ + sectionType: z.enum(['content', 'primaryContext', 'secondaryContext']).optional(), + /** The item type. Currently only support FIELD */ + type: z.enum(['FIELD']).optional(), +}); + +export type IssueLayoutItemPayload = z.infer; diff --git a/src/version2/schemas/issueLayoutPayload.ts b/src/version2/schemas/issueLayoutPayload.ts new file mode 100644 index 0000000000..74d6b66413 --- /dev/null +++ b/src/version2/schemas/issueLayoutPayload.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; +import { IssueLayoutItemPayloadSchema } from './issueLayoutItemPayload'; + +/** Defines the payload to configure the issue layouts for a project. */ +export const IssueLayoutPayloadSchema = z.object({ + containerId: ProjectCreateResourceIdentifierSchema.optional(), + /** The issue layout type */ + issueLayoutType: z.enum(['ISSUE_VIEW', 'ISSUE_CREATE', 'REQUEST_FORM']).optional(), + /** The configuration of items in the issue layout */ + items: z.array(IssueLayoutItemPayloadSchema).optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), +}); + +export type IssueLayoutPayload = z.infer; diff --git a/src/version2/schemas/issueLimitReportResponseBean.ts b/src/version2/schemas/issueLimitReportResponseBean.ts new file mode 100644 index 0000000000..75c7e7e4d7 --- /dev/null +++ b/src/version2/schemas/issueLimitReportResponseBean.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const IssueLimitReportResponseBeanSchema = z.object({ + /** A list of ids of issues approaching the limit and their field count */ + issuesApproachingLimit: z.object({}).optional(), + /** A list of ids of issues breaching the limit and their field count */ + issuesBreachingLimit: z.object({}).optional(), + /** The fields and their defined limits */ + limits: z.object({}).optional(), +}); + +export type IssueLimitReportResponseBean = z.infer; diff --git a/src/version2/schemas/issueLink.ts b/src/version2/schemas/issueLink.ts new file mode 100644 index 0000000000..bc30fbd640 --- /dev/null +++ b/src/version2/schemas/issueLink.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +/** Details of a link between issues. */ +export const IssueLinkSchema = z.object({ + /** The ID of the issue link. */ + id: z.string().optional(), + /** + * Provides details about the linked issue. If presenting this link in a user interface, use the `inward` field of the + * issue link type to label the link. + */ + inwardIssue: z.unknown(), + /** + * Provides details about the linked issue. If presenting this link in a user interface, use the `outward` field of + * the issue link type to label the link. + */ + outwardIssue: z.unknown(), + /** The URL of the issue link. */ + self: z.string().optional(), + /** The type of link between the issues. */ + type: z.unknown(), +}); + +export type IssueLink = z.infer; diff --git a/src/version2/schemas/issueLinkType.ts b/src/version2/schemas/issueLinkType.ts new file mode 100644 index 0000000000..67ed36457a --- /dev/null +++ b/src/version2/schemas/issueLinkType.ts @@ -0,0 +1,48 @@ +import { z } from 'zod'; + +/** + * This object is used as follows: * + * + * - - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it defines and reports on the type of link between the + * issues. Find a list of issue link types with [Get issue link types](#api-rest-api-2-issueLinkType-get). + * - - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it defines and reports on issue link types. + */ +export const IssueLinkTypeSchema = z.object({ + /** + * The ID of the issue link type and is used as follows: + * + * - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it is the type of issue link. Required on create when + * `name` isn't provided. Otherwise, read only. + * - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is read only. + */ + id: z.string().optional(), + /** + * The description of the issue link type inward link and is used as follows: + * + * - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it is read only. + * - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is required on create and optional on + * update. Otherwise, read only. + */ + inward: z.string().optional(), + /** + * The name of the issue link type and is used as follows: + * + * - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it is the type of issue link. Required on create when + * `id` isn't provided. Otherwise, read only. + * - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is required on create and optional on + * update. Otherwise, read only. + */ + name: z.string().optional(), + /** + * The description of the issue link type outward link and is used as follows: + * + * - In the [ issueLink](#api-rest-api-2-issueLink-post) resource it is read only. + * - In the [ issueLinkType](#api-rest-api-2-issueLinkType-post) resource it is required on create and optional on + * update. Otherwise, read only. + */ + outward: z.string().optional(), + /** The URL of the issue link type. Read only. */ + self: z.string().optional(), +}); + +export type IssueLinkType = z.infer; diff --git a/src/version2/schemas/issueLinkTypes.ts b/src/version2/schemas/issueLinkTypes.ts new file mode 100644 index 0000000000..847f5057f6 --- /dev/null +++ b/src/version2/schemas/issueLinkTypes.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { IssueLinkTypeSchema } from './issueLinkType'; + +/** A list of issue link type beans. */ +export const IssueLinkTypesSchema = z.object({ + /** The issue link type bean. */ + issueLinkTypes: z.array(IssueLinkTypeSchema).optional(), +}); + +export type IssueLinkTypes = z.infer; diff --git a/src/version2/schemas/issueList.ts b/src/version2/schemas/issueList.ts new file mode 100644 index 0000000000..bd2609a2ac --- /dev/null +++ b/src/version2/schemas/issueList.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** A list of issue IDs. */ +export const IssueListSchema = z.object({ + /** The list of issue IDs. */ + issueIds: z.array(z.string()), +}); + +export type IssueList = z.infer; diff --git a/src/version2/schemas/issueMatches.ts b/src/version2/schemas/issueMatches.ts new file mode 100644 index 0000000000..9d83c77031 --- /dev/null +++ b/src/version2/schemas/issueMatches.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { IssueMatchesForJQLSchema } from './issueMatchesForJQL'; + +/** A list of matched issues or errors for each JQL query, in the order the JQL queries were passed. */ +export const IssueMatchesSchema = z.object({ + matches: z.array(IssueMatchesForJQLSchema), +}); + +export type IssueMatches = z.infer; diff --git a/src/version2/schemas/issueMatchesForJQL.ts b/src/version2/schemas/issueMatchesForJQL.ts new file mode 100644 index 0000000000..af86c87670 --- /dev/null +++ b/src/version2/schemas/issueMatchesForJQL.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** A list of the issues matched to a JQL query or details of errors encountered during matching. */ +export const IssueMatchesForJQLSchema = z.object({ + /** A list of errors. */ + errors: z.array(z.string()), + /** A list of issue IDs. */ + matchedIssues: z.array(z.number().int()), +}); + +export type IssueMatchesForJQL = z.infer; diff --git a/src/version2/schemas/issuePickerSuggestions.ts b/src/version2/schemas/issuePickerSuggestions.ts new file mode 100644 index 0000000000..1a0fd1dea2 --- /dev/null +++ b/src/version2/schemas/issuePickerSuggestions.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { IssuePickerSuggestionsIssueTypeSchema } from './issuePickerSuggestionsIssueType'; + +/** A list of issues suggested for use in auto-completion. */ +export const IssuePickerSuggestionsSchema = z.object({ + /** A list of issues for an issue type suggested for use in auto-completion. */ + sections: z.array(IssuePickerSuggestionsIssueTypeSchema).optional(), +}); + +export type IssuePickerSuggestions = z.infer; diff --git a/src/version2/schemas/issuePickerSuggestionsIssueType.ts b/src/version2/schemas/issuePickerSuggestionsIssueType.ts new file mode 100644 index 0000000000..2285e2eb3e --- /dev/null +++ b/src/version2/schemas/issuePickerSuggestionsIssueType.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { SuggestedIssueSchema } from './suggestedIssue'; + +/** A type of issue suggested for use in auto-completion. */ +export const IssuePickerSuggestionsIssueTypeSchema = z.object({ + /** The ID of the type of issues suggested for use in auto-completion. */ + id: z.string().optional(), + /** A list of issues suggested for use in auto-completion. */ + issues: z.array(SuggestedIssueSchema).optional(), + /** The label of the type of issues suggested for use in auto-completion. */ + label: z.string().optional(), + /** If no issue suggestions are found, returns a message indicating no suggestions were found, */ + msg: z.string().optional(), + /** If issue suggestions are found, returns a message indicating the number of issues suggestions found and returned. */ + sub: z.string().optional(), +}); + +export type IssuePickerSuggestionsIssueType = z.infer; diff --git a/src/version2/schemas/issueSecurityLevelMember.ts b/src/version2/schemas/issueSecurityLevelMember.ts new file mode 100644 index 0000000000..237089a2d2 --- /dev/null +++ b/src/version2/schemas/issueSecurityLevelMember.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Issue security level member. */ +export const IssueSecurityLevelMemberSchema = z.object({ + /** + * The user or group being granted the permission. It consists of a `type` and a type-dependent `parameter`. See + * [Holder object](../api-group-permission-schemes/#holder-object) in _Get all permission schemes_ for more + * information. + */ + holder: z.unknown(), + /** The ID of the issue security level member. */ + id: z.number().int(), + /** The ID of the issue security level. */ + issueSecurityLevelId: z.number().int(), +}); + +export type IssueSecurityLevelMember = z.infer; diff --git a/src/version2/schemas/issueSecuritySchemeToProjectMapping.ts b/src/version2/schemas/issueSecuritySchemeToProjectMapping.ts new file mode 100644 index 0000000000..7e5c08da85 --- /dev/null +++ b/src/version2/schemas/issueSecuritySchemeToProjectMapping.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** Details about an project using security scheme mapping. */ +export const IssueSecuritySchemeToProjectMappingSchema = z.object({ + issueSecuritySchemeId: z.string().optional(), + projectId: z.string().optional(), +}); + +export type IssueSecuritySchemeToProjectMapping = z.infer; diff --git a/src/version2/schemas/issueTransition.ts b/src/version2/schemas/issueTransition.ts new file mode 100644 index 0000000000..71b72bac37 --- /dev/null +++ b/src/version2/schemas/issueTransition.ts @@ -0,0 +1,31 @@ +import { z } from 'zod'; + +/** Details of an issue transition. */ +export const IssueTransitionSchema = z.object({ + /** Expand options that include additional transition details in the response. */ + expand: z.string().optional(), + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields: z.object({}).optional(), + /** Whether there is a screen associated with the issue transition. */ + hasScreen: z.boolean().optional(), + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id: z.string().optional(), + /** Whether the transition is available to be performed. */ + isAvailable: z.boolean().optional(), + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional: z.boolean().optional(), + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal: z.boolean().optional(), + /** Whether this is the initial issue transition for the workflow. */ + isInitial: z.boolean().optional(), + looped: z.boolean().optional(), + /** The name of the issue transition. */ + name: z.string().optional(), + /** Details of the issue status after the transition. */ + to: z.unknown().optional(), +}); + +export type IssueTransition = z.infer; diff --git a/src/version2/schemas/issueTypeCreateBean.ts b/src/version2/schemas/issueTypeCreateBean.ts new file mode 100644 index 0000000000..3db1d128eb --- /dev/null +++ b/src/version2/schemas/issueTypeCreateBean.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +export const IssueTypeCreateBeanSchema = z.object({ + /** The description of the issue type. */ + description: z.string().optional(), + /** + * The hierarchy level of the issue type. Use: + * + * - `-1` for Subtask. + * - `0` for Base. + * + * Defaults to `0`. + */ + hierarchyLevel: z.number().int().optional(), + /** The unique name for the issue type. The maximum length is 60 characters. */ + name: z.string(), + /** + * Deprecated. Use `hierarchyLevel` instead. See the [deprecation + * notice](https://community.developer.atlassian.com/t/deprecation-of-the-epic-link-parent-link-and-other-related-fields-in-rest-apis-and-webhooks/54048) + * for details. + * + * Whether the issue type is `subtype` or `standard`. Defaults to `standard`. + */ + type: z.enum(['subtask', 'standard']).optional(), +}); + +export type IssueTypeCreateBean = z.infer; diff --git a/src/version2/schemas/issueTypeDetails.ts b/src/version2/schemas/issueTypeDetails.ts new file mode 100644 index 0000000000..349bb13856 --- /dev/null +++ b/src/version2/schemas/issueTypeDetails.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +/** Details about an issue type. */ +export const IssueTypeDetailsSchema = z.object({ + /** The ID of the issue type's avatar. */ + avatarId: z.number().int().optional(), + /** The description of the issue type. */ + description: z.string().optional(), + /** Unique ID for next-gen projects. */ + entityId: z.string().optional(), + /** Hierarchy level of the issue type. */ + hierarchyLevel: z.number().int().optional(), + /** The URL of the issue type's avatar. */ + iconUrl: z.string().optional(), + /** The ID of the issue type. */ + id: z.string().optional(), + /** The name of the issue type. */ + name: z.string().optional(), + /** Details of the next-gen projects the issue type is available in. */ + scope: z.unknown().optional(), + /** The URL of these issue type details. */ + self: z.string().optional(), + /** Whether this issue type is used to create subtasks. */ + subtask: z.boolean().optional(), +}); + +export type IssueTypeDetails = z.infer; diff --git a/src/version2/schemas/issueTypeHierarchyPayload.ts b/src/version2/schemas/issueTypeHierarchyPayload.ts new file mode 100644 index 0000000000..201b668818 --- /dev/null +++ b/src/version2/schemas/issueTypeHierarchyPayload.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** The payload for creating an issue type hierarchy */ +export const IssueTypeHierarchyPayloadSchema = z.object({ + /** The hierarchy level of the issue type. 0, 1, 2, 3 .. n; Negative values for subtasks */ + hierarchyLevel: z.number().int().optional(), + /** The name of the issue type */ + name: z.string().optional(), + /** + * The conflict strategy to use when the issue type already exists. FAIL - Fail execution, this always needs to be + * unique; USE - Use the existing entity and ignore new entity parameters + */ + onConflict: z.enum(['FAIL', 'USE', 'NEW']).optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), +}); + +export type IssueTypeHierarchyPayload = z.infer; diff --git a/src/version2/schemas/issueTypeIds.ts b/src/version2/schemas/issueTypeIds.ts new file mode 100644 index 0000000000..cc267f8673 --- /dev/null +++ b/src/version2/schemas/issueTypeIds.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The list of issue type IDs. */ +export const IssueTypeIdsSchema = z.object({ + /** The list of issue type IDs. */ + issueTypeIds: z.array(z.string()), +}); + +export type IssueTypeIds = z.infer; diff --git a/src/version2/schemas/issueTypeIdsToRemove.ts b/src/version2/schemas/issueTypeIdsToRemove.ts new file mode 100644 index 0000000000..bed4f7c7e0 --- /dev/null +++ b/src/version2/schemas/issueTypeIdsToRemove.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** The list of issue type IDs to be removed from the field configuration scheme. */ +export const IssueTypeIdsToRemoveSchema = z.object({ + /** + * The list of issue type IDs. Must contain unique values not longer than 255 characters and not be empty. Maximum of + * 100 IDs. + */ + issueTypeIds: z.array(z.string()), +}); + +export type IssueTypeIdsToRemove = z.infer; diff --git a/src/version2/schemas/issueTypeInfo.ts b/src/version2/schemas/issueTypeInfo.ts new file mode 100644 index 0000000000..5677a27e12 --- /dev/null +++ b/src/version2/schemas/issueTypeInfo.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of an issue type. */ +export const IssueTypeInfoSchema = z.object({ + /** The avatar of the issue type. */ + avatarId: z.number().int().optional(), + /** The ID of the issue type. */ + id: z.number().int().optional(), + /** The name of the issue type. */ + name: z.string().optional(), +}); + +export type IssueTypeInfo = z.infer; diff --git a/src/version2/schemas/issueTypeIssueCreateMetadata.ts b/src/version2/schemas/issueTypeIssueCreateMetadata.ts new file mode 100644 index 0000000000..74076da173 --- /dev/null +++ b/src/version2/schemas/issueTypeIssueCreateMetadata.ts @@ -0,0 +1,31 @@ +import { z } from 'zod'; + +/** Details of the issue creation metadata for an issue type. */ +export const IssueTypeIssueCreateMetadataSchema = z.object({ + /** The ID of the issue type's avatar. */ + avatarId: z.number().int().optional(), + /** The description of the issue type. */ + description: z.string().optional(), + /** Unique ID for next-gen projects. */ + entityId: z.string().optional(), + /** Expand options that include additional issue type metadata details in the response. */ + expand: z.string().optional(), + /** List of the fields available when creating an issue for the issue type. */ + fields: z.object({}).optional(), + /** Hierarchy level of the issue type. */ + hierarchyLevel: z.number().int().optional(), + /** The URL of the issue type's avatar. */ + iconUrl: z.string().optional(), + /** The ID of the issue type. */ + id: z.string().optional(), + /** The name of the issue type. */ + name: z.string().optional(), + /** Details of the next-gen projects the issue type is available in. */ + scope: z.unknown().optional(), + /** The URL of these issue type details. */ + self: z.string().optional(), + /** Whether this issue type is used to create subtasks. */ + subtask: z.boolean().optional(), +}); + +export type IssueTypeIssueCreateMetadata = z.infer; diff --git a/src/version2/schemas/issueTypePayload.ts b/src/version2/schemas/issueTypePayload.ts new file mode 100644 index 0000000000..e5654b3247 --- /dev/null +++ b/src/version2/schemas/issueTypePayload.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** The payload for creating an issue type */ +export const IssueTypePayloadSchema = z.object({ + /** + * The avatar ID of the issue type. Go to + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-avatars/#api-rest-api-3-avatar-type-system-get + * to choose an avatarId existing in Jira + */ + avatarId: z.number().int().optional(), + /** The description of the issue type */ + description: z.string().optional(), + /** The hierarchy level of the issue type. 0, 1, 2, 3 .. n; Negative values for subtasks */ + hierarchyLevel: z.number().int().optional(), + /** The name of the issue type */ + name: z.string().optional(), + /** + * The conflict strategy to use when the issue type already exists. FAIL - Fail execution, this always needs to be + * unique; USE - Use the existing entity and ignore new entity parameters + */ + onConflict: z.enum(['FAIL', 'USE', 'NEW']).optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), +}); + +export type IssueTypePayload = z.infer; diff --git a/src/version2/schemas/issueTypeProjectCreatePayload.ts b/src/version2/schemas/issueTypeProjectCreatePayload.ts new file mode 100644 index 0000000000..ca2b55c80c --- /dev/null +++ b/src/version2/schemas/issueTypeProjectCreatePayload.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; +import { IssueTypeHierarchyPayloadSchema } from './issueTypeHierarchyPayload'; +import { IssueTypeSchemePayloadSchema } from './issueTypeSchemePayload'; +import { IssueTypePayloadSchema } from './issueTypePayload'; + +/** The payload for creating issue types in a project */ +export const IssueTypeProjectCreatePayloadSchema = z.object({ + /** + * Defines the issue type hierarhy to be created and used during this project creation. This will only add new levels + * if there isn't an existing level + */ + issueTypeHierarchy: z.array(IssueTypeHierarchyPayloadSchema).optional(), + issueTypeScheme: IssueTypeSchemePayloadSchema.optional(), + /** + * Only needed if you want to create issue types, you can otherwise use the ids of issue types in the scheme + * configuration + */ + issueTypes: z.array(IssueTypePayloadSchema).optional(), +}); + +export type IssueTypeProjectCreatePayload = z.infer; diff --git a/src/version2/schemas/issueTypeScheme.ts b/src/version2/schemas/issueTypeScheme.ts new file mode 100644 index 0000000000..65c96cc91e --- /dev/null +++ b/src/version2/schemas/issueTypeScheme.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details of an issue type scheme. */ +export const IssueTypeSchemeSchema = z.object({ + /** The ID of the default issue type of the issue type scheme. */ + defaultIssueTypeId: z.string().optional(), + /** The description of the issue type scheme. */ + description: z.string().optional(), + /** The ID of the issue type scheme. */ + id: z.string(), + /** Whether the issue type scheme is the default. */ + isDefault: z.boolean().optional(), + /** The name of the issue type scheme. */ + name: z.string(), +}); + +export type IssueTypeScheme = z.infer; diff --git a/src/version2/schemas/issueTypeSchemeDetails.ts b/src/version2/schemas/issueTypeSchemeDetails.ts new file mode 100644 index 0000000000..7ac9cd80f5 --- /dev/null +++ b/src/version2/schemas/issueTypeSchemeDetails.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Details of an issue type scheme and its associated issue types. */ +export const IssueTypeSchemeDetailsSchema = z.object({ + /** The ID of the default issue type of the issue type scheme. This ID must be included in `issueTypeIds`. */ + defaultIssueTypeId: z.string().optional(), + /** The description of the issue type scheme. The maximum length is 4000 characters. */ + description: z.string().optional(), + /** The list of issue types IDs of the issue type scheme. At least one standard issue type ID is required. */ + issueTypeIds: z.array(z.string()), + /** The name of the issue type scheme. The name must be unique. The maximum length is 255 characters. */ + name: z.string(), +}); + +export type IssueTypeSchemeDetails = z.infer; diff --git a/src/version2/schemas/issueTypeSchemeID.ts b/src/version2/schemas/issueTypeSchemeID.ts new file mode 100644 index 0000000000..9f8774cd2b --- /dev/null +++ b/src/version2/schemas/issueTypeSchemeID.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The ID of an issue type scheme. */ +export const IssueTypeSchemeIDSchema = z.object({ + /** The ID of the issue type scheme. */ + issueTypeSchemeId: z.string(), +}); + +export type IssueTypeSchemeID = z.infer; diff --git a/src/version2/schemas/issueTypeSchemeMapping.ts b/src/version2/schemas/issueTypeSchemeMapping.ts new file mode 100644 index 0000000000..29942a5325 --- /dev/null +++ b/src/version2/schemas/issueTypeSchemeMapping.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Issue type scheme item. */ +export const IssueTypeSchemeMappingSchema = z.object({ + /** The ID of the issue type. */ + issueTypeId: z.string(), + /** The ID of the issue type scheme. */ + issueTypeSchemeId: z.string(), +}); + +export type IssueTypeSchemeMapping = z.infer; diff --git a/src/version2/schemas/issueTypeSchemePayload.ts b/src/version2/schemas/issueTypeSchemePayload.ts new file mode 100644 index 0000000000..56ffa98951 --- /dev/null +++ b/src/version2/schemas/issueTypeSchemePayload.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** The payload for creating issue type schemes */ +export const IssueTypeSchemePayloadSchema = z.object({ + defaultIssueTypeId: ProjectCreateResourceIdentifierSchema.optional(), + /** The description of the issue type scheme */ + description: z.string().optional(), + /** The issue type IDs for the issue type scheme */ + issueTypeIds: z.array(ProjectCreateResourceIdentifierSchema).optional(), + /** The name of the issue type scheme */ + name: z.string().optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), +}); + +export type IssueTypeSchemePayload = z.infer; diff --git a/src/version2/schemas/issueTypeSchemeProjectAssociation.ts b/src/version2/schemas/issueTypeSchemeProjectAssociation.ts new file mode 100644 index 0000000000..ddeb183e0f --- /dev/null +++ b/src/version2/schemas/issueTypeSchemeProjectAssociation.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of the association between an issue type scheme and project. */ +export const IssueTypeSchemeProjectAssociationSchema = z.object({ + /** The ID of the issue type scheme. */ + issueTypeSchemeId: z.string(), + /** The ID of the project. */ + projectId: z.string(), +}); + +export type IssueTypeSchemeProjectAssociation = z.infer; diff --git a/src/version2/schemas/issueTypeSchemeProjects.ts b/src/version2/schemas/issueTypeSchemeProjects.ts new file mode 100644 index 0000000000..240a8d6fee --- /dev/null +++ b/src/version2/schemas/issueTypeSchemeProjects.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Issue type scheme with a list of the projects that use it. */ +export const IssueTypeSchemeProjectsSchema = z.object({ + /** Details of an issue type scheme. */ + issueTypeScheme: z.unknown(), + /** The IDs of the projects using the issue type scheme. */ + projectIds: z.array(z.string()), +}); + +export type IssueTypeSchemeProjects = z.infer; diff --git a/src/version2/schemas/issueTypeSchemeUpdateDetails.ts b/src/version2/schemas/issueTypeSchemeUpdateDetails.ts new file mode 100644 index 0000000000..e04d3c223b --- /dev/null +++ b/src/version2/schemas/issueTypeSchemeUpdateDetails.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of the name, description, and default issue type for an issue type scheme. */ +export const IssueTypeSchemeUpdateDetailsSchema = z.object({ + /** The ID of the default issue type of the issue type scheme. */ + defaultIssueTypeId: z.string().optional(), + /** The description of the issue type scheme. The maximum length is 4000 characters. */ + description: z.string().optional(), + /** The name of the issue type scheme. The name must be unique. The maximum length is 255 characters. */ + name: z.string().optional(), +}); + +export type IssueTypeSchemeUpdateDetails = z.infer; diff --git a/src/version2/schemas/issueTypeScreenScheme.ts b/src/version2/schemas/issueTypeScreenScheme.ts new file mode 100644 index 0000000000..2ce2077ab1 --- /dev/null +++ b/src/version2/schemas/issueTypeScreenScheme.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of an issue type screen scheme. */ +export const IssueTypeScreenSchemeSchema = z.object({ + /** The description of the issue type screen scheme. */ + description: z.string().optional(), + /** The ID of the issue type screen scheme. */ + id: z.string(), + /** The name of the issue type screen scheme. */ + name: z.string(), +}); + +export type IssueTypeScreenScheme = z.infer; diff --git a/src/version2/schemas/issueTypeScreenSchemeDetails.ts b/src/version2/schemas/issueTypeScreenSchemeDetails.ts new file mode 100644 index 0000000000..7777858949 --- /dev/null +++ b/src/version2/schemas/issueTypeScreenSchemeDetails.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; +import { IssueTypeScreenSchemeMappingSchema } from './issueTypeScreenSchemeMapping'; + +/** The details of an issue type screen scheme. */ +export const IssueTypeScreenSchemeDetailsSchema = z.object({ + /** The description of the issue type screen scheme. The maximum length is 255 characters. */ + description: z.string().optional(), + /** + * The IDs of the screen schemes for the issue type IDs and _default_. A _default_ entry is required to create an + * issue type screen scheme, it defines the mapping for all issue types without a screen scheme. + */ + issueTypeMappings: z.array(IssueTypeScreenSchemeMappingSchema), + /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: z.string(), +}); + +export type IssueTypeScreenSchemeDetails = z.infer; diff --git a/src/version2/schemas/issueTypeScreenSchemeId.ts b/src/version2/schemas/issueTypeScreenSchemeId.ts new file mode 100644 index 0000000000..5a741cce9c --- /dev/null +++ b/src/version2/schemas/issueTypeScreenSchemeId.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The ID of an issue type screen scheme. */ +export const IssueTypeScreenSchemeIdSchema = z.object({ + /** The ID of the issue type screen scheme. */ + id: z.string(), +}); + +export type IssueTypeScreenSchemeId = z.infer; diff --git a/src/version2/schemas/issueTypeScreenSchemeItem.ts b/src/version2/schemas/issueTypeScreenSchemeItem.ts new file mode 100644 index 0000000000..df95b00428 --- /dev/null +++ b/src/version2/schemas/issueTypeScreenSchemeItem.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** The screen scheme for an issue type. */ +export const IssueTypeScreenSchemeItemSchema = z.object({ + /** + * The ID of the issue type or _default_. Only issue types used in classic projects are accepted. When creating an + * issue screen scheme, an entry for _default_ must be provided and defines the mapping for all issue types without a + * screen scheme. Otherwise, a _default_ entry can't be provided. + */ + issueTypeId: z.string(), + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: z.string(), + /** The ID of the screen scheme. */ + screenSchemeId: z.string(), +}); + +export type IssueTypeScreenSchemeItem = z.infer; diff --git a/src/version2/schemas/issueTypeScreenSchemeMapping.ts b/src/version2/schemas/issueTypeScreenSchemeMapping.ts new file mode 100644 index 0000000000..083bac0bc3 --- /dev/null +++ b/src/version2/schemas/issueTypeScreenSchemeMapping.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** The IDs of the screen schemes for the issue type IDs. */ +export const IssueTypeScreenSchemeMappingSchema = z.object({ + /** + * The ID of the issue type or _default_. Only issue types used in classic projects are accepted. An entry for + * _default_ must be provided and defines the mapping for all issue types without a screen scheme. + */ + issueTypeId: z.string(), + /** The ID of the screen scheme. Only screen schemes used in classic projects are accepted. */ + screenSchemeId: z.string(), +}); + +export type IssueTypeScreenSchemeMapping = z.infer; diff --git a/src/version2/schemas/issueTypeScreenSchemeMappingDetails.ts b/src/version2/schemas/issueTypeScreenSchemeMappingDetails.ts new file mode 100644 index 0000000000..306d2b2383 --- /dev/null +++ b/src/version2/schemas/issueTypeScreenSchemeMappingDetails.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { IssueTypeScreenSchemeMappingSchema } from './issueTypeScreenSchemeMapping'; + +/** A list of issue type screen scheme mappings. */ +export const IssueTypeScreenSchemeMappingDetailsSchema = z.object({ + /** + * The list of issue type to screen scheme mappings. A _default_ entry cannot be specified because a default entry is + * added when an issue type screen scheme is created. + */ + issueTypeMappings: z.array(IssueTypeScreenSchemeMappingSchema), +}); + +export type IssueTypeScreenSchemeMappingDetails = z.infer; diff --git a/src/version2/schemas/issueTypeScreenSchemePayload.ts b/src/version2/schemas/issueTypeScreenSchemePayload.ts new file mode 100644 index 0000000000..9d194a144e --- /dev/null +++ b/src/version2/schemas/issueTypeScreenSchemePayload.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** + * Defines the payload for the issue type screen schemes. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-type-screen-schemes/#api-rest-api-3-issuetypescreenscheme-post + */ +export const IssueTypeScreenSchemePayloadSchema = z.object({ + defaultScreenScheme: ProjectCreateResourceIdentifierSchema.optional(), + /** The description of the issue type screen scheme */ + description: z.string().optional(), + /** + * The IDs of the screen schemes for the issue type IDs and default. A default entry is required to create an issue + * type screen scheme, it defines the mapping for all issue types without a screen scheme. + */ + explicitMappings: z.object({}).optional(), + /** The name of the issue type screen scheme */ + name: z.string().optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), +}); + +export type IssueTypeScreenSchemePayload = z.infer; diff --git a/src/version2/schemas/issueTypeScreenSchemeProjectAssociation.ts b/src/version2/schemas/issueTypeScreenSchemeProjectAssociation.ts new file mode 100644 index 0000000000..53c32dc056 --- /dev/null +++ b/src/version2/schemas/issueTypeScreenSchemeProjectAssociation.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Associated issue type screen scheme and project. */ +export const IssueTypeScreenSchemeProjectAssociationSchema = z.object({ + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: z.string().optional(), + /** The ID of the project. */ + projectId: z.string().optional(), +}); + +export type IssueTypeScreenSchemeProjectAssociation = z.infer; diff --git a/src/version2/schemas/issueTypeScreenSchemeUpdateDetails.ts b/src/version2/schemas/issueTypeScreenSchemeUpdateDetails.ts new file mode 100644 index 0000000000..d64df5097d --- /dev/null +++ b/src/version2/schemas/issueTypeScreenSchemeUpdateDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of an issue type screen scheme. */ +export const IssueTypeScreenSchemeUpdateDetailsSchema = z.object({ + /** The description of the issue type screen scheme. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: z.string().optional(), +}); + +export type IssueTypeScreenSchemeUpdateDetails = z.infer; diff --git a/src/version2/schemas/issueTypeScreenSchemesProjects.ts b/src/version2/schemas/issueTypeScreenSchemesProjects.ts new file mode 100644 index 0000000000..2fd6c930a3 --- /dev/null +++ b/src/version2/schemas/issueTypeScreenSchemesProjects.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Issue type screen scheme with a list of the projects that use it. */ +export const IssueTypeScreenSchemesProjectsSchema = z.object({ + /** Details of an issue type screen scheme. */ + issueTypeScreenScheme: z.unknown(), + /** The IDs of the projects using the issue type screen scheme. */ + projectIds: z.array(z.string()), +}); + +export type IssueTypeScreenSchemesProjects = z.infer; diff --git a/src/version2/schemas/issueTypeToContextMapping.ts b/src/version2/schemas/issueTypeToContextMapping.ts new file mode 100644 index 0000000000..9c61bde94d --- /dev/null +++ b/src/version2/schemas/issueTypeToContextMapping.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Mapping of an issue type to a context. */ +export const IssueTypeToContextMappingSchema = z.object({ + /** The ID of the context. */ + contextId: z.string(), + /** Whether the context is mapped to any issue type. */ + isAnyIssueType: z.boolean().optional(), + /** The ID of the issue type. */ + issueTypeId: z.string().optional(), +}); + +export type IssueTypeToContextMapping = z.infer; diff --git a/src/version2/schemas/issueTypeUpdateBean.ts b/src/version2/schemas/issueTypeUpdateBean.ts new file mode 100644 index 0000000000..144c6c34da --- /dev/null +++ b/src/version2/schemas/issueTypeUpdateBean.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +export const IssueTypeUpdateBeanSchema = z.object({ + /** + * The ID of an issue type avatar. This can be obtained be obtained from the following endpoints: + * + * - [System issue type avatar IDs + * only](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-avatars/#api-rest-api-3-avatar-type-system-get) + * - [System and custom issue type avatar + * IDs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-avatars/#api-rest-api-3-universal-avatar-type-type-owner-entityid-get) + */ + avatarId: z.number().int().optional(), + /** The description of the issue type. */ + description: z.string().optional(), + /** The unique name for the issue type. The maximum length is 60 characters. */ + name: z.string().optional(), +}); + +export type IssueTypeUpdateBean = z.infer; diff --git a/src/version2/schemas/issueTypeWithStatus.ts b/src/version2/schemas/issueTypeWithStatus.ts new file mode 100644 index 0000000000..1fabcb21fa --- /dev/null +++ b/src/version2/schemas/issueTypeWithStatus.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { StatusDetailsSchema } from './statusDetails'; + +/** Status details for an issue type. */ +export const IssueTypeWithStatusSchema = z.object({ + /** The ID of the issue type. */ + id: z.string(), + /** The name of the issue type. */ + name: z.string(), + /** The URL of the issue type's status details. */ + self: z.string(), + /** List of status details for the issue type. */ + statuses: z.array(StatusDetailsSchema), + /** Whether this issue type represents subtasks. */ + subtask: z.boolean(), +}); + +export type IssueTypeWithStatus = z.infer; diff --git a/src/version2/schemas/issueTypeWorkflowMapping.ts b/src/version2/schemas/issueTypeWorkflowMapping.ts new file mode 100644 index 0000000000..cfeaf4ff0c --- /dev/null +++ b/src/version2/schemas/issueTypeWorkflowMapping.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details about the mapping between an issue type and a workflow. */ +export const IssueTypeWorkflowMappingSchema = z.object({ + /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ + issueType: z.string().optional(), + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types + * mapping. + */ + updateDraftIfNeeded: z.boolean().optional(), + /** The name of the workflow. */ + workflow: z.string().optional(), +}); + +export type IssueTypeWorkflowMapping = z.infer; diff --git a/src/version2/schemas/issueTypesWorkflowMapping.ts b/src/version2/schemas/issueTypesWorkflowMapping.ts new file mode 100644 index 0000000000..c01255516e --- /dev/null +++ b/src/version2/schemas/issueTypesWorkflowMapping.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +/** Details about the mapping between issue types and a workflow. */ +export const IssueTypesWorkflowMappingSchema = z.object({ + /** Whether the workflow is the default workflow for the workflow scheme. */ + defaultMapping: z.boolean().optional(), + /** The list of issue type IDs. */ + issueTypes: z.array(z.string()).optional(), + /** + * Whether a draft workflow scheme is created or updated when updating an active workflow scheme. The draft is updated + * with the new workflow-issue types mapping. Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), + /** The name of the workflow. Optional if updating the workflow-issue types mapping. */ + workflow: z.string().optional(), +}); + +export type IssueTypesWorkflowMapping = z.infer; diff --git a/src/version2/schemas/issueUpdateDetails.ts b/src/version2/schemas/issueUpdateDetails.ts new file mode 100644 index 0000000000..0106275a0a --- /dev/null +++ b/src/version2/schemas/issueUpdateDetails.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; +import { EntityPropertySchema } from './entityProperty'; + +/** Details of an issue update request. */ +export const IssueUpdateDetailsSchema = z.object({ + /** + * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field + * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are + * required, use `update`. Fields included in here cannot be included in `update`. + */ + fields: z.object({}).optional(), + /** Additional issue history details. */ + historyMetadata: z.unknown().optional(), + /** Details of issue properties to be add or update. */ + properties: z.array(EntityPropertySchema).optional(), + /** Details of a transition. Required when performing a transition, optional when creating or editing an issue. */ + transition: z.unknown().optional(), + /** + * A Map containing the field field name and a list of operations to perform on the issue screen field. Note that + * fields included in here cannot be included in `fields`. + */ + update: z.object({}).optional(), +}); + +export type IssueUpdateDetails = z.infer; diff --git a/src/version2/schemas/issueUpdateMetadata.ts b/src/version2/schemas/issueUpdateMetadata.ts new file mode 100644 index 0000000000..fa4d0ca588 --- /dev/null +++ b/src/version2/schemas/issueUpdateMetadata.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +/** A list of editable field details. */ +export const IssueUpdateMetadataSchema = z.object({ + fields: z.object({}).optional(), +}); + +export type IssueUpdateMetadata = z.infer; diff --git a/src/version2/schemas/issuesAndJQLQueries.ts b/src/version2/schemas/issuesAndJQLQueries.ts new file mode 100644 index 0000000000..afc53edf47 --- /dev/null +++ b/src/version2/schemas/issuesAndJQLQueries.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** List of issues and JQL queries. */ +export const IssuesAndJQLQueriesSchema = z.object({ + /** A list of issue IDs. */ + issueIds: z.array(z.number().int()), + /** A list of JQL queries. */ + jqls: z.array(z.string()), +}); + +export type IssuesAndJQLQueries = z.infer; diff --git a/src/version2/schemas/issuesJqlMetaDataBean.ts b/src/version2/schemas/issuesJqlMetaDataBean.ts new file mode 100644 index 0000000000..4624a38742 --- /dev/null +++ b/src/version2/schemas/issuesJqlMetaDataBean.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** The description of the page of issues loaded by the provided JQL query. */ +export const IssuesJqlMetaDataBeanSchema = z.object({ + /** The number of issues that were loaded in this evaluation. */ + count: z.number().int(), + /** The maximum number of issues that could be loaded in this evaluation. */ + maxResults: z.number().int(), + /** The index of the first issue. */ + startAt: z.number().int(), + /** The total number of issues the JQL returned. */ + totalCount: z.number().int(), + /** Any warnings related to the JQL query. Present only if the validation mode was set to `warn`. */ + validationWarnings: z.array(z.string()).optional(), +}); + +export type IssuesJqlMetaDataBean = z.infer; diff --git a/src/version2/schemas/issuesMetaBean.ts b/src/version2/schemas/issuesMetaBean.ts new file mode 100644 index 0000000000..f9fcbbfaf7 --- /dev/null +++ b/src/version2/schemas/issuesMetaBean.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { IssuesJqlMetaDataBeanSchema } from './issuesJqlMetaDataBean'; + +/** Meta data describing the `issues` context variable. */ +export const IssuesMetaBeanSchema = z.object({ + jql: IssuesJqlMetaDataBeanSchema.optional(), +}); + +export type IssuesMetaBean = z.infer; diff --git a/src/version2/schemas/issuesUpdateBean.ts b/src/version2/schemas/issuesUpdateBean.ts new file mode 100644 index 0000000000..fdc2f0e7e7 --- /dev/null +++ b/src/version2/schemas/issuesUpdateBean.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; +import { IssueUpdateDetailsSchema } from './issueUpdateDetails'; + +export const IssuesUpdateBeanSchema = z.object({ + issueUpdates: z.array(IssueUpdateDetailsSchema).optional(), +}); + +export type IssuesUpdateBean = z.infer; diff --git a/src/version2/schemas/jExpEvaluateIssuesJqlMetaDataBean.ts b/src/version2/schemas/jExpEvaluateIssuesJqlMetaDataBean.ts new file mode 100644 index 0000000000..353ede2107 --- /dev/null +++ b/src/version2/schemas/jExpEvaluateIssuesJqlMetaDataBean.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** + * The description of the page of issues loaded by the provided JQL query.This bean will be replacing + * IssuesJqlMetaDataBean bean as part of new `evaluate` endpoint + */ +export const JExpEvaluateIssuesJqlMetaDataBeanSchema = z.object({ + /** Indicates whether this is the last page of the paginated response. */ + isLast: z.boolean().optional(), + /** Next Page token for the next page of issues. */ + nextPageToken: z.string(), +}); + +export type JExpEvaluateIssuesJqlMetaDataBean = z.infer; diff --git a/src/version2/schemas/jExpEvaluateIssuesMetaBean.ts b/src/version2/schemas/jExpEvaluateIssuesMetaBean.ts new file mode 100644 index 0000000000..3c674e9d7d --- /dev/null +++ b/src/version2/schemas/jExpEvaluateIssuesMetaBean.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { JExpEvaluateIssuesJqlMetaDataBeanSchema } from './jExpEvaluateIssuesJqlMetaDataBean'; + +/** + * Meta data describing the `issues` context variable.This bean will be replacing IssuesMetaBean bean as part of new + * `evaluate` endpoint + */ +export const JExpEvaluateIssuesMetaBeanSchema = z.object({ + jql: JExpEvaluateIssuesJqlMetaDataBeanSchema.optional(), +}); + +export type JExpEvaluateIssuesMetaBean = z.infer; diff --git a/src/version2/schemas/jExpEvaluateJiraExpressionResultBean.ts b/src/version2/schemas/jExpEvaluateJiraExpressionResultBean.ts new file mode 100644 index 0000000000..9fdcebb908 --- /dev/null +++ b/src/version2/schemas/jExpEvaluateJiraExpressionResultBean.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** + * The result of evaluating a Jira expression.This bean will be replacing `JiraExpressionResultBean` bean as part of new + * evaluate endpoint + */ +export const JExpEvaluateJiraExpressionResultBeanSchema = z.object({ + /** Contains various characteristics of the performed expression evaluation. */ + meta: z.unknown().optional(), + /** + * 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: z.unknown(), +}); + +export type JExpEvaluateJiraExpressionResultBean = z.infer; diff --git a/src/version2/schemas/jExpEvaluateMetaDataBean.ts b/src/version2/schemas/jExpEvaluateMetaDataBean.ts new file mode 100644 index 0000000000..6380e5e9cf --- /dev/null +++ b/src/version2/schemas/jExpEvaluateMetaDataBean.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +/** + * Contains information about the expression evaluation. This bean will be replacing + * `JiraExpressionEvaluationMetaDataBean` bean as part of new `evaluate` endpoint + */ +export const JExpEvaluateMetaDataBeanSchema = z.object({ + /** + * Contains information about the expression complexity. For example, the number of steps it took to evaluate the + * expression. + */ + complexity: z.unknown().optional(), + /** + * Contains information about the `issues` variable in the context. For example, is the issues were loaded with JQL, + * information about the page will be included here. + */ + issues: z.unknown().optional(), +}); + +export type JExpEvaluateMetaDataBean = z.infer; diff --git a/src/version2/schemas/jQLCountRequestBean.ts b/src/version2/schemas/jQLCountRequestBean.ts new file mode 100644 index 0000000000..a4e1585b30 --- /dev/null +++ b/src/version2/schemas/jQLCountRequestBean.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +export const JQLCountRequestBeanSchema = z.object({ + /** + * 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: z.string().optional(), +}); + +export type JQLCountRequestBean = z.infer; diff --git a/src/version2/schemas/jQLCountResultsBean.ts b/src/version2/schemas/jQLCountResultsBean.ts new file mode 100644 index 0000000000..e344281487 --- /dev/null +++ b/src/version2/schemas/jQLCountResultsBean.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const JQLCountResultsBeanSchema = z.object({ + /** Number of issues matching JQL query. */ + count: z.number().int().optional(), +}); + +export type JQLCountResultsBean = z.infer; diff --git a/src/version2/schemas/jQLPersonalDataMigrationRequest.ts b/src/version2/schemas/jQLPersonalDataMigrationRequest.ts new file mode 100644 index 0000000000..a6e0b8bf12 --- /dev/null +++ b/src/version2/schemas/jQLPersonalDataMigrationRequest.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The JQL queries to be converted. */ +export const JQLPersonalDataMigrationRequestSchema = z.object({ + /** A list of queries with user identifiers. Maximum of 100 queries. */ + queryStrings: z.array(z.string()).optional(), +}); + +export type JQLPersonalDataMigrationRequest = z.infer; diff --git a/src/version2/schemas/jQLQueryWithUnknownUsers.ts b/src/version2/schemas/jQLQueryWithUnknownUsers.ts new file mode 100644 index 0000000000..39d533fc95 --- /dev/null +++ b/src/version2/schemas/jQLQueryWithUnknownUsers.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** JQL queries that contained users that could not be found */ +export const JQLQueryWithUnknownUsersSchema = z.object({ + /** The converted query, with accountIDs instead of user identifiers, or 'unknown' for users that could not be found */ + convertedQuery: z.string().optional(), + /** The original query, for reference */ + originalQuery: z.string().optional(), +}); + +export type JQLQueryWithUnknownUsers = z.infer; diff --git a/src/version2/schemas/jQLReferenceData.ts b/src/version2/schemas/jQLReferenceData.ts new file mode 100644 index 0000000000..4da1547737 --- /dev/null +++ b/src/version2/schemas/jQLReferenceData.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { FieldReferenceDataSchema } from './fieldReferenceData'; +import { FunctionReferenceDataSchema } from './functionReferenceData'; + +/** Lists of JQL reference data. */ +export const JQLReferenceDataSchema = z.object({ + /** List of JQL query reserved words. */ + jqlReservedWords: z.array(z.string()).optional(), + /** List of fields usable in JQL queries. */ + visibleFieldNames: z.array(FieldReferenceDataSchema).optional(), + /** List of functions usable in JQL queries. */ + visibleFunctionNames: z.array(FunctionReferenceDataSchema).optional(), +}); + +export type JQLReferenceData = z.infer; diff --git a/src/version2/schemas/jexpEvaluateCtxIssues.ts b/src/version2/schemas/jexpEvaluateCtxIssues.ts new file mode 100644 index 0000000000..af97c87665 --- /dev/null +++ b/src/version2/schemas/jexpEvaluateCtxIssues.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** + * The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. This + * bean will be replacing `JexpIssues` bean as part of new `evaluate` endpoint + */ +export const JexpEvaluateCtxIssuesSchema = z.object({ + /** The JQL query that specifies the set of issues available in the Jira expression. */ + jql: z.unknown().optional(), +}); + +export type JexpEvaluateCtxIssues = z.infer; diff --git a/src/version2/schemas/jexpEvaluateCtxJqlIssues.ts b/src/version2/schemas/jexpEvaluateCtxJqlIssues.ts new file mode 100644 index 0000000000..1a23455def --- /dev/null +++ b/src/version2/schemas/jexpEvaluateCtxJqlIssues.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +/** + * The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. Not all + * issues returned by the JQL query are loaded, only those described by the `nextPageToken` and `maxResults` properties. + * This bean will be replacing JexpJqlIssues bean as part of new `evaluate` endpoint + */ +export const JexpEvaluateCtxJqlIssuesSchema = z.object({ + /** + * The maximum number of issues to return from the JQL query. max results value considered may be lower than the + * number specific here. + */ + maxResults: z.number().int().optional(), + /** + * 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: z.string().optional(), + /** The JQL query, required to be bounded. Additionally, `orderBy` clause can contain a maximum of 7 fields */ + query: z.string().optional(), +}); + +export type JexpEvaluateCtxJqlIssues = z.infer; diff --git a/src/version2/schemas/jexpIssues.ts b/src/version2/schemas/jexpIssues.ts new file mode 100644 index 0000000000..4eae6abc97 --- /dev/null +++ b/src/version2/schemas/jexpIssues.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ +export const JexpIssuesSchema = z.object({ + /** The JQL query that specifies the set of issues available in the Jira expression. */ + jql: z.unknown().optional(), +}); + +export type JexpIssues = z.infer; diff --git a/src/version2/schemas/jexpJqlIssues.ts b/src/version2/schemas/jexpJqlIssues.ts new file mode 100644 index 0000000000..915c79a14b --- /dev/null +++ b/src/version2/schemas/jexpJqlIssues.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +/** + * The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. Not all + * issues returned by the JQL query are loaded, only those described by the `startAt` and `maxResults` properties. To + * determine whether it is necessary to iterate to ensure all the issues returned by the JQL query are evaluated, + * inspect `meta.issues.jql.count` in the response. + */ +export const JexpJqlIssuesSchema = z.object({ + /** + * The maximum number of issues to return from the JQL query. Inspect `meta.issues.jql.maxResults` in the response to + * ensure the maximum value has not been exceeded. + */ + maxResults: z.number().int().optional(), + /** The JQL query. */ + query: z.string().optional(), + /** The index of the first issue to return from the JQL query. */ + startAt: z.number().int().optional(), + /** Determines how to validate the JQL query and treat the validation results. */ + validation: z.enum(['strict', 'warn', 'none']).optional(), +}); + +export type JexpJqlIssues = z.infer; diff --git a/src/version2/schemas/jiraExpressionAnalysis.ts b/src/version2/schemas/jiraExpressionAnalysis.ts new file mode 100644 index 0000000000..1138874451 --- /dev/null +++ b/src/version2/schemas/jiraExpressionAnalysis.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; +import { JiraExpressionComplexitySchema } from './jiraExpressionComplexity'; +import { JiraExpressionValidationErrorSchema } from './jiraExpressionValidationError'; + +/** Details about the analysed Jira expression. */ +export const JiraExpressionAnalysisSchema = z.object({ + complexity: JiraExpressionComplexitySchema.optional(), + /** A list of validation errors. Not included if the expression is valid. */ + errors: z.array(JiraExpressionValidationErrorSchema).optional(), + /** The analysed expression. */ + expression: z.string(), + /** EXPERIMENTAL. The inferred type of the expression. */ + type: z.string().optional(), + /** + * Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime + * (for example, if it executes too many expensive operations). + */ + valid: z.boolean(), +}); + +export type JiraExpressionAnalysis = z.infer; diff --git a/src/version2/schemas/jiraExpressionComplexity.ts b/src/version2/schemas/jiraExpressionComplexity.ts new file mode 100644 index 0000000000..9cc3ce42af --- /dev/null +++ b/src/version2/schemas/jiraExpressionComplexity.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +/** Details about the complexity of the analysed Jira expression. */ +export const JiraExpressionComplexitySchema = z.object({ + /** + * Information that can be used to determine how many [expensive + * operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) the + * evaluation of the expression will perform. This information may be a formula or number. For example: + * + * - `issues.map(i => i.comments)` performs as many expensive operations as there are issues on the issues list. So this + * parameter returns `N`, where `N` is the size of issue list. + * - `new Issue(10010).comments` gets comments for one issue, so its complexity is `2` (`1` to retrieve issue 10010 from + * the database plus `1` to get its comments). + */ + expensiveOperations: z.string(), + /** Variables used in the formula, mapped to the parts of the expression they refer to. */ + variables: z.object({}).optional(), +}); + +export type JiraExpressionComplexity = z.infer; diff --git a/src/version2/schemas/jiraExpressionEvalContextBean.ts b/src/version2/schemas/jiraExpressionEvalContextBean.ts new file mode 100644 index 0000000000..536e82c335 --- /dev/null +++ b/src/version2/schemas/jiraExpressionEvalContextBean.ts @@ -0,0 +1,36 @@ +import { z } from 'zod'; +import { CustomContextVariableSchema } from './customContextVariable'; + +export const JiraExpressionEvalContextBeanSchema = z.object({ + /** The ID of the board that is available under the `board` variable when evaluating the expression. */ + board: z.number().int().optional(), + /** + * Custom context variables and their types. These variable types are available for use in a custom context: + * + * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - `json`: A JSON object containing custom content. + * - `list`: A JSON list of `user`, `issue`, or `json` variable types. + */ + custom: z.array(CustomContextVariableSchema).optional(), + /** + * The ID of the customer request that is available under the `customerRequest` variable when evaluating the + * expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will + * have a different type. + */ + customerRequest: z.number().int().optional(), + /** The issue that is available under the `issue` variable when evaluating the expression. */ + issue: z.unknown().optional(), + /** The collection of issues that is available under the `issues` variable when evaluating the expression. */ + issues: z.unknown().optional(), + /** The project that is available under the `project` variable when evaluating the expression. */ + project: z.unknown().optional(), + /** The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. */ + serviceDesk: z.number().int().optional(), + /** The ID of the sprint that is available under the `sprint` variable when evaluating the expression. */ + sprint: z.number().int().optional(), +}); + +export type JiraExpressionEvalContextBean = z.infer; diff --git a/src/version2/schemas/jiraExpressionEvalRequestBean.ts b/src/version2/schemas/jiraExpressionEvalRequestBean.ts new file mode 100644 index 0000000000..5fdedd2d39 --- /dev/null +++ b/src/version2/schemas/jiraExpressionEvalRequestBean.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const JiraExpressionEvalRequestBeanSchema = z.object({ + /** The context in which the Jira expression is evaluated. */ + context: z.unknown().optional(), + /** The Jira expression to evaluate. */ + expression: z.string(), +}); + +export type JiraExpressionEvalRequestBean = z.infer; diff --git a/src/version2/schemas/jiraExpressionEvaluateContextBean.ts b/src/version2/schemas/jiraExpressionEvaluateContextBean.ts new file mode 100644 index 0000000000..7c1b7d6450 --- /dev/null +++ b/src/version2/schemas/jiraExpressionEvaluateContextBean.ts @@ -0,0 +1,36 @@ +import { z } from 'zod'; +import { CustomContextVariableSchema } from './customContextVariable'; + +export const JiraExpressionEvaluateContextBeanSchema = z.object({ + /** The ID of the board that is available under the `board` variable when evaluating the expression. */ + board: z.number().int().optional(), + /** + * Custom context variables and their types. These variable types are available for use in a custom context: + * + * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - `json`: A JSON object containing custom content. + * - `list`: A JSON list of `user`, `issue`, or `json` variable types. + */ + custom: z.array(CustomContextVariableSchema).optional(), + /** + * The ID of the customer request that is available under the `customerRequest` variable when evaluating the + * expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will + * have a different type. + */ + customerRequest: z.number().int().optional(), + /** The issue that is available under the `issue` variable when evaluating the expression. */ + issue: z.unknown().optional(), + /** The collection of issues that is available under the `issues` variable when evaluating the expression. */ + issues: z.unknown().optional(), + /** The project that is available under the `project` variable when evaluating the expression. */ + project: z.unknown().optional(), + /** The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. */ + serviceDesk: z.number().int().optional(), + /** The ID of the sprint that is available under the `sprint` variable when evaluating the expression. */ + sprint: z.number().int().optional(), +}); + +export type JiraExpressionEvaluateContextBean = z.infer; diff --git a/src/version2/schemas/jiraExpressionEvaluateRequestBean.ts b/src/version2/schemas/jiraExpressionEvaluateRequestBean.ts new file mode 100644 index 0000000000..edea559e4f --- /dev/null +++ b/src/version2/schemas/jiraExpressionEvaluateRequestBean.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** + * The request to evaluate a Jira expression. This bean will be replacing `JiraExpressionEvaluateRequest` as part of new + * `evaluate` endpoint + */ +export const JiraExpressionEvaluateRequestBeanSchema = z.object({ + /** The context in which the Jira expression is evaluated. */ + context: z.unknown().optional(), + /** The Jira expression to evaluate. */ + expression: z.string(), +}); + +export type JiraExpressionEvaluateRequestBean = z.infer; diff --git a/src/version2/schemas/jiraExpressionEvaluationMetaDataBean.ts b/src/version2/schemas/jiraExpressionEvaluationMetaDataBean.ts new file mode 100644 index 0000000000..73bc0bf956 --- /dev/null +++ b/src/version2/schemas/jiraExpressionEvaluationMetaDataBean.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const JiraExpressionEvaluationMetaDataBeanSchema = z.object({ + /** + * Contains information about the expression complexity. For example, the number of steps it took to evaluate the + * expression. + */ + complexity: z.unknown().optional(), + /** + * Contains information about the `issues` variable in the context. For example, is the issues were loaded with JQL, + * information about the page will be included here. + */ + issues: z.unknown().optional(), +}); + +export type JiraExpressionEvaluationMetaDataBean = z.infer; diff --git a/src/version2/schemas/jiraExpressionForAnalysis.ts b/src/version2/schemas/jiraExpressionForAnalysis.ts new file mode 100644 index 0000000000..2b636de85b --- /dev/null +++ b/src/version2/schemas/jiraExpressionForAnalysis.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** Details of Jira expressions for analysis. */ +export const JiraExpressionForAnalysisSchema = z.object({ + /** + * Context variables and their types. The type checker assumes that [common context + * variables](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables), such as + * `issue` or `project`, are available in context and sets their type. Use this property to override the default types + * or provide details of new variables. + */ + contextVariables: z.object({}).optional(), + /** The list of Jira expressions to analyse. */ + expressions: z.array(z.string()), +}); + +export type JiraExpressionForAnalysis = z.infer; diff --git a/src/version2/schemas/jiraExpressionResult.ts b/src/version2/schemas/jiraExpressionResult.ts new file mode 100644 index 0000000000..1a95ab0a26 --- /dev/null +++ b/src/version2/schemas/jiraExpressionResult.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** The result of evaluating a Jira expression. */ +export const JiraExpressionResultSchema = z.object({ + /** Contains various characteristics of the performed expression evaluation. */ + meta: z.unknown().optional(), + /** + * 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: z.unknown(), +}); + +export type JiraExpressionResult = z.infer; diff --git a/src/version2/schemas/jiraExpressionValidationError.ts b/src/version2/schemas/jiraExpressionValidationError.ts new file mode 100644 index 0000000000..db5c133e09 --- /dev/null +++ b/src/version2/schemas/jiraExpressionValidationError.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; + +/** + * Details about syntax and type errors. The error details apply to the entire expression, unless the object includes: * + * + * - - `line` and `column` + * - - `expression` + */ +export const JiraExpressionValidationErrorSchema = z.object({ + /** The text column in which the error occurred. */ + column: z.number().int().optional(), + /** The part of the expression in which the error occurred. */ + expression: z.string().optional(), + /** The text line in which the error occurred. */ + line: z.number().int().optional(), + /** Details about the error. */ + message: z.string(), + /** The error type. */ + type: z.enum(['syntax', 'type', 'other']), +}); + +export type JiraExpressionValidationError = z.infer; diff --git a/src/version2/schemas/jiraExpressionsAnalysis.ts b/src/version2/schemas/jiraExpressionsAnalysis.ts new file mode 100644 index 0000000000..65ca9f5fcc --- /dev/null +++ b/src/version2/schemas/jiraExpressionsAnalysis.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { JiraExpressionAnalysisSchema } from './jiraExpressionAnalysis'; + +/** Details about the analysed Jira expression. */ +export const JiraExpressionsAnalysisSchema = z.object({ + /** The results of Jira expressions analysis. */ + results: z.array(JiraExpressionAnalysisSchema), +}); + +export type JiraExpressionsAnalysis = z.infer; diff --git a/src/version2/schemas/jiraExpressionsComplexityBean.ts b/src/version2/schemas/jiraExpressionsComplexityBean.ts new file mode 100644 index 0000000000..e4f7a150b5 --- /dev/null +++ b/src/version2/schemas/jiraExpressionsComplexityBean.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +export const JiraExpressionsComplexityBeanSchema = z.object({ + /** The number of Jira REST API beans returned in the response. */ + beans: z.unknown(), + /** + * The number of expensive operations executed while evaluating the expression. Expensive operations are those that + * load additional data, such as entity properties, comments, or custom fields. + */ + expensiveOperations: z.unknown(), + /** The number of primitive values returned in the response. */ + primitiveValues: z.unknown(), + /** + * The number of steps it took to evaluate the expression, where a step is a high-level operation performed by the + * expression. A step is an operation such as arithmetic, accessing a property, accessing a context variable, or + * calling a function. + */ + steps: z.unknown(), +}); + +export type JiraExpressionsComplexityBean = z.infer; diff --git a/src/version2/schemas/jiraExpressionsComplexityValueBean.ts b/src/version2/schemas/jiraExpressionsComplexityValueBean.ts new file mode 100644 index 0000000000..aa0d365885 --- /dev/null +++ b/src/version2/schemas/jiraExpressionsComplexityValueBean.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const JiraExpressionsComplexityValueBeanSchema = z.object({ + /** The maximum allowed complexity. The evaluation will fail if this value is exceeded. */ + limit: z.number().int(), + /** The complexity value of the current expression. */ + value: z.number().int(), +}); + +export type JiraExpressionsComplexityValueBean = z.infer; diff --git a/src/version2/schemas/jiraStatus.ts b/src/version2/schemas/jiraStatus.ts new file mode 100644 index 0000000000..3311aa965a --- /dev/null +++ b/src/version2/schemas/jiraStatus.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; +import { StatusScopeSchema } from './statusScope'; + +/** Details of a status. */ +export const JiraStatusSchema = z.object({ + /** The description of the status. */ + description: z.string().optional(), + /** The ID of the status. */ + id: z.string().optional(), + /** The name of the status. */ + name: z.string().optional(), + scope: StatusScopeSchema.optional(), + /** The category of the status. */ + statusCategory: z.enum(['TODO', 'IN_PROGRESS', 'DONE']).optional(), +}); + +export type JiraStatus = z.infer; diff --git a/src/version2/schemas/jiraWorkflow.ts b/src/version2/schemas/jiraWorkflow.ts new file mode 100644 index 0000000000..c35a610728 --- /dev/null +++ b/src/version2/schemas/jiraWorkflow.ts @@ -0,0 +1,37 @@ +import { z } from 'zod'; +import { WorkflowLayoutSchema } from './workflowLayout'; +import { WorkflowScopeSchema } from './workflowScope'; +import { WorkflowReferenceStatusSchema } from './workflowReferenceStatus'; +import { WorkflowTransitionsSchema } from './workflowTransitions'; +import { DocumentVersionSchema } from './documentVersion'; + +/** Details of a workflow. */ +export const JiraWorkflowSchema = z.object({ + /** The creation date of the workflow. */ + created: z.string().optional(), + /** The description of the workflow. */ + description: z.string().optional(), + /** The ID of the workflow. */ + id: z.string().optional(), + /** Indicates if the workflow can be edited. */ + isEditable: z.boolean().optional(), + loopedTransitionContainerLayout: WorkflowLayoutSchema.optional(), + /** The name of the workflow. */ + name: z.string().optional(), + scope: WorkflowScopeSchema.optional(), + startPointLayout: WorkflowLayoutSchema.optional(), + /** The statuses referenced in this workflow. */ + statuses: z.array(WorkflowReferenceStatusSchema).optional(), + /** If there is a current [asynchronous task](#async-operations) operation for this workflow. */ + taskId: z.string().optional(), + /** + * The transitions of the workflow. Note that a transition can have either the deprecated `to`/`from` fields or the + * `toStatusReference`/`links` fields, but never both nor a combination. + */ + transitions: z.array(WorkflowTransitionsSchema).optional(), + /** The last edited date of the workflow. */ + updated: z.string().optional(), + version: DocumentVersionSchema.optional(), +}); + +export type JiraWorkflow = z.infer; diff --git a/src/version2/schemas/jiraWorkflowStatus.ts b/src/version2/schemas/jiraWorkflowStatus.ts new file mode 100644 index 0000000000..a394f757c5 --- /dev/null +++ b/src/version2/schemas/jiraWorkflowStatus.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { WorkflowScopeSchema } from './workflowScope'; + +/** Details of a status. */ +export const JiraWorkflowStatusSchema = z.object({ + /** The description of the status. */ + description: z.string().optional(), + /** The ID of the status. */ + id: z.string().optional(), + /** The name of the status. */ + name: z.string().optional(), + scope: WorkflowScopeSchema.optional(), + /** The category of the status. */ + statusCategory: z.enum(['TODO', 'IN_PROGRESS', 'DONE']).optional(), + /** The reference of the status. */ + statusReference: z.string().optional(), +}); + +export type JiraWorkflowStatus = z.infer; diff --git a/src/version2/schemas/jqlFunctionPrecomputationBean.ts b/src/version2/schemas/jqlFunctionPrecomputationBean.ts new file mode 100644 index 0000000000..376676d9f5 --- /dev/null +++ b/src/version2/schemas/jqlFunctionPrecomputationBean.ts @@ -0,0 +1,29 @@ +import { z } from 'zod'; + +/** Jql function precomputation. */ +export const JqlFunctionPrecomputationBeanSchema = z.object({ + /** The list of arguments function was invoked with. */ + arguments: z.array(z.string()).optional(), + /** The timestamp of the precomputation creation. */ + created: z.string().datetime().optional(), + /** The error message to be displayed to the user. */ + error: z.string().optional(), + /** The field the function was executed against. */ + field: z.string().optional(), + /** The function key. */ + functionKey: z.string().optional(), + /** The name of the function. */ + functionName: z.string().optional(), + /** The id of the precomputation. */ + id: z.string().optional(), + /** The operator in context of which function was executed. */ + operator: z.string().optional(), + /** The timestamp of the precomputation last update. */ + updated: z.string().datetime().optional(), + /** The timestamp of the precomputation last usage. */ + used: z.string().datetime().optional(), + /** The JQL fragment stored as the precomputation. */ + value: z.string().optional(), +}); + +export type JqlFunctionPrecomputationBean = z.infer; diff --git a/src/version2/schemas/jqlFunctionPrecomputationGetByIdRequest.ts b/src/version2/schemas/jqlFunctionPrecomputationGetByIdRequest.ts new file mode 100644 index 0000000000..363be405df --- /dev/null +++ b/src/version2/schemas/jqlFunctionPrecomputationGetByIdRequest.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +/** Request to fetch precomputations by ID. */ +export const JqlFunctionPrecomputationGetByIdRequestSchema = z.object({ + precomputationIDs: z.array(z.string()).optional(), +}); + +export type JqlFunctionPrecomputationGetByIdRequest = z.infer; diff --git a/src/version2/schemas/jqlFunctionPrecomputationGetByIdResponse.ts b/src/version2/schemas/jqlFunctionPrecomputationGetByIdResponse.ts new file mode 100644 index 0000000000..1894cc3cda --- /dev/null +++ b/src/version2/schemas/jqlFunctionPrecomputationGetByIdResponse.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { JqlFunctionPrecomputationBeanSchema } from './jqlFunctionPrecomputationBean'; + +/** Get precomputations by ID response. */ +export const JqlFunctionPrecomputationGetByIdResponseSchema = z.object({ + /** List of precomputations that were not found. */ + notFoundPrecomputationIDs: z.array(z.string()).optional(), + /** The list of precomputations. */ + precomputations: z.array(JqlFunctionPrecomputationBeanSchema).optional(), +}); + +export type JqlFunctionPrecomputationGetByIdResponse = z.infer; diff --git a/src/version2/schemas/jqlFunctionPrecomputationUpdateBean.ts b/src/version2/schemas/jqlFunctionPrecomputationUpdateBean.ts new file mode 100644 index 0000000000..8de9055ed5 --- /dev/null +++ b/src/version2/schemas/jqlFunctionPrecomputationUpdateBean.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** Precomputation id and its new value. */ +export const JqlFunctionPrecomputationUpdateBeanSchema = z.object({ + /** + * The error message to be displayed to the user if the given function clause is no longer valid during recalculation + * of the precomputation. + */ + error: z.string().optional(), + /** The id of the precomputation to update. */ + id: z.string(), + /** The new value of the precomputation. */ + value: z.string().optional(), +}); + +export type JqlFunctionPrecomputationUpdateBean = z.infer; diff --git a/src/version2/schemas/jqlFunctionPrecomputationUpdateErrorResponse.ts b/src/version2/schemas/jqlFunctionPrecomputationUpdateErrorResponse.ts new file mode 100644 index 0000000000..7bea1da067 --- /dev/null +++ b/src/version2/schemas/jqlFunctionPrecomputationUpdateErrorResponse.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Error response returned updating JQL Function precomputations fails. */ +export const JqlFunctionPrecomputationUpdateErrorResponseSchema = z.object({ + /** The list of error messages produced by this operation. */ + errorMessages: z.array(z.string()).optional(), + /** List of precomputations that were not found. */ + notFoundPrecomputationIDs: z.array(z.string()).optional(), +}); + +export type JqlFunctionPrecomputationUpdateErrorResponse = z.infer< + typeof JqlFunctionPrecomputationUpdateErrorResponseSchema +>; diff --git a/src/version2/schemas/jqlFunctionPrecomputationUpdateRequestBean.ts b/src/version2/schemas/jqlFunctionPrecomputationUpdateRequestBean.ts new file mode 100644 index 0000000000..2dde874bb9 --- /dev/null +++ b/src/version2/schemas/jqlFunctionPrecomputationUpdateRequestBean.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { JqlFunctionPrecomputationUpdateBeanSchema } from './jqlFunctionPrecomputationUpdateBean'; + +/** List of pairs (id and value) for precomputation updates. */ +export const JqlFunctionPrecomputationUpdateRequestBeanSchema = z.object({ + values: z.array(JqlFunctionPrecomputationUpdateBeanSchema).optional(), +}); + +export type JqlFunctionPrecomputationUpdateRequestBean = z.infer< + typeof JqlFunctionPrecomputationUpdateRequestBeanSchema +>; diff --git a/src/version2/schemas/jqlFunctionPrecomputationUpdateResponse.ts b/src/version2/schemas/jqlFunctionPrecomputationUpdateResponse.ts new file mode 100644 index 0000000000..9c67d7276b --- /dev/null +++ b/src/version2/schemas/jqlFunctionPrecomputationUpdateResponse.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** Result of updating JQL Function precomputations. */ +export const JqlFunctionPrecomputationUpdateResponseSchema = z.object({ + /** + * List of precomputations that were not found and skipped. Only returned if the request passed + * skipNotFoundPrecomputations=true. + */ + notFoundPrecomputationIDs: z.array(z.string()).optional(), +}); + +export type JqlFunctionPrecomputationUpdateResponse = z.infer; diff --git a/src/version2/schemas/jqlQueriesToParse.ts b/src/version2/schemas/jqlQueriesToParse.ts new file mode 100644 index 0000000000..539b59a96b --- /dev/null +++ b/src/version2/schemas/jqlQueriesToParse.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** A list of JQL queries to parse. */ +export const JqlQueriesToParseSchema = z.object({ + /** A list of queries to parse. */ + queries: z.array(z.string()), +}); + +export type JqlQueriesToParse = z.infer; diff --git a/src/version2/schemas/jqlQueriesToSanitize.ts b/src/version2/schemas/jqlQueriesToSanitize.ts new file mode 100644 index 0000000000..5c6d340ada --- /dev/null +++ b/src/version2/schemas/jqlQueriesToSanitize.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { JqlQueryToSanitizeSchema } from './jqlQueryToSanitize'; + +/** The list of JQL queries to sanitize for the given account IDs. */ +export const JqlQueriesToSanitizeSchema = z.object({ + /** The list of JQL queries to sanitize. Must contain unique values. Maximum of 20 queries. */ + queries: z.array(JqlQueryToSanitizeSchema), +}); + +export type JqlQueriesToSanitize = z.infer; diff --git a/src/version2/schemas/jqlQuery.ts b/src/version2/schemas/jqlQuery.ts new file mode 100644 index 0000000000..b40b63366c --- /dev/null +++ b/src/version2/schemas/jqlQuery.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { JqlQueryOrderByClauseSchema } from './jqlQueryOrderByClause'; +import { JqlQueryClauseSchema } from './jqlQueryClause'; + +/** A parsed JQL query. */ +export const JqlQuerySchema = z.object({ + orderBy: JqlQueryOrderByClauseSchema.optional(), + where: JqlQueryClauseSchema.optional(), +}); + +export type JqlQuery = z.infer; diff --git a/src/version2/schemas/jqlQueryClause.ts b/src/version2/schemas/jqlQueryClause.ts new file mode 100644 index 0000000000..b1ef74eef6 --- /dev/null +++ b/src/version2/schemas/jqlQueryClause.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; + +/** A JQL query clause. */ +export const JqlQueryClauseSchema = z.object({}); + +export type JqlQueryClause = z.infer; diff --git a/src/version2/schemas/jqlQueryClauseOperand.ts b/src/version2/schemas/jqlQueryClauseOperand.ts new file mode 100644 index 0000000000..9ef7aef043 --- /dev/null +++ b/src/version2/schemas/jqlQueryClauseOperand.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; + +/** Details of an operand in a JQL clause. */ +export const JqlQueryClauseOperandSchema = z.object({}); + +export type JqlQueryClauseOperand = z.infer; diff --git a/src/version2/schemas/jqlQueryClauseTimePredicate.ts b/src/version2/schemas/jqlQueryClauseTimePredicate.ts new file mode 100644 index 0000000000..f08fd91908 --- /dev/null +++ b/src/version2/schemas/jqlQueryClauseTimePredicate.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { JqlQueryClauseOperandSchema } from './jqlQueryClauseOperand'; + +/** A time predicate for a temporal JQL clause. */ +export const JqlQueryClauseTimePredicateSchema = z.object({ + operand: JqlQueryClauseOperandSchema, + /** The operator between the field and the operand. */ + operator: z.enum(['before', 'after', 'from', 'to', 'on', 'during', 'by']), +}); + +export type JqlQueryClauseTimePredicate = z.infer; diff --git a/src/version2/schemas/jqlQueryField.ts b/src/version2/schemas/jqlQueryField.ts new file mode 100644 index 0000000000..3beb312ae0 --- /dev/null +++ b/src/version2/schemas/jqlQueryField.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; +import { JqlQueryFieldEntityPropertySchema } from './jqlQueryFieldEntityProperty'; + +/** + * A field used in a JQL query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) + * for more information about fields in JQL queries. + */ +export const JqlQueryFieldSchema = z.object({ + /** The encoded name of the field, which can be used directly in a JQL query. */ + encodedName: z.string().optional(), + /** The name of the field. */ + name: z.string(), + /** When the field refers to a value in an entity property, details of the entity property value. */ + property: z.array(JqlQueryFieldEntityPropertySchema).optional(), +}); + +export type JqlQueryField = z.infer; diff --git a/src/version2/schemas/jqlQueryFieldEntityProperty.ts b/src/version2/schemas/jqlQueryFieldEntityProperty.ts new file mode 100644 index 0000000000..6b99b08642 --- /dev/null +++ b/src/version2/schemas/jqlQueryFieldEntityProperty.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** Details of an entity property. */ +export const JqlQueryFieldEntityPropertySchema = z.object({ + /** The object on which the property is set. */ + entity: z.string(), + /** The key of the property. */ + key: z.string(), + /** The path in the property value to query. */ + path: z.string(), + /** + * The type of the property value extraction. Not available if the extraction for the property is not registered on + * the instance with the [Entity + * property](https://developer.atlassian.com/cloud/jira/platform/modules/entity-property/) module. + */ + type: z.enum(['number', 'string', 'text', 'date', 'user']).optional(), +}); + +export type JqlQueryFieldEntityProperty = z.infer; diff --git a/src/version2/schemas/jqlQueryOrderByClause.ts b/src/version2/schemas/jqlQueryOrderByClause.ts new file mode 100644 index 0000000000..7d408386fe --- /dev/null +++ b/src/version2/schemas/jqlQueryOrderByClause.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { JqlQueryOrderByClauseElementSchema } from './jqlQueryOrderByClauseElement'; + +/** Details of the order-by JQL clause. */ +export const JqlQueryOrderByClauseSchema = z.object({ + /** The list of order-by clause fields and their ordering directives. */ + fields: z.array(JqlQueryOrderByClauseElementSchema), +}); + +export type JqlQueryOrderByClause = z.infer; diff --git a/src/version2/schemas/jqlQueryOrderByClauseElement.ts b/src/version2/schemas/jqlQueryOrderByClauseElement.ts new file mode 100644 index 0000000000..2343f91ce5 --- /dev/null +++ b/src/version2/schemas/jqlQueryOrderByClauseElement.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { JqlQueryFieldSchema } from './jqlQueryField'; + +/** An element of the order-by JQL clause. */ +export const JqlQueryOrderByClauseElementSchema = z.object({ + /** The direction in which to order the results. */ + direction: z.enum(['asc', 'desc']).optional(), + field: JqlQueryFieldSchema, +}); + +export type JqlQueryOrderByClauseElement = z.infer; diff --git a/src/version2/schemas/jqlQueryToSanitize.ts b/src/version2/schemas/jqlQueryToSanitize.ts new file mode 100644 index 0000000000..a3c2ccf693 --- /dev/null +++ b/src/version2/schemas/jqlQueryToSanitize.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** + * The JQL query to sanitize for the account ID. If the account ID is null, sanitizing is performed for an anonymous + * user. + */ +export const JqlQueryToSanitizeSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** The query to sanitize. */ + query: z.string(), +}); + +export type JqlQueryToSanitize = z.infer; diff --git a/src/version2/schemas/jqlQueryUnitaryOperand.ts b/src/version2/schemas/jqlQueryUnitaryOperand.ts new file mode 100644 index 0000000000..b37efe4c58 --- /dev/null +++ b/src/version2/schemas/jqlQueryUnitaryOperand.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; + +/** An operand that can be part of a list operand. */ +export const JqlQueryUnitaryOperandSchema = z.object({}); + +export type JqlQueryUnitaryOperand = z.infer; diff --git a/src/version2/schemas/jsonContextVariable.ts b/src/version2/schemas/jsonContextVariable.ts new file mode 100644 index 0000000000..6ad36398ac --- /dev/null +++ b/src/version2/schemas/jsonContextVariable.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** A JSON object with custom content. */ +export const JsonContextVariableSchema = z.object({ + /** Type of custom context variable. */ + type: z.string(), + /** A JSON object containing custom content. */ + value: z.object({}).optional(), +}); + +export type JsonContextVariable = z.infer; diff --git a/src/version2/schemas/jsonNode.ts b/src/version2/schemas/jsonNode.ts new file mode 100644 index 0000000000..fa096fa449 --- /dev/null +++ b/src/version2/schemas/jsonNode.ts @@ -0,0 +1,42 @@ +import { z } from 'zod'; + +export const JsonNodeSchema = z.object({ + array: z.boolean().optional(), + bigDecimal: z.boolean().optional(), + bigInteger: z.boolean().optional(), + bigIntegerValue: z.number().int().optional(), + binary: z.boolean().optional(), + binaryValue: z.array(z.string()).optional(), + boolean: z.boolean().optional(), + booleanValue: z.boolean().optional(), + containerNode: z.boolean().optional(), + decimalValue: z.number().optional(), + double: z.boolean().optional(), + doubleValue: z.number().optional(), + elements: z.object({}).optional(), + fieldNames: z.object({}).optional(), + fields: z.object({}).optional(), + floatingPointNumber: z.boolean().optional(), + int: z.boolean().optional(), + intValue: z.number().int().optional(), + integralNumber: z.boolean().optional(), + long: z.boolean().optional(), + longValue: z.number().int().optional(), + missingNode: z.boolean().optional(), + null: z.boolean().optional(), + number: z.boolean().optional(), + numberType: z.enum(['INT', 'LONG', 'BIG_INTEGER', 'FLOAT', 'DOUBLE', 'BIG_DECIMAL']).optional(), + numberValue: z.number().optional(), + object: z.boolean().optional(), + pojo: z.boolean().optional(), + textValue: z.string().optional(), + textual: z.boolean().optional(), + valueAsBoolean: z.boolean().optional(), + valueAsDouble: z.number().optional(), + valueAsInt: z.number().int().optional(), + valueAsLong: z.number().int().optional(), + valueAsText: z.string().optional(), + valueNode: z.boolean().optional(), +}); + +export type JsonNode = z.infer; diff --git a/src/version2/schemas/jsonTypeBean.ts b/src/version2/schemas/jsonTypeBean.ts new file mode 100644 index 0000000000..830b44ee75 --- /dev/null +++ b/src/version2/schemas/jsonTypeBean.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** The schema of a field. */ +export const JsonTypeBeanSchema = z.object({ + /** If the field is a custom field, the configuration of the field. */ + configuration: z.object({}).optional(), + /** If the field is a custom field, the URI of the field. */ + custom: z.string().optional(), + /** If the field is a custom field, the custom ID of the field. */ + customId: z.number().int().optional(), + /** When the data type is an array, the name of the field items within the array. */ + items: z.string().optional(), + /** If the field is a system field, the name of the field. */ + system: z.string().optional(), + /** The data type of the field. */ + type: z.string(), +}); + +export type JsonTypeBean = z.infer; diff --git a/src/version2/schemas/keywordOperand.ts b/src/version2/schemas/keywordOperand.ts new file mode 100644 index 0000000000..7694a6bb39 --- /dev/null +++ b/src/version2/schemas/keywordOperand.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** + * 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 const KeywordOperandSchema = z.object({ + /** The keyword that is the operand value. */ + keyword: z.enum(['empty']), +}); + +export type KeywordOperand = z.infer; diff --git a/src/version2/schemas/legacyJackson1ListAttachment.ts b/src/version2/schemas/legacyJackson1ListAttachment.ts new file mode 100644 index 0000000000..dcf46577db --- /dev/null +++ b/src/version2/schemas/legacyJackson1ListAttachment.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; +import { AttachmentSchema } from './attachment'; + +export const LegacyJackson1ListAttachmentSchema = z.array(AttachmentSchema); + +export type LegacyJackson1ListAttachment = z.infer; diff --git a/src/version2/schemas/legacyJackson1ListColumnItem.ts b/src/version2/schemas/legacyJackson1ListColumnItem.ts new file mode 100644 index 0000000000..79dfb2c8f5 --- /dev/null +++ b/src/version2/schemas/legacyJackson1ListColumnItem.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; +import { ColumnItemSchema } from './columnItem'; + +export const LegacyJackson1ListColumnItemSchema = z.array(ColumnItemSchema); + +export type LegacyJackson1ListColumnItem = z.infer; diff --git a/src/version2/schemas/legacyJackson1ListIssueEvent.ts b/src/version2/schemas/legacyJackson1ListIssueEvent.ts new file mode 100644 index 0000000000..fe40e8a043 --- /dev/null +++ b/src/version2/schemas/legacyJackson1ListIssueEvent.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; +import { IssueEventSchema } from './issueEvent'; + +export const LegacyJackson1ListIssueEventSchema = z.array(IssueEventSchema); + +export type LegacyJackson1ListIssueEvent = z.infer; diff --git a/src/version2/schemas/legacyJackson1ListIssueTypeWithStatus.ts b/src/version2/schemas/legacyJackson1ListIssueTypeWithStatus.ts new file mode 100644 index 0000000000..bc79f2a80f --- /dev/null +++ b/src/version2/schemas/legacyJackson1ListIssueTypeWithStatus.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; +import { IssueTypeWithStatusSchema } from './issueTypeWithStatus'; + +export const LegacyJackson1ListIssueTypeWithStatusSchema = z.array(IssueTypeWithStatusSchema); + +export type LegacyJackson1ListIssueTypeWithStatus = z.infer; diff --git a/src/version2/schemas/legacyJackson1ListProject.ts b/src/version2/schemas/legacyJackson1ListProject.ts new file mode 100644 index 0000000000..f6d36e268c --- /dev/null +++ b/src/version2/schemas/legacyJackson1ListProject.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; +import { ProjectSchema } from './project'; + +export const LegacyJackson1ListProjectSchema = z.array(ProjectSchema); + +export type LegacyJackson1ListProject = z.infer; diff --git a/src/version2/schemas/legacyJackson1ListProjectComponent.ts b/src/version2/schemas/legacyJackson1ListProjectComponent.ts new file mode 100644 index 0000000000..c5f8aba732 --- /dev/null +++ b/src/version2/schemas/legacyJackson1ListProjectComponent.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; +import { ProjectComponentSchema } from './projectComponent'; + +export const LegacyJackson1ListProjectComponentSchema = z.array(ProjectComponentSchema); + +export type LegacyJackson1ListProjectComponent = z.infer; diff --git a/src/version2/schemas/legacyJackson1ListProjectRoleDetails.ts b/src/version2/schemas/legacyJackson1ListProjectRoleDetails.ts new file mode 100644 index 0000000000..c245ebda99 --- /dev/null +++ b/src/version2/schemas/legacyJackson1ListProjectRoleDetails.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; +import { ProjectRoleDetailsSchema } from './projectRoleDetails'; + +export const LegacyJackson1ListProjectRoleDetailsSchema = z.array(ProjectRoleDetailsSchema); + +export type LegacyJackson1ListProjectRoleDetails = z.infer; diff --git a/src/version2/schemas/legacyJackson1ListProjectType.ts b/src/version2/schemas/legacyJackson1ListProjectType.ts new file mode 100644 index 0000000000..09f0439735 --- /dev/null +++ b/src/version2/schemas/legacyJackson1ListProjectType.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; +import { ProjectTypeSchema } from './projectType'; + +export const LegacyJackson1ListProjectTypeSchema = z.array(ProjectTypeSchema); + +export type LegacyJackson1ListProjectType = z.infer; diff --git a/src/version2/schemas/legacyJackson1ListUserMigrationBean.ts b/src/version2/schemas/legacyJackson1ListUserMigrationBean.ts new file mode 100644 index 0000000000..55997899df --- /dev/null +++ b/src/version2/schemas/legacyJackson1ListUserMigrationBean.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; +import { UserMigrationBeanSchema } from './userMigrationBean'; + +export const LegacyJackson1ListUserMigrationBeanSchema = z.array(UserMigrationBeanSchema); + +export type LegacyJackson1ListUserMigrationBean = z.infer; diff --git a/src/version2/schemas/legacyJackson1ListVersion.ts b/src/version2/schemas/legacyJackson1ListVersion.ts new file mode 100644 index 0000000000..80993787fc --- /dev/null +++ b/src/version2/schemas/legacyJackson1ListVersion.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; +import { VersionSchema } from './version'; + +export const LegacyJackson1ListVersionSchema = z.array(VersionSchema); + +export type LegacyJackson1ListVersion = z.infer; diff --git a/src/version2/schemas/legacyJackson1ListWorklog.ts b/src/version2/schemas/legacyJackson1ListWorklog.ts new file mode 100644 index 0000000000..23bd12da5e --- /dev/null +++ b/src/version2/schemas/legacyJackson1ListWorklog.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; +import { WorklogSchema } from './worklog'; + +export const LegacyJackson1ListWorklogSchema = z.array(WorklogSchema); + +export type LegacyJackson1ListWorklog = z.infer; diff --git a/src/version2/schemas/license.ts b/src/version2/schemas/license.ts new file mode 100644 index 0000000000..728b738af9 --- /dev/null +++ b/src/version2/schemas/license.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { LicensedApplicationSchema } from './licensedApplication'; + +/** Details about a license for the Jira instance. */ +export const LicenseSchema = z.object({ + /** The applications under this license. */ + applications: z.array(LicensedApplicationSchema), +}); + +export type License = z.infer; diff --git a/src/version2/schemas/licenseMetric.ts b/src/version2/schemas/licenseMetric.ts new file mode 100644 index 0000000000..97434ad758 --- /dev/null +++ b/src/version2/schemas/licenseMetric.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** A metric that provides insight into the active licence details */ +export const LicenseMetricSchema = z.object({ + /** The key of a specific license metric. */ + key: z.string().optional(), + /** + * The calculated value of a licence metric linked to the key. An example licence metric is the approximate number of + * user accounts. + */ + value: z.string().optional(), +}); + +export type LicenseMetric = z.infer; diff --git a/src/version2/schemas/licensedApplication.ts b/src/version2/schemas/licensedApplication.ts new file mode 100644 index 0000000000..6270ad6861 --- /dev/null +++ b/src/version2/schemas/licensedApplication.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details about a licensed Jira application. */ +export const LicensedApplicationSchema = z.object({ + /** The ID of the application. */ + id: z.string(), + /** The licensing plan. */ + plan: z.enum(['UNLICENSED', 'FREE', 'PAID']), +}); + +export type LicensedApplication = z.infer; diff --git a/src/version2/schemas/linkGroup.ts b/src/version2/schemas/linkGroup.ts new file mode 100644 index 0000000000..1b69b77f7b --- /dev/null +++ b/src/version2/schemas/linkGroup.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { LinkGroupSchema } from './linkGroup'; +import { SimpleLinkSchema } from './simpleLink'; + +/** Details a link group, which defines issue operations. */ +export const LinkGroupSchema = z.object({ + groups: z.array(LinkGroupSchema).optional(), + header: SimpleLinkSchema.optional(), + id: z.string().optional(), + links: z.array(SimpleLinkSchema).optional(), + styleClass: z.string().optional(), + weight: z.number().int().optional(), +}); + +export type LinkGroup = z.infer; diff --git a/src/version2/schemas/linkIssueRequestJsonBean.ts b/src/version2/schemas/linkIssueRequestJsonBean.ts new file mode 100644 index 0000000000..dbc218c409 --- /dev/null +++ b/src/version2/schemas/linkIssueRequestJsonBean.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { CommentSchema } from './comment'; +import { LinkedIssueSchema } from './linkedIssue'; +import { IssueLinkTypeSchema } from './issueLinkType'; + +export const LinkIssueRequestJsonBeanSchema = z.object({ + comment: CommentSchema.optional(), + inwardIssue: LinkedIssueSchema, + outwardIssue: LinkedIssueSchema, + type: IssueLinkTypeSchema, +}); + +export type LinkIssueRequestJsonBean = z.infer; diff --git a/src/version2/schemas/linkedIssue.ts b/src/version2/schemas/linkedIssue.ts new file mode 100644 index 0000000000..1cde235cc1 --- /dev/null +++ b/src/version2/schemas/linkedIssue.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** The ID or key of a linked issue. */ +export const LinkedIssueSchema = z.object({ + /** The fields associated with the issue. */ + fields: z.unknown().optional(), + /** The ID of an issue. Required if `key` isn't provided. */ + id: z.string().optional(), + /** The key of an issue. Required if `id` isn't provided. */ + key: z.string().optional(), + /** The URL of the issue. */ + self: z.string().optional(), +}); + +export type LinkedIssue = z.infer; diff --git a/src/version2/schemas/listOperand.ts b/src/version2/schemas/listOperand.ts new file mode 100644 index 0000000000..5174113cfe --- /dev/null +++ b/src/version2/schemas/listOperand.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { JqlQueryUnitaryOperandSchema } from './jqlQueryUnitaryOperand'; + +/** An operand that is a list of values. */ +export const ListOperandSchema = z.object({ + /** Encoded operand, which can be used directly in a JQL query. */ + encodedOperand: z.string().optional(), + /** The list of operand values. */ + values: z.array(JqlQueryUnitaryOperandSchema), +}); + +export type ListOperand = z.infer; diff --git a/src/version2/schemas/listWrapperCallbackApplicationRole.ts b/src/version2/schemas/listWrapperCallbackApplicationRole.ts new file mode 100644 index 0000000000..b61506535a --- /dev/null +++ b/src/version2/schemas/listWrapperCallbackApplicationRole.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const ListWrapperCallbackApplicationRoleSchema = z.object({}); + +export type ListWrapperCallbackApplicationRole = z.infer; diff --git a/src/version2/schemas/listWrapperCallbackGroupName.ts b/src/version2/schemas/listWrapperCallbackGroupName.ts new file mode 100644 index 0000000000..01d077655e --- /dev/null +++ b/src/version2/schemas/listWrapperCallbackGroupName.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const ListWrapperCallbackGroupNameSchema = z.object({}); + +export type ListWrapperCallbackGroupName = z.infer; diff --git a/src/version2/schemas/locale.ts b/src/version2/schemas/locale.ts new file mode 100644 index 0000000000..a099917bd8 --- /dev/null +++ b/src/version2/schemas/locale.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of a locale. */ +export const LocaleSchema = z.object({ + /** + * The locale code. The Java the locale format is used: a two character language code (ISO 639), an underscore, and + * two letter country code (ISO 3166). For example, en_US represents a locale of English (United States). Required on + * create. + */ + locale: z.string().optional(), +}); + +export type Locale = z.infer; diff --git a/src/version2/schemas/mappingsByIssueTypeOverride.ts b/src/version2/schemas/mappingsByIssueTypeOverride.ts new file mode 100644 index 0000000000..2ccbfc60cb --- /dev/null +++ b/src/version2/schemas/mappingsByIssueTypeOverride.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { WorkflowAssociationStatusMappingSchema } 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 const MappingsByIssueTypeOverrideSchema = z.object({ + /** The ID of the issue type for this mapping. */ + issueTypeId: z.string(), + /** The list of status mappings. */ + statusMappings: z.array(WorkflowAssociationStatusMappingSchema), +}); + +export type MappingsByIssueTypeOverride = z.infer; diff --git a/src/version2/schemas/mappingsByWorkflow.ts b/src/version2/schemas/mappingsByWorkflow.ts new file mode 100644 index 0000000000..a923cf67af --- /dev/null +++ b/src/version2/schemas/mappingsByWorkflow.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { WorkflowAssociationStatusMappingSchema } 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 const MappingsByWorkflowSchema = z.object({ + /** The ID of the new workflow. */ + newWorkflowId: z.string(), + /** The ID of the old workflow. */ + oldWorkflowId: z.string(), + /** The list of status mappings. */ + statusMappings: z.array(WorkflowAssociationStatusMappingSchema), +}); + +export type MappingsByWorkflow = z.infer; diff --git a/src/version2/schemas/moveFieldBean.ts b/src/version2/schemas/moveFieldBean.ts new file mode 100644 index 0000000000..951022531d --- /dev/null +++ b/src/version2/schemas/moveFieldBean.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +export const MoveFieldBeanSchema = z.object({ + /** + * The ID of the screen tab field after which to place the moved screen tab field. Required if `position` isn't + * provided. + */ + after: z.string().optional(), + /** The named position to which the screen tab field should be moved. Required if `after` isn't provided. */ + position: z.enum(['Earlier', 'Later', 'First', 'Last']).optional(), +}); + +export type MoveFieldBean = z.infer; diff --git a/src/version2/schemas/multiIssueEntityProperties.ts b/src/version2/schemas/multiIssueEntityProperties.ts new file mode 100644 index 0000000000..f52ea6c439 --- /dev/null +++ b/src/version2/schemas/multiIssueEntityProperties.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { IssueEntityPropertiesForMultiUpdateSchema } from './issueEntityPropertiesForMultiUpdate'; + +/** + * A list of issues and their respective properties to set or update. See [Entity + * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. + */ +export const MultiIssueEntityPropertiesSchema = z.object({ + /** A list of issue IDs and their respective properties. */ + issues: z.array(IssueEntityPropertiesForMultiUpdateSchema).optional(), +}); + +export type MultiIssueEntityProperties = z.infer; diff --git a/src/version2/schemas/multipartFile.ts b/src/version2/schemas/multipartFile.ts new file mode 100644 index 0000000000..80f62ffc72 --- /dev/null +++ b/src/version2/schemas/multipartFile.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { ResourceSchema } from './resource'; + +export const MultipartFileSchema = z.object({ + bytes: z.array(z.string()).optional(), + contentType: z.string().optional(), + empty: z.boolean().optional(), + inputStream: z.object({}).optional(), + name: z.string().optional(), + originalFilename: z.string().optional(), + resource: ResourceSchema.optional(), + size: z.number().int().optional(), +}); + +export type MultipartFile = z.infer; diff --git a/src/version2/schemas/multipleCustomFieldValuesUpdate.ts b/src/version2/schemas/multipleCustomFieldValuesUpdate.ts new file mode 100644 index 0000000000..7a9db85d2a --- /dev/null +++ b/src/version2/schemas/multipleCustomFieldValuesUpdate.ts @@ -0,0 +1,29 @@ +import { z } from 'zod'; + +/** A custom field and its new value with a list of issue to update. */ +export const MultipleCustomFieldValuesUpdateSchema = z.object({ + /** The ID or key of the custom field. For example, `customfield_10010`. */ + customField: z.string(), + /** The list of issue IDs. */ + issueIds: z.array(z.number().int()), + /** + * The value for the custom field. The value must be compatible with the [custom field + * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/#data-types) as + * follows: + * + * - `string` the value must be a string. + * - `number` the value must be a number. + * - `datetime` the value must be a string that represents a date in the ISO format or the simplified extended ISO + * format. For example, `"2023-01-18T12:00:00-03:00"` or `"2023-01-18T12:00:00.000Z"`. However, the milliseconds + * part is ignored. + * - `user` the value must be an object that contains the `accountId` field. + * - `group` the value must be an object that contains the group `name` or `groupId` field. Because group names can + * change, we recommend using `groupId`. + * + * A list of appropriate values must be provided if the field is of the `list` [collection + * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/#collection-types). + */ + value: z.unknown(), +}); + +export type MultipleCustomFieldValuesUpdate = z.infer; diff --git a/src/version2/schemas/multipleCustomFieldValuesUpdateDetails.ts b/src/version2/schemas/multipleCustomFieldValuesUpdateDetails.ts new file mode 100644 index 0000000000..636d2520fc --- /dev/null +++ b/src/version2/schemas/multipleCustomFieldValuesUpdateDetails.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { MultipleCustomFieldValuesUpdateSchema } from './multipleCustomFieldValuesUpdate'; + +/** List of updates for a custom fields. */ +export const MultipleCustomFieldValuesUpdateDetailsSchema = z.object({ + updates: z.array(MultipleCustomFieldValuesUpdateSchema).optional(), +}); + +export type MultipleCustomFieldValuesUpdateDetails = z.infer; diff --git a/src/version2/schemas/nestedResponse.ts b/src/version2/schemas/nestedResponse.ts new file mode 100644 index 0000000000..8e4a2e0992 --- /dev/null +++ b/src/version2/schemas/nestedResponse.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { ErrorCollectionSchema } from './errorCollection'; +import { WarningCollectionSchema } from './warningCollection'; + +export const NestedResponseSchema = z.object({ + errorCollection: ErrorCollectionSchema.optional(), + status: z.number().int().optional(), + warningCollection: WarningCollectionSchema.optional(), +}); + +export type NestedResponse = z.infer; diff --git a/src/version2/schemas/newUserDetails.ts b/src/version2/schemas/newUserDetails.ts new file mode 100644 index 0000000000..28405226bf --- /dev/null +++ b/src/version2/schemas/newUserDetails.ts @@ -0,0 +1,40 @@ +import { z } from 'zod'; + +/** The user details. */ +export const NewUserDetailsSchema = z.object({ + /** Deprecated, do not use. */ + applicationKeys: z.array(z.string()).optional(), + /** + * This property is no longer available. If the user has an Atlassian account, their display name is not changed. If + * the user does not have an Atlassian account, they are sent an email asking them set up an account. + */ + displayName: z.string().optional(), + /** The email address for the user. */ + emailAddress: z.string(), + /** + * This property is no longer available. See the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + key: z.string().optional(), + /** + * This property is no longer available. See the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name: z.string().optional(), + /** + * This property is no longer available. If the user has an Atlassian account, their password is not changed. If the + * user does not have an Atlassian account, they are sent an email asking them set up an account. + */ + password: z.string().optional(), + /** + * Products the new user has access to. Valid products are: jira-core, jira-servicedesk, jira-product-discovery, + * jira-software. To create a user without product access, set this field to be an empty array. + */ + products: z.array(z.string()), + /** The URL of the user. */ + self: z.string().optional(), +}); + +export type NewUserDetails = z.infer; diff --git a/src/version2/schemas/nonWorkingDay.ts b/src/version2/schemas/nonWorkingDay.ts new file mode 100644 index 0000000000..d968085c30 --- /dev/null +++ b/src/version2/schemas/nonWorkingDay.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const NonWorkingDaySchema = z.object({ + id: z.number().int().optional(), + iso8601Date: z.string().optional(), +}); + +export type NonWorkingDay = z.infer; diff --git a/src/version2/schemas/notification.ts b/src/version2/schemas/notification.ts new file mode 100644 index 0000000000..14d428e19d --- /dev/null +++ b/src/version2/schemas/notification.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +/** Details about a notification. */ +export const NotificationSchema = z.object({ + /** The HTML body of the email notification for the issue. */ + htmlBody: z.string().optional(), + /** Restricts the notifications to users with the specified permissions. */ + restrict: z.unknown().optional(), + /** + * The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue + * key and summary. + */ + subject: z.string().optional(), + /** The plain text body of the email notification for the issue. */ + textBody: z.string().optional(), + /** The recipients of the email notification for the issue. */ + to: z.unknown().optional(), +}); + +export type Notification = z.infer; diff --git a/src/version2/schemas/notificationEvent.ts b/src/version2/schemas/notificationEvent.ts new file mode 100644 index 0000000000..a5092ded4f --- /dev/null +++ b/src/version2/schemas/notificationEvent.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** Details about a notification event. */ +export const NotificationEventSchema = z.object({ + /** The description of the event. */ + description: z.string().optional(), + /** + * The ID of the event. The event can be a [Jira system + * event](https://confluence.atlassian.com/x/8YdKLg#Creatinganotificationscheme-eventsEvents) or a [custom + * event](https://confluence.atlassian.com/x/AIlKLg). + */ + id: z.number().int().optional(), + /** The name of the event. */ + name: z.string().optional(), + /** The template of the event. Only custom events configured by Jira administrators have template. */ + templateEvent: z.unknown().optional(), +}); + +export type NotificationEvent = z.infer; diff --git a/src/version2/schemas/notificationRecipients.ts b/src/version2/schemas/notificationRecipients.ts new file mode 100644 index 0000000000..1ae5cd7c24 --- /dev/null +++ b/src/version2/schemas/notificationRecipients.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; +import { GroupNameSchema } from './groupName'; +import { UserDetailsSchema } from './userDetails'; + +/** Details of the users and groups to receive the notification. */ +export const NotificationRecipientsSchema = z.object({ + /** Whether the notification should be sent to the issue's assignees. */ + assignee: z.boolean().optional(), + /** List of groupIds to receive the notification. */ + groupIds: z.array(z.string()).optional(), + /** List of groups to receive the notification. */ + groups: z.array(GroupNameSchema).optional(), + /** Whether the notification should be sent to the issue's reporter. */ + reporter: z.boolean().optional(), + /** List of users to receive the notification. */ + users: z.array(UserDetailsSchema).optional(), + /** Whether the notification should be sent to the issue's voters. */ + voters: z.boolean().optional(), + /** Whether the notification should be sent to the issue's watchers. */ + watchers: z.boolean().optional(), +}); + +export type NotificationRecipients = z.infer; diff --git a/src/version2/schemas/notificationRecipientsRestrictions.ts b/src/version2/schemas/notificationRecipientsRestrictions.ts new file mode 100644 index 0000000000..50bf65ff88 --- /dev/null +++ b/src/version2/schemas/notificationRecipientsRestrictions.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { GroupNameSchema } from './groupName'; +import { RestrictedPermissionSchema } from './restrictedPermission'; + +/** Details of the group membership or permissions needed to receive the notification. */ +export const NotificationRecipientsRestrictionsSchema = z.object({ + /** List of groupId memberships required to receive the notification. */ + groupIds: z.array(z.string()).optional(), + /** List of group memberships required to receive the notification. */ + groups: z.array(GroupNameSchema).optional(), + /** List of permissions required to receive the notification. */ + permissions: z.array(RestrictedPermissionSchema).optional(), +}); + +export type NotificationRecipientsRestrictions = z.infer; diff --git a/src/version2/schemas/notificationScheme.ts b/src/version2/schemas/notificationScheme.ts new file mode 100644 index 0000000000..a9153ef2ab --- /dev/null +++ b/src/version2/schemas/notificationScheme.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; +import { NotificationSchemeEventSchema } from './notificationSchemeEvent'; + +/** Details about a notification scheme. */ +export const NotificationSchemeSchema = z.object({ + /** The description of the notification scheme. */ + description: z.string().optional(), + /** Expand options that include additional notification scheme details in the response. */ + expand: z.string().optional(), + /** The ID of the notification scheme. */ + id: z.number().int().optional(), + /** The name of the notification scheme. */ + name: z.string().optional(), + /** The notification events and associated recipients. */ + notificationSchemeEvents: z.array(NotificationSchemeEventSchema).optional(), + /** The list of project IDs associated with the notification scheme. */ + projects: z.array(z.number().int()).optional(), + /** The scope of the notification scheme. */ + scope: z.unknown().optional(), + self: z.string().optional(), +}); + +export type NotificationScheme = z.infer; diff --git a/src/version2/schemas/notificationSchemeAndProjectMappingJsonBean.ts b/src/version2/schemas/notificationSchemeAndProjectMappingJsonBean.ts new file mode 100644 index 0000000000..97547ac73b --- /dev/null +++ b/src/version2/schemas/notificationSchemeAndProjectMappingJsonBean.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const NotificationSchemeAndProjectMappingJsonBeanSchema = z.object({ + notificationSchemeId: z.string().optional(), + projectId: z.string().optional(), +}); + +export type NotificationSchemeAndProjectMappingJsonBean = z.infer< + typeof NotificationSchemeAndProjectMappingJsonBeanSchema +>; diff --git a/src/version2/schemas/notificationSchemeEvent.ts b/src/version2/schemas/notificationSchemeEvent.ts new file mode 100644 index 0000000000..8f5e032a99 --- /dev/null +++ b/src/version2/schemas/notificationSchemeEvent.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { NotificationEventSchema } from './notificationEvent'; +import { EventNotificationSchema } from './eventNotification'; + +/** Details about a notification scheme event. */ +export const NotificationSchemeEventSchema = z.object({ + event: NotificationEventSchema.optional(), + notifications: z.array(EventNotificationSchema).optional(), +}); + +export type NotificationSchemeEvent = z.infer; diff --git a/src/version2/schemas/notificationSchemeEventDetails.ts b/src/version2/schemas/notificationSchemeEventDetails.ts new file mode 100644 index 0000000000..1464782005 --- /dev/null +++ b/src/version2/schemas/notificationSchemeEventDetails.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { NotificationSchemeNotificationDetailsSchema } from './notificationSchemeNotificationDetails'; + +/** Details of a notification scheme event. */ +export const NotificationSchemeEventDetailsSchema = z.object({ + /** The ID of the event. */ + event: z.unknown(), + /** The list of notifications mapped to a specified event. */ + notifications: z.array(NotificationSchemeNotificationDetailsSchema), +}); + +export type NotificationSchemeEventDetails = z.infer; diff --git a/src/version2/schemas/notificationSchemeEventIDPayload.ts b/src/version2/schemas/notificationSchemeEventIDPayload.ts new file mode 100644 index 0000000000..e74894aa1d --- /dev/null +++ b/src/version2/schemas/notificationSchemeEventIDPayload.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The event ID to use for reference in the payload */ +export const NotificationSchemeEventIDPayloadSchema = z.object({ + /** The event ID to use for reference in the payload */ + id: z.string().optional(), +}); + +export type NotificationSchemeEventIDPayload = z.infer; diff --git a/src/version2/schemas/notificationSchemeEventPayload.ts b/src/version2/schemas/notificationSchemeEventPayload.ts new file mode 100644 index 0000000000..92d2c49fae --- /dev/null +++ b/src/version2/schemas/notificationSchemeEventPayload.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { NotificationSchemeEventIDPayloadSchema } from './notificationSchemeEventIDPayload'; +import { NotificationSchemeNotificationDetailsPayloadSchema } from './notificationSchemeNotificationDetailsPayload'; + +/** The payload for creating a notification scheme event. Defines which notifications should be sent for a specific event */ +export const NotificationSchemeEventPayloadSchema = z.object({ + event: NotificationSchemeEventIDPayloadSchema.optional(), + /** The configuration for notification recipents */ + notifications: z.array(NotificationSchemeNotificationDetailsPayloadSchema).optional(), +}); + +export type NotificationSchemeEventPayload = z.infer; diff --git a/src/version2/schemas/notificationSchemeEventTypeId.ts b/src/version2/schemas/notificationSchemeEventTypeId.ts new file mode 100644 index 0000000000..62526680db --- /dev/null +++ b/src/version2/schemas/notificationSchemeEventTypeId.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The ID of an event that is being mapped to notifications. */ +export const NotificationSchemeEventTypeIdSchema = z.object({ + /** The ID of the notification scheme event. */ + id: z.string(), +}); + +export type NotificationSchemeEventTypeId = z.infer; diff --git a/src/version2/schemas/notificationSchemeId.ts b/src/version2/schemas/notificationSchemeId.ts new file mode 100644 index 0000000000..f00ff558ec --- /dev/null +++ b/src/version2/schemas/notificationSchemeId.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The ID of a notification scheme. */ +export const NotificationSchemeIdSchema = z.object({ + /** The ID of a notification scheme. */ + id: z.string(), +}); + +export type NotificationSchemeId = z.infer; diff --git a/src/version2/schemas/notificationSchemeNotificationDetails.ts b/src/version2/schemas/notificationSchemeNotificationDetails.ts new file mode 100644 index 0000000000..9cef919b44 --- /dev/null +++ b/src/version2/schemas/notificationSchemeNotificationDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of a notification within a notification scheme. */ +export const NotificationSchemeNotificationDetailsSchema = z.object({ + /** The notification type, e.g `CurrentAssignee`, `Group`, `EmailAddress`. */ + notificationType: z.string(), + /** The value corresponding to the specified notification type. */ + parameter: z.string().optional(), +}); + +export type NotificationSchemeNotificationDetails = z.infer; diff --git a/src/version2/schemas/notificationSchemeNotificationDetailsPayload.ts b/src/version2/schemas/notificationSchemeNotificationDetailsPayload.ts new file mode 100644 index 0000000000..c212025a70 --- /dev/null +++ b/src/version2/schemas/notificationSchemeNotificationDetailsPayload.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The configuration for notification recipents */ +export const NotificationSchemeNotificationDetailsPayloadSchema = z.object({ + /** The type of notification. */ + notificationType: z.string().optional(), + /** The parameter of the notification, should be eiither null if not required, or PCRI. */ + parameter: z.string().optional(), +}); + +export type NotificationSchemeNotificationDetailsPayload = z.infer< + typeof NotificationSchemeNotificationDetailsPayloadSchema +>; diff --git a/src/version2/schemas/notificationSchemePayload.ts b/src/version2/schemas/notificationSchemePayload.ts new file mode 100644 index 0000000000..df08135c5f --- /dev/null +++ b/src/version2/schemas/notificationSchemePayload.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; +import { NotificationSchemeEventPayloadSchema } from './notificationSchemeEventPayload'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** + * The payload for creating a notification scheme. The user has to supply the ID for the default notification scheme. + * For CMP this is provided in the project payload and should be left empty, for TMP it's provided using this payload + */ +export const NotificationSchemePayloadSchema = z.object({ + /** The description of the notification scheme */ + description: z.string().optional(), + /** The name of the notification scheme */ + name: z.string().optional(), + /** The events and notifications for the notification scheme */ + notificationSchemeEvents: z.array(NotificationSchemeEventPayloadSchema).optional(), + /** The strategy to use when there is a conflict with an existing entity */ + onConflict: z.enum(['FAIL', 'USE', 'NEW']).optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), +}); + +export type NotificationSchemePayload = z.infer; diff --git a/src/version2/schemas/oldToNewSecurityLevelMappingsBean.ts b/src/version2/schemas/oldToNewSecurityLevelMappingsBean.ts new file mode 100644 index 0000000000..daa4b84e64 --- /dev/null +++ b/src/version2/schemas/oldToNewSecurityLevelMappingsBean.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const OldToNewSecurityLevelMappingsBeanSchema = z.object({ + /** The new issue security level ID. Providing null will clear the assigned old level from issues. */ + newLevelId: z.string(), + /** The old issue security level ID. Providing null will remap all issues without any assigned levels. */ + oldLevelId: z.string(), +}); + +export type OldToNewSecurityLevelMappingsBean = z.infer; diff --git a/src/version2/schemas/operationMessage.ts b/src/version2/schemas/operationMessage.ts new file mode 100644 index 0000000000..14207b04e2 --- /dev/null +++ b/src/version2/schemas/operationMessage.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const OperationMessageSchema = z.object({ + /** The human-readable message that describes the result. */ + message: z.string(), + /** The status code of the response. */ + statusCode: z.number().int(), +}); + +export type OperationMessage = z.infer; diff --git a/src/version2/schemas/operations.ts b/src/version2/schemas/operations.ts new file mode 100644 index 0000000000..13975e2a33 --- /dev/null +++ b/src/version2/schemas/operations.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { LinkGroupSchema } from './linkGroup'; + +/** Details of the operations that can be performed on the issue. */ +export const OperationsSchema = z.object({ + /** Details of the link groups defining issue operations. */ + linkGroups: z.array(LinkGroupSchema).optional(), +}); + +export type Operations = z.infer; diff --git a/src/version2/schemas/orderOfCustomFieldOptions.ts b/src/version2/schemas/orderOfCustomFieldOptions.ts new file mode 100644 index 0000000000..ccbeff050c --- /dev/null +++ b/src/version2/schemas/orderOfCustomFieldOptions.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** An ordered list of custom field option IDs and information on where to move them. */ +export const OrderOfCustomFieldOptionsSchema = z.object({ + /** + * The ID of the custom field option or cascading option to place the moved options after. Required if `position` + * isn't provided. + */ + after: z.string().optional(), + /** + * A list of IDs of custom field options to move. The order of the custom field option IDs in the list is the order + * they are given after the move. The list must contain custom field options or cascading options, but not both. + */ + customFieldOptionIds: z.array(z.string()), + /** The position the custom field options should be moved to. Required if `after` isn't provided. */ + position: z.enum(['First', 'Last']).optional(), +}); + +export type OrderOfCustomFieldOptions = z.infer; diff --git a/src/version2/schemas/orderOfIssueTypes.ts b/src/version2/schemas/orderOfIssueTypes.ts new file mode 100644 index 0000000000..b55d0df783 --- /dev/null +++ b/src/version2/schemas/orderOfIssueTypes.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** An ordered list of issue type IDs and information about where to move them. */ +export const OrderOfIssueTypesSchema = z.object({ + /** The ID of the issue type to place the moved issue types after. Required if `position` isn't provided. */ + after: z.string().optional(), + /** + * A list of the issue type IDs to move. The order of the issue type IDs in the list is the order they are given after + * the move. + */ + issueTypeIds: z.array(z.string()), + /** The position the issue types should be moved to. Required if `after` isn't provided. */ + position: z.enum(['First', 'Last']).optional(), +}); + +export type OrderOfIssueTypes = z.infer; diff --git a/src/version2/schemas/pageBean2ComponentJsonBean.ts b/src/version2/schemas/pageBean2ComponentJsonBean.ts new file mode 100644 index 0000000000..1de2c6880f --- /dev/null +++ b/src/version2/schemas/pageBean2ComponentJsonBean.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ComponentJsonBeanSchema } from './componentJsonBean'; + +/** A page of items. */ +export const PageBean2ComponentJsonBeanSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(ComponentJsonBeanSchema).optional(), +}); + +export type PageBean2ComponentJsonBean = z.infer; diff --git a/src/version2/schemas/pageBean2JqlFunctionPrecomputationBean.ts b/src/version2/schemas/pageBean2JqlFunctionPrecomputationBean.ts new file mode 100644 index 0000000000..e538d2e3ed --- /dev/null +++ b/src/version2/schemas/pageBean2JqlFunctionPrecomputationBean.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { JqlFunctionPrecomputationBeanSchema } from './jqlFunctionPrecomputationBean'; + +/** A page of items. */ +export const PageBean2JqlFunctionPrecomputationBeanSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(JqlFunctionPrecomputationBeanSchema).optional(), +}); + +export type PageBean2JqlFunctionPrecomputationBean = z.infer; diff --git a/src/version2/schemas/pageBeanBulkContextualConfiguration.ts b/src/version2/schemas/pageBeanBulkContextualConfiguration.ts new file mode 100644 index 0000000000..0f23365d70 --- /dev/null +++ b/src/version2/schemas/pageBeanBulkContextualConfiguration.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { BulkContextualConfigurationSchema } from './bulkContextualConfiguration'; + +/** A page of items. */ +export const PageBeanBulkContextualConfigurationSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(BulkContextualConfigurationSchema).optional(), +}); + +export type PageBeanBulkContextualConfiguration = z.infer; diff --git a/src/version2/schemas/pageBeanChangelog.ts b/src/version2/schemas/pageBeanChangelog.ts new file mode 100644 index 0000000000..915a303b10 --- /dev/null +++ b/src/version2/schemas/pageBeanChangelog.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ChangelogSchema } from './changelog'; + +/** A page of items. */ +export const PageBeanChangelogSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(ChangelogSchema).optional(), +}); + +export type PageBeanChangelog = z.infer; diff --git a/src/version2/schemas/pageBeanComment.ts b/src/version2/schemas/pageBeanComment.ts new file mode 100644 index 0000000000..4408c382b8 --- /dev/null +++ b/src/version2/schemas/pageBeanComment.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { CommentSchema } from './comment'; + +/** A page of items. */ +export const PageBeanCommentSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(CommentSchema).optional(), +}); + +export type PageBeanComment = z.infer; diff --git a/src/version2/schemas/pageBeanComponentWithIssueCount.ts b/src/version2/schemas/pageBeanComponentWithIssueCount.ts new file mode 100644 index 0000000000..a8f3ce7532 --- /dev/null +++ b/src/version2/schemas/pageBeanComponentWithIssueCount.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ComponentWithIssueCountSchema } from './componentWithIssueCount'; + +/** A page of items. */ +export const PageBeanComponentWithIssueCountSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(ComponentWithIssueCountSchema).optional(), +}); + +export type PageBeanComponentWithIssueCount = z.infer; diff --git a/src/version2/schemas/pageBeanContext.ts b/src/version2/schemas/pageBeanContext.ts new file mode 100644 index 0000000000..ab65b348b4 --- /dev/null +++ b/src/version2/schemas/pageBeanContext.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ContextSchema } from './context'; + +/** A page of items. */ +export const PageBeanContextSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(ContextSchema).optional(), +}); + +export type PageBeanContext = z.infer; diff --git a/src/version2/schemas/pageBeanContextForProjectAndIssueType.ts b/src/version2/schemas/pageBeanContextForProjectAndIssueType.ts new file mode 100644 index 0000000000..80d4cf5a92 --- /dev/null +++ b/src/version2/schemas/pageBeanContextForProjectAndIssueType.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ContextForProjectAndIssueTypeSchema } from './contextForProjectAndIssueType'; + +/** A page of items. */ +export const PageBeanContextForProjectAndIssueTypeSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(ContextForProjectAndIssueTypeSchema).optional(), +}); + +export type PageBeanContextForProjectAndIssueType = z.infer; diff --git a/src/version2/schemas/pageBeanContextualConfiguration.ts b/src/version2/schemas/pageBeanContextualConfiguration.ts new file mode 100644 index 0000000000..6c6e226046 --- /dev/null +++ b/src/version2/schemas/pageBeanContextualConfiguration.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ContextualConfigurationSchema } from './contextualConfiguration'; + +/** A page of items. */ +export const PageBeanContextualConfigurationSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(ContextualConfigurationSchema).optional(), +}); + +export type PageBeanContextualConfiguration = z.infer; diff --git a/src/version2/schemas/pageBeanCustomFieldContext.ts b/src/version2/schemas/pageBeanCustomFieldContext.ts new file mode 100644 index 0000000000..712977eec3 --- /dev/null +++ b/src/version2/schemas/pageBeanCustomFieldContext.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { CustomFieldContextSchema } from './customFieldContext'; + +/** A page of items. */ +export const PageBeanCustomFieldContextSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(CustomFieldContextSchema).optional(), +}); + +export type PageBeanCustomFieldContext = z.infer; diff --git a/src/version2/schemas/pageBeanCustomFieldContextDefaultValue.ts b/src/version2/schemas/pageBeanCustomFieldContextDefaultValue.ts new file mode 100644 index 0000000000..fdd2f73250 --- /dev/null +++ b/src/version2/schemas/pageBeanCustomFieldContextDefaultValue.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { CustomFieldContextDefaultValueSchema } from './customFieldContextDefaultValue'; + +/** A page of items. */ +export const PageBeanCustomFieldContextDefaultValueSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(CustomFieldContextDefaultValueSchema).optional(), +}); + +export type PageBeanCustomFieldContextDefaultValue = z.infer; diff --git a/src/version2/schemas/pageBeanCustomFieldContextOption.ts b/src/version2/schemas/pageBeanCustomFieldContextOption.ts new file mode 100644 index 0000000000..ae90f8b43b --- /dev/null +++ b/src/version2/schemas/pageBeanCustomFieldContextOption.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { CustomFieldContextOptionSchema } from './customFieldContextOption'; + +/** A page of items. */ +export const PageBeanCustomFieldContextOptionSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(CustomFieldContextOptionSchema).optional(), +}); + +export type PageBeanCustomFieldContextOption = z.infer; diff --git a/src/version2/schemas/pageBeanCustomFieldContextProjectMapping.ts b/src/version2/schemas/pageBeanCustomFieldContextProjectMapping.ts new file mode 100644 index 0000000000..5094209ca2 --- /dev/null +++ b/src/version2/schemas/pageBeanCustomFieldContextProjectMapping.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { CustomFieldContextProjectMappingSchema } from './customFieldContextProjectMapping'; + +/** A page of items. */ +export const PageBeanCustomFieldContextProjectMappingSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(CustomFieldContextProjectMappingSchema).optional(), +}); + +export type PageBeanCustomFieldContextProjectMapping = z.infer; diff --git a/src/version2/schemas/pageBeanDashboard.ts b/src/version2/schemas/pageBeanDashboard.ts new file mode 100644 index 0000000000..5f53238120 --- /dev/null +++ b/src/version2/schemas/pageBeanDashboard.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { DashboardSchema } from './dashboard'; + +/** A page of items. */ +export const PageBeanDashboardSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(DashboardSchema).optional(), +}); + +export type PageBeanDashboard = z.infer; diff --git a/src/version2/schemas/pageBeanField.ts b/src/version2/schemas/pageBeanField.ts new file mode 100644 index 0000000000..1b084ca60f --- /dev/null +++ b/src/version2/schemas/pageBeanField.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { FieldSchema } from './field'; + +/** A page of items. */ +export const PageBeanFieldSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(FieldSchema).optional(), +}); + +export type PageBeanField = z.infer; diff --git a/src/version2/schemas/pageBeanFieldConfigurationDetails.ts b/src/version2/schemas/pageBeanFieldConfigurationDetails.ts new file mode 100644 index 0000000000..16e31c1eee --- /dev/null +++ b/src/version2/schemas/pageBeanFieldConfigurationDetails.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { FieldConfigurationDetailsSchema } from './fieldConfigurationDetails'; + +/** A page of items. */ +export const PageBeanFieldConfigurationDetailsSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(FieldConfigurationDetailsSchema).optional(), +}); + +export type PageBeanFieldConfigurationDetails = z.infer; diff --git a/src/version2/schemas/pageBeanFieldConfigurationIssueTypeItem.ts b/src/version2/schemas/pageBeanFieldConfigurationIssueTypeItem.ts new file mode 100644 index 0000000000..0e8b52a7f1 --- /dev/null +++ b/src/version2/schemas/pageBeanFieldConfigurationIssueTypeItem.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { FieldConfigurationIssueTypeItemSchema } from './fieldConfigurationIssueTypeItem'; + +/** A page of items. */ +export const PageBeanFieldConfigurationIssueTypeItemSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(FieldConfigurationIssueTypeItemSchema).optional(), +}); + +export type PageBeanFieldConfigurationIssueTypeItem = z.infer; diff --git a/src/version2/schemas/pageBeanFieldConfigurationItem.ts b/src/version2/schemas/pageBeanFieldConfigurationItem.ts new file mode 100644 index 0000000000..a1fe0be35e --- /dev/null +++ b/src/version2/schemas/pageBeanFieldConfigurationItem.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { FieldConfigurationItemSchema } from './fieldConfigurationItem'; + +/** A page of items. */ +export const PageBeanFieldConfigurationItemSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(FieldConfigurationItemSchema).optional(), +}); + +export type PageBeanFieldConfigurationItem = z.infer; diff --git a/src/version2/schemas/pageBeanFieldConfigurationScheme.ts b/src/version2/schemas/pageBeanFieldConfigurationScheme.ts new file mode 100644 index 0000000000..aabd0b529f --- /dev/null +++ b/src/version2/schemas/pageBeanFieldConfigurationScheme.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { FieldConfigurationSchemeSchema } from './fieldConfigurationScheme'; + +/** A page of items. */ +export const PageBeanFieldConfigurationSchemeSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(FieldConfigurationSchemeSchema).optional(), +}); + +export type PageBeanFieldConfigurationScheme = z.infer; diff --git a/src/version2/schemas/pageBeanFieldConfigurationSchemeProjects.ts b/src/version2/schemas/pageBeanFieldConfigurationSchemeProjects.ts new file mode 100644 index 0000000000..a643da1981 --- /dev/null +++ b/src/version2/schemas/pageBeanFieldConfigurationSchemeProjects.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { FieldConfigurationSchemeProjectsSchema } from './fieldConfigurationSchemeProjects'; + +/** A page of items. */ +export const PageBeanFieldConfigurationSchemeProjectsSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(FieldConfigurationSchemeProjectsSchema).optional(), +}); + +export type PageBeanFieldConfigurationSchemeProjects = z.infer; diff --git a/src/version2/schemas/pageBeanFilterDetails.ts b/src/version2/schemas/pageBeanFilterDetails.ts new file mode 100644 index 0000000000..743c7e0b2f --- /dev/null +++ b/src/version2/schemas/pageBeanFilterDetails.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { FilterDetailsSchema } from './filterDetails'; + +/** A page of items. */ +export const PageBeanFilterDetailsSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(FilterDetailsSchema).optional(), +}); + +export type PageBeanFilterDetails = z.infer; diff --git a/src/version2/schemas/pageBeanGroupDetails.ts b/src/version2/schemas/pageBeanGroupDetails.ts new file mode 100644 index 0000000000..6a9189be8d --- /dev/null +++ b/src/version2/schemas/pageBeanGroupDetails.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { GroupDetailsSchema } from './groupDetails'; + +/** A page of items. */ +export const PageBeanGroupDetailsSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(GroupDetailsSchema).optional(), +}); + +export type PageBeanGroupDetails = z.infer; diff --git a/src/version2/schemas/pageBeanIssueFieldOption.ts b/src/version2/schemas/pageBeanIssueFieldOption.ts new file mode 100644 index 0000000000..00386a47f8 --- /dev/null +++ b/src/version2/schemas/pageBeanIssueFieldOption.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { IssueFieldOptionSchema } from './issueFieldOption'; + +/** A page of items. */ +export const PageBeanIssueFieldOptionSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(IssueFieldOptionSchema).optional(), +}); + +export type PageBeanIssueFieldOption = z.infer; diff --git a/src/version2/schemas/pageBeanIssueSecurityLevelMember.ts b/src/version2/schemas/pageBeanIssueSecurityLevelMember.ts new file mode 100644 index 0000000000..1428c7097a --- /dev/null +++ b/src/version2/schemas/pageBeanIssueSecurityLevelMember.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { IssueSecurityLevelMemberSchema } from './issueSecurityLevelMember'; + +/** A page of items. */ +export const PageBeanIssueSecurityLevelMemberSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(IssueSecurityLevelMemberSchema).optional(), +}); + +export type PageBeanIssueSecurityLevelMember = z.infer; diff --git a/src/version2/schemas/pageBeanIssueSecuritySchemeToProjectMapping.ts b/src/version2/schemas/pageBeanIssueSecuritySchemeToProjectMapping.ts new file mode 100644 index 0000000000..56b99872d1 --- /dev/null +++ b/src/version2/schemas/pageBeanIssueSecuritySchemeToProjectMapping.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; +import { IssueSecuritySchemeToProjectMappingSchema } from './issueSecuritySchemeToProjectMapping'; + +/** A page of items. */ +export const PageBeanIssueSecuritySchemeToProjectMappingSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(IssueSecuritySchemeToProjectMappingSchema).optional(), +}); + +export type PageBeanIssueSecuritySchemeToProjectMapping = z.infer< + typeof PageBeanIssueSecuritySchemeToProjectMappingSchema +>; diff --git a/src/version2/schemas/pageBeanIssueTypeScheme.ts b/src/version2/schemas/pageBeanIssueTypeScheme.ts new file mode 100644 index 0000000000..67f470bb68 --- /dev/null +++ b/src/version2/schemas/pageBeanIssueTypeScheme.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { IssueTypeSchemeSchema } from './issueTypeScheme'; + +/** A page of items. */ +export const PageBeanIssueTypeSchemeSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(IssueTypeSchemeSchema).optional(), +}); + +export type PageBeanIssueTypeScheme = z.infer; diff --git a/src/version2/schemas/pageBeanIssueTypeSchemeMapping.ts b/src/version2/schemas/pageBeanIssueTypeSchemeMapping.ts new file mode 100644 index 0000000000..d154e58fc7 --- /dev/null +++ b/src/version2/schemas/pageBeanIssueTypeSchemeMapping.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { IssueTypeSchemeMappingSchema } from './issueTypeSchemeMapping'; + +/** A page of items. */ +export const PageBeanIssueTypeSchemeMappingSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(IssueTypeSchemeMappingSchema).optional(), +}); + +export type PageBeanIssueTypeSchemeMapping = z.infer; diff --git a/src/version2/schemas/pageBeanIssueTypeSchemeProjects.ts b/src/version2/schemas/pageBeanIssueTypeSchemeProjects.ts new file mode 100644 index 0000000000..81678a874c --- /dev/null +++ b/src/version2/schemas/pageBeanIssueTypeSchemeProjects.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { IssueTypeSchemeProjectsSchema } from './issueTypeSchemeProjects'; + +/** A page of items. */ +export const PageBeanIssueTypeSchemeProjectsSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(IssueTypeSchemeProjectsSchema).optional(), +}); + +export type PageBeanIssueTypeSchemeProjects = z.infer; diff --git a/src/version2/schemas/pageBeanIssueTypeScreenScheme.ts b/src/version2/schemas/pageBeanIssueTypeScreenScheme.ts new file mode 100644 index 0000000000..a05dbdf625 --- /dev/null +++ b/src/version2/schemas/pageBeanIssueTypeScreenScheme.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { IssueTypeScreenSchemeSchema } from './issueTypeScreenScheme'; + +/** A page of items. */ +export const PageBeanIssueTypeScreenSchemeSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(IssueTypeScreenSchemeSchema).optional(), +}); + +export type PageBeanIssueTypeScreenScheme = z.infer; diff --git a/src/version2/schemas/pageBeanIssueTypeScreenSchemeItem.ts b/src/version2/schemas/pageBeanIssueTypeScreenSchemeItem.ts new file mode 100644 index 0000000000..d1010b5edf --- /dev/null +++ b/src/version2/schemas/pageBeanIssueTypeScreenSchemeItem.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { IssueTypeScreenSchemeItemSchema } from './issueTypeScreenSchemeItem'; + +/** A page of items. */ +export const PageBeanIssueTypeScreenSchemeItemSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(IssueTypeScreenSchemeItemSchema).optional(), +}); + +export type PageBeanIssueTypeScreenSchemeItem = z.infer; diff --git a/src/version2/schemas/pageBeanIssueTypeScreenSchemesProjects.ts b/src/version2/schemas/pageBeanIssueTypeScreenSchemesProjects.ts new file mode 100644 index 0000000000..4261dc2a03 --- /dev/null +++ b/src/version2/schemas/pageBeanIssueTypeScreenSchemesProjects.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { IssueTypeScreenSchemesProjectsSchema } from './issueTypeScreenSchemesProjects'; + +/** A page of items. */ +export const PageBeanIssueTypeScreenSchemesProjectsSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(IssueTypeScreenSchemesProjectsSchema).optional(), +}); + +export type PageBeanIssueTypeScreenSchemesProjects = z.infer; diff --git a/src/version2/schemas/pageBeanIssueTypeToContextMapping.ts b/src/version2/schemas/pageBeanIssueTypeToContextMapping.ts new file mode 100644 index 0000000000..5b615d8c1f --- /dev/null +++ b/src/version2/schemas/pageBeanIssueTypeToContextMapping.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { IssueTypeToContextMappingSchema } from './issueTypeToContextMapping'; + +/** A page of items. */ +export const PageBeanIssueTypeToContextMappingSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(IssueTypeToContextMappingSchema).optional(), +}); + +export type PageBeanIssueTypeToContextMapping = z.infer; diff --git a/src/version2/schemas/pageBeanNotificationScheme.ts b/src/version2/schemas/pageBeanNotificationScheme.ts new file mode 100644 index 0000000000..f01068ee5f --- /dev/null +++ b/src/version2/schemas/pageBeanNotificationScheme.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { NotificationSchemeSchema } from './notificationScheme'; + +/** A page of items. */ +export const PageBeanNotificationSchemeSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(NotificationSchemeSchema).optional(), +}); + +export type PageBeanNotificationScheme = z.infer; diff --git a/src/version2/schemas/pageBeanNotificationSchemeAndProjectMappingJsonBean.ts b/src/version2/schemas/pageBeanNotificationSchemeAndProjectMappingJsonBean.ts new file mode 100644 index 0000000000..91af52c3c0 --- /dev/null +++ b/src/version2/schemas/pageBeanNotificationSchemeAndProjectMappingJsonBean.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; +import { NotificationSchemeAndProjectMappingJsonBeanSchema } from './notificationSchemeAndProjectMappingJsonBean'; + +/** A page of items. */ +export const PageBeanNotificationSchemeAndProjectMappingJsonBeanSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(NotificationSchemeAndProjectMappingJsonBeanSchema).optional(), +}); + +export type PageBeanNotificationSchemeAndProjectMappingJsonBean = z.infer< + typeof PageBeanNotificationSchemeAndProjectMappingJsonBeanSchema +>; diff --git a/src/version2/schemas/pageBeanPriority.ts b/src/version2/schemas/pageBeanPriority.ts new file mode 100644 index 0000000000..53b1590cb8 --- /dev/null +++ b/src/version2/schemas/pageBeanPriority.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { PrioritySchema } from './priority'; + +/** A page of items. */ +export const PageBeanPrioritySchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(PrioritySchema).optional(), +}); + +export type PageBeanPriority = z.infer; diff --git a/src/version2/schemas/pageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects.ts b/src/version2/schemas/pageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects.ts new file mode 100644 index 0000000000..8f64b74426 --- /dev/null +++ b/src/version2/schemas/pageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; +import { PrioritySchemeWithPaginatedPrioritiesAndProjectsSchema } from './prioritySchemeWithPaginatedPrioritiesAndProjects'; + +/** A page of items. */ +export const PageBeanPrioritySchemeWithPaginatedPrioritiesAndProjectsSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(PrioritySchemeWithPaginatedPrioritiesAndProjectsSchema).optional(), +}); + +export type PageBeanPrioritySchemeWithPaginatedPrioritiesAndProjects = z.infer< + typeof PageBeanPrioritySchemeWithPaginatedPrioritiesAndProjectsSchema +>; diff --git a/src/version2/schemas/pageBeanPriorityWithSequence.ts b/src/version2/schemas/pageBeanPriorityWithSequence.ts new file mode 100644 index 0000000000..ee19a278b7 --- /dev/null +++ b/src/version2/schemas/pageBeanPriorityWithSequence.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { PriorityWithSequenceSchema } from './priorityWithSequence'; + +/** A page of items. */ +export const PageBeanPriorityWithSequenceSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(PriorityWithSequenceSchema).optional(), +}); + +export type PageBeanPriorityWithSequence = z.infer; diff --git a/src/version2/schemas/pageBeanProject.ts b/src/version2/schemas/pageBeanProject.ts new file mode 100644 index 0000000000..1d250a29c9 --- /dev/null +++ b/src/version2/schemas/pageBeanProject.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ProjectSchema } from './project'; + +/** A page of items. */ +export const PageBeanProjectSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(ProjectSchema).optional(), +}); + +export type PageBeanProject = z.infer; diff --git a/src/version2/schemas/pageBeanProjectDetails.ts b/src/version2/schemas/pageBeanProjectDetails.ts new file mode 100644 index 0000000000..b014b26d8d --- /dev/null +++ b/src/version2/schemas/pageBeanProjectDetails.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ProjectDetailsSchema } from './projectDetails'; + +/** A page of items. */ +export const PageBeanProjectDetailsSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(ProjectDetailsSchema).optional(), +}); + +export type PageBeanProjectDetails = z.infer; diff --git a/src/version2/schemas/pageBeanResolutionJsonBean.ts b/src/version2/schemas/pageBeanResolutionJsonBean.ts new file mode 100644 index 0000000000..22d37af2ef --- /dev/null +++ b/src/version2/schemas/pageBeanResolutionJsonBean.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ResolutionJsonBeanSchema } from './resolutionJsonBean'; + +/** A page of items. */ +export const PageBeanResolutionJsonBeanSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(ResolutionJsonBeanSchema).optional(), +}); + +export type PageBeanResolutionJsonBean = z.infer; diff --git a/src/version2/schemas/pageBeanScreen.ts b/src/version2/schemas/pageBeanScreen.ts new file mode 100644 index 0000000000..973d41e026 --- /dev/null +++ b/src/version2/schemas/pageBeanScreen.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ScreenSchema } from './screen'; + +/** A page of items. */ +export const PageBeanScreenSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(ScreenSchema).optional(), +}); + +export type PageBeanScreen = z.infer; diff --git a/src/version2/schemas/pageBeanScreenScheme.ts b/src/version2/schemas/pageBeanScreenScheme.ts new file mode 100644 index 0000000000..ed1cd31be1 --- /dev/null +++ b/src/version2/schemas/pageBeanScreenScheme.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ScreenSchemeSchema } from './screenScheme'; + +/** A page of items. */ +export const PageBeanScreenSchemeSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(ScreenSchemeSchema).optional(), +}); + +export type PageBeanScreenScheme = z.infer; diff --git a/src/version2/schemas/pageBeanScreenWithTab.ts b/src/version2/schemas/pageBeanScreenWithTab.ts new file mode 100644 index 0000000000..db52d53c58 --- /dev/null +++ b/src/version2/schemas/pageBeanScreenWithTab.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ScreenWithTabSchema } from './screenWithTab'; + +/** A page of items. */ +export const PageBeanScreenWithTabSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(ScreenWithTabSchema).optional(), +}); + +export type PageBeanScreenWithTab = z.infer; diff --git a/src/version2/schemas/pageBeanSecurityLevel.ts b/src/version2/schemas/pageBeanSecurityLevel.ts new file mode 100644 index 0000000000..1ee9957b93 --- /dev/null +++ b/src/version2/schemas/pageBeanSecurityLevel.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { SecurityLevelSchema } from './securityLevel'; + +/** A page of items. */ +export const PageBeanSecurityLevelSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(SecurityLevelSchema).optional(), +}); + +export type PageBeanSecurityLevel = z.infer; diff --git a/src/version2/schemas/pageBeanSecurityLevelMember.ts b/src/version2/schemas/pageBeanSecurityLevelMember.ts new file mode 100644 index 0000000000..7201af45e3 --- /dev/null +++ b/src/version2/schemas/pageBeanSecurityLevelMember.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { SecurityLevelMemberSchema } from './securityLevelMember'; + +/** A page of items. */ +export const PageBeanSecurityLevelMemberSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(SecurityLevelMemberSchema).optional(), +}); + +export type PageBeanSecurityLevelMember = z.infer; diff --git a/src/version2/schemas/pageBeanSecuritySchemeWithProjects.ts b/src/version2/schemas/pageBeanSecuritySchemeWithProjects.ts new file mode 100644 index 0000000000..852ba589b3 --- /dev/null +++ b/src/version2/schemas/pageBeanSecuritySchemeWithProjects.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { SecuritySchemeWithProjectsSchema } from './securitySchemeWithProjects'; + +/** A page of items. */ +export const PageBeanSecuritySchemeWithProjectsSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(SecuritySchemeWithProjectsSchema).optional(), +}); + +export type PageBeanSecuritySchemeWithProjects = z.infer; diff --git a/src/version2/schemas/pageBeanString.ts b/src/version2/schemas/pageBeanString.ts new file mode 100644 index 0000000000..38e6c5b07b --- /dev/null +++ b/src/version2/schemas/pageBeanString.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +/** A page of items. */ +export const PageBeanStringSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(z.string()).optional(), +}); + +export type PageBeanString = z.infer; diff --git a/src/version2/schemas/pageBeanUiModificationDetails.ts b/src/version2/schemas/pageBeanUiModificationDetails.ts new file mode 100644 index 0000000000..80f152a170 --- /dev/null +++ b/src/version2/schemas/pageBeanUiModificationDetails.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { UiModificationDetailsSchema } from './uiModificationDetails'; + +/** A page of items. */ +export const PageBeanUiModificationDetailsSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(UiModificationDetailsSchema).optional(), +}); + +export type PageBeanUiModificationDetails = z.infer; diff --git a/src/version2/schemas/pageBeanUser.ts b/src/version2/schemas/pageBeanUser.ts new file mode 100644 index 0000000000..e42e8f6615 --- /dev/null +++ b/src/version2/schemas/pageBeanUser.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { UserSchema } from './user'; + +/** A page of items. */ +export const PageBeanUserSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(UserSchema).optional(), +}); + +export type PageBeanUser = z.infer; diff --git a/src/version2/schemas/pageBeanUserDetails.ts b/src/version2/schemas/pageBeanUserDetails.ts new file mode 100644 index 0000000000..08a4f7432d --- /dev/null +++ b/src/version2/schemas/pageBeanUserDetails.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { UserDetailsSchema } from './userDetails'; + +/** A page of items. */ +export const PageBeanUserDetailsSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(UserDetailsSchema).optional(), +}); + +export type PageBeanUserDetails = z.infer; diff --git a/src/version2/schemas/pageBeanUserKey.ts b/src/version2/schemas/pageBeanUserKey.ts new file mode 100644 index 0000000000..dbf216a734 --- /dev/null +++ b/src/version2/schemas/pageBeanUserKey.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { UserKeySchema } from './userKey'; + +/** A page of items. */ +export const PageBeanUserKeySchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(UserKeySchema).optional(), +}); + +export type PageBeanUserKey = z.infer; diff --git a/src/version2/schemas/pageBeanVersion.ts b/src/version2/schemas/pageBeanVersion.ts new file mode 100644 index 0000000000..d63943155a --- /dev/null +++ b/src/version2/schemas/pageBeanVersion.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { VersionSchema } from './version'; + +/** A page of items. */ +export const PageBeanVersionSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(VersionSchema).optional(), +}); + +export type PageBeanVersion = z.infer; diff --git a/src/version2/schemas/pageBeanWebhook.ts b/src/version2/schemas/pageBeanWebhook.ts new file mode 100644 index 0000000000..b8dc025ce5 --- /dev/null +++ b/src/version2/schemas/pageBeanWebhook.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { WebhookSchema } from './webhook'; + +/** A page of items. */ +export const PageBeanWebhookSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(WebhookSchema).optional(), +}); + +export type PageBeanWebhook = z.infer; diff --git a/src/version2/schemas/pageBeanWorkflow.ts b/src/version2/schemas/pageBeanWorkflow.ts new file mode 100644 index 0000000000..30d429d675 --- /dev/null +++ b/src/version2/schemas/pageBeanWorkflow.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { WorkflowSchema } from './workflow'; + +/** A page of items. */ +export const PageBeanWorkflowSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(WorkflowSchema).optional(), +}); + +export type PageBeanWorkflow = z.infer; diff --git a/src/version2/schemas/pageBeanWorkflowScheme.ts b/src/version2/schemas/pageBeanWorkflowScheme.ts new file mode 100644 index 0000000000..3c5c535e09 --- /dev/null +++ b/src/version2/schemas/pageBeanWorkflowScheme.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { WorkflowSchemeSchema } from './workflowScheme'; + +/** A page of items. */ +export const PageBeanWorkflowSchemeSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(WorkflowSchemeSchema).optional(), +}); + +export type PageBeanWorkflowScheme = z.infer; diff --git a/src/version2/schemas/pageBeanWorkflowTransitionRules.ts b/src/version2/schemas/pageBeanWorkflowTransitionRules.ts new file mode 100644 index 0000000000..c560a0ba6b --- /dev/null +++ b/src/version2/schemas/pageBeanWorkflowTransitionRules.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { WorkflowTransitionRulesSchema } from './workflowTransitionRules'; + +/** A page of items. */ +export const PageBeanWorkflowTransitionRulesSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(WorkflowTransitionRulesSchema).optional(), +}); + +export type PageBeanWorkflowTransitionRules = z.infer; diff --git a/src/version2/schemas/pageOfChangelogs.ts b/src/version2/schemas/pageOfChangelogs.ts new file mode 100644 index 0000000000..0ec6326e39 --- /dev/null +++ b/src/version2/schemas/pageOfChangelogs.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { ChangelogSchema } from './changelog'; + +/** A page of changelogs. */ +export const PageOfChangelogsSchema = z.object({ + /** The list of changelogs. */ + histories: z.array(ChangelogSchema).optional(), + /** The maximum number of results that could be on the page. */ + maxResults: z.number().int().optional(), + /** The index of the first item returned on the page. */ + startAt: z.number().int().optional(), + /** The number of results on the page. */ + total: z.number().int().optional(), +}); + +export type PageOfChangelogs = z.infer; diff --git a/src/version2/schemas/pageOfComments.ts b/src/version2/schemas/pageOfComments.ts new file mode 100644 index 0000000000..52a2d80879 --- /dev/null +++ b/src/version2/schemas/pageOfComments.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { CommentSchema } from './comment'; + +/** A page of comments. */ +export const PageOfCommentsSchema = z.object({ + /** The list of comments. */ + comments: z.array(CommentSchema).optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The number of items returned. */ + total: z.number().int().optional(), +}); + +export type PageOfComments = z.infer; diff --git a/src/version2/schemas/pageOfCreateMetaIssueTypeWithField.ts b/src/version2/schemas/pageOfCreateMetaIssueTypeWithField.ts new file mode 100644 index 0000000000..7a34cb396b --- /dev/null +++ b/src/version2/schemas/pageOfCreateMetaIssueTypeWithField.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; +import { FieldCreateMetadataSchema } from './fieldCreateMetadata'; + +/** A page of CreateMetaIssueType with Field. */ +export const PageOfCreateMetaIssueTypeWithFieldSchema = z.object({ + /** The collection of FieldCreateMetaBeans. */ + fields: z.array(FieldCreateMetadataSchema).optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + results: z.array(FieldCreateMetadataSchema).optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The total number of items in all pages. */ + total: z.number().int().optional(), +}); + +export type PageOfCreateMetaIssueTypeWithField = z.infer; diff --git a/src/version2/schemas/pageOfCreateMetaIssueTypes.ts b/src/version2/schemas/pageOfCreateMetaIssueTypes.ts new file mode 100644 index 0000000000..3b05a2b4a5 --- /dev/null +++ b/src/version2/schemas/pageOfCreateMetaIssueTypes.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; +import { IssueTypeIssueCreateMetadataSchema } from './issueTypeIssueCreateMetadata'; + +/** A page of CreateMetaIssueTypes. */ +export const PageOfCreateMetaIssueTypesSchema = z.object({ + createMetaIssueType: z.array(IssueTypeIssueCreateMetadataSchema).optional(), + /** The list of CreateMetaIssueType. */ + issueTypes: z.array(IssueTypeIssueCreateMetadataSchema).optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** The total number of items in all pages. */ + total: z.number().int().optional(), +}); + +export type PageOfCreateMetaIssueTypes = z.infer; diff --git a/src/version2/schemas/pageOfDashboards.ts b/src/version2/schemas/pageOfDashboards.ts new file mode 100644 index 0000000000..2b4a60f420 --- /dev/null +++ b/src/version2/schemas/pageOfDashboards.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; +import { DashboardSchema } from './dashboard'; + +/** A page containing dashboard details. */ +export const PageOfDashboardsSchema = z.object({ + /** List of dashboards. */ + dashboards: z.array(DashboardSchema).optional(), + /** The maximum number of results that could be on the page. */ + maxResults: z.number().int().optional(), + /** The URL of the next page of results, if any. */ + next: z.string().optional(), + /** The URL of the previous page of results, if any. */ + prev: z.string().optional(), + /** The index of the first item returned on the page. */ + startAt: z.number().int().optional(), + /** The number of results on the page. */ + total: z.number().int().optional(), +}); + +export type PageOfDashboards = z.infer; diff --git a/src/version2/schemas/pageOfStatuses.ts b/src/version2/schemas/pageOfStatuses.ts new file mode 100644 index 0000000000..39133aa64e --- /dev/null +++ b/src/version2/schemas/pageOfStatuses.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; +import { JiraStatusSchema } from './jiraStatus'; + +export const PageOfStatusesSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** The URL of the next page of results, if any. */ + nextPage: z.string().optional(), + /** The URL of this page. */ + self: z.string().optional(), + /** The index of the first item returned on the page. */ + startAt: z.number().int().optional(), + /** Number of items that satisfy the search. */ + total: z.number().int().optional(), + /** The list of items. */ + values: z.array(JiraStatusSchema).optional(), +}); + +export type PageOfStatuses = z.infer; diff --git a/src/version2/schemas/pageOfWorklogs.ts b/src/version2/schemas/pageOfWorklogs.ts new file mode 100644 index 0000000000..f5d35463cf --- /dev/null +++ b/src/version2/schemas/pageOfWorklogs.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { WorklogSchema } from './worklog'; + +/** Paginated list of worklog details */ +export const PageOfWorklogsSchema = z.object({ + /** The maximum number of results that could be on the page. */ + maxResults: z.number().int().optional(), + /** The index of the first item returned on the page. */ + startAt: z.number().int().optional(), + /** The number of results on the page. */ + total: z.number().int().optional(), + /** List of worklogs. */ + worklogs: z.array(WorklogSchema).optional(), +}); + +export type PageOfWorklogs = z.infer; diff --git a/src/version2/schemas/pageWithCursorGetPlanResponseForPage.ts b/src/version2/schemas/pageWithCursorGetPlanResponseForPage.ts new file mode 100644 index 0000000000..126906f167 --- /dev/null +++ b/src/version2/schemas/pageWithCursorGetPlanResponseForPage.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { GetPlanResponseForPageSchema } from './getPlanResponseForPage'; + +export const PageWithCursorGetPlanResponseForPageSchema = z.object({ + cursor: z.string().optional(), + last: z.boolean().optional(), + nextPageCursor: z.string().optional(), + size: z.number().int().optional(), + total: z.number().int().optional(), + values: z.array(GetPlanResponseForPageSchema).optional(), +}); + +export type PageWithCursorGetPlanResponseForPage = z.infer; diff --git a/src/version2/schemas/pageWithCursorGetTeamResponseForPage.ts b/src/version2/schemas/pageWithCursorGetTeamResponseForPage.ts new file mode 100644 index 0000000000..756d3b59da --- /dev/null +++ b/src/version2/schemas/pageWithCursorGetTeamResponseForPage.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { GetTeamResponseForPageSchema } from './getTeamResponseForPage'; + +export const PageWithCursorGetTeamResponseForPageSchema = z.object({ + cursor: z.string().optional(), + last: z.boolean().optional(), + nextPageCursor: z.string().optional(), + size: z.number().int().optional(), + total: z.number().int().optional(), + values: z.array(GetTeamResponseForPageSchema).optional(), +}); + +export type PageWithCursorGetTeamResponseForPage = z.infer; diff --git a/src/version2/schemas/pagedListUserDetailsApplicationUser.ts b/src/version2/schemas/pagedListUserDetailsApplicationUser.ts new file mode 100644 index 0000000000..0d9f9eb4d5 --- /dev/null +++ b/src/version2/schemas/pagedListUserDetailsApplicationUser.ts @@ -0,0 +1,29 @@ +import { z } from 'zod'; +import { UserDetailsSchema } from './userDetails'; + +/** + * A paged list. To access additional details append `[start-index:end-index]` to the expand request. For example, + * `?expand=sharedUsers[10:40]` returns a list starting at item 10 and finishing at item 40. + */ +export const PagedListUserDetailsApplicationUserSchema = z + .object({ + /** The index of the last item returned on the page. */ + 'end-index': z.number().int().optional(), + /** The list of items. */ + items: z.array(UserDetailsSchema).optional(), + /** The maximum number of results that could be on the page. */ + 'max-results': z.number().int().optional(), + /** The number of items on the page. */ + size: z.number().int().optional(), + /** The index of the first item returned on the page. */ + 'start-index': z.number().int().optional(), + }) + .transform(val => ({ + endIndex: val['end-index'], + items: val['items'], + maxResults: val['max-results'], + size: val['size'], + startIndex: val['start-index'], + })); + +export type PagedListUserDetailsApplicationUser = z.infer; diff --git a/src/version2/schemas/paginatedResponseComment.ts b/src/version2/schemas/paginatedResponseComment.ts new file mode 100644 index 0000000000..334b9ee963 --- /dev/null +++ b/src/version2/schemas/paginatedResponseComment.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { CommentSchema } from './comment'; + +export const PaginatedResponseCommentSchema = z.object({ + maxResults: z.number().int().optional(), + results: z.array(CommentSchema).optional(), + startAt: z.number().int().optional(), + total: z.number().int().optional(), +}); + +export type PaginatedResponseComment = z.infer; diff --git a/src/version2/schemas/paginatedResponseFieldCreateMetadata.ts b/src/version2/schemas/paginatedResponseFieldCreateMetadata.ts new file mode 100644 index 0000000000..05a2eb1d83 --- /dev/null +++ b/src/version2/schemas/paginatedResponseFieldCreateMetadata.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { FieldCreateMetadataSchema } from './fieldCreateMetadata'; + +export const PaginatedResponseFieldCreateMetadataSchema = z.object({ + maxResults: z.number().int().optional(), + results: z.array(FieldCreateMetadataSchema).optional(), + startAt: z.number().int().optional(), + total: z.number().int().optional(), +}); + +export type PaginatedResponseFieldCreateMetadata = z.infer; diff --git a/src/version2/schemas/paginatedResponseIssueTypeIssueCreateMetadata.ts b/src/version2/schemas/paginatedResponseIssueTypeIssueCreateMetadata.ts new file mode 100644 index 0000000000..c3b4c653c4 --- /dev/null +++ b/src/version2/schemas/paginatedResponseIssueTypeIssueCreateMetadata.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { IssueTypeIssueCreateMetadataSchema } from './issueTypeIssueCreateMetadata'; + +export const PaginatedResponseIssueTypeIssueCreateMetadataSchema = z.object({ + maxResults: z.number().int().optional(), + results: z.array(IssueTypeIssueCreateMetadataSchema).optional(), + startAt: z.number().int().optional(), + total: z.number().int().optional(), +}); + +export type PaginatedResponseIssueTypeIssueCreateMetadata = z.infer< + typeof PaginatedResponseIssueTypeIssueCreateMetadataSchema +>; diff --git a/src/version2/schemas/parsedJqlQueries.ts b/src/version2/schemas/parsedJqlQueries.ts new file mode 100644 index 0000000000..eb98723f21 --- /dev/null +++ b/src/version2/schemas/parsedJqlQueries.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { ParsedJqlQuerySchema } from './parsedJqlQuery'; + +/** A list of parsed JQL queries. */ +export const ParsedJqlQueriesSchema = z.object({ + /** A list of parsed JQL queries. */ + queries: z.array(ParsedJqlQuerySchema), +}); + +export type ParsedJqlQueries = z.infer; diff --git a/src/version2/schemas/parsedJqlQuery.ts b/src/version2/schemas/parsedJqlQuery.ts new file mode 100644 index 0000000000..ce2e366d9b --- /dev/null +++ b/src/version2/schemas/parsedJqlQuery.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Details of a parsed JQL query. */ +export const ParsedJqlQuerySchema = z.object({ + /** The list of syntax or validation errors. */ + errors: z.array(z.string()).optional(), + /** The JQL query that was parsed and validated. */ + query: z.string(), + /** The syntax tree of the query. Empty if the query was invalid. */ + structure: z.unknown().optional(), + /** The list of warning messages */ + warnings: z.array(z.string()).optional(), +}); + +export type ParsedJqlQuery = z.infer; diff --git a/src/version2/schemas/permissionDetails.ts b/src/version2/schemas/permissionDetails.ts new file mode 100644 index 0000000000..a9d97157c4 --- /dev/null +++ b/src/version2/schemas/permissionDetails.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { SharePermissionSchema } from './sharePermission'; + +/** Details for permissions of shareable entities */ +export const PermissionDetailsSchema = z.object({ + /** The edit permissions for the shareable entities. */ + editPermissions: z.array(SharePermissionSchema), + /** The share permissions for the shareable entities. */ + sharePermissions: z.array(SharePermissionSchema), +}); + +export type PermissionDetails = z.infer; diff --git a/src/version2/schemas/permissionGrant.ts b/src/version2/schemas/permissionGrant.ts new file mode 100644 index 0000000000..daf61b596e --- /dev/null +++ b/src/version2/schemas/permissionGrant.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; + +/** Details about a permission granted to a user or group. */ +export const PermissionGrantSchema = z.object({ + /** + * The user or group being granted the permission. It consists of a `type`, a type-dependent `parameter` and a + * type-dependent `value`. See [Holder object](../api-group-permission-schemes/#holder-object) in _Get all permission + * schemes_ for more information. + */ + holder: z.unknown().optional(), + /** The ID of the permission granted details. */ + id: z.number().int().optional(), + /** + * The permission to grant. This permission can be one of the built-in permissions or a custom permission added by an + * app. See [Built-in permissions](../api-group-permission-schemes/#built-in-permissions) in _Get all permission + * schemes_ for more information about the built-in permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information about custom permissions. + */ + permission: z.string().optional(), + /** The URL of the permission granted details. */ + self: z.string().optional(), +}); + +export type PermissionGrant = z.infer; diff --git a/src/version2/schemas/permissionGrantDTO.ts b/src/version2/schemas/permissionGrantDTO.ts new file mode 100644 index 0000000000..7f6a936650 --- /dev/null +++ b/src/version2/schemas/permissionGrantDTO.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** List of permission grants */ +export const PermissionGrantDTOSchema = z.object({ + applicationAccess: z.array(z.string()).optional(), + groupCustomFields: z.array(ProjectCreateResourceIdentifierSchema).optional(), + groups: z.array(ProjectCreateResourceIdentifierSchema).optional(), + permissionKeys: z.array(z.string()).optional(), + projectRoles: z.array(ProjectCreateResourceIdentifierSchema).optional(), + specialGrants: z.array(z.string()).optional(), + userCustomFields: z.array(ProjectCreateResourceIdentifierSchema).optional(), + users: z.array(ProjectCreateResourceIdentifierSchema).optional(), +}); + +export type PermissionGrantDTO = z.infer; diff --git a/src/version2/schemas/permissionGrants.ts b/src/version2/schemas/permissionGrants.ts new file mode 100644 index 0000000000..1e112f0d4f --- /dev/null +++ b/src/version2/schemas/permissionGrants.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { PermissionGrantSchema } from './permissionGrant'; + +/** List of permission grants. */ +export const PermissionGrantsSchema = z.object({ + /** Expand options that include additional permission grant details in the response. */ + expand: z.string().optional(), + /** Permission grants list. */ + permissions: z.array(PermissionGrantSchema).optional(), +}); + +export type PermissionGrants = z.infer; diff --git a/src/version2/schemas/permissionHolder.ts b/src/version2/schemas/permissionHolder.ts new file mode 100644 index 0000000000..f96dc50747 --- /dev/null +++ b/src/version2/schemas/permissionHolder.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +/** + * Details of a user, group, field, or project role that holds a permission. See [Holder + * object](../api-group-permission-schemes/#holder-object) in _Get all permission schemes_ for more information. + */ +export const PermissionHolderSchema = z.object({ + /** Expand options that include additional permission holder details in the response. */ + expand: z.string().optional(), + /** + * As a group's name can change, use of `value` is recommended. The identifier associated withthe `type` value that + * defines the holder of the permission. + */ + parameter: z.string().optional(), + /** The type of permission holder. */ + type: z.string(), + /** The identifier associated with the `type` value that defines the holder of the permission. */ + value: z.string().optional(), +}); + +export type PermissionHolder = z.infer; diff --git a/src/version2/schemas/permissionPayloadDTO.ts b/src/version2/schemas/permissionPayloadDTO.ts new file mode 100644 index 0000000000..00ef88cebe --- /dev/null +++ b/src/version2/schemas/permissionPayloadDTO.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; +import { PermissionGrantDTOSchema } from './permissionGrantDTO'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** The payload to create a permission scheme */ +export const PermissionPayloadDTOSchema = z.object({ + /** Configuration to generate addon role. Default is false if null. Only applies to GLOBAL-scoped permission scheme */ + addAddonRole: z.boolean().optional(), + /** The description of the permission scheme */ + description: z.string().optional(), + /** List of permission grants */ + grants: z.array(PermissionGrantDTOSchema).optional(), + /** The name of the permission scheme */ + name: z.string().optional(), + /** + * The strategy to use when there is a conflict with an existing permission scheme. FAIL - Fail execution, this always + * needs to be unique; USE - Use the existing entity and ignore new entity parameters; NEW - If the entity exist, try + * and create a new one with a different name + */ + onConflict: z.enum(['FAIL', 'USE', 'NEW']).optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), +}); + +export type PermissionPayloadDTO = z.infer; diff --git a/src/version2/schemas/permissionScheme.ts b/src/version2/schemas/permissionScheme.ts new file mode 100644 index 0000000000..caab3f4214 --- /dev/null +++ b/src/version2/schemas/permissionScheme.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; +import { PermissionGrantSchema } from './permissionGrant'; + +/** Details of a permission scheme. */ +export const PermissionSchemeSchema = z.object({ + /** A description for the permission scheme. */ + description: z.string().optional(), + /** The expand options available for the permission scheme. */ + expand: z.string().optional(), + /** The ID of the permission scheme. */ + id: z.number().int().optional(), + /** The name of the permission scheme. Must be unique. */ + name: z.string(), + /** + * The permission scheme to create or update. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. + */ + permissions: z.array(PermissionGrantSchema).optional(), + /** The scope of the permission scheme. */ + scope: z.unknown().optional(), + /** The URL of the permission scheme. */ + self: z.string().optional(), +}); + +export type PermissionScheme = z.infer; diff --git a/src/version2/schemas/permissionSchemes.ts b/src/version2/schemas/permissionSchemes.ts new file mode 100644 index 0000000000..d4c006a38c --- /dev/null +++ b/src/version2/schemas/permissionSchemes.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { PermissionSchemeSchema } from './permissionScheme'; + +/** List of all permission schemes. */ +export const PermissionSchemesSchema = z.object({ + /** Permission schemes list. */ + permissionSchemes: z.array(PermissionSchemeSchema).optional(), +}); + +export type PermissionSchemes = z.infer; diff --git a/src/version2/schemas/permissions.ts b/src/version2/schemas/permissions.ts new file mode 100644 index 0000000000..a2b832ad27 --- /dev/null +++ b/src/version2/schemas/permissions.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** Details about permissions. */ +export const PermissionsSchema = z.object({ + /** List of permissions. */ + permissions: z.object({}).optional(), +}); + +export type Permissions = z.infer; diff --git a/src/version2/schemas/permissionsKeysBean.ts b/src/version2/schemas/permissionsKeysBean.ts new file mode 100644 index 0000000000..6d380e739b --- /dev/null +++ b/src/version2/schemas/permissionsKeysBean.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const PermissionsKeysBeanSchema = z.object({ + /** A list of permission keys. */ + permissions: z.array(z.string()), +}); + +export type PermissionsKeysBean = z.infer; diff --git a/src/version2/schemas/permittedProjects.ts b/src/version2/schemas/permittedProjects.ts new file mode 100644 index 0000000000..a5f0a71333 --- /dev/null +++ b/src/version2/schemas/permittedProjects.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { ProjectIdentifierBeanSchema } from './projectIdentifierBean'; + +/** A list of projects in which a user is granted permissions. */ +export const PermittedProjectsSchema = z.object({ + /** A list of projects. */ + projects: z.array(ProjectIdentifierBeanSchema).optional(), +}); + +export type PermittedProjects = z.infer; diff --git a/src/version2/schemas/priority.ts b/src/version2/schemas/priority.ts new file mode 100644 index 0000000000..05a541dd0f --- /dev/null +++ b/src/version2/schemas/priority.ts @@ -0,0 +1,28 @@ +import { z } from 'zod'; + +/** An issue priority. */ +export const PrioritySchema = z.object({ + /** + * The avatarId of the avatar for the issue priority. This parameter is nullable and when set, this avatar references + * the universal avatar APIs. + */ + avatarId: z.number().int().optional(), + /** The description of the issue priority. */ + description: z.string().optional(), + /** The URL of the icon for the issue priority. */ + iconUrl: z.string().optional(), + /** The ID of the issue priority. */ + id: z.string().optional(), + /** Whether this priority is the default. */ + isDefault: z.boolean().optional(), + /** The name of the issue priority. */ + name: z.string().optional(), + /** Priority schemes associated with the issue priority. */ + schemes: z.unknown().optional(), + /** The URL of the issue priority. */ + self: z.string().optional(), + /** The color used to indicate the issue priority. */ + statusColor: z.string().optional(), +}); + +export type Priority = z.infer; diff --git a/src/version2/schemas/priorityId.ts b/src/version2/schemas/priorityId.ts new file mode 100644 index 0000000000..c3d7ccc870 --- /dev/null +++ b/src/version2/schemas/priorityId.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The ID of an issue priority. */ +export const PriorityIdSchema = z.object({ + /** The ID of the issue priority. */ + id: z.string(), +}); + +export type PriorityId = z.infer; diff --git a/src/version2/schemas/priorityMapping.ts b/src/version2/schemas/priorityMapping.ts new file mode 100644 index 0000000000..9e702940f7 --- /dev/null +++ b/src/version2/schemas/priorityMapping.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; + +/** Mapping of issue priorities for changes in priority schemes. */ +export const PriorityMappingSchema = z.object({ + /** + * 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: z.object({}).optional(), + /** + * 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: z.object({}).optional(), +}); + +export type PriorityMapping = z.infer; diff --git a/src/version2/schemas/prioritySchemeChangesWithoutMappings.ts b/src/version2/schemas/prioritySchemeChangesWithoutMappings.ts new file mode 100644 index 0000000000..63f6b09b37 --- /dev/null +++ b/src/version2/schemas/prioritySchemeChangesWithoutMappings.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const PrioritySchemeChangesWithoutMappingsSchema = z.object({ + /** Affected entity ids. */ + ids: z.array(z.number().int()), +}); + +export type PrioritySchemeChangesWithoutMappings = z.infer; diff --git a/src/version2/schemas/prioritySchemeId.ts b/src/version2/schemas/prioritySchemeId.ts new file mode 100644 index 0000000000..7b866cb836 --- /dev/null +++ b/src/version2/schemas/prioritySchemeId.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The ID of a priority scheme. */ +export const PrioritySchemeIdSchema = z.object({ + /** The ID of the priority scheme. */ + id: z.string().optional(), + /** The in-progress issue migration task. */ + task: z.unknown().optional(), +}); + +export type PrioritySchemeId = z.infer; diff --git a/src/version2/schemas/prioritySchemeWithPaginatedPrioritiesAndProjects.ts b/src/version2/schemas/prioritySchemeWithPaginatedPrioritiesAndProjects.ts new file mode 100644 index 0000000000..e839ec3997 --- /dev/null +++ b/src/version2/schemas/prioritySchemeWithPaginatedPrioritiesAndProjects.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; + +/** A priority scheme with paginated priorities and projects. */ +export const PrioritySchemeWithPaginatedPrioritiesAndProjectsSchema = z.object({ + default: z.boolean().optional(), + /** The ID of the default issue priority. */ + defaultPriorityId: z.string().optional(), + /** The description of the priority scheme */ + description: z.string().optional(), + /** The ID of the priority scheme. */ + id: z.string(), + isDefault: z.boolean().optional(), + /** The name of the priority scheme */ + name: z.string(), + /** The paginated list of priorities. */ + priorities: z.unknown().optional(), + /** The paginated list of projects. */ + projects: z.unknown().optional(), + /** The URL of the priority scheme. */ + self: z.string().optional(), +}); + +export type PrioritySchemeWithPaginatedPrioritiesAndProjects = z.infer< + typeof PrioritySchemeWithPaginatedPrioritiesAndProjectsSchema +>; diff --git a/src/version2/schemas/priorityWithSequence.ts b/src/version2/schemas/priorityWithSequence.ts new file mode 100644 index 0000000000..5b5dd9005d --- /dev/null +++ b/src/version2/schemas/priorityWithSequence.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; + +/** An issue priority with sequence information. */ +export const PriorityWithSequenceSchema = z.object({ + /** The description of the issue priority. */ + description: z.string().optional(), + /** The URL of the icon for the issue priority. */ + iconUrl: z.string().optional(), + /** The ID of the issue priority. */ + id: z.string().optional(), + /** Whether this priority is the default. */ + isDefault: z.boolean().optional(), + /** The name of the issue priority. */ + name: z.string().optional(), + /** The URL of the issue priority. */ + self: z.string().optional(), + /** The sequence of the issue priority. */ + sequence: z.string().optional(), + /** The color used to indicate the issue priority. */ + statusColor: z.string().optional(), +}); + +export type PriorityWithSequence = z.infer; diff --git a/src/version2/schemas/project.ts b/src/version2/schemas/project.ts new file mode 100644 index 0000000000..eae09502fe --- /dev/null +++ b/src/version2/schemas/project.ts @@ -0,0 +1,88 @@ +import { z } from 'zod'; +import { ProjectComponentSchema } from './projectComponent'; +import { IssueTypeDetailsSchema } from './issueTypeDetails'; +import { VersionSchema } from './version'; + +/** Details about a project. */ +export const ProjectSchema = z.object({ + /** Whether the project is archived. */ + archived: z.boolean().optional(), + /** The user who archived the project. */ + archivedBy: z.unknown().optional(), + /** The date when the project was archived. */ + archivedDate: z.string().datetime().optional(), + /** The default assignee when creating issues for this project. */ + assigneeType: z.enum(['PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** The URLs of the project's avatars. */ + avatarUrls: z.unknown().optional(), + /** List of the components contained in the project. */ + components: z.array(ProjectComponentSchema).optional(), + /** Whether the project is marked as deleted. */ + deleted: z.boolean().optional(), + /** The user who marked the project as deleted. */ + deletedBy: z.unknown().optional(), + /** The date when the project was marked as deleted. */ + deletedDate: z.string().datetime().optional(), + /** A brief description of the project. */ + description: z.string().optional(), + /** An email address associated with the project. */ + email: z.string().optional(), + /** Expand options that include additional project details in the response. */ + expand: z.string().optional(), + /** Whether the project is selected as a favorite. */ + favourite: z.boolean().optional(), + /** The ID of the project. */ + id: z.string().optional(), + /** Insights about the project. */ + insight: z.unknown().optional(), + /** + * Whether the project is private from the user's perspective. This means the user can't see the project or any + * associated issues. + */ + isPrivate: z.boolean().optional(), + /** The issue type hierarchy for the project. */ + issueTypeHierarchy: z.unknown().optional(), + /** List of the issue types available in the project. */ + issueTypes: z.array(IssueTypeDetailsSchema).optional(), + /** The key of the project. */ + key: z.string().optional(), + /** The project landing page info. */ + landingPageInfo: z.unknown().optional(), + /** The username of the project lead. */ + lead: z.unknown().optional(), + /** The name of the project. */ + name: z.string().optional(), + /** User permissions on the project */ + permissions: z.unknown().optional(), + /** The category the project belongs to. */ + projectCategory: z.unknown().optional(), + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey: z.enum(['software', 'service_desk', 'business']).optional(), + /** Map of project properties */ + properties: z.object({}).optional(), + /** The date when the project is deleted permanently. */ + retentionTillDate: z.string().datetime().optional(), + /** + * The name and self URL for each role defined in the project. For more information, see [Create project + * role](#api-rest-api-2-role-post). + */ + roles: z.object({}).optional(), + /** The URL of the project details. */ + self: z.string().optional(), + /** Whether the project is simplified. */ + simplified: z.boolean().optional(), + /** The type of the project. */ + style: z.enum(['classic', 'next-gen']).optional(), + /** A link to information about this project, such as project documentation. */ + url: z.string().optional(), + /** Unique ID for next-gen projects. */ + uuid: z.string().optional(), + /** The versions defined in the project. For more information, see [Create version](#api-rest-api-2-version-post). */ + versions: z.array(VersionSchema).optional(), +}); + +export type Project = z.infer; diff --git a/src/version2/schemas/projectAndIssueTypePair.ts b/src/version2/schemas/projectAndIssueTypePair.ts new file mode 100644 index 0000000000..b43cef6eb9 --- /dev/null +++ b/src/version2/schemas/projectAndIssueTypePair.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** A project and issueType ID pair that identifies a status mapping. */ +export const ProjectAndIssueTypePairSchema = z.object({ + /** The ID of the issue type. */ + issueTypeId: z.string(), + /** The ID of the project. */ + projectId: z.string(), +}); + +export type ProjectAndIssueTypePair = z.infer; diff --git a/src/version2/schemas/projectArchetype.ts b/src/version2/schemas/projectArchetype.ts new file mode 100644 index 0000000000..7119075185 --- /dev/null +++ b/src/version2/schemas/projectArchetype.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export const ProjectArchetypeSchema = z.object({ + realType: z.enum(['BUSINESS', 'SOFTWARE', 'PRODUCT_DISCOVERY', 'SERVICE_DESK', 'CUSTOMER_SERVICE', 'OPS']).optional(), + style: z.enum(['classic', 'next-gen']).optional(), + type: z.enum(['BUSINESS', 'SOFTWARE', 'PRODUCT_DISCOVERY', 'SERVICE_DESK', 'CUSTOMER_SERVICE', 'OPS']).optional(), +}); + +export type ProjectArchetype = z.infer; diff --git a/src/version2/schemas/projectAvatars.ts b/src/version2/schemas/projectAvatars.ts new file mode 100644 index 0000000000..1b9a4b4d92 --- /dev/null +++ b/src/version2/schemas/projectAvatars.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { AvatarSchema } from './avatar'; + +/** List of project avatars. */ +export const ProjectAvatarsSchema = z.object({ + /** List of avatars added to Jira. These avatars may be deleted. */ + custom: z.array(AvatarSchema).optional(), + /** List of avatars included with Jira. These avatars cannot be deleted. */ + system: z.array(AvatarSchema).optional(), +}); + +export type ProjectAvatars = z.infer; diff --git a/src/version2/schemas/projectCategory.ts b/src/version2/schemas/projectCategory.ts new file mode 100644 index 0000000000..d64f7b1ccc --- /dev/null +++ b/src/version2/schemas/projectCategory.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** A project category. */ +export const ProjectCategorySchema = z.object({ + /** The description of the project category. */ + description: z.string().optional(), + /** The ID of the project category. */ + id: z.string().optional(), + /** The name of the project category. Required on create, optional on update. */ + name: z.string().optional(), + /** The URL of the project category. */ + self: z.string().optional(), +}); + +export type ProjectCategory = z.infer; diff --git a/src/version2/schemas/projectComponent.ts b/src/version2/schemas/projectComponent.ts new file mode 100644 index 0000000000..170c51f044 --- /dev/null +++ b/src/version2/schemas/projectComponent.ts @@ -0,0 +1,79 @@ +import { z } from 'zod'; + +/** Details about a project component. */ +export const ProjectComponentSchema = z.object({ + /** Compass component's ID. Can't be updated. Not required for creating a Project Component. */ + ari: z.string().optional(), + /** + * The details of the user associated with `assigneeType`, if any. See `realAssignee` for details of the user assigned + * to issues created with this component. + */ + assignee: z.unknown().optional(), + /** + * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` + * for details on how the type of the user, and hence the user, assigned to issues is determined. Can take the + * following values: + * + * - `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the + * component is in. + * - `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for the component. + * - `UNASSIGNED` an assignee is not set for issues created with this component. + * - `PROJECT_DEFAULT` the assignee to any issues created with this component is nominally the default assignee for the + * project that the component is in. + * + * Default value: `PROJECT_DEFAULT`. Optional when creating or updating a component. + */ + assigneeType: z.enum(['PROJECT_DEFAULT', 'COMPONENT_LEAD', 'PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** The description for the component. Optional when creating or updating a component. */ + description: z.string().optional(), + /** The unique identifier for the component. */ + id: z.string().optional(), + /** + * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but + * the component lead is not set, then `false` is returned. + */ + isAssigneeTypeValid: z.boolean().optional(), + /** The user details for the component's lead user. */ + lead: z.unknown().optional(), + /** + * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian + * products. For example, _5b10ac8d82e05b22cc7d4ef5_. + */ + leadAccountId: z.string().optional(), + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + leadUserName: z.string().optional(), + /** Compass component's metadata. Can't be updated. Not required for creating a Project Component. */ + metadata: z.object({}).optional(), + /** + * The unique name for the component in the project. Required when creating a component. Optional when updating a + * component. The maximum length is 255 characters. + */ + name: z.string().optional(), + /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ + project: z.string().optional(), + /** The ID of the project the component is assigned to. */ + projectId: z.number().int().optional(), + /** The user assigned to issues created with this component, when `assigneeType` does not identify a valid assignee. */ + realAssignee: z.unknown().optional(), + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set + * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This + * property is set to one of the following values: + * + * - `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in + * the project that the component is in. + * - `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component lead has permission to be assigned + * issues in the project that the component is in. + * - `UNASSIGNED` when `assigneeType` is `UNASSIGNED` and Jira is configured to allow unassigned issues. + * - `PROJECT_DEFAULT` when none of the preceding cases are true. + */ + realAssigneeType: z.enum(['PROJECT_DEFAULT', 'COMPONENT_LEAD', 'PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** The URL of the component. */ + self: z.string().optional(), +}); + +export type ProjectComponent = z.infer; diff --git a/src/version2/schemas/projectCreateResourceIdentifier.ts b/src/version2/schemas/projectCreateResourceIdentifier.ts new file mode 100644 index 0000000000..924f1ef68d --- /dev/null +++ b/src/version2/schemas/projectCreateResourceIdentifier.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +/** + * Every project-created entity has an ID that must be unique within the scope of the project creation. PCRI (Project + * Create Resource Identifier) is a standard format for creating IDs and references to other project entities. PCRI + * format is defined as follows: pcri:[entityType]:[type]:[entityId] entityType - the type of an entity, e.g. status, + * role, workflow type - PCRI type, either `id` - The ID of an entity that already exists in the target site, or `ref` - + * A unique reference to an entity that is being created entityId - entity identifier, if type is `id` - must be an + * existing entity ID that exists in the Jira site, if `ref` - must be unique across all entities in the scope of this + * project template creation + */ +export const ProjectCreateResourceIdentifierSchema = z.object({ + anID: z.boolean().optional(), + areference: z.boolean().optional(), + entityId: z.string().optional(), + entityType: z.string().optional(), + id: z.string().optional(), + type: z.enum(['id', 'ref']).optional(), +}); + +export type ProjectCreateResourceIdentifier = z.infer; diff --git a/src/version2/schemas/projectCustomTemplateCreateRequestDTO.ts b/src/version2/schemas/projectCustomTemplateCreateRequestDTO.ts new file mode 100644 index 0000000000..698a28d9ef --- /dev/null +++ b/src/version2/schemas/projectCustomTemplateCreateRequestDTO.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { CustomTemplatesProjectDetailsSchema } from './customTemplatesProjectDetails'; +import { CustomTemplateRequestDTOSchema } from './customTemplateRequestDTO'; + +/** Request to create a project using a custom template */ +export const ProjectCustomTemplateCreateRequestDTOSchema = z.object({ + details: CustomTemplatesProjectDetailsSchema.optional(), + template: CustomTemplateRequestDTOSchema.optional(), +}); + +export type ProjectCustomTemplateCreateRequestDTO = z.infer; diff --git a/src/version2/schemas/projectDataPolicies.ts b/src/version2/schemas/projectDataPolicies.ts new file mode 100644 index 0000000000..5251de306f --- /dev/null +++ b/src/version2/schemas/projectDataPolicies.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { ProjectWithDataPolicySchema } from './projectWithDataPolicy'; + +/** Details about data policies for a list of projects. */ +export const ProjectDataPoliciesSchema = z.object({ + /** List of projects with data policies. */ + projectDataPolicies: z.array(ProjectWithDataPolicySchema).optional(), +}); + +export type ProjectDataPolicies = z.infer; diff --git a/src/version2/schemas/projectDataPolicy.ts b/src/version2/schemas/projectDataPolicy.ts new file mode 100644 index 0000000000..91e3b6d0f9 --- /dev/null +++ b/src/version2/schemas/projectDataPolicy.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** Details about data policy. */ +export const ProjectDataPolicySchema = z.object({ + /** Whether the project contains any content inaccessible to the requesting application. */ + anyContentBlocked: z.boolean().optional(), +}); + +export type ProjectDataPolicy = z.infer; diff --git a/src/version2/schemas/projectDetails.ts b/src/version2/schemas/projectDetails.ts new file mode 100644 index 0000000000..9f8f9710f0 --- /dev/null +++ b/src/version2/schemas/projectDetails.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +/** Details about a project. */ +export const ProjectDetailsSchema = z.object({ + /** The URLs of the project's avatars. */ + avatarUrls: z.unknown().optional(), + /** The ID of the project. */ + id: z.string().optional(), + /** The key of the project. */ + key: z.string().optional(), + /** The name of the project. */ + name: z.string().optional(), + /** The category the project belongs to. */ + projectCategory: z.unknown().optional(), + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey: z.enum(['software', 'service_desk', 'business']).optional(), + /** The URL of the project details. */ + self: z.string().optional(), + /** Whether or not the project is simplified. */ + simplified: z.boolean().optional(), +}); + +export type ProjectDetails = z.infer; diff --git a/src/version2/schemas/projectEmailAddress.ts b/src/version2/schemas/projectEmailAddress.ts new file mode 100644 index 0000000000..685b2861a3 --- /dev/null +++ b/src/version2/schemas/projectEmailAddress.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** A project's sender email address. */ +export const ProjectEmailAddressSchema = z.object({ + /** The email address. */ + emailAddress: z.string().optional(), + /** When using a custom domain, the status of the email address. */ + emailAddressStatus: z.array(z.string()).optional(), +}); + +export type ProjectEmailAddress = z.infer; diff --git a/src/version2/schemas/projectFeature.ts b/src/version2/schemas/projectFeature.ts new file mode 100644 index 0000000000..548057ca74 --- /dev/null +++ b/src/version2/schemas/projectFeature.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; + +/** Details of a project feature. */ +export const ProjectFeatureSchema = z.object({ + /** The key of the feature. */ + feature: z.string().optional(), + /** URI for the image representing the feature. */ + imageUri: z.string().optional(), + /** Localized display description for the feature. */ + localisedDescription: z.string().optional(), + /** Localized display name for the feature. */ + localisedName: z.string().optional(), + /** List of keys of the features required to enable the feature. */ + prerequisites: z.array(z.string()).optional(), + /** The ID of the project. */ + projectId: z.number().int().optional(), + /** + * The state of the feature. When updating the state of a feature, only ENABLED and DISABLED are supported. Responses + * can contain all values + */ + state: z.enum(['ENABLED', 'DISABLED', 'COMING_SOON']).optional(), + /** Whether the state of the feature can be updated. */ + toggleLocked: z.boolean().optional(), +}); + +export type ProjectFeature = z.infer; diff --git a/src/version2/schemas/projectFeatureState.ts b/src/version2/schemas/projectFeatureState.ts new file mode 100644 index 0000000000..e199e783ef --- /dev/null +++ b/src/version2/schemas/projectFeatureState.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** Details of the feature state. */ +export const ProjectFeatureStateSchema = z.object({ + /** The feature state. */ + state: z.enum(['ENABLED', 'DISABLED', 'COMING_SOON']).optional(), +}); + +export type ProjectFeatureState = z.infer; diff --git a/src/version2/schemas/projectId.ts b/src/version2/schemas/projectId.ts new file mode 100644 index 0000000000..487cdc6d56 --- /dev/null +++ b/src/version2/schemas/projectId.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** Project ID details. */ +export const ProjectIdSchema = z.object({ + /** The ID of the project. */ + id: z.string(), +}); + +export type ProjectId = z.infer; diff --git a/src/version2/schemas/projectIdAssociationContext.ts b/src/version2/schemas/projectIdAssociationContext.ts new file mode 100644 index 0000000000..61d66f3b20 --- /dev/null +++ b/src/version2/schemas/projectIdAssociationContext.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const ProjectIdAssociationContextSchema = z.object({}); + +export type ProjectIdAssociationContext = z.infer; diff --git a/src/version2/schemas/projectIdentifierBean.ts b/src/version2/schemas/projectIdentifierBean.ts new file mode 100644 index 0000000000..ce6ef82613 --- /dev/null +++ b/src/version2/schemas/projectIdentifierBean.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The identifiers for a project. */ +export const ProjectIdentifierBeanSchema = z.object({ + /** The ID of the project. */ + id: z.number().int().optional(), + /** The key of the project. */ + key: z.string().optional(), +}); + +export type ProjectIdentifierBean = z.infer; diff --git a/src/version2/schemas/projectIdentifiers.ts b/src/version2/schemas/projectIdentifiers.ts new file mode 100644 index 0000000000..c81366dc0a --- /dev/null +++ b/src/version2/schemas/projectIdentifiers.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Identifiers for a project. */ +export const ProjectIdentifiersSchema = z.object({ + /** The ID of the created project. */ + id: z.number().int(), + /** The key of the created project. */ + key: z.string(), + /** The URL of the created project. */ + self: z.string(), +}); + +export type ProjectIdentifiers = z.infer; diff --git a/src/version2/schemas/projectIds.ts b/src/version2/schemas/projectIds.ts new file mode 100644 index 0000000000..3dbd67b9c4 --- /dev/null +++ b/src/version2/schemas/projectIds.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** A list of project IDs. */ +export const ProjectIdsSchema = z.object({ + /** The IDs of projects. */ + projectIds: z.array(z.string()), +}); + +export type ProjectIds = z.infer; diff --git a/src/version2/schemas/projectInsight.ts b/src/version2/schemas/projectInsight.ts new file mode 100644 index 0000000000..fc0940fcd4 --- /dev/null +++ b/src/version2/schemas/projectInsight.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Additional details about a project. */ +export const ProjectInsightSchema = z.object({ + /** The last issue update time. */ + lastIssueUpdateTime: z.string().datetime().optional(), + /** Total issue count. */ + totalIssueCount: z.number().int().optional(), +}); + +export type ProjectInsight = z.infer; diff --git a/src/version2/schemas/projectIssueCreateMetadata.ts b/src/version2/schemas/projectIssueCreateMetadata.ts new file mode 100644 index 0000000000..cbc34a0a9b --- /dev/null +++ b/src/version2/schemas/projectIssueCreateMetadata.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { IssueTypeIssueCreateMetadataSchema } from './issueTypeIssueCreateMetadata'; + +/** Details of the issue creation metadata for a project. */ +export const ProjectIssueCreateMetadataSchema = z.object({ + /** List of the project's avatars, returning the avatar size and associated URL. */ + avatarUrls: z.unknown().optional(), + /** Expand options that include additional project issue create metadata details in the response. */ + expand: z.string().optional(), + /** The ID of the project. */ + id: z.string().optional(), + /** List of the issue types supported by the project. */ + issuetypes: z.array(IssueTypeIssueCreateMetadataSchema).optional(), + /** The key of the project. */ + key: z.string().optional(), + /** The name of the project. */ + name: z.string().optional(), + /** The URL of the project. */ + self: z.string().optional(), +}); + +export type ProjectIssueCreateMetadata = z.infer; diff --git a/src/version2/schemas/projectIssueSecurityLevels.ts b/src/version2/schemas/projectIssueSecurityLevels.ts new file mode 100644 index 0000000000..f98009d143 --- /dev/null +++ b/src/version2/schemas/projectIssueSecurityLevels.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { SecurityLevelSchema } from './securityLevel'; + +/** List of issue level security items in a project. */ +export const ProjectIssueSecurityLevelsSchema = z.object({ + /** Issue level security items list. */ + levels: z.array(SecurityLevelSchema), +}); + +export type ProjectIssueSecurityLevels = z.infer; diff --git a/src/version2/schemas/projectIssueTypeHierarchy.ts b/src/version2/schemas/projectIssueTypeHierarchy.ts new file mode 100644 index 0000000000..1904af6d51 --- /dev/null +++ b/src/version2/schemas/projectIssueTypeHierarchy.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { ProjectIssueTypesHierarchyLevelSchema } from './projectIssueTypesHierarchyLevel'; + +/** The hierarchy of issue types within a project. */ +export const ProjectIssueTypeHierarchySchema = z.object({ + /** Details of an issue type hierarchy level. */ + hierarchy: z.array(ProjectIssueTypesHierarchyLevelSchema).optional(), + /** The ID of the project. */ + projectId: z.number().int().optional(), +}); + +export type ProjectIssueTypeHierarchy = z.infer; diff --git a/src/version2/schemas/projectIssueTypeMapping.ts b/src/version2/schemas/projectIssueTypeMapping.ts new file mode 100644 index 0000000000..edea564d5d --- /dev/null +++ b/src/version2/schemas/projectIssueTypeMapping.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The project and issue type mapping. */ +export const ProjectIssueTypeMappingSchema = z.object({ + /** The ID of the issue type. */ + issueTypeId: z.string(), + /** The ID of the project. */ + projectId: z.string(), +}); + +export type ProjectIssueTypeMapping = z.infer; diff --git a/src/version2/schemas/projectIssueTypeMappings.ts b/src/version2/schemas/projectIssueTypeMappings.ts new file mode 100644 index 0000000000..de1d7de46e --- /dev/null +++ b/src/version2/schemas/projectIssueTypeMappings.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { ProjectIssueTypeMappingSchema } from './projectIssueTypeMapping'; + +/** The project and issue type mappings. */ +export const ProjectIssueTypeMappingsSchema = z.object({ + /** The project and issue type mappings. */ + mappings: z.array(ProjectIssueTypeMappingSchema), +}); + +export type ProjectIssueTypeMappings = z.infer; diff --git a/src/version2/schemas/projectIssueTypesHierarchyLevel.ts b/src/version2/schemas/projectIssueTypesHierarchyLevel.ts new file mode 100644 index 0000000000..250410c5c7 --- /dev/null +++ b/src/version2/schemas/projectIssueTypesHierarchyLevel.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; +import { IssueTypeInfoSchema } from './issueTypeInfo'; + +/** Details of an issue type hierarchy level. */ +export const ProjectIssueTypesHierarchyLevelSchema = z.object({ + /** + * The ID of the issue type 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/). + */ + entityId: z.string().optional(), + /** The list of issue types in the hierarchy level. */ + issueTypes: z.array(IssueTypeInfoSchema).optional(), + /** The level of the issue type hierarchy level. */ + level: z.number().int().optional(), + /** The name of the issue type hierarchy level. */ + name: z.string().optional(), +}); + +export type ProjectIssueTypesHierarchyLevel = z.infer; diff --git a/src/version2/schemas/projectLandingPageInfo.ts b/src/version2/schemas/projectLandingPageInfo.ts new file mode 100644 index 0000000000..a31046f7ab --- /dev/null +++ b/src/version2/schemas/projectLandingPageInfo.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const ProjectLandingPageInfoSchema = z.object({ + attributes: z.object({}).optional(), + boardId: z.number().int().optional(), + boardName: z.string().optional(), + projectKey: z.string().optional(), + projectType: z.string().optional(), + queueCategory: z.string().optional(), + queueId: z.number().int().optional(), + queueName: z.string().optional(), + simpleBoard: z.boolean().optional(), + simplified: z.boolean().optional(), + url: z.string().optional(), +}); + +export type ProjectLandingPageInfo = z.infer; diff --git a/src/version2/schemas/projectPayload.ts b/src/version2/schemas/projectPayload.ts new file mode 100644 index 0000000000..7d96baa9dd --- /dev/null +++ b/src/version2/schemas/projectPayload.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** The payload for creating a project */ +export const ProjectPayloadSchema = z.object({ + fieldLayoutSchemeId: ProjectCreateResourceIdentifierSchema.optional(), + issueSecuritySchemeId: ProjectCreateResourceIdentifierSchema.optional(), + issueTypeSchemeId: ProjectCreateResourceIdentifierSchema.optional(), + issueTypeScreenSchemeId: ProjectCreateResourceIdentifierSchema.optional(), + notificationSchemeId: ProjectCreateResourceIdentifierSchema.optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), + permissionSchemeId: ProjectCreateResourceIdentifierSchema.optional(), + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes), which + * defines the application-specific feature set. If you don't specify the project template you have to specify the + * project type. + */ + projectTypeKey: z.enum(['software', 'business', 'service_desk', 'product_discovery']).optional(), + workflowSchemeId: ProjectCreateResourceIdentifierSchema.optional(), +}); + +export type ProjectPayload = z.infer; diff --git a/src/version2/schemas/projectPermissions.ts b/src/version2/schemas/projectPermissions.ts new file mode 100644 index 0000000000..5403a1ca8f --- /dev/null +++ b/src/version2/schemas/projectPermissions.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** Permissions which a user has on a project. */ +export const ProjectPermissionsSchema = z.object({ + /** Whether the logged user can edit the project. */ + canEdit: z.boolean().optional(), +}); + +export type ProjectPermissions = z.infer; diff --git a/src/version2/schemas/projectRole.ts b/src/version2/schemas/projectRole.ts new file mode 100644 index 0000000000..8ce0177c05 --- /dev/null +++ b/src/version2/schemas/projectRole.ts @@ -0,0 +1,33 @@ +import { z } from 'zod'; +import { RoleActorSchema } from './roleActor'; + +/** Details about the roles in a project. */ +export const ProjectRoleSchema = z.object({ + /** The list of users who act in this role. */ + actors: z.array(RoleActorSchema).optional(), + /** Whether this role is the admin role for the project. */ + admin: z.boolean().optional(), + /** Whether the calling user is part of this role. */ + currentUserRole: z.boolean().optional(), + /** Whether this role is the default role for the project */ + default: z.boolean().optional(), + /** The description of the project role. */ + description: z.string().optional(), + /** The ID of the project role. */ + id: z.number().int().optional(), + /** The name of the project role. */ + name: z.string().optional(), + /** Whether the roles are configurable for this project. */ + roleConfigurable: z.boolean().optional(), + /** + * The scope of the role. Indicated for roles associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ + scope: z.unknown().optional(), + /** The URL the project role details. */ + self: z.string().optional(), + /** The translated name of the project role. */ + translatedName: z.string().optional(), +}); + +export type ProjectRole = z.infer; diff --git a/src/version2/schemas/projectRoleActorsUpdateBean.ts b/src/version2/schemas/projectRoleActorsUpdateBean.ts new file mode 100644 index 0000000000..4893d37570 --- /dev/null +++ b/src/version2/schemas/projectRoleActorsUpdateBean.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; + +export const ProjectRoleActorsUpdateBeanSchema = z.object({ + /** + * The actors to add to the project role. + * + * Add groups using: + * + * - `atlassian-group-role-actor` and a list of group names. + * - `atlassian-group-role-actor-id` and a list of group IDs. + * + * As a group's name can change, use of `atlassian-group-role-actor-id` is recommended. For example, + * `"atlassian-group-role-actor-id":["eef79f81-0b89-4fca-a736-4be531a10869","77f6ab39-e755-4570-a6ae-2d7a8df0bcb8"]`. + * + * Add users using `atlassian-user-role-actor` and a list of account IDs. For example, + * `"atlassian-user-role-actor":["12345678-9abc-def1-2345-6789abcdef12", "abcdef12-3456-789a-bcde-f123456789ab"]`. + */ + categorisedActors: z.object({}).optional(), + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: z.number().int().optional(), +}); + +export type ProjectRoleActorsUpdateBean = z.infer; diff --git a/src/version2/schemas/projectRoleDetails.ts b/src/version2/schemas/projectRoleDetails.ts new file mode 100644 index 0000000000..fa6f6b533a --- /dev/null +++ b/src/version2/schemas/projectRoleDetails.ts @@ -0,0 +1,28 @@ +import { z } from 'zod'; + +/** Details about a project role. */ +export const ProjectRoleDetailsSchema = z.object({ + /** Whether this role is the admin role for the project. */ + admin: z.boolean().optional(), + /** Whether this role is the default role for the project. */ + default: z.boolean().optional(), + /** The description of the project role. */ + description: z.string().optional(), + /** The ID of the project role. */ + id: z.number().int().optional(), + /** The name of the project role. */ + name: z.string().optional(), + /** Whether the roles are configurable for this project. */ + roleConfigurable: z.boolean().optional(), + /** + * The scope of the role. Indicated for roles associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ + scope: z.unknown().optional(), + /** The URL the project role details. */ + self: z.string().optional(), + /** The translated name of the project role. */ + translatedName: z.string().optional(), +}); + +export type ProjectRoleDetails = z.infer; diff --git a/src/version2/schemas/projectRoleGroup.ts b/src/version2/schemas/projectRoleGroup.ts new file mode 100644 index 0000000000..bd533b5e36 --- /dev/null +++ b/src/version2/schemas/projectRoleGroup.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of the group associated with the role. */ +export const ProjectRoleGroupSchema = z.object({ + /** The display name of the group. */ + displayName: z.string().optional(), + /** The ID of the group. */ + groupId: z.string().optional(), + /** The name of the group. As a group's name can change, use of `groupId` is recommended to identify the group. */ + name: z.string().optional(), +}); + +export type ProjectRoleGroup = z.infer; diff --git a/src/version2/schemas/projectRoleUser.ts b/src/version2/schemas/projectRoleUser.ts new file mode 100644 index 0000000000..535b0f6a0d --- /dev/null +++ b/src/version2/schemas/projectRoleUser.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of the user associated with the role. */ +export const ProjectRoleUserSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. Returns _unknown_ if the record is deleted and corrupted, for example, as the result of + * a server import. + */ + accountId: z.string().optional(), +}); + +export type ProjectRoleUser = z.infer; diff --git a/src/version2/schemas/projectScopeBean.ts b/src/version2/schemas/projectScopeBean.ts new file mode 100644 index 0000000000..5397d5a5a0 --- /dev/null +++ b/src/version2/schemas/projectScopeBean.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const ProjectScopeBeanSchema = z.object({ + /** + * Defines the behavior of the option in the project.If notSelectable is set, the option cannot be set as the field's + * value. This is useful for archiving an option that has previously been selected but shouldn't be used anymore.If + * defaultValue is set, the option is selected by default. + */ + attributes: z.array(z.enum(['notSelectable', 'defaultValue'])).optional(), + /** The ID of the project that the option's behavior applies to. */ + id: z.number().int().optional(), +}); + +export type ProjectScopeBean = z.infer; diff --git a/src/version2/schemas/projectTemplateKey.ts b/src/version2/schemas/projectTemplateKey.ts new file mode 100644 index 0000000000..df00db0601 --- /dev/null +++ b/src/version2/schemas/projectTemplateKey.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const ProjectTemplateKeySchema = z.object({ + key: z.string().optional(), + uuid: z.string().optional(), +}); + +export type ProjectTemplateKey = z.infer; diff --git a/src/version2/schemas/projectTemplateModel.ts b/src/version2/schemas/projectTemplateModel.ts new file mode 100644 index 0000000000..c18f25e81b --- /dev/null +++ b/src/version2/schemas/projectTemplateModel.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { ProjectArchetypeSchema } from './projectArchetype'; +import { ProjectTemplateKeySchema } from './projectTemplateKey'; +import { CustomTemplateOptionsSchema } from './customTemplateOptions'; + +export const ProjectTemplateModelSchema = z.object({ + archetype: ProjectArchetypeSchema.optional(), + defaultBoardView: z.string().optional(), + description: z.string().optional(), + liveTemplateProjectIdReference: z.number().int().optional(), + name: z.string().optional(), + projectTemplateKey: ProjectTemplateKeySchema.optional(), + snapshotTemplate: z.object({}).optional(), + templateGenerationOptions: CustomTemplateOptionsSchema.optional(), + type: z.enum(['LIVE', 'SNAPSHOT']).optional(), +}); + +export type ProjectTemplateModel = z.infer; diff --git a/src/version2/schemas/projectType.ts b/src/version2/schemas/projectType.ts new file mode 100644 index 0000000000..5220668b53 --- /dev/null +++ b/src/version2/schemas/projectType.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details about a project type. */ +export const ProjectTypeSchema = z.object({ + /** The color of the project type. */ + color: z.string().optional(), + /** The key of the project type's description. */ + descriptionI18nKey: z.string().optional(), + /** The formatted key of the project type. */ + formattedKey: z.string().optional(), + /** The icon of the project type. */ + icon: z.string().optional(), + /** The key of the project type. */ + key: z.string().optional(), +}); + +export type ProjectType = z.infer; diff --git a/src/version2/schemas/projectUsage.ts b/src/version2/schemas/projectUsage.ts new file mode 100644 index 0000000000..2ca88312af --- /dev/null +++ b/src/version2/schemas/projectUsage.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The project. */ +export const ProjectUsageSchema = z.object({ + /** The project ID. */ + id: z.string().optional(), +}); + +export type ProjectUsage = z.infer; diff --git a/src/version2/schemas/projectUsagePage.ts b/src/version2/schemas/projectUsagePage.ts new file mode 100644 index 0000000000..b3e57ca0d2 --- /dev/null +++ b/src/version2/schemas/projectUsagePage.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { ProjectUsageSchema } from './projectUsage'; + +/** A page of projects. */ +export const ProjectUsagePageSchema = z.object({ + /** Page token for the next page of project usages. */ + nextPageToken: z.string().optional(), + /** The list of projects. */ + values: z.array(ProjectUsageSchema).optional(), +}); + +export type ProjectUsagePage = z.infer; diff --git a/src/version2/schemas/projectWithDataPolicy.ts b/src/version2/schemas/projectWithDataPolicy.ts new file mode 100644 index 0000000000..e5726f9f1d --- /dev/null +++ b/src/version2/schemas/projectWithDataPolicy.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details about data policies for a project. */ +export const ProjectWithDataPolicySchema = z.object({ + /** Data policy. */ + dataPolicy: z.unknown().optional(), + /** The project ID. */ + id: z.number().int().optional(), +}); + +export type ProjectWithDataPolicy = z.infer; diff --git a/src/version2/schemas/propertyKey.ts b/src/version2/schemas/propertyKey.ts new file mode 100644 index 0000000000..f7635cf417 --- /dev/null +++ b/src/version2/schemas/propertyKey.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Property key details. */ +export const PropertyKeySchema = z.object({ + /** The key of the property. */ + key: z.string().optional(), + /** The URL of the property. */ + self: z.string().optional(), +}); + +export type PropertyKey = z.infer; diff --git a/src/version2/schemas/propertyKeys.ts b/src/version2/schemas/propertyKeys.ts new file mode 100644 index 0000000000..c0881eb48a --- /dev/null +++ b/src/version2/schemas/propertyKeys.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { PropertyKeySchema } from './propertyKey'; + +/** List of property keys. */ +export const PropertyKeysSchema = z.object({ + /** Property key details. */ + keys: z.array(PropertyKeySchema).optional(), +}); + +export type PropertyKeys = z.infer; diff --git a/src/version2/schemas/publishDraftWorkflowScheme.ts b/src/version2/schemas/publishDraftWorkflowScheme.ts new file mode 100644 index 0000000000..d93bcaad1c --- /dev/null +++ b/src/version2/schemas/publishDraftWorkflowScheme.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { StatusMappingSchema } from './statusMapping'; + +/** Details about the status mappings for publishing a draft workflow scheme. */ +export const PublishDraftWorkflowSchemeSchema = z.object({ + /** Mappings of statuses to new statuses for issue types. */ + statusMappings: z.array(StatusMappingSchema).optional(), +}); + +export type PublishDraftWorkflowScheme = z.infer; diff --git a/src/version2/schemas/publishedWorkflowId.ts b/src/version2/schemas/publishedWorkflowId.ts new file mode 100644 index 0000000000..ea25e10009 --- /dev/null +++ b/src/version2/schemas/publishedWorkflowId.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Properties that identify a published workflow. */ +export const PublishedWorkflowIdSchema = z.object({ + /** The entity ID of the workflow. */ + entityId: z.string().optional(), + /** The name of the workflow. */ + name: z.string(), +}); + +export type PublishedWorkflowId = z.infer; diff --git a/src/version2/schemas/quickFilterPayload.ts b/src/version2/schemas/quickFilterPayload.ts new file mode 100644 index 0000000000..7c6ec1b862 --- /dev/null +++ b/src/version2/schemas/quickFilterPayload.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The payload for defining quick filters */ +export const QuickFilterPayloadSchema = z.object({ + /** The description of the quick filter */ + description: z.string().optional(), + /** The jql query for the quick filter */ + jqlQuery: z.string().optional(), + /** The name of the quick filter */ + name: z.string().optional(), +}); + +export type QuickFilterPayload = z.infer; diff --git a/src/version2/schemas/redactionJobStatusResponse.ts b/src/version2/schemas/redactionJobStatusResponse.ts new file mode 100644 index 0000000000..81cb84148c --- /dev/null +++ b/src/version2/schemas/redactionJobStatusResponse.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { BulkRedactionResponseSchema } from './bulkRedactionResponse'; + +export const RedactionJobStatusResponseSchema = z.object({ + bulkRedactionResponse: BulkRedactionResponseSchema.optional(), + jobStatus: z.enum(['PENDING', 'IN_PROGRESS', 'COMPLETED']).optional(), +}); + +export type RedactionJobStatusResponse = z.infer; diff --git a/src/version2/schemas/redactionPosition.ts b/src/version2/schemas/redactionPosition.ts new file mode 100644 index 0000000000..9f2dec188a --- /dev/null +++ b/src/version2/schemas/redactionPosition.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +/** Represents the position of the redaction */ +export const RedactionPositionSchema = z.object({ + /** + * The ADF pointer indicating the position of the text to be redacted. This is only required when redacting from rich + * text(ADF) fields. For plain text fields, this field can be omitted. + */ + adfPointer: z.string().optional(), + /** The text which will be redacted, encoded using SHA256 hash and Base64 digest */ + expectedText: z.string(), + /** The start index(inclusive) for the redaction in specified content */ + from: z.number().int(), + /** The ending index(exclusive) for the redaction in specified content */ + to: z.number().int(), +}); + +export type RedactionPosition = z.infer; diff --git a/src/version2/schemas/registeredWebhook.ts b/src/version2/schemas/registeredWebhook.ts new file mode 100644 index 0000000000..8421189647 --- /dev/null +++ b/src/version2/schemas/registeredWebhook.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** ID of a registered webhook or error messages explaining why a webhook wasn't registered. */ +export const RegisteredWebhookSchema = z.object({ + /** The ID of the webhook. Returned if the webhook is created. */ + createdWebhookId: z.number().int().optional(), + /** Error messages specifying why the webhook creation failed. */ + errors: z.array(z.string()).optional(), +}); + +export type RegisteredWebhook = z.infer; diff --git a/src/version2/schemas/remoteIssueLink.ts b/src/version2/schemas/remoteIssueLink.ts new file mode 100644 index 0000000000..54be61d1f1 --- /dev/null +++ b/src/version2/schemas/remoteIssueLink.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** Details of an issue remote link. */ +export const RemoteIssueLinkSchema = z.object({ + /** Details of the remote application the linked item is in. */ + application: z.unknown().optional(), + /** The global ID of the link, such as the ID of the item on the remote system. */ + globalId: z.string().optional(), + /** The ID of the link. */ + id: z.number().int().optional(), + /** Details of the item linked to. */ + object: z.unknown().optional(), + /** Description of the relationship between the issue and the linked item. */ + relationship: z.string().optional(), + /** The URL of the link. */ + self: z.string().optional(), +}); + +export type RemoteIssueLink = z.infer; diff --git a/src/version2/schemas/remoteIssueLinkIdentifies.ts b/src/version2/schemas/remoteIssueLinkIdentifies.ts new file mode 100644 index 0000000000..863a889c6d --- /dev/null +++ b/src/version2/schemas/remoteIssueLinkIdentifies.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of the identifiers for a created or updated remote issue link. */ +export const RemoteIssueLinkIdentifiesSchema = z.object({ + /** The ID of the remote issue link, such as the ID of the item on the remote system. */ + id: z.number().int().optional(), + /** The URL of the remote issue link. */ + self: z.string().optional(), +}); + +export type RemoteIssueLinkIdentifies = z.infer; diff --git a/src/version2/schemas/remoteIssueLinkRequest.ts b/src/version2/schemas/remoteIssueLinkRequest.ts new file mode 100644 index 0000000000..e7d95dcae7 --- /dev/null +++ b/src/version2/schemas/remoteIssueLinkRequest.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; + +/** Details of a remote issue link. */ +export const RemoteIssueLinkRequestSchema = z.object({ + /** Details of the remote application the linked item is in. For example, trello. */ + application: z.unknown().optional(), + /** + * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence + * would consist of the app ID and page ID, like this: `appId=456&pageId=123`. + * + * Setting this field enables the remote issue link details to be updated or deleted using remote system and item + * details as the record identifier, rather than using the record's Jira ID. + * + * The maximum length is 255 characters. + */ + globalId: z.string().optional(), + /** Details of the item linked to. */ + object: z.unknown(), + /** + * Description of the relationship between the issue and the linked item. If not set, the relationship description + * "links to" is used in Jira. + */ + relationship: z.string().optional(), +}); + +export type RemoteIssueLinkRequest = z.infer; diff --git a/src/version2/schemas/remoteObject.ts b/src/version2/schemas/remoteObject.ts new file mode 100644 index 0000000000..6e538b01fc --- /dev/null +++ b/src/version2/schemas/remoteObject.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** The linked item. */ +export const RemoteObjectSchema = z.object({ + /** Details of the icon for the item. If no icon is defined, the default link icon is used in Jira. */ + icon: z.unknown().optional(), + /** The status of the item. */ + status: z.unknown().optional(), + /** The summary details of the item. */ + summary: z.string().optional(), + /** The title of the item. */ + title: z.string(), + /** The URL of the item. */ + url: z.string(), +}); + +export type RemoteObject = z.infer; diff --git a/src/version2/schemas/removeOptionFromIssuesResult.ts b/src/version2/schemas/removeOptionFromIssuesResult.ts new file mode 100644 index 0000000000..55077325ea --- /dev/null +++ b/src/version2/schemas/removeOptionFromIssuesResult.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +export const RemoveOptionFromIssuesResultSchema = z.object({ + /** + * A collection of errors related to unchanged issues. The collection size is limited, which means not all errors may + * be returned. + */ + errors: z.unknown().optional(), + /** The IDs of the modified issues. */ + modifiedIssues: z.array(z.number().int()).optional(), + /** The IDs of the unchanged issues, those issues where errors prevent modification. */ + unmodifiedIssues: z.array(z.number().int()).optional(), +}); + +export type RemoveOptionFromIssuesResult = z.infer; diff --git a/src/version2/schemas/reorderIssuePriorities.ts b/src/version2/schemas/reorderIssuePriorities.ts new file mode 100644 index 0000000000..885ed0c79b --- /dev/null +++ b/src/version2/schemas/reorderIssuePriorities.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Change the order of issue priorities. */ +export const ReorderIssuePrioritiesSchema = z.object({ + /** The ID of the priority. Required if `position` isn't provided. */ + after: z.string().optional(), + /** The list of issue IDs to be reordered. Cannot contain duplicates nor after ID. */ + ids: z.array(z.string()), + /** The position for issue priorities to be moved to. Required if `after` isn't provided. */ + position: z.string().optional(), +}); + +export type ReorderIssuePriorities = z.infer; diff --git a/src/version2/schemas/reorderIssueResolutionsRequest.ts b/src/version2/schemas/reorderIssueResolutionsRequest.ts new file mode 100644 index 0000000000..c9f4a5457e --- /dev/null +++ b/src/version2/schemas/reorderIssueResolutionsRequest.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Change the order of issue resolutions. */ +export const ReorderIssueResolutionsRequestSchema = z.object({ + /** The ID of the resolution. Required if `position` isn't provided. */ + after: z.string().optional(), + /** The list of resolution IDs to be reordered. Cannot contain duplicates nor after ID. */ + ids: z.array(z.string()), + /** The position for issue resolutions to be moved to. Required if `after` isn't provided. */ + position: z.string().optional(), +}); + +export type ReorderIssueResolutionsRequest = z.infer; diff --git a/src/version2/schemas/requiredMappingByIssueType.ts b/src/version2/schemas/requiredMappingByIssueType.ts new file mode 100644 index 0000000000..68b3d7e7b3 --- /dev/null +++ b/src/version2/schemas/requiredMappingByIssueType.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The list of required status mappings by issue type. */ +export const RequiredMappingByIssueTypeSchema = z.object({ + /** The ID of the issue type. */ + issueTypeId: z.string().optional(), + /** The status IDs requiring mapping. */ + statusIds: z.array(z.string()).optional(), +}); + +export type RequiredMappingByIssueType = z.infer; diff --git a/src/version2/schemas/requiredMappingByWorkflows.ts b/src/version2/schemas/requiredMappingByWorkflows.ts new file mode 100644 index 0000000000..0a511795ae --- /dev/null +++ b/src/version2/schemas/requiredMappingByWorkflows.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The list of required status mappings by workflow. */ +export const RequiredMappingByWorkflowsSchema = z.object({ + /** The ID of the source workflow. */ + sourceWorkflowId: z.string().optional(), + /** The status IDs requiring mapping. */ + statusIds: z.array(z.string()).optional(), + /** The ID of the target workflow. */ + targetWorkflowId: z.string().optional(), +}); + +export type RequiredMappingByWorkflows = z.infer; diff --git a/src/version2/schemas/resolution.ts b/src/version2/schemas/resolution.ts new file mode 100644 index 0000000000..2a310d8f8b --- /dev/null +++ b/src/version2/schemas/resolution.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Details of an issue resolution. */ +export const ResolutionSchema = z.object({ + /** The description of the issue resolution. */ + description: z.string().optional(), + /** The ID of the issue resolution. */ + id: z.string().optional(), + /** The name of the issue resolution. */ + name: z.string().optional(), + /** The URL of the issue resolution. */ + self: z.string().optional(), +}); + +export type Resolution = z.infer; diff --git a/src/version2/schemas/resolutionId.ts b/src/version2/schemas/resolutionId.ts new file mode 100644 index 0000000000..07f98750d6 --- /dev/null +++ b/src/version2/schemas/resolutionId.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The ID of an issue resolution. */ +export const ResolutionIdSchema = z.object({ + /** The ID of the issue resolution. */ + id: z.string(), +}); + +export type ResolutionId = z.infer; diff --git a/src/version2/schemas/resolutionJsonBean.ts b/src/version2/schemas/resolutionJsonBean.ts new file mode 100644 index 0000000000..cc7dcfd1ea --- /dev/null +++ b/src/version2/schemas/resolutionJsonBean.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +export const ResolutionJsonBeanSchema = z.object({ + default: z.boolean().optional(), + description: z.string().optional(), + iconUrl: z.string().optional(), + id: z.string().optional(), + name: z.string().optional(), + self: z.string().optional(), +}); + +export type ResolutionJsonBean = z.infer; diff --git a/src/version2/schemas/resource.ts b/src/version2/schemas/resource.ts new file mode 100644 index 0000000000..292099ec61 --- /dev/null +++ b/src/version2/schemas/resource.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const ResourceSchema = z.object({ + description: z.string().optional(), + file: z.string().optional(), + filename: z.string().optional(), + inputStream: z.object({}).optional(), + open: z.boolean().optional(), + readable: z.boolean().optional(), + uri: z.string().optional(), + url: z.string().optional(), +}); + +export type Resource = z.infer; diff --git a/src/version2/schemas/restrictedPermission.ts b/src/version2/schemas/restrictedPermission.ts new file mode 100644 index 0000000000..5317d31e71 --- /dev/null +++ b/src/version2/schemas/restrictedPermission.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details of the permission. */ +export const RestrictedPermissionSchema = z.object({ + /** + * 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: z.string().optional(), + /** + * 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: z.string().optional(), +}); + +export type RestrictedPermission = z.infer; diff --git a/src/version2/schemas/richText.ts b/src/version2/schemas/richText.ts new file mode 100644 index 0000000000..68eb1374d2 --- /dev/null +++ b/src/version2/schemas/richText.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const RichTextSchema = z.object({ + empty: z.boolean().optional(), + emptyAdf: z.boolean().optional(), + finalised: z.boolean().optional(), + valueSet: z.boolean().optional(), +}); + +export type RichText = z.infer; diff --git a/src/version2/schemas/roleActor.ts b/src/version2/schemas/roleActor.ts new file mode 100644 index 0000000000..aebf1c512b --- /dev/null +++ b/src/version2/schemas/roleActor.ts @@ -0,0 +1,26 @@ +import { z } from 'zod'; + +/** Details about a user assigned to a project role. */ +export const RoleActorSchema = z.object({ + actorGroup: z.unknown().optional(), + actorUser: z.unknown().optional(), + /** The avatar of the role actor. */ + avatarUrl: z.string().optional(), + /** + * The display name of the role actor. For users, depending on the user’s privacy setting, this may return an + * alternative value for the user's name. + */ + displayName: z.string().optional(), + /** The ID of the role actor. */ + id: z.number().int().optional(), + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name: z.string().optional(), + /** The type of role actor. */ + type: z.enum(['atlassian-group-role-actor', 'atlassian-user-role-actor']).optional(), +}); + +export type RoleActor = z.infer; diff --git a/src/version2/schemas/rolePayload.ts b/src/version2/schemas/rolePayload.ts new file mode 100644 index 0000000000..e0400c0874 --- /dev/null +++ b/src/version2/schemas/rolePayload.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** + * The payload used to create a project role. It is optional for CMP projects, as a default role actor will be provided. + * TMP will add new role actors to the table. + */ +export const RolePayloadSchema = z.object({ + /** The default actors for the role. By adding default actors, the role will be added to any future projects created */ + defaultActors: z.array(ProjectCreateResourceIdentifierSchema).optional(), + /** The description of the role */ + description: z.string().optional(), + /** The name of the role */ + name: z.string().optional(), + /** + * The strategy to use when there is a conflict with an existing project role. FAIL - Fail execution, this always + * needs to be unique; USE - Use the existing entity and ignore new entity parameters + */ + onConflict: z.enum(['FAIL', 'USE', 'NEW']).optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), + /** The type of the role. Only used by project-scoped project */ + type: z.enum(['HIDDEN', 'VIEWABLE', 'EDITABLE']).optional(), +}); + +export type RolePayload = z.infer; diff --git a/src/version2/schemas/rolesCapabilityPayload.ts b/src/version2/schemas/rolesCapabilityPayload.ts new file mode 100644 index 0000000000..fa20084bcb --- /dev/null +++ b/src/version2/schemas/rolesCapabilityPayload.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { RolePayloadSchema } from './rolePayload'; + +export const RolesCapabilityPayloadSchema = z.object({ + /** A map of role PCRI (can be ID or REF) to a list of user or group PCRI IDs to associate with the role and project. */ + roleToProjectActors: z.object({}).optional(), + /** The list of roles to create. */ + roles: z.array(RolePayloadSchema).optional(), +}); + +export type RolesCapabilityPayload = z.infer; diff --git a/src/version2/schemas/ruleConfiguration.ts b/src/version2/schemas/ruleConfiguration.ts new file mode 100644 index 0000000000..19f6fbd4b7 --- /dev/null +++ b/src/version2/schemas/ruleConfiguration.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** A rule configuration. */ +export const RuleConfigurationSchema = z.object({ + /** Whether the rule is disabled. */ + disabled: z.boolean().optional(), + /** + * 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). + */ + tag: z.string().optional(), + /** Configuration of the rule, as it is stored by the Connect or the Forge app on the rule configuration page. */ + value: z.string(), +}); + +export type RuleConfiguration = z.infer; diff --git a/src/version2/schemas/rulePayload.ts b/src/version2/schemas/rulePayload.ts new file mode 100644 index 0000000000..8b9b8830a9 --- /dev/null +++ b/src/version2/schemas/rulePayload.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** The payload for creating rules in a workflow */ +export const RulePayloadSchema = z.object({ + /** The parameters of the rule */ + parameters: z.object({}).optional(), + /** + * The key of the rule. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflows-capabilities-get + */ + ruleKey: z.string().optional(), +}); + +export type RulePayload = z.infer; diff --git a/src/version2/schemas/sanitizedJqlQueries.ts b/src/version2/schemas/sanitizedJqlQueries.ts new file mode 100644 index 0000000000..bf9856feb3 --- /dev/null +++ b/src/version2/schemas/sanitizedJqlQueries.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { SanitizedJqlQuerySchema } from './sanitizedJqlQuery'; + +/** The sanitized JQL queries for the given account IDs. */ +export const SanitizedJqlQueriesSchema = z.object({ + /** The list of sanitized JQL queries. */ + queries: z.array(SanitizedJqlQuerySchema).optional(), +}); + +export type SanitizedJqlQueries = z.infer; diff --git a/src/version2/schemas/sanitizedJqlQuery.ts b/src/version2/schemas/sanitizedJqlQuery.ts new file mode 100644 index 0000000000..8afed293b1 --- /dev/null +++ b/src/version2/schemas/sanitizedJqlQuery.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Details of the sanitized JQL query. */ +export const SanitizedJqlQuerySchema = z.object({ + /** The account ID of the user for whom sanitization was performed. */ + accountId: z.string().optional(), + /** The list of errors. */ + errors: z.unknown().optional(), + /** The initial query. */ + initialQuery: z.string().optional(), + /** The sanitized query, if there were no errors. */ + sanitizedQuery: z.string().optional(), +}); + +export type SanitizedJqlQuery = z.infer; diff --git a/src/version2/schemas/saveProjectTemplateRequest.ts b/src/version2/schemas/saveProjectTemplateRequest.ts new file mode 100644 index 0000000000..9573705bdf --- /dev/null +++ b/src/version2/schemas/saveProjectTemplateRequest.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { CustomTemplateOptionsSchema } from './customTemplateOptions'; + +/** The request details to generate template from a project */ +export const SaveProjectTemplateRequestSchema = z.object({ + /** The ID of the target project */ + projectId: z.number().int().optional(), + templateGenerationOptions: CustomTemplateOptionsSchema.optional(), + /** The type of the template: LIVE | SNAPSHOT */ + templateType: z.enum(['LIVE', 'SNAPSHOT']).optional(), +}); + +export type SaveProjectTemplateRequest = z.infer; diff --git a/src/version2/schemas/saveTemplateRequest.ts b/src/version2/schemas/saveTemplateRequest.ts new file mode 100644 index 0000000000..dd625630b5 --- /dev/null +++ b/src/version2/schemas/saveTemplateRequest.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { SaveProjectTemplateRequestSchema } from './saveProjectTemplateRequest'; + +/** Request to save a custom template */ +export const SaveTemplateRequestSchema = z.object({ + /** The description of the template */ + templateDescription: z.string().optional(), + templateFromProjectRequest: SaveProjectTemplateRequestSchema.optional(), + /** The name of the template */ + templateName: z.string().optional(), +}); + +export type SaveTemplateRequest = z.infer; diff --git a/src/version2/schemas/saveTemplateResponse.ts b/src/version2/schemas/saveTemplateResponse.ts new file mode 100644 index 0000000000..dd3617d45b --- /dev/null +++ b/src/version2/schemas/saveTemplateResponse.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; +import { ProjectTemplateKeySchema } from './projectTemplateKey'; + +export const SaveTemplateResponseSchema = z.object({ + projectTemplateKey: ProjectTemplateKeySchema.optional(), +}); + +export type SaveTemplateResponse = z.infer; diff --git a/src/version2/schemas/scope.ts b/src/version2/schemas/scope.ts new file mode 100644 index 0000000000..970c1b8544 --- /dev/null +++ b/src/version2/schemas/scope.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ +export const ScopeSchema = z.object({ + /** The project the item has scope in. */ + project: z.unknown().optional(), + /** The type of scope. */ + type: z.enum(['PROJECT', 'TEMPLATE']).optional(), +}); + +export type Scope = z.infer; diff --git a/src/version2/schemas/scopePayload.ts b/src/version2/schemas/scopePayload.ts new file mode 100644 index 0000000000..6678e0d448 --- /dev/null +++ b/src/version2/schemas/scopePayload.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The payload for creating a scope. Defines if a project is team-managed project or company-managed project */ +export const ScopePayloadSchema = z.object({ + /** The type of the scope. Use `GLOBAL` or empty for company-managed project, and `PROJECT` for team-managed project */ + type: z.enum(['GLOBAL', 'PROJECT']).optional(), +}); + +export type ScopePayload = z.infer; diff --git a/src/version2/schemas/screen.ts b/src/version2/schemas/screen.ts new file mode 100644 index 0000000000..420a114dec --- /dev/null +++ b/src/version2/schemas/screen.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** A screen. */ +export const ScreenSchema = z.object({ + /** The description of the screen. */ + description: z.string().optional(), + /** The ID of the screen. */ + id: z.number().int().optional(), + /** The name of the screen. */ + name: z.string().optional(), + /** The scope of the screen. */ + scope: z.unknown().optional(), +}); + +export type Screen = z.infer; diff --git a/src/version2/schemas/screenDetails.ts b/src/version2/schemas/screenDetails.ts new file mode 100644 index 0000000000..423ac7a71f --- /dev/null +++ b/src/version2/schemas/screenDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of a screen. */ +export const ScreenDetailsSchema = z.object({ + /** The description of the screen. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the screen. The name must be unique. The maximum length is 255 characters. */ + name: z.string(), +}); + +export type ScreenDetails = z.infer; diff --git a/src/version2/schemas/screenPayload.ts b/src/version2/schemas/screenPayload.ts new file mode 100644 index 0000000000..328bf24e55 --- /dev/null +++ b/src/version2/schemas/screenPayload.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; +import { TabPayloadSchema } from './tabPayload'; + +/** + * Defines the payload for the field screens. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screens/#api-rest-api-3-screens-post + */ +export const ScreenPayloadSchema = z.object({ + /** The description of the screen */ + description: z.string().optional(), + /** The name of the screen */ + name: z.string().optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), + /** + * The tabs of the screen. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-tab-fields/#api-rest-api-3-screens-screenid-tabs-tabid-fields-post + */ + tabs: z.array(TabPayloadSchema).optional(), +}); + +export type ScreenPayload = z.infer; diff --git a/src/version2/schemas/screenScheme.ts b/src/version2/schemas/screenScheme.ts new file mode 100644 index 0000000000..42e8b14bca --- /dev/null +++ b/src/version2/schemas/screenScheme.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** A screen scheme. */ +export const ScreenSchemeSchema = z.object({ + /** The description of the screen scheme. */ + description: z.string().optional(), + /** The ID of the screen scheme. */ + id: z.number().int().optional(), + /** Details of the issue type screen schemes associated with the screen scheme. */ + issueTypeScreenSchemes: z.unknown().optional(), + /** The name of the screen scheme. */ + name: z.string().optional(), + /** The IDs of the screens for the screen types of the screen scheme. */ + screens: z.unknown().optional(), +}); + +export type ScreenScheme = z.infer; diff --git a/src/version2/schemas/screenSchemeDetails.ts b/src/version2/schemas/screenSchemeDetails.ts new file mode 100644 index 0000000000..5fbed121b0 --- /dev/null +++ b/src/version2/schemas/screenSchemeDetails.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** Details of a screen scheme. */ +export const ScreenSchemeDetailsSchema = z.object({ + /** The description of the screen scheme. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: z.string(), + /** + * The IDs of the screens for the screen types of the screen scheme. Only screens used in classic projects are + * accepted. + */ + screens: z.unknown(), +}); + +export type ScreenSchemeDetails = z.infer; diff --git a/src/version2/schemas/screenSchemeId.ts b/src/version2/schemas/screenSchemeId.ts new file mode 100644 index 0000000000..0df1ce720d --- /dev/null +++ b/src/version2/schemas/screenSchemeId.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The ID of a screen scheme. */ +export const ScreenSchemeIdSchema = z.object({ + /** The ID of the screen scheme. */ + id: z.number().int(), +}); + +export type ScreenSchemeId = z.infer; diff --git a/src/version2/schemas/screenSchemePayload.ts b/src/version2/schemas/screenSchemePayload.ts new file mode 100644 index 0000000000..bbae2bcc66 --- /dev/null +++ b/src/version2/schemas/screenSchemePayload.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** + * Defines the payload for the screen schemes. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-schemes/#api-rest-api-3-screenscheme-post + */ +export const ScreenSchemePayloadSchema = z.object({ + defaultScreen: ProjectCreateResourceIdentifierSchema.optional(), + /** The description of the screen scheme */ + description: z.string().optional(), + /** The name of the screen scheme */ + name: z.string().optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), + /** + * Similar to the field layout scheme those mappings allow users to set different screens for different operations: + * default - always there, applied to all operations that don't have an explicit mapping `create`, `view`, `edit` - + * specific operations that are available and users can assign a different screen for each one of them + * https://support.atlassian.com/jira-cloud-administration/docs/manage-screen-schemes/#Associating-a-screen-with-an-issue-operation + */ + screens: z.object({}).optional(), +}); + +export type ScreenSchemePayload = z.infer; diff --git a/src/version2/schemas/screenTypes.ts b/src/version2/schemas/screenTypes.ts new file mode 100644 index 0000000000..6d8a09276a --- /dev/null +++ b/src/version2/schemas/screenTypes.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** The IDs of the screens for the screen types of the screen scheme. */ +export const ScreenTypesSchema = z.object({ + /** The ID of the create screen. */ + create: z.number().int().optional(), + /** The ID of the default screen. Required when creating a screen scheme. */ + default: z.number().int(), + /** The ID of the edit screen. */ + edit: z.number().int().optional(), + /** The ID of the view screen. */ + view: z.number().int().optional(), +}); + +export type ScreenTypes = z.infer; diff --git a/src/version2/schemas/screenWithTab.ts b/src/version2/schemas/screenWithTab.ts new file mode 100644 index 0000000000..2989880249 --- /dev/null +++ b/src/version2/schemas/screenWithTab.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** A screen with tab details. */ +export const ScreenWithTabSchema = z.object({ + /** The description of the screen. */ + description: z.string().optional(), + /** The ID of the screen. */ + id: z.number().int().optional(), + /** The name of the screen. */ + name: z.string().optional(), + /** The scope of the screen. */ + scope: z.unknown().optional(), + /** The tab for the screen. */ + tab: z.unknown().optional(), +}); + +export type ScreenWithTab = z.infer; diff --git a/src/version2/schemas/screenableField.ts b/src/version2/schemas/screenableField.ts new file mode 100644 index 0000000000..bb35e4de8b --- /dev/null +++ b/src/version2/schemas/screenableField.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** A screen tab field. */ +export const ScreenableFieldSchema = z.object({ + /** The ID of the screen tab field. */ + id: z.string().optional(), + /** The name of the screen tab field. Required on create and update. The maximum length is 255 characters. */ + name: z.string().optional(), +}); + +export type ScreenableField = z.infer; diff --git a/src/version2/schemas/screenableTab.ts b/src/version2/schemas/screenableTab.ts new file mode 100644 index 0000000000..1a762b86ca --- /dev/null +++ b/src/version2/schemas/screenableTab.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** A screen tab. */ +export const ScreenableTabSchema = z.object({ + /** The ID of the screen tab. */ + id: z.number().int().optional(), + /** The name of the screen tab. The maximum length is 255 characters. */ + name: z.string(), +}); + +export type ScreenableTab = z.infer; diff --git a/src/version2/schemas/searchAndReconcileRequestBean.ts b/src/version2/schemas/searchAndReconcileRequestBean.ts new file mode 100644 index 0000000000..1eaa4ee197 --- /dev/null +++ b/src/version2/schemas/searchAndReconcileRequestBean.ts @@ -0,0 +1,74 @@ +import { z } from 'zod'; + +export const SearchAndReconcileRequestBeanSchema = z.object({ + /** + * 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: z.string().optional(), + /** + * 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: z.array(z.string()).optional(), + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys: z.boolean().optional(), + /** + * 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: z.string().optional(), + /** + * 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: z.number().int().optional(), + /** + * 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: z.string().optional(), + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties: z.array(z.string()).optional(), + /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids */ + reconcileIssues: z.array(z.number().int()).optional(), +}); + +export type SearchAndReconcileRequestBean = z.infer; diff --git a/src/version2/schemas/searchAndReconcileResults.ts b/src/version2/schemas/searchAndReconcileResults.ts new file mode 100644 index 0000000000..d9bb168300 --- /dev/null +++ b/src/version2/schemas/searchAndReconcileResults.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; +import { IssueBeanSchema } from './issueBean'; + +/** The result of a JQL search with issues reconsilation. */ +export const SearchAndReconcileResultsSchema = z.object({ + /** Indicates whether this is the last page of the paginated response. */ + isLast: z.boolean().optional(), + /** The list of issues found by the search or reconsiliation. */ + issues: z.array(IssueBeanSchema).optional(), + /** The ID and name of each field in the search results. */ + names: z.object({}).optional(), + /** + * Continuation token to fetch the next page. If this result represents the last or the only page this token will be + * null. This token will expire in 7 days. + */ + nextPageToken: z.string().optional(), + /** The schema describing the field types in the search results. */ + schema: z.object({}).optional(), +}); + +export type SearchAndReconcileResults = z.infer; diff --git a/src/version2/schemas/searchAutoCompleteFilter.ts b/src/version2/schemas/searchAutoCompleteFilter.ts new file mode 100644 index 0000000000..d47d0e6524 --- /dev/null +++ b/src/version2/schemas/searchAutoCompleteFilter.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of how to filter and list search auto complete information. */ +export const SearchAutoCompleteFilterSchema = z.object({ + /** Include collapsed fields for fields that have non-unique names. */ + includeCollapsedFields: z.boolean().optional(), + /** List of project IDs used to filter the visible field details returned. */ + projectIds: z.array(z.number().int()).optional(), +}); + +export type SearchAutoCompleteFilter = z.infer; diff --git a/src/version2/schemas/searchRequestBean.ts b/src/version2/schemas/searchRequestBean.ts new file mode 100644 index 0000000000..30f900c603 --- /dev/null +++ b/src/version2/schemas/searchRequestBean.ts @@ -0,0 +1,68 @@ +import { z } from 'zod'; + +export const SearchRequestBeanSchema = z.object({ + /** + * 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: z.array(z.string()).optional(), + /** + * 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: z.array(z.string()).optional(), + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys: z.boolean().optional(), + /** A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. */ + jql: z.string().optional(), + /** The maximum number of items to return per page. */ + maxResults: z.number().int().optional(), + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties: z.array(z.string()).optional(), + /** The index of the first item to return in the page of results (page offset). The base index is `0`. */ + startAt: z.number().int().optional(), + /** + * Determines how to validate the JQL query and treat the validation results. Supported values: + * + * - `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * - `warn` Returns all errors as warnings. + * - `none` No validation is performed. + * - `true` _Deprecated_ A legacy synonym for `strict`. + * - `false` _Deprecated_ A legacy synonym for `warn`. + * + * The default is `strict`. + * + * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. + */ + validateQuery: z.enum(['strict', 'warn', 'none', 'true', 'false']).optional(), +}); + +export type SearchRequestBean = z.infer; diff --git a/src/version2/schemas/searchResults.ts b/src/version2/schemas/searchResults.ts new file mode 100644 index 0000000000..a9eb4126f3 --- /dev/null +++ b/src/version2/schemas/searchResults.ts @@ -0,0 +1,24 @@ +import { z } from 'zod'; +import { IssueBeanSchema } from './issueBean'; + +/** The result of a JQL search. */ +export const SearchResultsSchema = z.object({ + /** Expand options that include additional search result details in the response. */ + expand: z.string().optional(), + /** The list of issues found by the search. */ + issues: z.array(IssueBeanSchema).optional(), + /** The maximum number of results that could be on the page. */ + maxResults: z.number().int().optional(), + /** The ID and name of each field in the search results. */ + names: z.object({}).optional(), + /** The schema describing the field types in the search results. */ + schema: z.object({}).optional(), + /** The index of the first item returned on the page. */ + startAt: z.number().int().optional(), + /** The number of results on the page. */ + total: z.number().int().optional(), + /** Any warnings related to the JQL query. */ + warningMessages: z.array(z.string()).optional(), +}); + +export type SearchResults = z.infer; diff --git a/src/version2/schemas/securityLevel.ts b/src/version2/schemas/securityLevel.ts new file mode 100644 index 0000000000..88f29f3c35 --- /dev/null +++ b/src/version2/schemas/securityLevel.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** Details of an issue level security item. */ +export const SecurityLevelSchema = z.object({ + /** The description of the issue level security item. */ + description: z.string().optional(), + /** The ID of the issue level security item. */ + id: z.string().optional(), + /** Whether the issue level security item is the default. */ + isDefault: z.boolean().optional(), + /** The ID of the issue level security scheme. */ + issueSecuritySchemeId: z.string().optional(), + /** The name of the issue level security item. */ + name: z.string().optional(), + /** The URL of the issue level security item. */ + self: z.string().optional(), +}); + +export type SecurityLevel = z.infer; diff --git a/src/version2/schemas/securityLevelMember.ts b/src/version2/schemas/securityLevelMember.ts new file mode 100644 index 0000000000..02e7b191f8 --- /dev/null +++ b/src/version2/schemas/securityLevelMember.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +/** Issue security level member. */ +export const SecurityLevelMemberSchema = z.object({ + /** + * The user or group being granted the permission. It consists of a `type` and a type-dependent `parameter`. See + * [Holder object](../api-group-permission-schemes/#holder-object) in _Get all permission schemes_ for more + * information. + */ + holder: z.unknown(), + /** The ID of the issue security level member. */ + id: z.string(), + /** The ID of the issue security level. */ + issueSecurityLevelId: z.string(), + /** The ID of the issue security scheme. */ + issueSecuritySchemeId: z.string(), + managed: z.boolean().optional(), +}); + +export type SecurityLevelMember = z.infer; diff --git a/src/version2/schemas/securityLevelMemberPayload.ts b/src/version2/schemas/securityLevelMemberPayload.ts new file mode 100644 index 0000000000..6f58bb56ee --- /dev/null +++ b/src/version2/schemas/securityLevelMemberPayload.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; + +/** + * The payload for creating a security level member. See + * https://support.atlassian.com/jira-cloud-administration/docs/configure-issue-security-schemes/ + */ +export const SecurityLevelMemberPayloadSchema = z.object({ + /** + * Defines the value associated with the type. For reporter this would be {"null"}; for users this would be the names + * of specific users); for group this would be group names like {"administrators", "jira-administrators", + * "jira-users"} + */ + parameter: z.string().optional(), + /** The type of the security level member */ + type: z.enum(['group', 'reporter', 'users']).optional(), +}); + +export type SecurityLevelMemberPayload = z.infer; diff --git a/src/version2/schemas/securityLevelPayload.ts b/src/version2/schemas/securityLevelPayload.ts new file mode 100644 index 0000000000..03b62f3b70 --- /dev/null +++ b/src/version2/schemas/securityLevelPayload.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { SecurityLevelMemberPayloadSchema } from './securityLevelMemberPayload'; + +/** + * The payload for creating a security level. See + * https://support.atlassian.com/jira-cloud-administration/docs/configure-issue-security-schemes/ + */ +export const SecurityLevelPayloadSchema = z.object({ + /** The description of the security level */ + description: z.string().optional(), + /** Whether the security level is default for the security scheme */ + isDefault: z.boolean().optional(), + /** The name of the security level */ + name: z.string().optional(), + /** The members of the security level */ + securityLevelMembers: z.array(SecurityLevelMemberPayloadSchema).optional(), +}); + +export type SecurityLevelPayload = z.infer; diff --git a/src/version2/schemas/securityScheme.ts b/src/version2/schemas/securityScheme.ts new file mode 100644 index 0000000000..9bbd0ce86a --- /dev/null +++ b/src/version2/schemas/securityScheme.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { SecurityLevelSchema } from './securityLevel'; + +/** Details about a security scheme. */ +export const SecuritySchemeSchema = z.object({ + /** The ID of the default security level. */ + defaultSecurityLevelId: z.number().int().optional(), + /** The description of the issue security scheme. */ + description: z.string().optional(), + /** The ID of the issue security scheme. */ + id: z.number().int().optional(), + levels: z.array(SecurityLevelSchema).optional(), + /** The name of the issue security scheme. */ + name: z.string().optional(), + /** The URL of the issue security scheme. */ + self: z.string().optional(), +}); + +export type SecurityScheme = z.infer; diff --git a/src/version2/schemas/securitySchemeId.ts b/src/version2/schemas/securitySchemeId.ts new file mode 100644 index 0000000000..f15c403316 --- /dev/null +++ b/src/version2/schemas/securitySchemeId.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The ID of the issue security scheme. */ +export const SecuritySchemeIdSchema = z.object({ + /** The ID of the issue security scheme. */ + id: z.string(), +}); + +export type SecuritySchemeId = z.infer; diff --git a/src/version2/schemas/securitySchemeLevel.ts b/src/version2/schemas/securitySchemeLevel.ts new file mode 100644 index 0000000000..867e5e68d7 --- /dev/null +++ b/src/version2/schemas/securitySchemeLevel.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { SecuritySchemeLevelMemberBeanSchema } from './securitySchemeLevelMemberBean'; + +export const SecuritySchemeLevelSchema = z.object({ + /** The description of the issue security scheme level. */ + description: z.string().optional(), + /** Specifies whether the level is the default level. False by default. */ + isDefault: z.boolean().optional(), + /** The list of level members which should be added to the issue security scheme level. */ + members: z.array(SecuritySchemeLevelMemberBeanSchema).optional(), + /** The name of the issue security scheme level. Must be unique. */ + name: z.string(), +}); + +export type SecuritySchemeLevel = z.infer; diff --git a/src/version2/schemas/securitySchemeLevelMemberBean.ts b/src/version2/schemas/securitySchemeLevelMemberBean.ts new file mode 100644 index 0000000000..ada9446f89 --- /dev/null +++ b/src/version2/schemas/securitySchemeLevelMemberBean.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const SecuritySchemeLevelMemberBeanSchema = z.object({ + /** The value corresponding to the specified member type. */ + parameter: z.string().optional(), + /** The issue security level member type, e.g `reporter`, `group`, `user`, `projectrole`, `applicationRole`. */ + type: z.string(), +}); + +export type SecuritySchemeLevelMemberBean = z.infer; diff --git a/src/version2/schemas/securitySchemeMembersRequest.ts b/src/version2/schemas/securitySchemeMembersRequest.ts new file mode 100644 index 0000000000..43178a270d --- /dev/null +++ b/src/version2/schemas/securitySchemeMembersRequest.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { SecuritySchemeLevelMemberBeanSchema } from './securitySchemeLevelMemberBean'; + +/** Details of issue security scheme level new members. */ +export const SecuritySchemeMembersRequestSchema = z.object({ + /** The list of level members which should be added to the issue security scheme level. */ + members: z.array(SecuritySchemeLevelMemberBeanSchema).optional(), +}); + +export type SecuritySchemeMembersRequest = z.infer; diff --git a/src/version2/schemas/securitySchemePayload.ts b/src/version2/schemas/securitySchemePayload.ts new file mode 100644 index 0000000000..43dc4eb524 --- /dev/null +++ b/src/version2/schemas/securitySchemePayload.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; +import { SecurityLevelPayloadSchema } from './securityLevelPayload'; + +/** + * The payload for creating a security scheme. See + * https://support.atlassian.com/jira-cloud-administration/docs/configure-issue-security-schemes/ + */ +export const SecuritySchemePayloadSchema = z.object({ + /** The description of the security scheme */ + description: z.string().optional(), + /** The name of the security scheme */ + name: z.string().optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), + /** The security levels for the security scheme */ + securityLevels: z.array(SecurityLevelPayloadSchema).optional(), +}); + +export type SecuritySchemePayload = z.infer; diff --git a/src/version2/schemas/securitySchemeWithProjects.ts b/src/version2/schemas/securitySchemeWithProjects.ts new file mode 100644 index 0000000000..5e9712ed4e --- /dev/null +++ b/src/version2/schemas/securitySchemeWithProjects.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** Details about an issue security scheme. */ +export const SecuritySchemeWithProjectsSchema = z.object({ + /** The default level ID of the issue security scheme. */ + defaultLevel: z.number().int().optional(), + /** The description of the issue security scheme. */ + description: z.string().optional(), + /** The ID of the issue security scheme. */ + id: z.number().int(), + /** The name of the issue security scheme. */ + name: z.string(), + /** The list of project IDs associated with the issue security scheme. */ + projectIds: z.array(z.number().int()).optional(), + /** The URL of the issue security scheme. */ + self: z.string(), +}); + +export type SecuritySchemeWithProjects = z.infer; diff --git a/src/version2/schemas/securitySchemes.ts b/src/version2/schemas/securitySchemes.ts new file mode 100644 index 0000000000..76fb01177e --- /dev/null +++ b/src/version2/schemas/securitySchemes.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { SecuritySchemeSchema } from './securityScheme'; + +/** List of security schemes. */ +export const SecuritySchemesSchema = z.object({ + /** List of security schemes. */ + issueSecuritySchemes: z.array(SecuritySchemeSchema).optional(), +}); + +export type SecuritySchemes = z.infer; diff --git a/src/version2/schemas/serverInformation.ts b/src/version2/schemas/serverInformation.ts new file mode 100644 index 0000000000..309a5d17a4 --- /dev/null +++ b/src/version2/schemas/serverInformation.ts @@ -0,0 +1,39 @@ +import { z } from 'zod'; +import { HealthCheckResultSchema } from './healthCheckResult'; + +/** Details about the Jira instance. */ +export const ServerInformationSchema = z.object({ + /** The base URL of the Jira instance. */ + baseUrl: z.string().optional(), + /** The timestamp when the Jira version was built. */ + buildDate: z.string().datetime().optional(), + /** The build number of the Jira version. */ + buildNumber: z.number().int().optional(), + /** The type of server deployment. This is always returned as _Cloud_. */ + deploymentType: z.string().optional(), + /** The display URL of the Jira instance. */ + displayUrl: z.string().optional(), + /** The display URL of Confluence. */ + displayUrlConfluence: z.string().optional(), + /** The display URL of the Servicedesk Help Center. */ + displayUrlServicedeskHelpCenter: z.string().optional(), + /** Jira instance health check results. Deprecated and no longer returned. */ + healthChecks: z.array(HealthCheckResultSchema).optional(), + /** The unique identifier of the Jira version. */ + scmInfo: z.string().optional(), + /** The time in Jira when this request was responded to. */ + serverTime: z.string().datetime().optional(), + /** + * The default timezone of the Jira server. In a format known as Olson Time Zones, IANA Time Zones or TZ Database Time + * Zones. + */ + serverTimeZone: z.string().optional(), + /** The name of the Jira instance. */ + serverTitle: z.string().optional(), + /** The version of Jira. */ + version: z.string().optional(), + /** The major, minor, and revision version numbers of the Jira version. */ + versionNumbers: z.array(z.number().int()).optional(), +}); + +export type ServerInformation = z.infer; diff --git a/src/version2/schemas/serviceManagementNavigationInfo.ts b/src/version2/schemas/serviceManagementNavigationInfo.ts new file mode 100644 index 0000000000..16c2592b51 --- /dev/null +++ b/src/version2/schemas/serviceManagementNavigationInfo.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export const ServiceManagementNavigationInfoSchema = z.object({ + queueCategory: z.string().optional(), + queueId: z.number().int().optional(), + queueName: z.string().optional(), +}); + +export type ServiceManagementNavigationInfo = z.infer; diff --git a/src/version2/schemas/serviceRegistry.ts b/src/version2/schemas/serviceRegistry.ts new file mode 100644 index 0000000000..527b0f098e --- /dev/null +++ b/src/version2/schemas/serviceRegistry.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { ServiceRegistryTierSchema } from './serviceRegistryTier'; + +export const ServiceRegistrySchema = z.object({ + /** Service description */ + description: z.string().optional(), + /** Service ID */ + id: z.string().optional(), + /** Service name */ + name: z.string().optional(), + /** Organization ID */ + organizationId: z.string().optional(), + /** Service revision */ + revision: z.string().optional(), + serviceTier: ServiceRegistryTierSchema.optional(), +}); + +export type ServiceRegistry = z.infer; diff --git a/src/version2/schemas/serviceRegistryTier.ts b/src/version2/schemas/serviceRegistryTier.ts new file mode 100644 index 0000000000..49684ff21c --- /dev/null +++ b/src/version2/schemas/serviceRegistryTier.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +export const ServiceRegistryTierSchema = z.object({ + /** Tier description */ + description: z.string().optional(), + /** Tier ID */ + id: z.string().optional(), + /** Tier level */ + level: z.number().int().optional(), + /** Tier name */ + name: z.string().optional(), + /** Name key of the tier */ + nameKey: z.string().optional(), +}); + +export type ServiceRegistryTier = z.infer; diff --git a/src/version2/schemas/setDefaultLevelsRequest.ts b/src/version2/schemas/setDefaultLevelsRequest.ts new file mode 100644 index 0000000000..88db3a8766 --- /dev/null +++ b/src/version2/schemas/setDefaultLevelsRequest.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { DefaultLevelValueSchema } from './defaultLevelValue'; + +/** Details of new default levels. */ +export const SetDefaultLevelsRequestSchema = z.object({ + /** List of objects with issue security scheme ID and new default level ID. */ + defaultValues: z.array(DefaultLevelValueSchema), +}); + +export type SetDefaultLevelsRequest = z.infer; diff --git a/src/version2/schemas/setDefaultPriorityRequest.ts b/src/version2/schemas/setDefaultPriorityRequest.ts new file mode 100644 index 0000000000..d48cedb8c4 --- /dev/null +++ b/src/version2/schemas/setDefaultPriorityRequest.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** The new default issue priority. */ +export const SetDefaultPriorityRequestSchema = z.object({ + /** + * The ID of the new default issue priority. Must be an existing ID or null. Setting this to null erases the default + * priority setting. + */ + id: z.string(), +}); + +export type SetDefaultPriorityRequest = z.infer; diff --git a/src/version2/schemas/setDefaultResolutionRequest.ts b/src/version2/schemas/setDefaultResolutionRequest.ts new file mode 100644 index 0000000000..f62a0748e5 --- /dev/null +++ b/src/version2/schemas/setDefaultResolutionRequest.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** The new default issue resolution. */ +export const SetDefaultResolutionRequestSchema = z.object({ + /** + * The ID of the new default issue resolution. Must be an existing ID or null. Setting this to null erases the default + * resolution setting. + */ + id: z.string(), +}); + +export type SetDefaultResolutionRequest = z.infer; diff --git a/src/version2/schemas/sharePermission.ts b/src/version2/schemas/sharePermission.ts new file mode 100644 index 0000000000..694e912f03 --- /dev/null +++ b/src/version2/schemas/sharePermission.ts @@ -0,0 +1,42 @@ +import { z } from 'zod'; + +/** Details of a share permission for the filter. */ +export const SharePermissionSchema = z.object({ + /** + * The group that the filter is shared with. For a request, specify the `groupId` or `name` property for the group. As + * a group's name can change, use of `groupId` is recommended. + */ + group: z.unknown().optional(), + /** The unique identifier of the share permission. */ + id: z.number().int().optional(), + /** + * The project that the filter is shared with. This is similar to the project object returned by [Get + * project](#api-rest-api-2-project-projectIdOrKey-get) but it contains a subset of the properties, which are: `self`, + * `id`, `key`, `assigneeType`, `name`, `roles`, `avatarUrls`, `projectType`, `simplified`. For a request, specify the + * `id` for the project. + */ + project: z.unknown().optional(), + /** + * The project role that the filter is shared with. For a request, specify the `id` for the role. You must also + * specify the `project` object and `id` for the project that the role is in. + */ + role: z.unknown().optional(), + /** + * The type of share permission: + * + * - `user` Shared with a user. + * - `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well. + * - `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well. + * - `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in + * requests, where it needs to be specify with `projectId` and `projectRoleId`. + * - `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified. + * - `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as + * the `type`. + * - `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request. + */ + type: z.enum(['user', 'group', 'project', 'projectRole', 'global', 'loggedin', 'authenticated', 'project-unknown']), + /** The user account ID that the filter is shared with. For a request, specify the `accountId` property for the user. */ + user: z.unknown().optional(), +}); + +export type SharePermission = z.infer; diff --git a/src/version2/schemas/sharePermissionInputBean.ts b/src/version2/schemas/sharePermissionInputBean.ts new file mode 100644 index 0000000000..4ddb14a358 --- /dev/null +++ b/src/version2/schemas/sharePermissionInputBean.ts @@ -0,0 +1,40 @@ +import { z } from 'zod'; + +export const SharePermissionInputBeanSchema = z.object({ + /** The user account ID that the filter is shared with. For a request, specify the `accountId` property for the user. */ + accountId: z.string().optional(), + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products.For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. Cannot be provided with `groupname`. + */ + groupId: z.string().optional(), + /** + * The name of the group to share the filter with. Set `type` to `group`. Please note that the name of a group is + * mutable, to reliably identify a group use `groupId`. + */ + groupname: z.string().optional(), + /** The ID of the project to share the filter with. Set `type` to `project`. */ + projectId: z.string().optional(), + /** + * The ID of the project role to share the filter with. Set `type` to `projectRole` and the `projectId` for the + * project that the role is in. + */ + projectRoleId: z.string().optional(), + /** The rights for the share permission. */ + rights: z.number().int().optional(), + /** + * The type of the share permission.Specify the type as follows: + * + * - `user` Share with a user. + * - `group` Share with a group. Specify `groupname` as well. + * - `project` Share with a project. Specify `projectId` as well. + * - `projectRole` Share with a project role in a project. Specify `projectId` and `projectRoleId` as well. + * - `global` Share globally, including anonymous users. If set, this type overrides all existing share permissions and + * must be deleted before any non-global share permissions is set. + * - `authenticated` Share with all logged-in users. This shows as `loggedin` in the response. If set, this type + * overrides all existing share permissions and must be deleted before any non-global share permissions is set. + */ + type: z.enum(['user', 'project', 'group', 'projectRole', 'global', 'authenticated']), +}); + +export type SharePermissionInputBean = z.infer; diff --git a/src/version2/schemas/simpleApplicationPropertyBean.ts b/src/version2/schemas/simpleApplicationPropertyBean.ts new file mode 100644 index 0000000000..bca482c3e6 --- /dev/null +++ b/src/version2/schemas/simpleApplicationPropertyBean.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const SimpleApplicationPropertyBeanSchema = z.object({ + /** The ID of the application property. */ + id: z.string().optional(), + /** The new value. */ + value: z.string().optional(), +}); + +export type SimpleApplicationPropertyBean = z.infer; diff --git a/src/version2/schemas/simpleErrorCollection.ts b/src/version2/schemas/simpleErrorCollection.ts new file mode 100644 index 0000000000..41756a7ad0 --- /dev/null +++ b/src/version2/schemas/simpleErrorCollection.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const SimpleErrorCollectionSchema = z.object({ + /** The list of error messages produced by this operation. For example, "input parameter 'key' must be provided" */ + errorMessages: z.array(z.string()).optional(), + /** + * 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: z.object({}).optional(), + httpStatusCode: z.number().int().optional(), +}); + +export type SimpleErrorCollection = z.infer; diff --git a/src/version2/schemas/simpleLink.ts b/src/version2/schemas/simpleLink.ts new file mode 100644 index 0000000000..60b61d8a53 --- /dev/null +++ b/src/version2/schemas/simpleLink.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** Details about the operations available in this version. */ +export const SimpleLinkSchema = z.object({ + href: z.string().optional(), + iconClass: z.string().optional(), + id: z.string().optional(), + label: z.string().optional(), + styleClass: z.string().optional(), + title: z.string().optional(), + weight: z.number().int().optional(), +}); + +export type SimpleLink = z.infer; diff --git a/src/version2/schemas/simpleListWrapperApplicationRole.ts b/src/version2/schemas/simpleListWrapperApplicationRole.ts new file mode 100644 index 0000000000..6b593bbbe1 --- /dev/null +++ b/src/version2/schemas/simpleListWrapperApplicationRole.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; +import { ListWrapperCallbackApplicationRoleSchema } from './listWrapperCallbackApplicationRole'; +import { ApplicationRoleSchema } from './applicationRole'; + +export const SimpleListWrapperApplicationRoleSchema = z + .object({ + callback: ListWrapperCallbackApplicationRoleSchema.optional(), + items: z.array(ApplicationRoleSchema).optional(), + 'max-results': z.number().int().optional(), + pagingCallback: ListWrapperCallbackApplicationRoleSchema.optional(), + size: z.number().int().optional(), + }) + .transform(val => ({ + callback: val['callback'], + items: val['items'], + maxResults: val['max-results'], + pagingCallback: val['pagingCallback'], + size: val['size'], + })); + +export type SimpleListWrapperApplicationRole = z.infer; diff --git a/src/version2/schemas/simpleListWrapperGroupName.ts b/src/version2/schemas/simpleListWrapperGroupName.ts new file mode 100644 index 0000000000..197a6ebfba --- /dev/null +++ b/src/version2/schemas/simpleListWrapperGroupName.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; +import { ListWrapperCallbackGroupNameSchema } from './listWrapperCallbackGroupName'; +import { GroupNameSchema } from './groupName'; + +export const SimpleListWrapperGroupNameSchema = z + .object({ + callback: ListWrapperCallbackGroupNameSchema.optional(), + items: z.array(GroupNameSchema).optional(), + 'max-results': z.number().int().optional(), + pagingCallback: ListWrapperCallbackGroupNameSchema.optional(), + size: z.number().int().optional(), + }) + .transform(val => ({ + callback: val['callback'], + items: val['items'], + maxResults: val['max-results'], + pagingCallback: val['pagingCallback'], + size: val['size'], + })); + +export type SimpleListWrapperGroupName = z.infer; diff --git a/src/version2/schemas/simplifiedHierarchyLevel.ts b/src/version2/schemas/simplifiedHierarchyLevel.ts new file mode 100644 index 0000000000..766e4f75ce --- /dev/null +++ b/src/version2/schemas/simplifiedHierarchyLevel.ts @@ -0,0 +1,43 @@ +import { z } from 'zod'; + +export const SimplifiedHierarchyLevelSchema = z.object({ + /** + * 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: z.number().int().optional(), + /** + * 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: z.number().int().optional(), + /** + * 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: z.string().optional(), + hierarchyLevelNumber: z.number().int().optional(), + /** + * 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: z.number().int().optional(), + /** The issue types available in this hierarchy level. */ + issueTypeIds: z.array(z.number().int()).optional(), + /** The level of this item in the hierarchy. */ + level: z.number().int().optional(), + /** The name of this hierarchy level. */ + name: z.string().optional(), + /** + * 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: z.number().int().optional(), +}); + +export type SimplifiedHierarchyLevel = z.infer; diff --git a/src/version2/schemas/singleRedactionRequest.ts b/src/version2/schemas/singleRedactionRequest.ts new file mode 100644 index 0000000000..6c72bce1f0 --- /dev/null +++ b/src/version2/schemas/singleRedactionRequest.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { ContentItemSchema } from './contentItem'; +import { RedactionPositionSchema } from './redactionPosition'; + +export const SingleRedactionRequestSchema = z.object({ + contentItem: ContentItemSchema, + /** Unique id for the redaction request; ID format should be of UUID */ + externalId: z.string(), + /** The reason why the content is being redacted */ + reason: z.string(), + redactionPosition: RedactionPositionSchema, +}); + +export type SingleRedactionRequest = z.infer; diff --git a/src/version2/schemas/singleRedactionResponse.ts b/src/version2/schemas/singleRedactionResponse.ts new file mode 100644 index 0000000000..a3a8cbb67b --- /dev/null +++ b/src/version2/schemas/singleRedactionResponse.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Result for requested redactions */ +export const SingleRedactionResponseSchema = z.object({ + /** An unique id for the redaction request */ + externalId: z.string(), + /** Indicates if redaction was success/failure */ + successful: z.boolean(), +}); + +export type SingleRedactionResponse = z.infer; diff --git a/src/version2/schemas/softwareNavigationInfo.ts b/src/version2/schemas/softwareNavigationInfo.ts new file mode 100644 index 0000000000..59c23cadb1 --- /dev/null +++ b/src/version2/schemas/softwareNavigationInfo.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const SoftwareNavigationInfoSchema = z.object({ + boardId: z.number().int().optional(), + boardName: z.string().optional(), + simpleBoard: z.boolean().optional(), + totalBoardsInProject: z.number().int().optional(), +}); + +export type SoftwareNavigationInfo = z.infer; diff --git a/src/version2/schemas/status.ts b/src/version2/schemas/status.ts new file mode 100644 index 0000000000..d7a37b3e43 --- /dev/null +++ b/src/version2/schemas/status.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** The status of the item. */ +export const StatusSchema = z.object({ + /** Details of the icon representing the status. If not provided, no status icon displays in Jira. */ + icon: z.unknown().optional(), + /** + * Whether the item is resolved. If set to "true", the link to the issue is displayed in a strikethrough font, + * otherwise the link displays in normal font. + */ + resolved: z.boolean().optional(), +}); + +export type Status = z.infer; diff --git a/src/version2/schemas/statusCategory.ts b/src/version2/schemas/statusCategory.ts new file mode 100644 index 0000000000..cb066ecdb6 --- /dev/null +++ b/src/version2/schemas/statusCategory.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** A status category. */ +export const StatusCategorySchema = z.object({ + /** The name of the color used to represent the status category. */ + colorName: z.string().optional(), + /** The ID of the status category. */ + id: z.number().int().optional(), + /** The key of the status category. */ + key: z.string().optional(), + /** The name of the status category. */ + name: z.string().optional(), + /** The URL of the status category. */ + self: z.string().optional(), +}); + +export type StatusCategory = z.infer; diff --git a/src/version2/schemas/statusCreate.ts b/src/version2/schemas/statusCreate.ts new file mode 100644 index 0000000000..f2d2f2fa98 --- /dev/null +++ b/src/version2/schemas/statusCreate.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details of the status being created. */ +export const StatusCreateSchema = z.object({ + /** The description of the status. */ + description: z.string().optional(), + /** The name of the status. */ + name: z.string(), + /** The category of the status. */ + statusCategory: z.enum(['TODO', 'IN_PROGRESS', 'DONE']), +}); + +export type StatusCreate = z.infer; diff --git a/src/version2/schemas/statusCreateRequest.ts b/src/version2/schemas/statusCreateRequest.ts new file mode 100644 index 0000000000..a4b443843e --- /dev/null +++ b/src/version2/schemas/statusCreateRequest.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { StatusScopeSchema } from './statusScope'; +import { StatusCreateSchema } from './statusCreate'; + +/** Details of the statuses being created and their scope. */ +export const StatusCreateRequestSchema = z.object({ + scope: StatusScopeSchema, + /** Details of the statuses being created. */ + statuses: z.array(StatusCreateSchema), +}); + +export type StatusCreateRequest = z.infer; diff --git a/src/version2/schemas/statusDetails.ts b/src/version2/schemas/statusDetails.ts new file mode 100644 index 0000000000..4c72758dff --- /dev/null +++ b/src/version2/schemas/statusDetails.ts @@ -0,0 +1,21 @@ +import { z } from 'zod'; + +/** A status. */ +export const StatusDetailsSchema = z.object({ + /** The description of the status. */ + description: z.string().optional(), + /** The URL of the icon used to represent the status. */ + iconUrl: z.string().optional(), + /** The ID of the status. */ + id: z.string().optional(), + /** The name of the status. */ + name: z.string().optional(), + /** The scope of the field. */ + scope: z.unknown().optional(), + /** The URL of the status. */ + self: z.string().optional(), + /** The category assigned to the status. */ + statusCategory: z.unknown().optional(), +}); + +export type StatusDetails = z.infer; diff --git a/src/version2/schemas/statusLayoutUpdate.ts b/src/version2/schemas/statusLayoutUpdate.ts new file mode 100644 index 0000000000..fa319b1b47 --- /dev/null +++ b/src/version2/schemas/statusLayoutUpdate.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { ApprovalConfigurationSchema } from './approvalConfiguration'; +import { WorkflowLayoutSchema } from './workflowLayout'; + +/** The statuses associated with this workflow. */ +export const StatusLayoutUpdateSchema = z.object({ + approvalConfiguration: ApprovalConfigurationSchema.optional(), + layout: WorkflowLayoutSchema.optional(), + /** The properties for this status layout. */ + properties: z.object({}), + /** A unique ID which the status will use to refer to this layout configuration. */ + statusReference: z.string(), +}); + +export type StatusLayoutUpdate = z.infer; diff --git a/src/version2/schemas/statusMapping.ts b/src/version2/schemas/statusMapping.ts new file mode 100644 index 0000000000..66580ca591 --- /dev/null +++ b/src/version2/schemas/statusMapping.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details about the mapping from a status to a new status for an issue type. */ +export const StatusMappingSchema = z.object({ + /** The ID of the issue type. */ + issueTypeId: z.string(), + /** The ID of the new status. */ + newStatusId: z.string(), + /** The ID of the status. */ + statusId: z.string(), +}); + +export type StatusMapping = z.infer; diff --git a/src/version2/schemas/statusMappingDTO.ts b/src/version2/schemas/statusMappingDTO.ts new file mode 100644 index 0000000000..2b859120c9 --- /dev/null +++ b/src/version2/schemas/statusMappingDTO.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { StatusMigrationSchema } from './statusMigration'; + +/** The mapping of old to new status ID for a specific project and issue type. */ +export const StatusMappingDTOSchema = z.object({ + /** The issue type for the status mapping. */ + issueTypeId: z.string(), + /** The project for the status mapping. */ + projectId: z.string(), + /** The list of old and new status ID mappings for the specified project and issue type. */ + statusMigrations: z.array(StatusMigrationSchema), +}); + +export type StatusMappingDTO = z.infer; diff --git a/src/version2/schemas/statusMetadata.ts b/src/version2/schemas/statusMetadata.ts new file mode 100644 index 0000000000..cf83c58a80 --- /dev/null +++ b/src/version2/schemas/statusMetadata.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The details of the statuses in the associated workflows. */ +export const StatusMetadataSchema = z.object({ + /** The category of the status. */ + category: z.enum(['TODO', 'IN_PROGRESS', 'DONE']).optional(), + /** The ID of the status. */ + id: z.string().optional(), + /** The name of the status. */ + name: z.string().optional(), +}); + +export type StatusMetadata = z.infer; diff --git a/src/version2/schemas/statusMigration.ts b/src/version2/schemas/statusMigration.ts new file mode 100644 index 0000000000..68167d8b53 --- /dev/null +++ b/src/version2/schemas/statusMigration.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The mapping of old to new status ID. */ +export const StatusMigrationSchema = z.object({ + /** The new status ID. */ + newStatusReference: z.string(), + /** The old status ID. */ + oldStatusReference: z.string(), +}); + +export type StatusMigration = z.infer; diff --git a/src/version2/schemas/statusPayload.ts b/src/version2/schemas/statusPayload.ts new file mode 100644 index 0000000000..5292291850 --- /dev/null +++ b/src/version2/schemas/statusPayload.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** The payload for creating a status */ +export const StatusPayloadSchema = z.object({ + /** The description of the status */ + description: z.string().optional(), + /** The name of the status */ + name: z.string().optional(), + /** + * The conflict strategy for the status already exists. FAIL - Fail execution, this always needs to be unique; USE - + * Use the existing entity and ignore new entity parameters; NEW - Create a new entity + */ + onConflict: z.enum(['FAIL', 'USE', 'NEW']).optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), + /** The status category of the status. The value is case-sensitive. */ + statusCategory: z.enum(['TODO', 'IN_PROGRESS', 'DONE']).optional(), +}); + +export type StatusPayload = z.infer; diff --git a/src/version2/schemas/statusProjectIssueTypeUsage.ts b/src/version2/schemas/statusProjectIssueTypeUsage.ts new file mode 100644 index 0000000000..bcfe2764a0 --- /dev/null +++ b/src/version2/schemas/statusProjectIssueTypeUsage.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The list of issue types. */ +export const StatusProjectIssueTypeUsageSchema = z.object({ + /** The issue type ID. */ + id: z.string().optional(), +}); + +export type StatusProjectIssueTypeUsage = z.infer; diff --git a/src/version2/schemas/statusProjectIssueTypeUsageDTO.ts b/src/version2/schemas/statusProjectIssueTypeUsageDTO.ts new file mode 100644 index 0000000000..6f07889837 --- /dev/null +++ b/src/version2/schemas/statusProjectIssueTypeUsageDTO.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { StatusProjectIssueTypeUsagePageSchema } from './statusProjectIssueTypeUsagePage'; + +/** The issue types using this status in a project. */ +export const StatusProjectIssueTypeUsageDTOSchema = z.object({ + issueTypes: StatusProjectIssueTypeUsagePageSchema.optional(), + /** The project ID. */ + projectId: z.string().optional(), + /** The status ID. */ + statusId: z.string().optional(), +}); + +export type StatusProjectIssueTypeUsageDTO = z.infer; diff --git a/src/version2/schemas/statusProjectIssueTypeUsagePage.ts b/src/version2/schemas/statusProjectIssueTypeUsagePage.ts new file mode 100644 index 0000000000..5a50caf76f --- /dev/null +++ b/src/version2/schemas/statusProjectIssueTypeUsagePage.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { StatusProjectIssueTypeUsageSchema } from './statusProjectIssueTypeUsage'; + +/** A page of issue types. */ +export const StatusProjectIssueTypeUsagePageSchema = z.object({ + /** Page token for the next page of issue type usages. */ + nextPageToken: z.string().optional(), + /** The list of issue types. */ + values: z.array(StatusProjectIssueTypeUsageSchema).optional(), +}); + +export type StatusProjectIssueTypeUsagePage = z.infer; diff --git a/src/version2/schemas/statusProjectUsage.ts b/src/version2/schemas/statusProjectUsage.ts new file mode 100644 index 0000000000..be8af0833b --- /dev/null +++ b/src/version2/schemas/statusProjectUsage.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The project. */ +export const StatusProjectUsageSchema = z.object({ + /** The project ID. */ + id: z.string().optional(), +}); + +export type StatusProjectUsage = z.infer; diff --git a/src/version2/schemas/statusProjectUsageDTO.ts b/src/version2/schemas/statusProjectUsageDTO.ts new file mode 100644 index 0000000000..5018e3cc6d --- /dev/null +++ b/src/version2/schemas/statusProjectUsageDTO.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { StatusProjectUsagePageSchema } from './statusProjectUsagePage'; + +/** The projects using this status. */ +export const StatusProjectUsageDTOSchema = z.object({ + projects: StatusProjectUsagePageSchema.optional(), + /** The status ID. */ + statusId: z.string().optional(), +}); + +export type StatusProjectUsageDTO = z.infer; diff --git a/src/version2/schemas/statusProjectUsagePage.ts b/src/version2/schemas/statusProjectUsagePage.ts new file mode 100644 index 0000000000..c5f040a8eb --- /dev/null +++ b/src/version2/schemas/statusProjectUsagePage.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { StatusProjectUsageSchema } from './statusProjectUsage'; + +/** A page of projects. */ +export const StatusProjectUsagePageSchema = z.object({ + /** Page token for the next page of issue type usages. */ + nextPageToken: z.string().optional(), + /** The list of projects. */ + values: z.array(StatusProjectUsageSchema).optional(), +}); + +export type StatusProjectUsagePage = z.infer; diff --git a/src/version2/schemas/statusScope.ts b/src/version2/schemas/statusScope.ts new file mode 100644 index 0000000000..3fc9638670 --- /dev/null +++ b/src/version2/schemas/statusScope.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { ProjectIdSchema } from './projectId'; + +/** The scope of the status. */ +export const StatusScopeSchema = z.object({ + project: ProjectIdSchema.optional(), + /** The scope of the status. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ + type: z.enum(['PROJECT', 'GLOBAL']), +}); + +export type StatusScope = z.infer; diff --git a/src/version2/schemas/statusUpdate.ts b/src/version2/schemas/statusUpdate.ts new file mode 100644 index 0000000000..a2f7b91bad --- /dev/null +++ b/src/version2/schemas/statusUpdate.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Details of the status being updated. */ +export const StatusUpdateSchema = z.object({ + /** The description of the status. */ + description: z.string().optional(), + /** The ID of the status. */ + id: z.string(), + /** The name of the status. */ + name: z.string(), + /** The category of the status. */ + statusCategory: z.enum(['TODO', 'IN_PROGRESS', 'DONE']), +}); + +export type StatusUpdate = z.infer; diff --git a/src/version2/schemas/statusUpdateRequest.ts b/src/version2/schemas/statusUpdateRequest.ts new file mode 100644 index 0000000000..b6ca6147d1 --- /dev/null +++ b/src/version2/schemas/statusUpdateRequest.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { StatusUpdateSchema } from './statusUpdate'; + +/** The list of statuses that will be updated. */ +export const StatusUpdateRequestSchema = z.object({ + /** The list of statuses that will be updated. */ + statuses: z.array(StatusUpdateSchema), +}); + +export type StatusUpdateRequest = z.infer; diff --git a/src/version2/schemas/statusWorkflowUsageDTO.ts b/src/version2/schemas/statusWorkflowUsageDTO.ts new file mode 100644 index 0000000000..4feda07ac9 --- /dev/null +++ b/src/version2/schemas/statusWorkflowUsageDTO.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { StatusWorkflowUsagePageSchema } from './statusWorkflowUsagePage'; + +/** Workflows using the status. */ +export const StatusWorkflowUsageDTOSchema = z.object({ + /** The status ID. */ + statusId: z.string().optional(), + workflows: StatusWorkflowUsagePageSchema.optional(), +}); + +export type StatusWorkflowUsageDTO = z.infer; diff --git a/src/version2/schemas/statusWorkflowUsagePage.ts b/src/version2/schemas/statusWorkflowUsagePage.ts new file mode 100644 index 0000000000..c88f3c97a6 --- /dev/null +++ b/src/version2/schemas/statusWorkflowUsagePage.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { StatusWorkflowUsageWorkflowSchema } from './statusWorkflowUsageWorkflow'; + +/** A page of workflows. */ +export const StatusWorkflowUsagePageSchema = z.object({ + /** Page token for the next page of issue type usages. */ + nextPageToken: z.string().optional(), + /** The list of statuses. */ + values: z.array(StatusWorkflowUsageWorkflowSchema).optional(), +}); + +export type StatusWorkflowUsagePage = z.infer; diff --git a/src/version2/schemas/statusWorkflowUsageWorkflow.ts b/src/version2/schemas/statusWorkflowUsageWorkflow.ts new file mode 100644 index 0000000000..a7efe5c9b0 --- /dev/null +++ b/src/version2/schemas/statusWorkflowUsageWorkflow.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The worflow. */ +export const StatusWorkflowUsageWorkflowSchema = z.object({ + /** The workflow ID. */ + id: z.string().optional(), +}); + +export type StatusWorkflowUsageWorkflow = z.infer; diff --git a/src/version2/schemas/statusesPerWorkflow.ts b/src/version2/schemas/statusesPerWorkflow.ts new file mode 100644 index 0000000000..b6be6f8c5d --- /dev/null +++ b/src/version2/schemas/statusesPerWorkflow.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The statuses associated with each workflow. */ +export const StatusesPerWorkflowSchema = z.object({ + /** The ID of the initial status for the workflow. */ + initialStatusId: z.string().optional(), + /** The status IDs associated with the workflow. */ + statuses: z.array(z.string()).optional(), + /** The ID of the workflow. */ + workflowId: z.string().optional(), +}); + +export type StatusesPerWorkflow = z.infer; diff --git a/src/version2/schemas/streamingResponseBody.ts b/src/version2/schemas/streamingResponseBody.ts new file mode 100644 index 0000000000..a12fe46c92 --- /dev/null +++ b/src/version2/schemas/streamingResponseBody.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const StreamingResponseBodySchema = z.object({}); + +export type StreamingResponseBody = z.infer; diff --git a/src/version2/schemas/stringList.ts b/src/version2/schemas/stringList.ts new file mode 100644 index 0000000000..f7a3767d91 --- /dev/null +++ b/src/version2/schemas/stringList.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const StringListSchema = z.object({}); + +export type StringList = z.infer; diff --git a/src/version2/schemas/suggestedIssue.ts b/src/version2/schemas/suggestedIssue.ts new file mode 100644 index 0000000000..1daf78f5bd --- /dev/null +++ b/src/version2/schemas/suggestedIssue.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** An issue suggested for use in the issue picker auto-completion. */ +export const SuggestedIssueSchema = z.object({ + /** The ID of the issue. */ + id: z.number().int().optional(), + /** The URL of the issue type's avatar. */ + img: z.string().optional(), + /** The key of the issue. */ + key: z.string().optional(), + /** The key of the issue in HTML format. */ + keyHtml: z.string().optional(), + /** The phrase containing the query string in HTML format, with the string highlighted with HTML bold tags. */ + summary: z.string().optional(), + /** The phrase containing the query string, as plain text. */ + summaryText: z.string().optional(), +}); + +export type SuggestedIssue = z.infer; diff --git a/src/version2/schemas/suggestedMappingsForPrioritiesRequestBean.ts b/src/version2/schemas/suggestedMappingsForPrioritiesRequestBean.ts new file mode 100644 index 0000000000..9d7e419b2e --- /dev/null +++ b/src/version2/schemas/suggestedMappingsForPrioritiesRequestBean.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of changes to a priority scheme's priorities that require suggested priority mappings. */ +export const SuggestedMappingsForPrioritiesRequestBeanSchema = z.object({ + /** The ids of priorities being removed from the scheme. */ + add: z.array(z.number().int()).optional(), + /** The ids of priorities being removed from the scheme. */ + remove: z.array(z.number().int()).optional(), +}); + +export type SuggestedMappingsForPrioritiesRequestBean = z.infer; diff --git a/src/version2/schemas/suggestedMappingsForProjectsRequestBean.ts b/src/version2/schemas/suggestedMappingsForProjectsRequestBean.ts new file mode 100644 index 0000000000..6f2c9174dc --- /dev/null +++ b/src/version2/schemas/suggestedMappingsForProjectsRequestBean.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** Details of changes to a priority scheme's projects that require suggested priority mappings. */ +export const SuggestedMappingsForProjectsRequestBeanSchema = z.object({ + /** The ids of projects being added to the scheme. */ + add: z.array(z.number().int()).optional(), +}); + +export type SuggestedMappingsForProjectsRequestBean = z.infer; diff --git a/src/version2/schemas/suggestedMappingsRequestBean.ts b/src/version2/schemas/suggestedMappingsRequestBean.ts new file mode 100644 index 0000000000..1d4468cb8f --- /dev/null +++ b/src/version2/schemas/suggestedMappingsRequestBean.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details of changes to a priority scheme that require suggested priority mappings. */ +export const SuggestedMappingsRequestBeanSchema = z.object({ + /** The maximum number of results that could be on the page. */ + maxResults: z.number().int().optional(), + /** The priority changes in the scheme. */ + priorities: z.unknown().optional(), + /** The project changes in the scheme. */ + projects: z.unknown().optional(), + /** The id of the priority scheme. */ + schemeId: z.number().int().optional(), + /** The index of the first item returned on the page. */ + startAt: z.number().int().optional(), +}); + +export type SuggestedMappingsRequestBean = z.infer; diff --git a/src/version2/schemas/swimlanePayload.ts b/src/version2/schemas/swimlanePayload.ts new file mode 100644 index 0000000000..42133e6a3c --- /dev/null +++ b/src/version2/schemas/swimlanePayload.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The payload for custom swimlanes */ +export const SwimlanePayloadSchema = z.object({ + /** The description of the quick filter */ + description: z.string().optional(), + /** The jql query for the quick filter */ + jqlQuery: z.string().optional(), + /** The name of the quick filter */ + name: z.string().optional(), +}); + +export type SwimlanePayload = z.infer; diff --git a/src/version2/schemas/swimlanesPayload.ts b/src/version2/schemas/swimlanesPayload.ts new file mode 100644 index 0000000000..012e512663 --- /dev/null +++ b/src/version2/schemas/swimlanesPayload.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; +import { SwimlanePayloadSchema } from './swimlanePayload'; + +/** The payload for customising a swimlanes on a board */ +export const SwimlanesPayloadSchema = z.object({ + /** The custom swimlane definitions. */ + customSwimlanes: z.array(SwimlanePayloadSchema).optional(), + /** The name of the custom swimlane to use for work items that don't match any other swimlanes. */ + defaultCustomSwimlaneName: z.string().optional(), + /** The swimlane strategy for the board. */ + swimlaneStrategy: z + .enum([ + 'none', + 'custom', + 'parentChild', + 'assignee', + 'assigneeUnassignedFirst', + 'epic', + 'project', + 'issueparent', + 'issuechildren', + 'request_type', + ]) + .optional(), +}); + +export type SwimlanesPayload = z.infer; diff --git a/src/version2/schemas/systemAvatars.ts b/src/version2/schemas/systemAvatars.ts new file mode 100644 index 0000000000..08115cae84 --- /dev/null +++ b/src/version2/schemas/systemAvatars.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { AvatarSchema } from './avatar'; + +/** List of system avatars. */ +export const SystemAvatarsSchema = z.object({ + /** A list of avatar details. */ + system: z.array(AvatarSchema).optional(), +}); + +export type SystemAvatars = z.infer; diff --git a/src/version2/schemas/tabPayload.ts b/src/version2/schemas/tabPayload.ts new file mode 100644 index 0000000000..a19b8eaf77 --- /dev/null +++ b/src/version2/schemas/tabPayload.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** + * Defines the payload for the tabs of the screen. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-tab-fields/#api-rest-api-3-screens-screenid-tabs-tabid-fields-post + */ +export const TabPayloadSchema = z.object({ + /** + * The list of resource identifier of the field associated to the tab. See + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-tab-fields/#api-rest-api-3-screens-screenid-tabs-tabid-fields-post + */ + fields: z.array(ProjectCreateResourceIdentifierSchema).optional(), + /** The name of the tab */ + name: z.string().optional(), +}); + +export type TabPayload = z.infer; diff --git a/src/version2/schemas/taskProgressBeanJsonNode.ts b/src/version2/schemas/taskProgressBeanJsonNode.ts new file mode 100644 index 0000000000..8d394468bc --- /dev/null +++ b/src/version2/schemas/taskProgressBeanJsonNode.ts @@ -0,0 +1,33 @@ +import { z } from 'zod'; + +/** Details about a task. */ +export const TaskProgressBeanJsonNodeSchema = z.object({ + /** The description of the task. */ + description: z.string().optional(), + /** The execution time of the task, in milliseconds. */ + elapsedRuntime: z.number().int(), + /** A timestamp recording when the task was finished. */ + finished: z.number().int().optional(), + /** The ID of the task. */ + id: z.string(), + /** A timestamp recording when the task progress was last updated. */ + lastUpdate: z.number().int(), + /** Information about the progress of the task. */ + message: z.string().optional(), + /** The progress of the task, as a percentage complete. */ + progress: z.number().int(), + /** The result of the task execution. */ + result: z.unknown().optional(), + /** The URL of the task. */ + self: z.string(), + /** A timestamp recording when the task was started. */ + started: z.number().int().optional(), + /** The status of the task. */ + status: z.enum(['ENQUEUED', 'RUNNING', 'COMPLETE', 'FAILED', 'CANCEL_REQUESTED', 'CANCELLED', 'DEAD']), + /** A timestamp recording when the task was submitted. */ + submitted: z.number().int(), + /** The ID of the user who submitted the task. */ + submittedBy: z.number().int(), +}); + +export type TaskProgressBeanJsonNode = z.infer; diff --git a/src/version2/schemas/taskProgressBeanObject.ts b/src/version2/schemas/taskProgressBeanObject.ts new file mode 100644 index 0000000000..ed1954d2b9 --- /dev/null +++ b/src/version2/schemas/taskProgressBeanObject.ts @@ -0,0 +1,33 @@ +import { z } from 'zod'; + +/** Details about a task. */ +export const TaskProgressBeanObjectSchema = z.object({ + /** The description of the task. */ + description: z.string().optional(), + /** The execution time of the task, in milliseconds. */ + elapsedRuntime: z.number().int(), + /** A timestamp recording when the task was finished. */ + finished: z.number().int().optional(), + /** The ID of the task. */ + id: z.string(), + /** A timestamp recording when the task progress was last updated. */ + lastUpdate: z.number().int(), + /** Information about the progress of the task. */ + message: z.string().optional(), + /** The progress of the task, as a percentage complete. */ + progress: z.number().int(), + /** The result of the task execution. */ + result: z.unknown().optional(), + /** The URL of the task. */ + self: z.string(), + /** A timestamp recording when the task was started. */ + started: z.number().int().optional(), + /** The status of the task. */ + status: z.enum(['ENQUEUED', 'RUNNING', 'COMPLETE', 'FAILED', 'CANCEL_REQUESTED', 'CANCELLED', 'DEAD']), + /** A timestamp recording when the task was submitted. */ + submitted: z.number().int(), + /** The ID of the user who submitted the task. */ + submittedBy: z.number().int(), +}); + +export type TaskProgressBeanObject = z.infer; diff --git a/src/version2/schemas/taskProgressBeanRemoveOptionFromIssuesResult.ts b/src/version2/schemas/taskProgressBeanRemoveOptionFromIssuesResult.ts new file mode 100644 index 0000000000..7e0f1eebd7 --- /dev/null +++ b/src/version2/schemas/taskProgressBeanRemoveOptionFromIssuesResult.ts @@ -0,0 +1,35 @@ +import { z } from 'zod'; + +/** Details about a task. */ +export const TaskProgressBeanRemoveOptionFromIssuesResultSchema = z.object({ + /** The description of the task. */ + description: z.string().optional(), + /** The execution time of the task, in milliseconds. */ + elapsedRuntime: z.number().int(), + /** A timestamp recording when the task was finished. */ + finished: z.number().int().optional(), + /** The ID of the task. */ + id: z.string(), + /** A timestamp recording when the task progress was last updated. */ + lastUpdate: z.number().int(), + /** Information about the progress of the task. */ + message: z.string().optional(), + /** The progress of the task, as a percentage complete. */ + progress: z.number().int(), + /** The result of the task execution. */ + result: z.unknown().optional(), + /** The URL of the task. */ + self: z.string(), + /** A timestamp recording when the task was started. */ + started: z.number().int().optional(), + /** The status of the task. */ + status: z.enum(['ENQUEUED', 'RUNNING', 'COMPLETE', 'FAILED', 'CANCEL_REQUESTED', 'CANCELLED', 'DEAD']), + /** A timestamp recording when the task was submitted. */ + submitted: z.number().int(), + /** The ID of the user who submitted the task. */ + submittedBy: z.number().int(), +}); + +export type TaskProgressBeanRemoveOptionFromIssuesResult = z.infer< + typeof TaskProgressBeanRemoveOptionFromIssuesResultSchema +>; diff --git a/src/version2/schemas/timeTrackingConfiguration.ts b/src/version2/schemas/timeTrackingConfiguration.ts new file mode 100644 index 0000000000..6b283be693 --- /dev/null +++ b/src/version2/schemas/timeTrackingConfiguration.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Details of the time tracking configuration. */ +export const TimeTrackingConfigurationSchema = z.object({ + /** The default unit of time applied to logged time. */ + defaultUnit: z.enum(['minute', 'hour', 'day', 'week']), + /** The format that will appear on an issue's _Time Spent_ field. */ + timeFormat: z.enum(['pretty', 'days', 'hours']), + /** The number of days in a working week. */ + workingDaysPerWeek: z.number(), + /** The number of hours in a working day. */ + workingHoursPerDay: z.number(), +}); + +export type TimeTrackingConfiguration = z.infer; diff --git a/src/version2/schemas/timeTrackingDetails.ts b/src/version2/schemas/timeTrackingDetails.ts new file mode 100644 index 0000000000..789f1a164e --- /dev/null +++ b/src/version2/schemas/timeTrackingDetails.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** Time tracking details. */ +export const TimeTrackingDetailsSchema = z.object({ + /** The original estimate of time needed for this issue in readable format. */ + originalEstimate: z.string().optional(), + /** The original estimate of time needed for this issue in seconds. */ + originalEstimateSeconds: z.number().int().optional(), + /** The remaining estimate of time needed for this issue in readable format. */ + remainingEstimate: z.string().optional(), + /** The remaining estimate of time needed for this issue in seconds. */ + remainingEstimateSeconds: z.number().int().optional(), + /** Time worked on this issue in readable format. */ + timeSpent: z.string().optional(), + /** Time worked on this issue in seconds. */ + timeSpentSeconds: z.number().int().optional(), +}); + +export type TimeTrackingDetails = z.infer; diff --git a/src/version2/schemas/timeTrackingProvider.ts b/src/version2/schemas/timeTrackingProvider.ts new file mode 100644 index 0000000000..68a5ecb1b8 --- /dev/null +++ b/src/version2/schemas/timeTrackingProvider.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details about the time tracking provider. */ +export const TimeTrackingProviderSchema = z.object({ + /** The key for the time tracking provider. For example, _JIRA_. */ + key: z.string(), + /** The name of the time tracking provider. For example, _JIRA provided time tracking_. */ + name: z.string().optional(), + /** + * The URL of the configuration page for the time tracking provider app. For example, _/example/config/url_. This + * property is only returned if the `adminPageKey` property is set in the module descriptor of the time tracking + * provider app. + */ + url: z.string().optional(), +}); + +export type TimeTrackingProvider = z.infer; diff --git a/src/version2/schemas/toLayoutPayload.ts b/src/version2/schemas/toLayoutPayload.ts new file mode 100644 index 0000000000..37e588384e --- /dev/null +++ b/src/version2/schemas/toLayoutPayload.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** The payload for the layout details for the destination end of a transition */ +export const ToLayoutPayloadSchema = z.object({ + /** Defines where the transition line will be connected to a status. Port 0 to 7 are acceptable values. */ + port: z.number().int().optional(), + status: ProjectCreateResourceIdentifierSchema.optional(), +}); + +export type ToLayoutPayload = z.infer; diff --git a/src/version2/schemas/transition.ts b/src/version2/schemas/transition.ts new file mode 100644 index 0000000000..634008262c --- /dev/null +++ b/src/version2/schemas/transition.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; +import { WorkflowRulesSchema } from './workflowRules'; +import { TransitionScreenDetailsSchema } from './transitionScreenDetails'; + +/** Details of a workflow transition. */ +export const TransitionSchema = z.object({ + /** The description of the transition. */ + description: z.string(), + /** The statuses the transition can start from. */ + from: z.array(z.string()), + /** The ID of the transition. */ + id: z.string(), + /** The name of the transition. */ + name: z.string(), + /** The properties of the transition. */ + properties: z.object({}).optional(), + rules: WorkflowRulesSchema.optional(), + screen: TransitionScreenDetailsSchema.optional(), + /** The status the transition goes to. */ + to: z.string(), + /** The type of the transition. */ + type: z.enum(['global', 'initial', 'directed']), +}); + +export type Transition = z.infer; diff --git a/src/version2/schemas/transitionPayload.ts b/src/version2/schemas/transitionPayload.ts new file mode 100644 index 0000000000..f25e1166f2 --- /dev/null +++ b/src/version2/schemas/transitionPayload.ts @@ -0,0 +1,37 @@ +import { z } from 'zod'; +import { RulePayloadSchema } from './rulePayload'; +import { ConditionGroupPayloadSchema } from './conditionGroupPayload'; +import { FromLayoutPayloadSchema } from './fromLayoutPayload'; +import { ToLayoutPayloadSchema } from './toLayoutPayload'; + +/** The payload for creating a transition in a workflow. Can be DIRECTED, GLOBAL, SELF-LOOPED, GLOBAL LOOPED */ +export const TransitionPayloadSchema = z.object({ + /** The actions that are performed when the transition is made */ + actions: z.array(RulePayloadSchema).optional(), + conditions: ConditionGroupPayloadSchema.optional(), + /** + * Mechanism in Jira for triggering certain actions, like notifications, automations, etc. Unless a custom + * notification scheme is configure, it's better not to provide any value here + */ + customIssueEventId: z.string().optional(), + /** The description of the transition */ + description: z.string().optional(), + /** The statuses that the transition can be made from */ + from: z.array(FromLayoutPayloadSchema).optional(), + /** The id of the transition */ + id: z.number().int().optional(), + /** The name of the transition */ + name: z.string().optional(), + /** The properties of the transition */ + properties: z.object({}).optional(), + to: ToLayoutPayloadSchema.optional(), + transitionScreen: RulePayloadSchema.optional(), + /** The triggers that are performed when the transition is made */ + triggers: z.array(RulePayloadSchema).optional(), + /** The type of the transition */ + type: z.enum(['global', 'initial', 'directed']).optional(), + /** The validators that are performed when the transition is made */ + validators: z.array(RulePayloadSchema).optional(), +}); + +export type TransitionPayload = z.infer; diff --git a/src/version2/schemas/transitionScreenDetails.ts b/src/version2/schemas/transitionScreenDetails.ts new file mode 100644 index 0000000000..4b142f293e --- /dev/null +++ b/src/version2/schemas/transitionScreenDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The details of a transition screen. */ +export const TransitionScreenDetailsSchema = z.object({ + /** The ID of the screen. */ + id: z.string(), + /** The name of the screen. */ + name: z.string().optional(), +}); + +export type TransitionScreenDetails = z.infer; diff --git a/src/version2/schemas/transitionUpdateDTO.ts b/src/version2/schemas/transitionUpdateDTO.ts new file mode 100644 index 0000000000..7ece758f43 --- /dev/null +++ b/src/version2/schemas/transitionUpdateDTO.ts @@ -0,0 +1,35 @@ +import { z } from 'zod'; +import { WorkflowRuleConfigurationSchema } from './workflowRuleConfiguration'; +import { ConditionGroupUpdateSchema } from './conditionGroupUpdate'; +import { WorkflowTransitionLinksSchema } from './workflowTransitionLinks'; +import { WorkflowTriggerSchema } from './workflowTrigger'; + +/** The transition update data. */ +export const TransitionUpdateDTOSchema = z.object({ + /** The post-functions of the transition. */ + actions: z.array(WorkflowRuleConfigurationSchema).optional(), + conditions: ConditionGroupUpdateSchema.optional(), + /** The custom event ID of the transition. */ + customIssueEventId: z.string().optional(), + /** The description of the transition. */ + description: z.string().optional(), + /** The ID of the transition. */ + id: z.string().optional(), + /** The statuses the transition can start from, and the mapping of ports between the statuses. */ + links: z.array(WorkflowTransitionLinksSchema).optional(), + /** The name of the transition. */ + name: z.string().optional(), + /** The properties of the transition. */ + properties: z.object({}).optional(), + /** The status the transition goes to. */ + toStatusReference: z.string().optional(), + transitionScreen: WorkflowRuleConfigurationSchema.optional(), + /** The triggers of the transition. */ + triggers: z.array(WorkflowTriggerSchema).optional(), + /** The transition type. */ + type: z.enum(['INITIAL', 'GLOBAL', 'DIRECTED']).optional(), + /** The validators of the transition. */ + validators: z.array(WorkflowRuleConfigurationSchema).optional(), +}); + +export type TransitionUpdateDTO = z.infer; diff --git a/src/version2/schemas/transitions.ts b/src/version2/schemas/transitions.ts new file mode 100644 index 0000000000..235f0eb7f8 --- /dev/null +++ b/src/version2/schemas/transitions.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { IssueTransitionSchema } from './issueTransition'; + +/** List of issue transitions. */ +export const TransitionsSchema = z.object({ + /** Expand options that include additional transitions details in the response. */ + expand: z.string().optional(), + /** List of issue transitions. */ + transitions: z.array(IssueTransitionSchema).optional(), +}); + +export type Transitions = z.infer; diff --git a/src/version2/schemas/uiModificationContextDetails.ts b/src/version2/schemas/uiModificationContextDetails.ts new file mode 100644 index 0000000000..55998fc46c --- /dev/null +++ b/src/version2/schemas/uiModificationContextDetails.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; + +/** The details of a UI modification's context, which define where to activate the UI modification. */ +export const UiModificationContextDetailsSchema = z.object({ + /** The ID of the UI modification context. */ + id: z.string().optional(), + /** Whether a context is available. For example, when a project is deleted the context becomes unavailable. */ + isAvailable: z.boolean().optional(), + /** + * The issue type ID of the context. Null is treated as a wildcard, meaning the UI modification will be applied to all + * issue types. Each UI modification context can have a maximum of one wildcard. + */ + issueTypeId: z.string().optional(), + /** + * The project ID of the context. Null is treated as a wildcard, meaning the UI modification will be applied to all + * projects. Each UI modification context can have a maximum of one wildcard. + */ + projectId: z.string().optional(), + /** + * The view type of the context. Only `GIC`(Global Issue Create), `IssueView` and `IssueTransition` are supported. + * Null is treated as a wildcard, meaning the UI modification will be applied to all view types. Each UI modification + * context can have a maximum of one wildcard. + */ + viewType: z.enum(['GIC', 'IssueView', 'IssueTransition']).optional(), +}); + +export type UiModificationContextDetails = z.infer; diff --git a/src/version2/schemas/uiModificationDetails.ts b/src/version2/schemas/uiModificationDetails.ts new file mode 100644 index 0000000000..8df219db0f --- /dev/null +++ b/src/version2/schemas/uiModificationDetails.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; +import { UiModificationContextDetailsSchema } from './uiModificationContextDetails'; + +/** The details of a UI modification. */ +export const UiModificationDetailsSchema = z.object({ + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts: z.array(UiModificationContextDetailsSchema).optional(), + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data: z.string().optional(), + /** The description of the UI modification. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The ID of the UI modification. */ + id: z.string(), + /** The name of the UI modification. The maximum length is 255 characters. */ + name: z.string(), + /** The URL of the UI modification. */ + self: z.string(), +}); + +export type UiModificationDetails = z.infer; diff --git a/src/version2/schemas/uiModificationIdentifiers.ts b/src/version2/schemas/uiModificationIdentifiers.ts new file mode 100644 index 0000000000..2e4b4cacb1 --- /dev/null +++ b/src/version2/schemas/uiModificationIdentifiers.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Identifiers for a UI modification. */ +export const UiModificationIdentifiersSchema = z.object({ + /** The ID of the UI modification. */ + id: z.string(), + /** The URL of the UI modification. */ + self: z.string(), +}); + +export type UiModificationIdentifiers = z.infer; diff --git a/src/version2/schemas/unrestrictedUserEmail.ts b/src/version2/schemas/unrestrictedUserEmail.ts new file mode 100644 index 0000000000..fbcb640350 --- /dev/null +++ b/src/version2/schemas/unrestrictedUserEmail.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const UnrestrictedUserEmailSchema = z.object({ + /** The accountId of the user */ + accountId: z.string().optional(), + /** The email of the user */ + email: z.string().optional(), +}); + +export type UnrestrictedUserEmail = z.infer; diff --git a/src/version2/schemas/updateCustomFieldDetails.ts b/src/version2/schemas/updateCustomFieldDetails.ts new file mode 100644 index 0000000000..023ea942d7 --- /dev/null +++ b/src/version2/schemas/updateCustomFieldDetails.ts @@ -0,0 +1,54 @@ +import { z } from 'zod'; + +/** Details of a custom field. */ +export const UpdateCustomFieldDetailsSchema = z.object({ + /** The description of the custom field. The maximum length is 40000 characters. */ + description: z.string().optional(), + /** The name of the custom field. It doesn't have to be unique. The maximum length is 255 characters. */ + name: z.string().optional(), + /** + * The searcher that defines the way the field is searched in Jira. It can be set to `null`, otherwise you must + * specify the valid searcher for the field type, as listed below (abbreviated values shown): + * + * - `cascadingselect`: `cascadingselectsearcher` + * - `datepicker`: `daterange` + * - `datetime`: `datetimerange` + * - `float`: `exactnumber` or `numberrange` + * - `grouppicker`: `grouppickersearcher` + * - `importid`: `exactnumber` or `numberrange` + * - `labels`: `labelsearcher` + * - `multicheckboxes`: `multiselectsearcher` + * - `multigrouppicker`: `multiselectsearcher` + * - `multiselect`: `multiselectsearcher` + * - `multiuserpicker`: `userpickergroupsearcher` + * - `multiversion`: `versionsearcher` + * - `project`: `projectsearcher` + * - `radiobuttons`: `multiselectsearcher` + * - `readonlyfield`: `textsearcher` + * - `select`: `multiselectsearcher` + * - `textarea`: `textsearcher` + * - `textfield`: `textsearcher` + * - `url`: `exacttextsearcher` + * - `userpicker`: `userpickergroupsearcher` + * - `version`: `versionsearcher` + */ + searcherKey: z + .enum([ + 'com.atlassian.jira.plugin.system.customfieldtypes:cascadingselectsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:daterange', + 'com.atlassian.jira.plugin.system.customfieldtypes:datetimerange', + 'com.atlassian.jira.plugin.system.customfieldtypes:exactnumber', + 'com.atlassian.jira.plugin.system.customfieldtypes:exacttextsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:numberrange', + 'com.atlassian.jira.plugin.system.customfieldtypes:projectsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:textsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher', + 'com.atlassian.jira.plugin.system.customfieldtypes:versionsearcher', + ]) + .optional(), +}); + +export type UpdateCustomFieldDetails = z.infer; diff --git a/src/version2/schemas/updateDefaultProjectClassificationBean.ts b/src/version2/schemas/updateDefaultProjectClassificationBean.ts new file mode 100644 index 0000000000..96d2485940 --- /dev/null +++ b/src/version2/schemas/updateDefaultProjectClassificationBean.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The request for updating the default project classification level. */ +export const UpdateDefaultProjectClassificationBeanSchema = z.object({ + /** The ID of the project classification. */ + id: z.string(), +}); + +export type UpdateDefaultProjectClassificationBean = z.infer; diff --git a/src/version2/schemas/updateDefaultScreenScheme.ts b/src/version2/schemas/updateDefaultScreenScheme.ts new file mode 100644 index 0000000000..731adb7cae --- /dev/null +++ b/src/version2/schemas/updateDefaultScreenScheme.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The ID of a screen scheme. */ +export const UpdateDefaultScreenSchemeSchema = z.object({ + /** The ID of the screen scheme. */ + screenSchemeId: z.string(), +}); + +export type UpdateDefaultScreenScheme = z.infer; diff --git a/src/version2/schemas/updateFieldConfigurationSchemeDetails.ts b/src/version2/schemas/updateFieldConfigurationSchemeDetails.ts new file mode 100644 index 0000000000..3b4bfebf09 --- /dev/null +++ b/src/version2/schemas/updateFieldConfigurationSchemeDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The details of the field configuration scheme. */ +export const UpdateFieldConfigurationSchemeDetailsSchema = z.object({ + /** The description of the field configuration scheme. */ + description: z.string().optional(), + /** The name of the field configuration scheme. The name must be unique. */ + name: z.string(), +}); + +export type UpdateFieldConfigurationSchemeDetails = z.infer; diff --git a/src/version2/schemas/updateIssueSecurityLevelDetails.ts b/src/version2/schemas/updateIssueSecurityLevelDetails.ts new file mode 100644 index 0000000000..d440edfbd7 --- /dev/null +++ b/src/version2/schemas/updateIssueSecurityLevelDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of issue security scheme level. */ +export const UpdateIssueSecurityLevelDetailsSchema = z.object({ + /** The description of the issue security scheme level. */ + description: z.string().optional(), + /** The name of the issue security scheme level. Must be unique. */ + name: z.string().optional(), +}); + +export type UpdateIssueSecurityLevelDetails = z.infer; diff --git a/src/version2/schemas/updateIssueSecuritySchemeRequestBean.ts b/src/version2/schemas/updateIssueSecuritySchemeRequestBean.ts new file mode 100644 index 0000000000..88649a2b77 --- /dev/null +++ b/src/version2/schemas/updateIssueSecuritySchemeRequestBean.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const UpdateIssueSecuritySchemeRequestBeanSchema = z.object({ + /** The description of the security scheme scheme. */ + description: z.string().optional(), + /** The name of the security scheme scheme. Must be unique. */ + name: z.string().optional(), +}); + +export type UpdateIssueSecuritySchemeRequestBean = z.infer; diff --git a/src/version2/schemas/updateNotificationSchemeDetails.ts b/src/version2/schemas/updateNotificationSchemeDetails.ts new file mode 100644 index 0000000000..1aa0c3cdf8 --- /dev/null +++ b/src/version2/schemas/updateNotificationSchemeDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of a notification scheme. */ +export const UpdateNotificationSchemeDetailsSchema = z.object({ + /** The description of the notification scheme. */ + description: z.string().optional(), + /** The name of the notification scheme. Must be unique. */ + name: z.string().optional(), +}); + +export type UpdateNotificationSchemeDetails = z.infer; diff --git a/src/version2/schemas/updatePrioritiesInSchemeRequestBean.ts b/src/version2/schemas/updatePrioritiesInSchemeRequestBean.ts new file mode 100644 index 0000000000..1030d248b2 --- /dev/null +++ b/src/version2/schemas/updatePrioritiesInSchemeRequestBean.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Update priorities in a scheme */ +export const UpdatePrioritiesInSchemeRequestBeanSchema = z.object({ + /** Priorities to add to a scheme */ + add: z.unknown().optional(), + /** Priorities to remove from a scheme */ + remove: z.unknown().optional(), +}); + +export type UpdatePrioritiesInSchemeRequestBean = z.infer; diff --git a/src/version2/schemas/updatePriorityDetails.ts b/src/version2/schemas/updatePriorityDetails.ts new file mode 100644 index 0000000000..0a87c82f06 --- /dev/null +++ b/src/version2/schemas/updatePriorityDetails.ts @@ -0,0 +1,43 @@ +import { z } from 'zod'; + +/** Details of an issue priority. */ +export const UpdatePriorityDetailsSchema = z.object({ + /** The ID for the avatar for the priority. This parameter is nullable and both iconUrl and avatarId cannot be defined. */ + avatarId: z.number().int().optional(), + /** The description of the priority. */ + description: z.string().optional(), + /** + * 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. + */ + iconUrl: z + .enum([ + '/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', + ]) + .optional(), + /** The name of the priority. Must be unique. */ + name: z.string().optional(), + /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ + statusColor: z.string().optional(), +}); + +export type UpdatePriorityDetails = z.infer; diff --git a/src/version2/schemas/updatePrioritySchemeRequestBean.ts b/src/version2/schemas/updatePrioritySchemeRequestBean.ts new file mode 100644 index 0000000000..bba0eff79b --- /dev/null +++ b/src/version2/schemas/updatePrioritySchemeRequestBean.ts @@ -0,0 +1,45 @@ +import { z } from 'zod'; + +/** Details of a priority scheme. */ +export const UpdatePrioritySchemeRequestBeanSchema = z.object({ + /** The default priority of the scheme. */ + defaultPriorityId: z.number().int().optional(), + /** The description of the priority scheme. */ + description: z.string().optional(), + /** + * Instructions to migrate the priorities of issues. + * + * `in` mappings are used to migrate the priorities of issues to priorities used within the priority scheme. + * + * `out` mappings are used to migrate the priorities of issues to priorities not used within the priority scheme. + * + * - When **priorities** are **added** to the priority scheme, no mapping needs to be provided as the new priorities are + * not used by any issues. + * - When **priorities** are **removed** from the priority scheme, issues that are using those priorities must be + * migrated to new priorities used by the priority scheme. + * + * - An `in` mapping must be provided for each of these priorities. + * - When **projects** are **added** to the priority scheme, the priorities of issues in those projects might need to be + * migrated to new priorities used by the priority scheme. This can occur when the current scheme does not use all + * the priorities in the project(s)' priority scheme(s). + * + * - An `in` mapping must be provided for each of these priorities. + * - When **projects** are **removed** from the priority scheme, the priorities of issues in those projects might need + * to be migrated to new priorities within the **Default Priority Scheme** that are not used by the priority scheme. + * This can occur when the **Default Priority Scheme** does not use all the priorities within the current scheme. + * + * - An `out` mapping must be provided for each of these priorities. + * + * For more information on `in` and `out` mappings, see the child properties documentation for the `PriorityMapping` + * object below. + */ + mappings: z.unknown().optional(), + /** The name of the priority scheme. Must be unique. */ + name: z.string().optional(), + /** The priorities in the scheme. */ + priorities: z.unknown().optional(), + /** The projects in the scheme. */ + projects: z.unknown().optional(), +}); + +export type UpdatePrioritySchemeRequestBean = z.infer; diff --git a/src/version2/schemas/updatePrioritySchemeResponseBean.ts b/src/version2/schemas/updatePrioritySchemeResponseBean.ts new file mode 100644 index 0000000000..bbc562c290 --- /dev/null +++ b/src/version2/schemas/updatePrioritySchemeResponseBean.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { PrioritySchemeWithPaginatedPrioritiesAndProjectsSchema } from './prioritySchemeWithPaginatedPrioritiesAndProjects'; + +/** Details of the updated priority scheme. */ +export const UpdatePrioritySchemeResponseBeanSchema = z.object({ + priorityScheme: PrioritySchemeWithPaginatedPrioritiesAndProjectsSchema.optional(), + /** The in-progress issue migration task. */ + task: z.unknown().optional(), +}); + +export type UpdatePrioritySchemeResponseBean = z.infer; diff --git a/src/version2/schemas/updateProjectDetails.ts b/src/version2/schemas/updateProjectDetails.ts new file mode 100644 index 0000000000..9009f4f301 --- /dev/null +++ b/src/version2/schemas/updateProjectDetails.ts @@ -0,0 +1,57 @@ +import { z } from 'zod'; + +/** Details about the project. */ +export const UpdateProjectDetailsSchema = z.object({ + /** The default assignee when creating issues for this project. */ + assigneeType: z.enum(['PROJECT_LEAD', 'UNASSIGNED']).optional(), + /** An integer value for the project's avatar. */ + avatarId: z.number().int().optional(), + /** + * 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.` + */ + categoryId: z.number().int().optional(), + /** A brief description of the project. */ + description: z.string().optional(), + /** + * 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 + * scheme IDs. + */ + issueSecurityScheme: z.number().int().optional(), + /** + * 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. + */ + key: z.string().optional(), + /** + * This parameter is deprecated because of privacy changes. Use `leadAccountId` instead. See the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. The user name of the project lead. Cannot be provided with `leadAccountId`. + */ + lead: z.string().optional(), + /** The account ID of the project lead. Cannot be provided with `lead`. */ + leadAccountId: z.string().optional(), + /** The name of the project. */ + name: z.string().optional(), + /** + * 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: z.number().int().optional(), + /** + * 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. + */ + permissionScheme: z.number().int().optional(), + /** + * 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: z.array(z.string()).optional(), + /** A link to information about this project, such as project documentation */ + url: z.string().optional(), +}); + +export type UpdateProjectDetails = z.infer; diff --git a/src/version2/schemas/updateProjectsInSchemeRequestBean.ts b/src/version2/schemas/updateProjectsInSchemeRequestBean.ts new file mode 100644 index 0000000000..748e43f62a --- /dev/null +++ b/src/version2/schemas/updateProjectsInSchemeRequestBean.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Update projects in a scheme */ +export const UpdateProjectsInSchemeRequestBeanSchema = z.object({ + /** Projects to add to a scheme */ + add: z.unknown().optional(), + /** Projects to remove from a scheme */ + remove: z.unknown().optional(), +}); + +export type UpdateProjectsInSchemeRequestBean = z.infer; diff --git a/src/version2/schemas/updateResolutionDetails.ts b/src/version2/schemas/updateResolutionDetails.ts new file mode 100644 index 0000000000..a6f506033b --- /dev/null +++ b/src/version2/schemas/updateResolutionDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of an issue resolution. */ +export const UpdateResolutionDetailsSchema = z.object({ + /** The description of the resolution. */ + description: z.string().optional(), + /** The name of the resolution. Must be unique. */ + name: z.string(), +}); + +export type UpdateResolutionDetails = z.infer; diff --git a/src/version2/schemas/updateScreenDetails.ts b/src/version2/schemas/updateScreenDetails.ts new file mode 100644 index 0000000000..e9e1f7517d --- /dev/null +++ b/src/version2/schemas/updateScreenDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Details of a screen. */ +export const UpdateScreenDetailsSchema = z.object({ + /** The description of the screen. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the screen. The name must be unique. The maximum length is 255 characters. */ + name: z.string().optional(), +}); + +export type UpdateScreenDetails = z.infer; diff --git a/src/version2/schemas/updateScreenSchemeDetails.ts b/src/version2/schemas/updateScreenSchemeDetails.ts new file mode 100644 index 0000000000..81d6ac2672 --- /dev/null +++ b/src/version2/schemas/updateScreenSchemeDetails.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** Details of a screen scheme. */ +export const UpdateScreenSchemeDetailsSchema = z.object({ + /** The description of the screen scheme. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: z.string().optional(), + /** + * The IDs of the screens for the screen types of the screen scheme. Only screens used in classic projects are + * accepted. + */ + screens: z.unknown().optional(), +}); + +export type UpdateScreenSchemeDetails = z.infer; diff --git a/src/version2/schemas/updateScreenTypes.ts b/src/version2/schemas/updateScreenTypes.ts new file mode 100644 index 0000000000..652fff25d4 --- /dev/null +++ b/src/version2/schemas/updateScreenTypes.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** The IDs of the screens for the screen types of the screen scheme. */ +export const UpdateScreenTypesSchema = z.object({ + /** The ID of the create screen. To remove the screen association, pass a null. */ + create: z.string().optional(), + /** The ID of the default screen. When specified, must include a screen ID as a default screen is required. */ + default: z.string().optional(), + /** The ID of the edit screen. To remove the screen association, pass a null. */ + edit: z.string().optional(), + /** The ID of the view screen. To remove the screen association, pass a null. */ + view: z.string().optional(), +}); + +export type UpdateScreenTypes = z.infer; diff --git a/src/version2/schemas/updateUiModificationDetails.ts b/src/version2/schemas/updateUiModificationDetails.ts new file mode 100644 index 0000000000..d115479a20 --- /dev/null +++ b/src/version2/schemas/updateUiModificationDetails.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { UiModificationContextDetailsSchema } from './uiModificationContextDetails'; + +/** The details of a UI modification. */ +export const UpdateUiModificationDetailsSchema = z.object({ + /** + * List of contexts of the UI modification. The maximum number of contexts is 1000. If provided, replaces all existing + * contexts. + */ + contexts: z.array(UiModificationContextDetailsSchema).optional(), + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data: z.string().optional(), + /** The description of the UI modification. The maximum length is 255 characters. */ + description: z.string().optional(), + /** The name of the UI modification. The maximum length is 255 characters. */ + name: z.string().optional(), +}); + +export type UpdateUiModificationDetails = z.infer; diff --git a/src/version2/schemas/updateUserToGroupBean.ts b/src/version2/schemas/updateUserToGroupBean.ts new file mode 100644 index 0000000000..96388dad3f --- /dev/null +++ b/src/version2/schemas/updateUserToGroupBean.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +export const UpdateUserToGroupBeanSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** + * This property is no longer available. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name: z.string().optional(), +}); + +export type UpdateUserToGroupBean = z.infer; diff --git a/src/version2/schemas/updatedProjectCategory.ts b/src/version2/schemas/updatedProjectCategory.ts new file mode 100644 index 0000000000..d931da7c21 --- /dev/null +++ b/src/version2/schemas/updatedProjectCategory.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** A project category. */ +export const UpdatedProjectCategorySchema = z.object({ + /** The name of the project category. */ + description: z.string().optional(), + /** The ID of the project category. */ + id: z.string().optional(), + /** The description of the project category. */ + name: z.string().optional(), + /** The URL of the project category. */ + self: z.string().optional(), +}); + +export type UpdatedProjectCategory = z.infer; diff --git a/src/version2/schemas/user.ts b/src/version2/schemas/user.ts new file mode 100644 index 0000000000..a07f539e67 --- /dev/null +++ b/src/version2/schemas/user.ts @@ -0,0 +1,66 @@ +import { z } from 'zod'; + +/** + * A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these + * exceptions: * + * + * - - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email + * is blank). + * - - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export const UserSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. Required in requests. + */ + accountId: z.string().optional(), + /** + * The user account type. Can take the following values: + * + * - `atlassian` regular Atlassian user account + * - `app` system account used for Connect applications and OAuth to represent external systems + * - `customer` Jira Service Desk account representing an external service desk + */ + accountType: z.enum(['atlassian', 'app', 'customer', 'unknown']).optional(), + /** Whether the user is active. */ + active: z.boolean().optional(), + /** The application roles the user is assigned to. */ + applicationRoles: z.unknown().optional(), + /** The avatars of the user. */ + avatarUrls: z.unknown().optional(), + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName: z.string().optional(), + /** The email address of the user. Depending on the user’s privacy setting, this may be returned as null. */ + emailAddress: z.string().optional(), + /** Expand options that include additional user details in the response. */ + expand: z.string().optional(), + /** The groups that the user belongs to. */ + groups: z.unknown().optional(), + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + key: z.string().optional(), + /** The locale of the user. Depending on the user’s privacy setting, this may be returned as null. */ + locale: z.string().optional(), + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name: z.string().optional(), + /** The URL of the user. */ + self: z.string().optional(), + /** + * The time zone specified in the user's profile. If the user's time zone is not visible to the current user (due to + * user's profile setting), or if a time zone has not been set, the instance's default time zone will be returned. + */ + timeZone: z.string().optional(), +}); + +export type User = z.infer; diff --git a/src/version2/schemas/userBean.ts b/src/version2/schemas/userBean.ts new file mode 100644 index 0000000000..f821036a35 --- /dev/null +++ b/src/version2/schemas/userBean.ts @@ -0,0 +1,31 @@ +import { z } from 'zod'; + +export const UserBeanSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** Whether the user is active. */ + active: z.boolean().optional(), + /** The avatars of the user. */ + avatarUrls: z.unknown().optional(), + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName: z.string().optional(), + /** + * This property is deprecated in favor of `accountId` because of privacy changes. See the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. The key of the user. + */ + key: z.string().optional(), + /** + * This property is deprecated in favor of `accountId` because of privacy changes. See the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. The username of the user. + */ + name: z.string().optional(), + /** The URL of the user. */ + self: z.string().optional(), +}); + +export type UserBean = z.infer; diff --git a/src/version2/schemas/userBeanAvatarUrls.ts b/src/version2/schemas/userBeanAvatarUrls.ts new file mode 100644 index 0000000000..69907687e7 --- /dev/null +++ b/src/version2/schemas/userBeanAvatarUrls.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +export const UserBeanAvatarUrlsSchema = z.object({ + /** The URL of the user's 16x16 pixel avatar. */ + '16x16': z.string().optional(), + /** The URL of the user's 24x24 pixel avatar. */ + '24x24': z.string().optional(), + /** The URL of the user's 32x32 pixel avatar. */ + '32x32': z.string().optional(), + /** The URL of the user's 48x48 pixel avatar. */ + '48x48': z.string().optional(), +}); + +export type UserBeanAvatarUrls = z.infer; diff --git a/src/version2/schemas/userColumnRequestBody.ts b/src/version2/schemas/userColumnRequestBody.ts new file mode 100644 index 0000000000..56dc54de40 --- /dev/null +++ b/src/version2/schemas/userColumnRequestBody.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const UserColumnRequestBodySchema = z.object({ + columns: z.array(z.string()).optional(), +}); + +export type UserColumnRequestBody = z.infer; diff --git a/src/version2/schemas/userContextVariable.ts b/src/version2/schemas/userContextVariable.ts new file mode 100644 index 0000000000..3fdba269b3 --- /dev/null +++ b/src/version2/schemas/userContextVariable.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** + * A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) specified as an + * Atlassian account ID. + */ +export const UserContextVariableSchema = z.object({ + /** The account ID of the user. */ + accountId: z.string(), + /** Type of custom context variable. */ + type: z.string(), +}); + +export type UserContextVariable = z.infer; diff --git a/src/version2/schemas/userDetails.ts b/src/version2/schemas/userDetails.ts new file mode 100644 index 0000000000..515f4f8f12 --- /dev/null +++ b/src/version2/schemas/userDetails.ts @@ -0,0 +1,54 @@ +import { z } from 'zod'; + +/** + * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions: * + * + * - - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email + * is blank). + * - - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export const UserDetailsSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application + * user) or 'customer' (Jira Service Desk customer user) + */ + accountType: z.string().optional(), + /** Whether the user is active. */ + active: z.boolean().optional(), + /** The avatars of the user. */ + avatarUrls: z.unknown().optional(), + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName: z.string().optional(), + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress: z.string().optional(), + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + key: z.string().optional(), + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name: z.string().optional(), + /** The URL of the user. */ + self: z.string().optional(), + /** + * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as + * null. + */ + timeZone: z.string().optional(), +}); + +export type UserDetails = z.infer; diff --git a/src/version2/schemas/userFilter.ts b/src/version2/schemas/userFilter.ts new file mode 100644 index 0000000000..ff7add672d --- /dev/null +++ b/src/version2/schemas/userFilter.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** Filter for a User Picker (single) custom field. */ +export const UserFilterSchema = z.object({ + /** Whether the filter is enabled. */ + enabled: z.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: z.array(z.string()).optional(), + /** + * 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: z.array(z.number().int()).optional(), +}); + +export type UserFilter = z.infer; diff --git a/src/version2/schemas/userKey.ts b/src/version2/schemas/userKey.ts new file mode 100644 index 0000000000..88d9bd78a4 --- /dev/null +++ b/src/version2/schemas/userKey.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; + +/** List of user account IDs. */ +export const UserKeySchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. Returns _unknown_ if the record is deleted and corrupted, for example, as the result of + * a server import. + */ + accountId: z.string().optional(), + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + key: z.string().optional(), +}); + +export type UserKey = z.infer; diff --git a/src/version2/schemas/userList.ts b/src/version2/schemas/userList.ts new file mode 100644 index 0000000000..79dbf2e155 --- /dev/null +++ b/src/version2/schemas/userList.ts @@ -0,0 +1,29 @@ +import { z } from 'zod'; +import { UserSchema } from './user'; + +/** + * A paginated list of users sharing the filter. This includes users that are members of the groups or can browse the + * projects that the filter is shared with. + */ +export const UserListSchema = z + .object({ + /** The index of the last item returned on the page. */ + 'end-index': z.number().int().optional(), + /** The list of items. */ + items: z.array(UserSchema).optional(), + /** The maximum number of results that could be on the page. */ + 'max-results': z.number().int().optional(), + /** The number of items on the page. */ + size: z.number().int().optional(), + /** The index of the first item returned on the page. */ + 'start-index': z.number().int().optional(), + }) + .transform(val => ({ + endIndex: val['end-index'], + items: val['items'], + maxResults: val['max-results'], + size: val['size'], + startIndex: val['start-index'], + })); + +export type UserList = z.infer; diff --git a/src/version2/schemas/userMigrationBean.ts b/src/version2/schemas/userMigrationBean.ts new file mode 100644 index 0000000000..4b23c55b09 --- /dev/null +++ b/src/version2/schemas/userMigrationBean.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +export const UserMigrationBeanSchema = z.object({ + accountId: z.string().optional(), + key: z.string().optional(), + username: z.string().optional(), +}); + +export type UserMigrationBean = z.infer; diff --git a/src/version2/schemas/userNavPropertyJsonBean.ts b/src/version2/schemas/userNavPropertyJsonBean.ts new file mode 100644 index 0000000000..1dbd94125c --- /dev/null +++ b/src/version2/schemas/userNavPropertyJsonBean.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const UserNavPropertyJsonBeanSchema = z.object({ + key: z.string().optional(), + value: z.string().optional(), +}); + +export type UserNavPropertyJsonBean = z.infer; diff --git a/src/version2/schemas/userPermission.ts b/src/version2/schemas/userPermission.ts new file mode 100644 index 0000000000..1731168c5b --- /dev/null +++ b/src/version2/schemas/userPermission.ts @@ -0,0 +1,30 @@ +import { z } from 'zod'; + +/** Details of a permission and its availability to a user. */ +export const UserPermissionSchema = z.object({ + /** + * 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: z.boolean().optional(), + /** The description of the permission. */ + description: z.string().optional(), + /** Whether the permission is available to the user in the queried context. */ + havePermission: z.boolean().optional(), + /** + * 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: z.string().optional(), + /** + * 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: z.string().optional(), + /** The name of the permission. */ + name: z.string().optional(), + /** The type of the permission. */ + type: z.enum(['GLOBAL', 'PROJECT']).optional(), +}); + +export type UserPermission = z.infer; diff --git a/src/version2/schemas/userPickerUser.ts b/src/version2/schemas/userPickerUser.ts new file mode 100644 index 0000000000..66547ae61e --- /dev/null +++ b/src/version2/schemas/userPickerUser.ts @@ -0,0 +1,41 @@ +import { z } from 'zod'; + +/** A user found in a search. */ +export const UserPickerUserSchema = z.object({ + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: z.string().optional(), + /** + * The user account type. Can take the following values: + * + * - `atlassian` regular Atlassian user account + * - `app` system account used for Connect applications and OAuth to represent external systems + * - `customer` Jira Service Desk account representing an external service desk + */ + accountType: z.enum(['atlassian', 'app', 'customer', 'unknown']).optional(), + /** The avatar URL of the user. */ + avatarUrl: z.string().optional(), + /** The display name of the user. Depending on the user’s privacy setting, this may be returned as null. */ + displayName: z.string().optional(), + /** + * The display name, email address, and key of the user with the matched query string highlighted with the HTML bold + * tag. + */ + html: z.string().optional(), + /** + * This property 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: z.string().optional(), + /** + * This property is no longer available . See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name: z.string().optional(), +}); + +export type UserPickerUser = z.infer; diff --git a/src/version2/schemas/validationOptionsForCreate.ts b/src/version2/schemas/validationOptionsForCreate.ts new file mode 100644 index 0000000000..e1bd5250cc --- /dev/null +++ b/src/version2/schemas/validationOptionsForCreate.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** + * The level of validation to return from the API. If no values are provided, the default would return `WARNING` and + * `ERROR` level validation results. + */ +export const ValidationOptionsForCreateSchema = z.object({ + levels: z.array(z.enum(['WARNING', 'ERROR'])).optional(), +}); + +export type ValidationOptionsForCreate = z.infer; diff --git a/src/version2/schemas/validationOptionsForUpdate.ts b/src/version2/schemas/validationOptionsForUpdate.ts new file mode 100644 index 0000000000..c9732177b0 --- /dev/null +++ b/src/version2/schemas/validationOptionsForUpdate.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** + * The level of validation to return from the API. If no values are provided, the default would return `WARNING` and + * `ERROR` level validation results. + */ +export const ValidationOptionsForUpdateSchema = z.object({ + levels: z.array(z.enum(['WARNING', 'ERROR'])).optional(), +}); + +export type ValidationOptionsForUpdate = z.infer; diff --git a/src/version2/schemas/valueOperand.ts b/src/version2/schemas/valueOperand.ts new file mode 100644 index 0000000000..10a895994f --- /dev/null +++ b/src/version2/schemas/valueOperand.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** An operand that is a user-provided value. */ +export const ValueOperandSchema = z.object({ + /** Encoded value, which can be used directly in a JQL query. */ + encodedValue: z.string().optional(), + /** The operand value. */ + value: z.string(), +}); + +export type ValueOperand = z.infer; diff --git a/src/version2/schemas/version.ts b/src/version2/schemas/version.ts new file mode 100644 index 0000000000..c7741d4f7e --- /dev/null +++ b/src/version2/schemas/version.ts @@ -0,0 +1,87 @@ +import { z } from 'zod'; +import { VersionApproverSchema } from './versionApprover'; +import { SimpleLinkSchema } from './simpleLink'; + +/** Details about a project version. */ +export const VersionSchema = z.object({ + /** If the expand option `approvers` is used, returns a list containing the approvers for this version. */ + approvers: z.array(VersionApproverSchema).optional(), + /** Indicates that the version is archived. Optional when creating or updating a version. */ + archived: z.boolean().optional(), + /** The description of the version. Optional when creating or updating a version. The maximum size is 16,384 bytes. */ + description: z.string().optional(), + /** If the expand option `driver` is used, returns the Atlassian account ID of the driver. */ + driver: z.string().optional(), + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about version in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `operations` Returns the list of operations available for this version. + * - `issuesstatus` Returns the count of issues in this version for each of the status categories _to do_, _in + * progress_, _done_, and _unmapped_. The _unmapped_ property contains a count of issues with a status other than + * _to do_, _in progress_, and _done_. + * - `driver` Returns the Atlassian account ID of the version driver. + * - `approvers` Returns a list containing approvers for this version. + * + * Optional for create and update. + */ + expand: z.string().optional(), + /** The ID of the version. */ + id: z.string().optional(), + /** + * If the expand option `issuesstatus` is used, returns the count of issues in this version for each of the status + * categories _to do_, _in progress_, _done_, and _unmapped_. The _unmapped_ property contains a count of issues with + * a status other than _to do_, _in progress_, and _done_. + */ + issuesStatusForFixVersion: z.unknown().optional(), + /** + * The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not + * applicable when creating a version. Optional when updating a version. + */ + moveUnfixedIssuesTo: z.string().optional(), + /** + * The unique name of the version. Required when creating a version. Optional when updating a version. The maximum + * length is 255 characters. + */ + name: z.string().optional(), + /** If the expand option `operations` is used, returns the list of operations available for this version. */ + operations: z.array(SimpleLinkSchema).optional(), + /** Indicates that the version is overdue. */ + overdue: z.boolean().optional(), + /** Deprecated. Use `projectId`. */ + project: z.string().optional(), + /** + * The ID of the project to which this version is attached. Required when creating a version. Not applicable when + * updating a version. + */ + projectId: z.number().int().optional(), + /** + * The release date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a + * version. + */ + releaseDate: z.string().datetime().optional(), + /** + * Indicates that the version is released. If the version is released a request to release again is ignored. Not + * applicable when creating a version. Optional when updating a version. + */ + released: z.boolean().optional(), + /** The URL of the version. */ + self: z.string().optional(), + /** + * The start date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a + * version. + */ + startDate: z.string().datetime().optional(), + /** + * The date on which work on this version is expected to finish, expressed in the instance's _Day/Month/Year Format_ + * date format. + */ + userReleaseDate: z.string().optional(), + /** + * The date on which work on this version is expected to start, expressed in the instance's _Day/Month/Year Format_ + * date format. + */ + userStartDate: z.string().optional(), +}); + +export type Version = z.infer; diff --git a/src/version2/schemas/versionApprover.ts b/src/version2/schemas/versionApprover.ts new file mode 100644 index 0000000000..6e32c04c40 --- /dev/null +++ b/src/version2/schemas/versionApprover.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Contains details about a version approver. */ +export const VersionApproverSchema = z.object({ + /** The Atlassian account ID of the approver. */ + accountId: z.string().optional(), + /** A description of why the user is declining the approval. */ + declineReason: z.string().optional(), + /** A description of what the user is approving within the specified version. */ + description: z.string().optional(), + /** The status of the approval, which can be _PENDING_, _APPROVED_, or _DECLINED_ */ + status: z.string().optional(), +}); + +export type VersionApprover = z.infer; diff --git a/src/version2/schemas/versionIssueCounts.ts b/src/version2/schemas/versionIssueCounts.ts new file mode 100644 index 0000000000..67ee9e7534 --- /dev/null +++ b/src/version2/schemas/versionIssueCounts.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { VersionUsageInCustomFieldSchema } from './versionUsageInCustomField'; + +/** Various counts of issues within a version. */ +export const VersionIssueCountsSchema = z.object({ + /** List of custom fields using the version. */ + customFieldUsage: z.array(VersionUsageInCustomFieldSchema).optional(), + /** Count of issues where a version custom field is set to the version. */ + issueCountWithCustomFieldsShowingVersion: z.number().int().optional(), + /** Count of issues where the `affectedVersion` is set to the version. */ + issuesAffectedCount: z.number().int().optional(), + /** Count of issues where the `fixVersion` is set to the version. */ + issuesFixedCount: z.number().int().optional(), + /** The URL of these count details. */ + self: z.string().optional(), +}); + +export type VersionIssueCounts = z.infer; diff --git a/src/version2/schemas/versionIssuesStatus.ts b/src/version2/schemas/versionIssuesStatus.ts new file mode 100644 index 0000000000..db2a6e9309 --- /dev/null +++ b/src/version2/schemas/versionIssuesStatus.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; + +/** Counts of the number of issues in various statuses. */ +export const VersionIssuesStatusSchema = z.object({ + /** Count of issues with status _done_. */ + done: z.number().int().optional(), + /** Count of issues with status _in progress_. */ + inProgress: z.number().int().optional(), + /** Count of issues with status _to do_. */ + toDo: z.number().int().optional(), + /** Count of issues with a status other than _to do_, _in progress_, and _done_. */ + unmapped: z.number().int().optional(), +}); + +export type VersionIssuesStatus = z.infer; diff --git a/src/version2/schemas/versionMoveBean.ts b/src/version2/schemas/versionMoveBean.ts new file mode 100644 index 0000000000..0249462ca2 --- /dev/null +++ b/src/version2/schemas/versionMoveBean.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const VersionMoveBeanSchema = z.object({ + /** The URL (self link) of the version after which to place the moved version. Cannot be used with `position`. */ + after: z.string().optional(), + /** An absolute position in which to place the moved version. Cannot be used with `after`. */ + position: z.enum(['Earlier', 'Later', 'First', 'Last']).optional(), +}); + +export type VersionMoveBean = z.infer; diff --git a/src/version2/schemas/versionRelatedWork.ts b/src/version2/schemas/versionRelatedWork.ts new file mode 100644 index 0000000000..1a2dafc526 --- /dev/null +++ b/src/version2/schemas/versionRelatedWork.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; + +/** Associated related work to a version */ +export const VersionRelatedWorkSchema = z.object({ + /** The category of the related work */ + category: z.string(), + /** The ID of the issue associated with the related work (if there is one). Cannot be updated via the Rest API. */ + issueId: z.number().int().optional(), + /** + * 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: z.string().optional(), + /** The title of the related work */ + title: z.string().optional(), + /** The URL of the related work. Will be null for the native release note related work item, but is otherwise required. */ + url: z.string().optional(), +}); + +export type VersionRelatedWork = z.infer; diff --git a/src/version2/schemas/versionUnresolvedIssuesCount.ts b/src/version2/schemas/versionUnresolvedIssuesCount.ts new file mode 100644 index 0000000000..24a81342a0 --- /dev/null +++ b/src/version2/schemas/versionUnresolvedIssuesCount.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Count of a version's unresolved issues. */ +export const VersionUnresolvedIssuesCountSchema = z.object({ + /** Count of issues. */ + issuesCount: z.number().int().optional(), + /** Count of unresolved issues. */ + issuesUnresolvedCount: z.number().int().optional(), + /** The URL of these count details. */ + self: z.string().optional(), +}); + +export type VersionUnresolvedIssuesCount = z.infer; diff --git a/src/version2/schemas/versionUsageInCustomField.ts b/src/version2/schemas/versionUsageInCustomField.ts new file mode 100644 index 0000000000..d77b62a7a9 --- /dev/null +++ b/src/version2/schemas/versionUsageInCustomField.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** List of custom fields using the version. */ +export const VersionUsageInCustomFieldSchema = z.object({ + /** The ID of the custom field. */ + customFieldId: z.number().int().optional(), + /** The name of the custom field. */ + fieldName: z.string().optional(), + /** Count of the issues where the custom field contains the version. */ + issueCountWithVersionInCustomField: z.number().int().optional(), +}); + +export type VersionUsageInCustomField = z.infer; diff --git a/src/version2/schemas/visibility.ts b/src/version2/schemas/visibility.ts new file mode 100644 index 0000000000..1d1b1144a8 --- /dev/null +++ b/src/version2/schemas/visibility.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** The group or role to which this item is visible. */ +export const VisibilitySchema = z.object({ + /** The ID of the group or the name of the role that visibility of this item is restricted to. */ + identifier: z.string().optional(), + /** Whether visibility of this item is restricted to a group or role. */ + type: z.enum(['group', 'role']).optional(), + /** + * The name of the group or role that visibility of this item is restricted to. Please note that the name of a group + * is mutable, to reliably identify a group use `identifier`. + */ + value: z.string().optional(), +}); + +export type Visibility = z.infer; diff --git a/src/version2/schemas/votes.ts b/src/version2/schemas/votes.ts new file mode 100644 index 0000000000..ad248a61bf --- /dev/null +++ b/src/version2/schemas/votes.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { UserSchema } from './user'; + +/** The details of votes on an issue. */ +export const VotesSchema = z.object({ + /** Whether the user making this request has voted on the issue. */ + hasVoted: z.boolean().optional(), + /** The URL of these issue vote details. */ + self: z.string().optional(), + /** + * List of the users who have voted on this issue. An empty list is returned when the calling user doesn't have the + * _View voters and watchers_ project permission. + */ + voters: z.array(UserSchema).optional(), + /** The number of votes on the issue. */ + votes: z.number().int().optional(), +}); + +export type Votes = z.infer; diff --git a/src/version2/schemas/warningCollection.ts b/src/version2/schemas/warningCollection.ts new file mode 100644 index 0000000000..8aabfb0ad7 --- /dev/null +++ b/src/version2/schemas/warningCollection.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const WarningCollectionSchema = z.object({ + warnings: z.array(z.string()).optional(), +}); + +export type WarningCollection = z.infer; diff --git a/src/version2/schemas/watchers.ts b/src/version2/schemas/watchers.ts new file mode 100644 index 0000000000..860a834100 --- /dev/null +++ b/src/version2/schemas/watchers.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { UserDetailsSchema } from './userDetails'; + +/** The details of watchers on an issue. */ +export const WatchersSchema = z.object({ + /** Whether the calling user is watching this issue. */ + isWatching: z.boolean().optional(), + /** The URL of these issue watcher details. */ + self: z.string().optional(), + /** The number of users watching this issue. */ + watchCount: z.number().int().optional(), + /** Details of the users watching this issue. */ + watchers: z.array(UserDetailsSchema).optional(), +}); + +export type Watchers = z.infer; diff --git a/src/version2/schemas/webhook.ts b/src/version2/schemas/webhook.ts new file mode 100644 index 0000000000..85d2276f7b --- /dev/null +++ b/src/version2/schemas/webhook.ts @@ -0,0 +1,43 @@ +import { z } from 'zod'; + +/** A webhook. */ +export const WebhookSchema = z.object({ + /** The Jira events that trigger the webhook. */ + events: z.array( + z.enum([ + 'jira:issue_created', + 'jira:issue_updated', + 'jira:issue_deleted', + 'comment_created', + 'comment_updated', + 'comment_deleted', + 'issue_property_set', + 'issue_property_deleted', + ]), + ), + /** + * The date after which the webhook is no longer sent. Use [Extend webhook + * life](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-webhooks/#api-rest-api-3-webhook-refresh-put) + * to extend the date. + */ + expirationDate: z.number().int().optional(), + /** + * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. + * If this parameter is not present, the app is notified about all field updates. + */ + fieldIdsFilter: z.array(z.string()).optional(), + /** The ID of the webhook. */ + id: z.number().int(), + /** + * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or + * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property + * updates. + */ + issuePropertyKeysFilter: z.array(z.string()).optional(), + /** The JQL filter that specifies which issues the webhook is sent for. */ + jqlFilter: z.string(), + /** The URL that specifies where the webhooks are sent. */ + url: z.string(), +}); + +export type Webhook = z.infer; diff --git a/src/version2/schemas/webhookDetails.ts b/src/version2/schemas/webhookDetails.ts new file mode 100644 index 0000000000..56a170707a --- /dev/null +++ b/src/version2/schemas/webhookDetails.ts @@ -0,0 +1,40 @@ +import { z } from 'zod'; + +/** A list of webhooks. */ +export const WebhookDetailsSchema = z.object({ + /** The Jira events that trigger the webhook. */ + events: z.array( + z.enum([ + 'jira:issue_created', + 'jira:issue_updated', + 'jira:issue_deleted', + 'comment_created', + 'comment_updated', + 'comment_deleted', + 'issue_property_set', + 'issue_property_deleted', + ]), + ), + /** + * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. + * If this parameter is not present, the app is notified about all field updates. + */ + fieldIdsFilter: z.array(z.string()).optional(), + /** + * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or + * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property + * updates. + */ + issuePropertyKeysFilter: z.array(z.string()).optional(), + /** + * The JQL filter that specifies which issues the webhook is sent for. Only a subset of JQL can be used. The supported + * elements are: + * + * - Fields: `issueKey`, `project`, `issuetype`, `status`, `assignee`, `reporter`, `issue.property`, and `cf[id]`. For + * custom fields (`cf[id]`), only the epic label custom field is supported.". + * - Operators: `=`, `!=`, `IN`, and `NOT IN`. + */ + jqlFilter: z.string(), +}); + +export type WebhookDetails = z.infer; diff --git a/src/version2/schemas/webhookRegistrationDetails.ts b/src/version2/schemas/webhookRegistrationDetails.ts new file mode 100644 index 0000000000..cd8d08d6ad --- /dev/null +++ b/src/version2/schemas/webhookRegistrationDetails.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { WebhookDetailsSchema } from './webhookDetails'; + +/** Details of webhooks to register. */ +export const WebhookRegistrationDetailsSchema = z.object({ + /** + * The URL that specifies where to send the webhooks. This URL must use the same base URL as the Connect app. Only a + * single URL per app is allowed to be registered. + */ + url: z.string(), + /** A list of webhooks. */ + webhooks: z.array(WebhookDetailsSchema), +}); + +export type WebhookRegistrationDetails = z.infer; diff --git a/src/version2/schemas/webhooksExpirationDate.ts b/src/version2/schemas/webhooksExpirationDate.ts new file mode 100644 index 0000000000..76fe6ad7b4 --- /dev/null +++ b/src/version2/schemas/webhooksExpirationDate.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The date the refreshed webhooks expire. */ +export const WebhooksExpirationDateSchema = z.object({ + /** The expiration date of all the refreshed webhooks. */ + expirationDate: z.number().int(), +}); + +export type WebhooksExpirationDate = z.infer; diff --git a/src/version2/schemas/workManagementNavigationInfo.ts b/src/version2/schemas/workManagementNavigationInfo.ts new file mode 100644 index 0000000000..e32e869334 --- /dev/null +++ b/src/version2/schemas/workManagementNavigationInfo.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +export const WorkManagementNavigationInfoSchema = z.object({ + boardName: z.string().optional(), +}); + +export type WorkManagementNavigationInfo = z.infer; diff --git a/src/version2/schemas/workflow.ts b/src/version2/schemas/workflow.ts new file mode 100644 index 0000000000..e52b4850d5 --- /dev/null +++ b/src/version2/schemas/workflow.ts @@ -0,0 +1,33 @@ +import { z } from 'zod'; +import { PublishedWorkflowIdSchema } from './publishedWorkflowId'; +import { WorkflowOperationsSchema } from './workflowOperations'; +import { ProjectDetailsSchema } from './projectDetails'; +import { WorkflowSchemeIdNameSchema } from './workflowSchemeIdName'; +import { WorkflowStatusSchema } from './workflowStatus'; +import { TransitionSchema } from './transition'; + +/** Details about a workflow. */ +export const WorkflowSchema = z.object({ + /** The creation date of the workflow. */ + created: z.string().datetime().optional(), + /** The description of the workflow. */ + description: z.string(), + /** Whether the workflow has a draft version. */ + hasDraftWorkflow: z.boolean().optional(), + id: PublishedWorkflowIdSchema, + /** Whether this is the default workflow. */ + isDefault: z.boolean().optional(), + operations: WorkflowOperationsSchema.optional(), + /** The projects the workflow is assigned to, through workflow schemes. */ + projects: z.array(ProjectDetailsSchema).optional(), + /** The workflow schemes the workflow is assigned to. */ + schemes: z.array(WorkflowSchemeIdNameSchema).optional(), + /** The statuses of the workflow. */ + statuses: z.array(WorkflowStatusSchema).optional(), + /** The transitions of the workflow. */ + transitions: z.array(TransitionSchema).optional(), + /** The last edited date of the workflow. */ + updated: z.string().datetime().optional(), +}); + +export type Workflow = z.infer; diff --git a/src/version2/schemas/workflowAssociationStatusMapping.ts b/src/version2/schemas/workflowAssociationStatusMapping.ts new file mode 100644 index 0000000000..76f943461a --- /dev/null +++ b/src/version2/schemas/workflowAssociationStatusMapping.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The list of status mappings. */ +export const WorkflowAssociationStatusMappingSchema = z.object({ + /** The ID of the status in the new workflow. */ + newStatusId: z.string(), + /** The ID of the status in the old workflow that isn't present in the new workflow. */ + oldStatusId: z.string(), +}); + +export type WorkflowAssociationStatusMapping = z.infer; diff --git a/src/version2/schemas/workflowCapabilities.ts b/src/version2/schemas/workflowCapabilities.ts new file mode 100644 index 0000000000..ac85febabc --- /dev/null +++ b/src/version2/schemas/workflowCapabilities.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; +import { AvailableWorkflowConnectRuleSchema } from './availableWorkflowConnectRule'; +import { AvailableWorkflowForgeRuleSchema } from './availableWorkflowForgeRule'; +import { AvailableWorkflowSystemRuleSchema } from './availableWorkflowSystemRule'; +import { AvailableWorkflowTriggersSchema } from './availableWorkflowTriggers'; + +export const WorkflowCapabilitiesSchema = z.object({ + /** The Connect provided ecosystem rules available. */ + connectRules: z.array(AvailableWorkflowConnectRuleSchema).optional(), + /** + * The scope of the workflow capabilities. `GLOBAL` for company-managed projects and `PROJECT` for team-managed + * projects. + */ + editorScope: z.enum(['PROJECT', 'GLOBAL']).optional(), + /** The Forge provided ecosystem rules available. */ + forgeRules: z.array(AvailableWorkflowForgeRuleSchema).optional(), + /** The types of projects that this capability set is available for. */ + projectTypes: z.array(z.enum(['software', 'service_desk', 'product_discovery', 'business', 'unknown'])).optional(), + /** The Atlassian provided system rules available. */ + systemRules: z.array(AvailableWorkflowSystemRuleSchema).optional(), + /** The trigger rules available. */ + triggerRules: z.array(AvailableWorkflowTriggersSchema).optional(), +}); + +export type WorkflowCapabilities = z.infer; diff --git a/src/version2/schemas/workflowCapabilityPayload.ts b/src/version2/schemas/workflowCapabilityPayload.ts new file mode 100644 index 0000000000..490a6506af --- /dev/null +++ b/src/version2/schemas/workflowCapabilityPayload.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { StatusPayloadSchema } from './statusPayload'; +import { WorkflowSchemePayloadSchema } from './workflowSchemePayload'; +import { WorkflowPayloadSchema } from './workflowPayload'; + +/** + * The payload for creating a workflows. See + * https://www.atlassian.com/software/jira/guides/workflows/overview#what-is-a-jira-workflow + */ +export const WorkflowCapabilityPayloadSchema = z.object({ + /** The statuses for the workflow */ + statuses: z.array(StatusPayloadSchema).optional(), + workflowScheme: WorkflowSchemePayloadSchema.optional(), + /** The transitions for the workflow */ + workflows: z.array(WorkflowPayloadSchema).optional(), +}); + +export type WorkflowCapabilityPayload = z.infer; diff --git a/src/version2/schemas/workflowCompoundCondition.ts b/src/version2/schemas/workflowCompoundCondition.ts new file mode 100644 index 0000000000..9fc8e6774c --- /dev/null +++ b/src/version2/schemas/workflowCompoundCondition.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { WorkflowConditionSchema } from './workflowCondition'; + +/** A compound workflow transition rule condition. This object returns `nodeType` as `compound`. */ +export const WorkflowCompoundConditionSchema = z.object({ + /** The list of workflow conditions. */ + conditions: z.array(WorkflowConditionSchema), + nodeType: z.string(), + /** The compound condition operator. */ + operator: z.enum(['AND', 'OR']), +}); + +export type WorkflowCompoundCondition = z.infer; diff --git a/src/version2/schemas/workflowCondition.ts b/src/version2/schemas/workflowCondition.ts new file mode 100644 index 0000000000..0bb100aae7 --- /dev/null +++ b/src/version2/schemas/workflowCondition.ts @@ -0,0 +1,6 @@ +import { z } from 'zod'; + +/** The workflow transition rule conditions tree. */ +export const WorkflowConditionSchema = z.object({}); + +export type WorkflowCondition = z.infer; diff --git a/src/version2/schemas/workflowCreate.ts b/src/version2/schemas/workflowCreate.ts new file mode 100644 index 0000000000..ea5b948a4e --- /dev/null +++ b/src/version2/schemas/workflowCreate.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; +import { WorkflowLayoutSchema } from './workflowLayout'; +import { StatusLayoutUpdateSchema } from './statusLayoutUpdate'; +import { TransitionUpdateDTOSchema } from './transitionUpdateDTO'; + +/** The details of the workflows to create. */ +export const WorkflowCreateSchema = z.object({ + /** The description of the workflow to create. */ + description: z.string().optional(), + loopedTransitionContainerLayout: WorkflowLayoutSchema.optional(), + /** The name of the workflow to create. */ + name: z.string(), + startPointLayout: WorkflowLayoutSchema.optional(), + /** The statuses associated with this workflow. */ + statuses: z.array(StatusLayoutUpdateSchema), + /** The transitions of this workflow. */ + transitions: z.array(TransitionUpdateDTOSchema), +}); + +export type WorkflowCreate = z.infer; diff --git a/src/version2/schemas/workflowCreateRequest.ts b/src/version2/schemas/workflowCreateRequest.ts new file mode 100644 index 0000000000..cf3c19a84c --- /dev/null +++ b/src/version2/schemas/workflowCreateRequest.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { WorkflowScopeSchema } from './workflowScope'; +import { WorkflowStatusUpdateSchema } from './workflowStatusUpdate'; +import { WorkflowCreateSchema } from './workflowCreate'; + +/** The create workflows payload. */ +export const WorkflowCreateRequestSchema = z.object({ + scope: WorkflowScopeSchema.optional(), + /** The statuses to associate with the workflows. */ + statuses: z.array(WorkflowStatusUpdateSchema).optional(), + /** The details of the workflows to create. */ + workflows: z.array(WorkflowCreateSchema).optional(), +}); + +export type WorkflowCreateRequest = z.infer; diff --git a/src/version2/schemas/workflowCreateResponse.ts b/src/version2/schemas/workflowCreateResponse.ts new file mode 100644 index 0000000000..a361d7bbbf --- /dev/null +++ b/src/version2/schemas/workflowCreateResponse.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { JiraWorkflowStatusSchema } from './jiraWorkflowStatus'; +import { JiraWorkflowSchema } from './jiraWorkflow'; + +/** Details of the created workflows and statuses. */ +export const WorkflowCreateResponseSchema = z.object({ + /** List of created statuses. */ + statuses: z.array(JiraWorkflowStatusSchema).optional(), + /** List of created workflows. */ + workflows: z.array(JiraWorkflowSchema).optional(), +}); + +export type WorkflowCreateResponse = z.infer; diff --git a/src/version2/schemas/workflowCreateValidateRequest.ts b/src/version2/schemas/workflowCreateValidateRequest.ts new file mode 100644 index 0000000000..60ecd7da14 --- /dev/null +++ b/src/version2/schemas/workflowCreateValidateRequest.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { WorkflowCreateRequestSchema } from './workflowCreateRequest'; +import { ValidationOptionsForCreateSchema } from './validationOptionsForCreate'; + +export const WorkflowCreateValidateRequestSchema = z.object({ + payload: WorkflowCreateRequestSchema, + validationOptions: ValidationOptionsForCreateSchema.optional(), +}); + +export type WorkflowCreateValidateRequest = z.infer; diff --git a/src/version2/schemas/workflowElementReference.ts b/src/version2/schemas/workflowElementReference.ts new file mode 100644 index 0000000000..7bde272722 --- /dev/null +++ b/src/version2/schemas/workflowElementReference.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; +import { ProjectAndIssueTypePairSchema } from './projectAndIssueTypePair'; + +/** A reference to the location of the error. This will be null if the error does not refer to a specific element. */ +export const WorkflowElementReferenceSchema = z.object({ + /** A property key. */ + propertyKey: z.string().optional(), + /** A rule ID. */ + ruleId: z.string().optional(), + statusMappingReference: ProjectAndIssueTypePairSchema.optional(), + /** A status reference. */ + statusReference: z.string().optional(), + /** A transition ID. */ + transitionId: z.string().optional(), +}); + +export type WorkflowElementReference = z.infer; diff --git a/src/version2/schemas/workflowIDs.ts b/src/version2/schemas/workflowIDs.ts new file mode 100644 index 0000000000..44af56a295 --- /dev/null +++ b/src/version2/schemas/workflowIDs.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The classic workflow identifiers. */ +export const WorkflowIDsSchema = z.object({ + /** The entity ID of the workflow. */ + entityId: z.string().optional(), + /** The name of the workflow. */ + name: z.string(), +}); + +export type WorkflowIDs = z.infer; diff --git a/src/version2/schemas/workflowId.ts b/src/version2/schemas/workflowId.ts new file mode 100644 index 0000000000..229f2975d2 --- /dev/null +++ b/src/version2/schemas/workflowId.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Properties that identify a workflow. */ +export const WorkflowIdSchema = z.object({ + /** Whether the workflow is in the draft state. */ + draft: z.boolean(), + /** The name of the workflow. */ + name: z.string(), +}); + +export type WorkflowId = z.infer; diff --git a/src/version2/schemas/workflowLayout.ts b/src/version2/schemas/workflowLayout.ts new file mode 100644 index 0000000000..544d579884 --- /dev/null +++ b/src/version2/schemas/workflowLayout.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The starting point for the statuses in the workflow. */ +export const WorkflowLayoutSchema = z.object({ + /** The x axis location. */ + x: z.number().optional(), + /** The y axis location. */ + y: z.number().optional(), +}); + +export type WorkflowLayout = z.infer; diff --git a/src/version2/schemas/workflowMetadataAndIssueTypeRestModel.ts b/src/version2/schemas/workflowMetadataAndIssueTypeRestModel.ts new file mode 100644 index 0000000000..e8c52c2d2b --- /dev/null +++ b/src/version2/schemas/workflowMetadataAndIssueTypeRestModel.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { WorkflowMetadataRestModelSchema } from './workflowMetadataRestModel'; + +/** The workflow metadata and issue type IDs which use this workflow. */ +export const WorkflowMetadataAndIssueTypeRestModelSchema = z.object({ + /** The list of issue type IDs for the mapping. */ + issueTypeIds: z.array(z.string()), + workflow: WorkflowMetadataRestModelSchema, +}); + +export type WorkflowMetadataAndIssueTypeRestModel = z.infer; diff --git a/src/version2/schemas/workflowMetadataRestModel.ts b/src/version2/schemas/workflowMetadataRestModel.ts new file mode 100644 index 0000000000..b803bf025c --- /dev/null +++ b/src/version2/schemas/workflowMetadataRestModel.ts @@ -0,0 +1,15 @@ +import { z } from 'zod'; +import { DocumentVersionSchema } from './documentVersion'; + +/** Workflow metadata and usage detail. */ +export const WorkflowMetadataRestModelSchema = z.object({ + /** The description of the workflow. */ + description: z.string(), + /** The ID of the workflow. */ + id: z.string(), + /** The name of the workflow. */ + name: z.string(), + version: DocumentVersionSchema, +}); + +export type WorkflowMetadataRestModel = z.infer; diff --git a/src/version2/schemas/workflowOperations.ts b/src/version2/schemas/workflowOperations.ts new file mode 100644 index 0000000000..e531476ed2 --- /dev/null +++ b/src/version2/schemas/workflowOperations.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** Operations allowed on a workflow */ +export const WorkflowOperationsSchema = z.object({ + /** Whether the workflow can be deleted. */ + canDelete: z.boolean(), + /** Whether the workflow can be updated. */ + canEdit: z.boolean(), +}); + +export type WorkflowOperations = z.infer; diff --git a/src/version2/schemas/workflowPayload.ts b/src/version2/schemas/workflowPayload.ts new file mode 100644 index 0000000000..e8505193b7 --- /dev/null +++ b/src/version2/schemas/workflowPayload.ts @@ -0,0 +1,27 @@ +import { z } from 'zod'; +import { WorkflowStatusLayoutPayloadSchema } from './workflowStatusLayoutPayload'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; +import { WorkflowStatusPayloadSchema } from './workflowStatusPayload'; +import { TransitionPayloadSchema } from './transitionPayload'; + +/** + * The payload for creating workflow, see + * https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflows-create-post + */ +export const WorkflowPayloadSchema = z.object({ + /** The description of the workflow */ + description: z.string().optional(), + loopedTransitionContainerLayout: WorkflowStatusLayoutPayloadSchema.optional(), + /** The name of the workflow */ + name: z.string().optional(), + /** The strategy to use if there is a conflict with another workflow */ + onConflict: z.enum(['FAIL', 'USE', 'NEW']).optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), + startPointLayout: WorkflowStatusLayoutPayloadSchema.optional(), + /** The statuses to be used in the workflow */ + statuses: z.array(WorkflowStatusPayloadSchema).optional(), + /** The transitions for the workflow */ + transitions: z.array(TransitionPayloadSchema).optional(), +}); + +export type WorkflowPayload = z.infer; diff --git a/src/version2/schemas/workflowProjectIssueTypeUsage.ts b/src/version2/schemas/workflowProjectIssueTypeUsage.ts new file mode 100644 index 0000000000..16c843d74b --- /dev/null +++ b/src/version2/schemas/workflowProjectIssueTypeUsage.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The issue type. */ +export const WorkflowProjectIssueTypeUsageSchema = z.object({ + /** The ID of the issue type. */ + id: z.string().optional(), +}); + +export type WorkflowProjectIssueTypeUsage = z.infer; diff --git a/src/version2/schemas/workflowProjectIssueTypeUsageDTO.ts b/src/version2/schemas/workflowProjectIssueTypeUsageDTO.ts new file mode 100644 index 0000000000..706431415f --- /dev/null +++ b/src/version2/schemas/workflowProjectIssueTypeUsageDTO.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { WorkflowProjectIssueTypeUsagePageSchema } from './workflowProjectIssueTypeUsagePage'; + +/** Issue types associated with the workflow for a project. */ +export const WorkflowProjectIssueTypeUsageDTOSchema = z.object({ + issueTypes: WorkflowProjectIssueTypeUsagePageSchema.optional(), + /** The ID of the project. */ + projectId: z.string().optional(), + /** The ID of the workflow. */ + workflowId: z.string().optional(), +}); + +export type WorkflowProjectIssueTypeUsageDTO = z.infer; diff --git a/src/version2/schemas/workflowProjectIssueTypeUsagePage.ts b/src/version2/schemas/workflowProjectIssueTypeUsagePage.ts new file mode 100644 index 0000000000..5842407cc1 --- /dev/null +++ b/src/version2/schemas/workflowProjectIssueTypeUsagePage.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { WorkflowProjectIssueTypeUsageSchema } from './workflowProjectIssueTypeUsage'; + +/** A page of issue types. */ +export const WorkflowProjectIssueTypeUsagePageSchema = z.object({ + /** Token for the next page of issue type usages. */ + nextPageToken: z.string().optional(), + /** The list of issue types. */ + values: z.array(WorkflowProjectIssueTypeUsageSchema).optional(), +}); + +export type WorkflowProjectIssueTypeUsagePage = z.infer; diff --git a/src/version2/schemas/workflowProjectUsageDTO.ts b/src/version2/schemas/workflowProjectUsageDTO.ts new file mode 100644 index 0000000000..61df26195d --- /dev/null +++ b/src/version2/schemas/workflowProjectUsageDTO.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { ProjectUsagePageSchema } from './projectUsagePage'; + +/** Projects using the workflow. */ +export const WorkflowProjectUsageDTOSchema = z.object({ + projects: ProjectUsagePageSchema.optional(), + /** The workflow ID. */ + workflowId: z.string().optional(), +}); + +export type WorkflowProjectUsageDTO = z.infer; diff --git a/src/version2/schemas/workflowReadRequest.ts b/src/version2/schemas/workflowReadRequest.ts new file mode 100644 index 0000000000..a93622e074 --- /dev/null +++ b/src/version2/schemas/workflowReadRequest.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { ProjectAndIssueTypePairSchema } from './projectAndIssueTypePair'; + +export const WorkflowReadRequestSchema = z.object({ + /** The list of projects and issue types to query. */ + projectAndIssueTypes: z.array(ProjectAndIssueTypePairSchema).optional(), + /** The list of workflow IDs to query. */ + workflowIds: z.array(z.string()).optional(), + /** The list of workflow names to query. */ + workflowNames: z.array(z.string()).optional(), +}); + +export type WorkflowReadRequest = z.infer; diff --git a/src/version2/schemas/workflowReadResponse.ts b/src/version2/schemas/workflowReadResponse.ts new file mode 100644 index 0000000000..98b73051f4 --- /dev/null +++ b/src/version2/schemas/workflowReadResponse.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { JiraWorkflowStatusSchema } from './jiraWorkflowStatus'; +import { JiraWorkflowSchema } from './jiraWorkflow'; + +/** Details of workflows and related statuses. */ +export const WorkflowReadResponseSchema = z.object({ + /** List of statuses. */ + statuses: z.array(JiraWorkflowStatusSchema).optional(), + /** List of workflows. */ + workflows: z.array(JiraWorkflowSchema).optional(), +}); + +export type WorkflowReadResponse = z.infer; diff --git a/src/version2/schemas/workflowReferenceStatus.ts b/src/version2/schemas/workflowReferenceStatus.ts new file mode 100644 index 0000000000..146ace8d4a --- /dev/null +++ b/src/version2/schemas/workflowReferenceStatus.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; +import { ApprovalConfigurationSchema } from './approvalConfiguration'; +import { WorkflowStatusLayoutSchema } from './workflowStatusLayout'; + +/** The statuses referenced in the workflow. */ +export const WorkflowReferenceStatusSchema = z.object({ + approvalConfiguration: ApprovalConfigurationSchema.optional(), + /** Indicates if the status is deprecated. */ + deprecated: z.boolean().optional(), + layout: WorkflowStatusLayoutSchema.optional(), + /** The properties associated with the status. */ + properties: z.object({}).optional(), + /** The reference of the status. */ + statusReference: z.string().optional(), +}); + +export type WorkflowReferenceStatus = z.infer; diff --git a/src/version2/schemas/workflowRuleConfiguration.ts b/src/version2/schemas/workflowRuleConfiguration.ts new file mode 100644 index 0000000000..80ec9a62cf --- /dev/null +++ b/src/version2/schemas/workflowRuleConfiguration.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The configuration of the rule. */ +export const WorkflowRuleConfigurationSchema = z.object({ + /** The ID of the rule. */ + id: z.string().optional(), + /** The parameters related to the rule. */ + parameters: z.object({}).optional(), + /** The rule key of the rule. */ + ruleKey: z.string(), +}); + +export type WorkflowRuleConfiguration = z.infer; diff --git a/src/version2/schemas/workflowRules.ts b/src/version2/schemas/workflowRules.ts new file mode 100644 index 0000000000..5adfef06f7 --- /dev/null +++ b/src/version2/schemas/workflowRules.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { WorkflowConditionSchema } from './workflowCondition'; +import { WorkflowTransitionRuleSchema } from './workflowTransitionRule'; + +/** A collection of transition rules. */ +export const WorkflowRulesSchema = z.object({ + conditionsTree: WorkflowConditionSchema.optional(), + /** The workflow post functions. */ + postFunctions: z.array(WorkflowTransitionRuleSchema).optional(), + /** The workflow validators. */ + validators: z.array(WorkflowTransitionRuleSchema).optional(), +}); + +export type WorkflowRules = z.infer; diff --git a/src/version2/schemas/workflowRulesSearch.ts b/src/version2/schemas/workflowRulesSearch.ts new file mode 100644 index 0000000000..9104541d77 --- /dev/null +++ b/src/version2/schemas/workflowRulesSearch.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** Details of the workflow and its transition rules. */ +export const WorkflowRulesSearchSchema = z.object({ + /** + * Use expand to include additional information in the response. This parameter accepts `transition` which, for each + * rule, returns information about the transition the rule is assigned to. + */ + expand: z.string().optional(), + /** The list of workflow rule IDs. */ + ruleIds: z.array(z.string()), + /** The workflow ID. */ + workflowEntityId: z.string(), +}); + +export type WorkflowRulesSearch = z.infer; diff --git a/src/version2/schemas/workflowRulesSearchDetails.ts b/src/version2/schemas/workflowRulesSearchDetails.ts new file mode 100644 index 0000000000..c679c64aec --- /dev/null +++ b/src/version2/schemas/workflowRulesSearchDetails.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { WorkflowTransitionRulesSchema } from './workflowTransitionRules'; + +/** Details of workflow transition rules. */ +export const WorkflowRulesSearchDetailsSchema = z.object({ + /** List of workflow rule IDs that do not belong to the workflow or can not be found. */ + invalidRules: z.array(z.string()).optional(), + /** List of valid workflow transition rules. */ + validRules: z.array(WorkflowTransitionRulesSchema).optional(), + /** The workflow ID. */ + workflowEntityId: z.string().optional(), +}); + +export type WorkflowRulesSearchDetails = z.infer; diff --git a/src/version2/schemas/workflowScheme.ts b/src/version2/schemas/workflowScheme.ts new file mode 100644 index 0000000000..b836c5a944 --- /dev/null +++ b/src/version2/schemas/workflowScheme.ts @@ -0,0 +1,68 @@ +import { z } from 'zod'; + +/** Details about a workflow scheme. */ +export const WorkflowSchemeSchema = z.object({ + /** + * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ + * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira + * Workflow (jira)_. + */ + defaultWorkflow: z.string().optional(), + /** The description of the workflow scheme. */ + description: z.string().optional(), + /** Whether the workflow scheme is a draft or not. */ + draft: z.boolean().optional(), + /** The ID of the workflow scheme. */ + id: z.number().int().optional(), + /** + * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an + * issue type can only be mapped to one workflow in a workflow scheme. + */ + issueTypeMappings: z.object({}).optional(), + /** The issue types available in Jira. */ + issueTypes: z.object({}).optional(), + /** + * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue + * type-project mappings only. This property does not apply to non-draft workflows. + */ + lastModified: z.string().optional(), + /** + * The user that last modified the draft workflow scheme. A modification is a change to the issue type-project + * mappings only. This property does not apply to non-draft workflows. + */ + lastModifiedUser: z.unknown().optional(), + /** + * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when + * creating a workflow scheme. + */ + name: z.string().optional(), + /** + * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The + * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. + */ + originalDefaultWorkflow: z.string().optional(), + /** + * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, + * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one + * workflow in a workflow scheme. + */ + originalIssueTypeMappings: z.object({}).optional(), + self: z.string().optional(), + /** + * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow + * scheme is a workflow scheme that is used by at least one project. The following examples show how this property + * works: + * + * - Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is + * updated. Otherwise, a draft workflow scheme is created. + * - Update an active workflow scheme with `updateDraftIfNeeded` set to `false`: An error is returned, as active + * workflow schemes cannot be updated. + * - Update an inactive workflow scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as + * inactive workflow schemes do not require drafts to update. + * + * Defaults to `false`. + */ + updateDraftIfNeeded: z.boolean().optional(), +}); + +export type WorkflowScheme = z.infer; diff --git a/src/version2/schemas/workflowSchemeAssociation.ts b/src/version2/schemas/workflowSchemeAssociation.ts new file mode 100644 index 0000000000..0aa09beaf6 --- /dev/null +++ b/src/version2/schemas/workflowSchemeAssociation.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The explicit association between issue types and a workflow in a workflow scheme. */ +export const WorkflowSchemeAssociationSchema = z.object({ + /** The issue types assigned to the workflow. */ + issueTypeIds: z.array(z.string()), + /** The ID of the workflow. */ + workflowId: z.string(), +}); + +export type WorkflowSchemeAssociation = z.infer; diff --git a/src/version2/schemas/workflowSchemeAssociations.ts b/src/version2/schemas/workflowSchemeAssociations.ts new file mode 100644 index 0000000000..29633fcb2b --- /dev/null +++ b/src/version2/schemas/workflowSchemeAssociations.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** A workflow scheme along with a list of projects that use it. */ +export const WorkflowSchemeAssociationsSchema = z.object({ + /** The list of projects that use the workflow scheme. */ + projectIds: z.array(z.string()), + /** The workflow scheme. */ + workflowScheme: z.unknown(), +}); + +export type WorkflowSchemeAssociations = z.infer; diff --git a/src/version2/schemas/workflowSchemeIdName.ts b/src/version2/schemas/workflowSchemeIdName.ts new file mode 100644 index 0000000000..d8c2cf00e9 --- /dev/null +++ b/src/version2/schemas/workflowSchemeIdName.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The ID and the name of the workflow scheme. */ +export const WorkflowSchemeIdNameSchema = z.object({ + /** The ID of the workflow scheme. */ + id: z.string(), + /** The name of the workflow scheme. */ + name: z.string(), +}); + +export type WorkflowSchemeIdName = z.infer; diff --git a/src/version2/schemas/workflowSchemePayload.ts b/src/version2/schemas/workflowSchemePayload.ts new file mode 100644 index 0000000000..e659106e62 --- /dev/null +++ b/src/version2/schemas/workflowSchemePayload.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** + * The payload for creating a workflow scheme. See + * https://www.atlassian.com/software/jira/guides/workflows/overview#what-is-a-jira-workflow-scheme + */ +export const WorkflowSchemePayloadSchema = z.object({ + defaultWorkflow: ProjectCreateResourceIdentifierSchema.optional(), + /** The description of the workflow scheme */ + description: z.string().optional(), + /** Association between issuetypes and workflows */ + explicitMappings: z.object({}).optional(), + /** The name of the workflow scheme */ + name: z.string().optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), +}); + +export type WorkflowSchemePayload = z.infer; diff --git a/src/version2/schemas/workflowSchemeProjectAssociation.ts b/src/version2/schemas/workflowSchemeProjectAssociation.ts new file mode 100644 index 0000000000..8a9845817e --- /dev/null +++ b/src/version2/schemas/workflowSchemeProjectAssociation.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; + +/** An associated workflow scheme and project. */ +export const WorkflowSchemeProjectAssociationSchema = z.object({ + /** The ID of the project. */ + projectId: z.string(), + /** + * The ID of the workflow scheme. If the workflow scheme ID is `null`, the operation assigns the default workflow + * scheme. + */ + workflowSchemeId: z.string().optional(), +}); + +export type WorkflowSchemeProjectAssociation = z.infer; diff --git a/src/version2/schemas/workflowSchemeProjectUsageDTO.ts b/src/version2/schemas/workflowSchemeProjectUsageDTO.ts new file mode 100644 index 0000000000..7b063e761b --- /dev/null +++ b/src/version2/schemas/workflowSchemeProjectUsageDTO.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { ProjectUsagePageSchema } from './projectUsagePage'; + +/** Projects using the workflow scheme. */ +export const WorkflowSchemeProjectUsageDTOSchema = z.object({ + projects: ProjectUsagePageSchema.optional(), + /** The workflow scheme ID. */ + workflowSchemeId: z.string().optional(), +}); + +export type WorkflowSchemeProjectUsageDTO = z.infer; diff --git a/src/version2/schemas/workflowSchemeReadRequest.ts b/src/version2/schemas/workflowSchemeReadRequest.ts new file mode 100644 index 0000000000..91f349c8e0 --- /dev/null +++ b/src/version2/schemas/workflowSchemeReadRequest.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The workflow scheme read request body. */ +export const WorkflowSchemeReadRequestSchema = z.object({ + /** The list of project IDs to query. */ + projectIds: z.array(z.string()).optional(), + /** The list of workflow scheme IDs to query. */ + workflowSchemeIds: z.array(z.string()).optional(), +}); + +export type WorkflowSchemeReadRequest = z.infer; diff --git a/src/version2/schemas/workflowSchemeReadResponse.ts b/src/version2/schemas/workflowSchemeReadResponse.ts new file mode 100644 index 0000000000..c1bc370c77 --- /dev/null +++ b/src/version2/schemas/workflowSchemeReadResponse.ts @@ -0,0 +1,23 @@ +import { z } from 'zod'; +import { WorkflowMetadataRestModelSchema } from './workflowMetadataRestModel'; +import { WorkflowScopeSchema } from './workflowScope'; +import { DocumentVersionSchema } from './documentVersion'; +import { WorkflowMetadataAndIssueTypeRestModelSchema } from './workflowMetadataAndIssueTypeRestModel'; + +export const WorkflowSchemeReadResponseSchema = z.object({ + defaultWorkflow: WorkflowMetadataRestModelSchema.optional(), + /** The description of the workflow scheme. */ + description: z.string().optional(), + /** The ID of the workflow scheme. */ + id: z.string(), + /** The name of the workflow scheme. */ + name: z.string(), + scope: WorkflowScopeSchema, + /** Indicates if there's an [asynchronous task](#async-operations) for this workflow scheme. */ + taskId: z.string().optional(), + version: DocumentVersionSchema, + /** Mappings from workflows to issue types. */ + workflowsForIssueTypes: z.array(WorkflowMetadataAndIssueTypeRestModelSchema), +}); + +export type WorkflowSchemeReadResponse = z.infer; diff --git a/src/version2/schemas/workflowSchemeUpdateRequest.ts b/src/version2/schemas/workflowSchemeUpdateRequest.ts new file mode 100644 index 0000000000..0fe5493edd --- /dev/null +++ b/src/version2/schemas/workflowSchemeUpdateRequest.ts @@ -0,0 +1,38 @@ +import { z } from 'zod'; +import { MappingsByIssueTypeOverrideSchema } from './mappingsByIssueTypeOverride'; +import { MappingsByWorkflowSchema } from './mappingsByWorkflow'; +import { DocumentVersionSchema } from './documentVersion'; +import { WorkflowSchemeAssociationSchema } from './workflowSchemeAssociation'; + +/** The update workflow scheme payload. */ +export const WorkflowSchemeUpdateRequestSchema = z.object({ + /** + * 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: z.string().optional(), + /** The new description for this workflow scheme. */ + description: z.string(), + /** The ID of this workflow scheme. */ + id: z.string(), + /** The new name for this workflow scheme. */ + name: z.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: z.array(MappingsByIssueTypeOverrideSchema).optional(), + /** + * 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: z.array(MappingsByWorkflowSchema).optional(), + version: DocumentVersionSchema, + /** Mappings from workflows to issue types. */ + workflowsForIssueTypes: z.array(WorkflowSchemeAssociationSchema).optional(), +}); + +export type WorkflowSchemeUpdateRequest = z.infer; diff --git a/src/version2/schemas/workflowSchemeUpdateRequiredMappingsRequest.ts b/src/version2/schemas/workflowSchemeUpdateRequiredMappingsRequest.ts new file mode 100644 index 0000000000..d82e182ea9 --- /dev/null +++ b/src/version2/schemas/workflowSchemeUpdateRequiredMappingsRequest.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { WorkflowSchemeAssociationSchema } from './workflowSchemeAssociation'; + +/** The request payload to get the required mappings for updating a workflow scheme. */ +export const WorkflowSchemeUpdateRequiredMappingsRequestSchema = z.object({ + /** + * 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: z.string().optional(), + /** The ID of the workflow scheme. */ + id: z.string(), + /** The new workflow to issue type mappings for this workflow scheme. */ + workflowsForIssueTypes: z.array(WorkflowSchemeAssociationSchema), +}); + +export type WorkflowSchemeUpdateRequiredMappingsRequest = z.infer< + typeof WorkflowSchemeUpdateRequiredMappingsRequestSchema +>; diff --git a/src/version2/schemas/workflowSchemeUpdateRequiredMappingsResponse.ts b/src/version2/schemas/workflowSchemeUpdateRequiredMappingsResponse.ts new file mode 100644 index 0000000000..26683b5d63 --- /dev/null +++ b/src/version2/schemas/workflowSchemeUpdateRequiredMappingsResponse.ts @@ -0,0 +1,20 @@ +import { z } from 'zod'; +import { RequiredMappingByIssueTypeSchema } from './requiredMappingByIssueType'; +import { RequiredMappingByWorkflowsSchema } from './requiredMappingByWorkflows'; +import { StatusMetadataSchema } from './statusMetadata'; +import { StatusesPerWorkflowSchema } from './statusesPerWorkflow'; + +export const WorkflowSchemeUpdateRequiredMappingsResponseSchema = z.object({ + /** The list of required status mappings by issue type. */ + statusMappingsByIssueTypes: z.array(RequiredMappingByIssueTypeSchema).optional(), + /** The list of required status mappings by workflow. */ + statusMappingsByWorkflows: z.array(RequiredMappingByWorkflowsSchema).optional(), + /** The details of the statuses in the associated workflows. */ + statuses: z.array(StatusMetadataSchema).optional(), + /** The statuses associated with each workflow. */ + statusesPerWorkflow: z.array(StatusesPerWorkflowSchema).optional(), +}); + +export type WorkflowSchemeUpdateRequiredMappingsResponse = z.infer< + typeof WorkflowSchemeUpdateRequiredMappingsResponseSchema +>; diff --git a/src/version2/schemas/workflowSchemeUsage.ts b/src/version2/schemas/workflowSchemeUsage.ts new file mode 100644 index 0000000000..9ea5fe2c97 --- /dev/null +++ b/src/version2/schemas/workflowSchemeUsage.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** The worflow scheme. */ +export const WorkflowSchemeUsageSchema = z.object({ + /** The workflow scheme ID. */ + id: z.string().optional(), +}); + +export type WorkflowSchemeUsage = z.infer; diff --git a/src/version2/schemas/workflowSchemeUsageDTO.ts b/src/version2/schemas/workflowSchemeUsageDTO.ts new file mode 100644 index 0000000000..03ec6cf0fb --- /dev/null +++ b/src/version2/schemas/workflowSchemeUsageDTO.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { WorkflowSchemeUsagePageSchema } from './workflowSchemeUsagePage'; + +/** Workflow schemes using the workflow. */ +export const WorkflowSchemeUsageDTOSchema = z.object({ + /** The workflow ID. */ + workflowId: z.string().optional(), + workflowSchemes: WorkflowSchemeUsagePageSchema.optional(), +}); + +export type WorkflowSchemeUsageDTO = z.infer; diff --git a/src/version2/schemas/workflowSchemeUsagePage.ts b/src/version2/schemas/workflowSchemeUsagePage.ts new file mode 100644 index 0000000000..f93bc86498 --- /dev/null +++ b/src/version2/schemas/workflowSchemeUsagePage.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; +import { WorkflowSchemeUsageSchema } from './workflowSchemeUsage'; + +/** A page of workflow schemes. */ +export const WorkflowSchemeUsagePageSchema = z.object({ + /** Token for the next page of issue type usages. */ + nextPageToken: z.string().optional(), + /** The list of workflow schemes. */ + values: z.array(WorkflowSchemeUsageSchema).optional(), +}); + +export type WorkflowSchemeUsagePage = z.infer; diff --git a/src/version2/schemas/workflowScope.ts b/src/version2/schemas/workflowScope.ts new file mode 100644 index 0000000000..a73d259e5e --- /dev/null +++ b/src/version2/schemas/workflowScope.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { ProjectIdSchema } from './projectId'; + +/** The scope of the workflow. */ +export const WorkflowScopeSchema = z.object({ + project: ProjectIdSchema.optional(), + /** The scope of the workflow. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ + type: z.enum(['PROJECT', 'GLOBAL']).optional(), +}); + +export type WorkflowScope = z.infer; diff --git a/src/version2/schemas/workflowSearchResponse.ts b/src/version2/schemas/workflowSearchResponse.ts new file mode 100644 index 0000000000..96849137fd --- /dev/null +++ b/src/version2/schemas/workflowSearchResponse.ts @@ -0,0 +1,25 @@ +import { z } from 'zod'; +import { JiraWorkflowStatusSchema } from './jiraWorkflowStatus'; +import { JiraWorkflowSchema } from './jiraWorkflow'; + +/** Page of items, including workflows and related statuses. */ +export const WorkflowSearchResponseSchema = z.object({ + /** Whether this is the last page. */ + isLast: z.boolean().optional(), + /** The maximum number of items that could be returned. */ + maxResults: z.number().int().optional(), + /** If there is another page of results, the URL of the next page. */ + nextPage: z.string().optional(), + /** The URL of the page. */ + self: z.string().optional(), + /** The index of the first item returned. */ + startAt: z.number().int().optional(), + /** List of statuses. */ + statuses: z.array(JiraWorkflowStatusSchema).optional(), + /** The number of items returned. */ + total: z.number().int().optional(), + /** List of workflows. */ + values: z.array(JiraWorkflowSchema).optional(), +}); + +export type WorkflowSearchResponse = z.infer; diff --git a/src/version2/schemas/workflowSimpleCondition.ts b/src/version2/schemas/workflowSimpleCondition.ts new file mode 100644 index 0000000000..b199bbe8ef --- /dev/null +++ b/src/version2/schemas/workflowSimpleCondition.ts @@ -0,0 +1,12 @@ +import { z } from 'zod'; + +/** A workflow transition rule condition. This object returns `nodeType` as `simple`. */ +export const WorkflowSimpleConditionSchema = z.object({ + /** EXPERIMENTAL. The configuration of the transition rule. */ + configuration: z.object({}).optional(), + nodeType: z.string(), + /** The type of the transition rule. */ + type: z.string(), +}); + +export type WorkflowSimpleCondition = z.infer; diff --git a/src/version2/schemas/workflowStatus.ts b/src/version2/schemas/workflowStatus.ts new file mode 100644 index 0000000000..95c36ea8a9 --- /dev/null +++ b/src/version2/schemas/workflowStatus.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +/** Details of a workflow status. */ +export const WorkflowStatusSchema = z.object({ + /** The ID of the issue status. */ + id: z.string(), + /** The name of the status in the workflow. */ + name: z.string(), + /** + * Additional properties that modify the behavior of issues in this status. Supports the properties + * `jira.issue.editable` and `issueEditable` (deprecated) that indicate whether issues are editable. + */ + properties: z.object({}).optional(), +}); + +export type WorkflowStatus = z.infer; diff --git a/src/version2/schemas/workflowStatusLayout.ts b/src/version2/schemas/workflowStatusLayout.ts new file mode 100644 index 0000000000..d3abadde7b --- /dev/null +++ b/src/version2/schemas/workflowStatusLayout.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The x and y location of the status in the workflow. */ +export const WorkflowStatusLayoutSchema = z.object({ + /** The x axis location. */ + x: z.number().optional(), + /** The y axis location. */ + y: z.number().optional(), +}); + +export type WorkflowStatusLayout = z.infer; diff --git a/src/version2/schemas/workflowStatusLayoutPayload.ts b/src/version2/schemas/workflowStatusLayoutPayload.ts new file mode 100644 index 0000000000..bca7c97845 --- /dev/null +++ b/src/version2/schemas/workflowStatusLayoutPayload.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** The layout of the workflow status. */ +export const WorkflowStatusLayoutPayloadSchema = z.object({ + /** The x coordinate of the status. */ + x: z.number().optional(), + /** The y coordinate of the status. */ + y: z.number().optional(), +}); + +export type WorkflowStatusLayoutPayload = z.infer; diff --git a/src/version2/schemas/workflowStatusPayload.ts b/src/version2/schemas/workflowStatusPayload.ts new file mode 100644 index 0000000000..5d69b9ca7d --- /dev/null +++ b/src/version2/schemas/workflowStatusPayload.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { WorkflowStatusLayoutPayloadSchema } from './workflowStatusLayoutPayload'; +import { ProjectCreateResourceIdentifierSchema } from './projectCreateResourceIdentifier'; + +/** The statuses to be used in the workflow */ +export const WorkflowStatusPayloadSchema = z.object({ + layout: WorkflowStatusLayoutPayloadSchema.optional(), + pcri: ProjectCreateResourceIdentifierSchema.optional(), + /** The properties of the workflow status. */ + properties: z.object({}).optional(), +}); + +export type WorkflowStatusPayload = z.infer; diff --git a/src/version2/schemas/workflowStatusUpdate.ts b/src/version2/schemas/workflowStatusUpdate.ts new file mode 100644 index 0000000000..3a00dca262 --- /dev/null +++ b/src/version2/schemas/workflowStatusUpdate.ts @@ -0,0 +1,17 @@ +import { z } from 'zod'; + +/** Details of the status being updated. */ +export const WorkflowStatusUpdateSchema = z.object({ + /** The description of the status. */ + description: z.string().optional(), + /** The ID of the status. */ + id: z.string().optional(), + /** The name of the status. */ + name: z.string(), + /** The category of the status. */ + statusCategory: z.enum(['TODO', 'IN_PROGRESS', 'DONE']), + /** The reference of the status. */ + statusReference: z.string(), +}); + +export type WorkflowStatusUpdate = z.infer; diff --git a/src/version2/schemas/workflowTransition.ts b/src/version2/schemas/workflowTransition.ts new file mode 100644 index 0000000000..a24b6ff00f --- /dev/null +++ b/src/version2/schemas/workflowTransition.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** A workflow transition. */ +export const WorkflowTransitionSchema = z.object({ + /** The transition ID. */ + id: z.number().int(), + /** The transition name. */ + name: z.string(), +}); + +export type WorkflowTransition = z.infer; diff --git a/src/version2/schemas/workflowTransitionLinks.ts b/src/version2/schemas/workflowTransitionLinks.ts new file mode 100644 index 0000000000..37ce7677b8 --- /dev/null +++ b/src/version2/schemas/workflowTransitionLinks.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The statuses the transition can start from, and the mapping of ports between the statuses. */ +export const WorkflowTransitionLinksSchema = z.object({ + /** The port that the transition starts from. */ + fromPort: z.number().int().optional(), + /** The status that the transition starts from. */ + fromStatusReference: z.string().optional(), + /** The port that the transition goes to. */ + toPort: z.number().int().optional(), +}); + +export type WorkflowTransitionLinks = z.infer; diff --git a/src/version2/schemas/workflowTransitionProperty.ts b/src/version2/schemas/workflowTransitionProperty.ts new file mode 100644 index 0000000000..146ca9ae8f --- /dev/null +++ b/src/version2/schemas/workflowTransitionProperty.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** Details about the server Jira is running on. */ +export const WorkflowTransitionPropertySchema = z.object({ + /** The ID of the transition property. */ + id: z.string().optional(), + /** The key of the transition property. Also known as the name of the transition property. */ + key: z.string().optional(), + /** The value of the transition property. */ + value: z.string(), +}); + +export type WorkflowTransitionProperty = z.infer; diff --git a/src/version2/schemas/workflowTransitionRule.ts b/src/version2/schemas/workflowTransitionRule.ts new file mode 100644 index 0000000000..cf55687f66 --- /dev/null +++ b/src/version2/schemas/workflowTransitionRule.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +/** A workflow transition rule. */ +export const WorkflowTransitionRuleSchema = z.object({ + /** EXPERIMENTAL. The configuration of the transition rule. */ + configuration: z.unknown().optional(), + /** The type of the transition rule. */ + type: z.string(), +}); + +export type WorkflowTransitionRule = z.infer; diff --git a/src/version2/schemas/workflowTransitionRules.ts b/src/version2/schemas/workflowTransitionRules.ts new file mode 100644 index 0000000000..5770d8ab10 --- /dev/null +++ b/src/version2/schemas/workflowTransitionRules.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; +import { AppWorkflowTransitionRuleSchema } from './appWorkflowTransitionRule'; +import { WorkflowIdSchema } from './workflowId'; + +/** A workflow with transition rules. */ +export const WorkflowTransitionRulesSchema = z.object({ + /** The list of conditions within the workflow. */ + conditions: z.array(AppWorkflowTransitionRuleSchema).optional(), + /** The list of post functions within the workflow. */ + postFunctions: z.array(AppWorkflowTransitionRuleSchema).optional(), + /** The list of validators within the workflow. */ + validators: z.array(AppWorkflowTransitionRuleSchema).optional(), + workflowId: WorkflowIdSchema, +}); + +export type WorkflowTransitionRules = z.infer; diff --git a/src/version2/schemas/workflowTransitionRulesDetails.ts b/src/version2/schemas/workflowTransitionRulesDetails.ts new file mode 100644 index 0000000000..c0868ed3f5 --- /dev/null +++ b/src/version2/schemas/workflowTransitionRulesDetails.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; +import { WorkflowIdSchema } from './workflowId'; + +/** Details about a workflow configuration update request. */ +export const WorkflowTransitionRulesDetailsSchema = z.object({ + workflowId: WorkflowIdSchema, + /** The list of connect workflow rule IDs. */ + workflowRuleIds: z.array(z.string()), +}); + +export type WorkflowTransitionRulesDetails = z.infer; diff --git a/src/version2/schemas/workflowTransitionRulesUpdate.ts b/src/version2/schemas/workflowTransitionRulesUpdate.ts new file mode 100644 index 0000000000..b027518321 --- /dev/null +++ b/src/version2/schemas/workflowTransitionRulesUpdate.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { WorkflowTransitionRulesSchema } from './workflowTransitionRules'; + +/** Details about a workflow configuration update request. */ +export const WorkflowTransitionRulesUpdateSchema = z.object({ + /** The list of workflows with transition rules to update. */ + workflows: z.array(WorkflowTransitionRulesSchema), +}); + +export type WorkflowTransitionRulesUpdate = z.infer; diff --git a/src/version2/schemas/workflowTransitionRulesUpdateErrorDetails.ts b/src/version2/schemas/workflowTransitionRulesUpdateErrorDetails.ts new file mode 100644 index 0000000000..afe944aff8 --- /dev/null +++ b/src/version2/schemas/workflowTransitionRulesUpdateErrorDetails.ts @@ -0,0 +1,19 @@ +import { z } from 'zod'; +import { WorkflowIdSchema } from './workflowId'; + +/** Details of any errors encountered while updating workflow transition rules for a workflow. */ +export const WorkflowTransitionRulesUpdateErrorDetailsSchema = z.object({ + /** + * A list of transition rule update errors, indexed by the transition rule ID. Any transition rule that appears here + * wasn't updated. + */ + ruleUpdateErrors: z.object({}), + /** + * The list of errors that specify why the workflow update failed. The workflow was not updated if the list contains + * any entries. + */ + updateErrors: z.array(z.string()), + workflowId: WorkflowIdSchema, +}); + +export type WorkflowTransitionRulesUpdateErrorDetails = z.infer; diff --git a/src/version2/schemas/workflowTransitionRulesUpdateErrors.ts b/src/version2/schemas/workflowTransitionRulesUpdateErrors.ts new file mode 100644 index 0000000000..b349809e5e --- /dev/null +++ b/src/version2/schemas/workflowTransitionRulesUpdateErrors.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { WorkflowTransitionRulesUpdateErrorDetailsSchema } from './workflowTransitionRulesUpdateErrorDetails'; + +/** Details of any errors encountered while updating workflow transition rules. */ +export const WorkflowTransitionRulesUpdateErrorsSchema = z.object({ + /** A list of workflows. */ + updateResults: z.array(WorkflowTransitionRulesUpdateErrorDetailsSchema), +}); + +export type WorkflowTransitionRulesUpdateErrors = z.infer; diff --git a/src/version2/schemas/workflowTransitions.ts b/src/version2/schemas/workflowTransitions.ts new file mode 100644 index 0000000000..5135cc348d --- /dev/null +++ b/src/version2/schemas/workflowTransitions.ts @@ -0,0 +1,35 @@ +import { z } from 'zod'; +import { WorkflowRuleConfigurationSchema } from './workflowRuleConfiguration'; +import { ConditionGroupConfigurationSchema } from './conditionGroupConfiguration'; +import { WorkflowTransitionLinksSchema } from './workflowTransitionLinks'; +import { WorkflowTriggerSchema } from './workflowTrigger'; + +/** The transitions of the workflow. */ +export const WorkflowTransitionsSchema = z.object({ + /** The post-functions of the transition. */ + actions: z.array(WorkflowRuleConfigurationSchema).optional(), + conditions: ConditionGroupConfigurationSchema.optional(), + /** The custom event ID of the transition. */ + customIssueEventId: z.string().optional(), + /** The description of the transition. */ + description: z.string().optional(), + /** The ID of the transition. */ + id: z.string().optional(), + /** The statuses the transition can start from, and the mapping of ports between the statuses. */ + links: z.array(WorkflowTransitionLinksSchema).optional(), + /** The name of the transition. */ + name: z.string().optional(), + /** The properties of the transition. */ + properties: z.object({}).optional(), + /** The status the transition goes to. */ + toStatusReference: z.string().optional(), + transitionScreen: WorkflowRuleConfigurationSchema.optional(), + /** The triggers of the transition. */ + triggers: z.array(WorkflowTriggerSchema).optional(), + /** The transition type. */ + type: z.enum(['INITIAL', 'GLOBAL', 'DIRECTED']).optional(), + /** The validators of the transition. */ + validators: z.array(WorkflowRuleConfigurationSchema).optional(), +}); + +export type WorkflowTransitions = z.infer; diff --git a/src/version2/schemas/workflowTrigger.ts b/src/version2/schemas/workflowTrigger.ts new file mode 100644 index 0000000000..0ace4b7764 --- /dev/null +++ b/src/version2/schemas/workflowTrigger.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** The trigger configuration associated with a workflow. */ +export const WorkflowTriggerSchema = z.object({ + /** The ID of the trigger. */ + id: z.string().optional(), + /** The parameters of the trigger. */ + parameters: z.object({}), + /** The rule key of the trigger. */ + ruleKey: z.string(), +}); + +export type WorkflowTrigger = z.infer; diff --git a/src/version2/schemas/workflowUpdate.ts b/src/version2/schemas/workflowUpdate.ts new file mode 100644 index 0000000000..3819f8e0e8 --- /dev/null +++ b/src/version2/schemas/workflowUpdate.ts @@ -0,0 +1,28 @@ +import { z } from 'zod'; +import { StatusMigrationSchema } from './statusMigration'; +import { WorkflowLayoutSchema } from './workflowLayout'; +import { StatusMappingDTOSchema } from './statusMappingDTO'; +import { StatusLayoutUpdateSchema } from './statusLayoutUpdate'; +import { TransitionUpdateDTOSchema } from './transitionUpdateDTO'; +import { DocumentVersionSchema } from './documentVersion'; + +/** The details of the workflows to update. */ +export const WorkflowUpdateSchema = z.object({ + /** The mapping of old to new status ID. */ + defaultStatusMappings: z.array(StatusMigrationSchema).optional(), + /** The new description for this workflow. */ + description: z.string().optional(), + /** The ID of this workflow. */ + id: z.string(), + loopedTransitionContainerLayout: WorkflowLayoutSchema.optional(), + startPointLayout: WorkflowLayoutSchema.optional(), + /** The mapping of old to new status ID for a specific project and issue type. */ + statusMappings: z.array(StatusMappingDTOSchema).optional(), + /** The statuses associated with this workflow. */ + statuses: z.array(StatusLayoutUpdateSchema), + /** The transitions of this workflow. */ + transitions: z.array(TransitionUpdateDTOSchema), + version: DocumentVersionSchema, +}); + +export type WorkflowUpdate = z.infer; diff --git a/src/version2/schemas/workflowUpdateRequest.ts b/src/version2/schemas/workflowUpdateRequest.ts new file mode 100644 index 0000000000..bd343ac0de --- /dev/null +++ b/src/version2/schemas/workflowUpdateRequest.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; +import { WorkflowStatusUpdateSchema } from './workflowStatusUpdate'; +import { WorkflowUpdateSchema } from './workflowUpdate'; + +/** The update workflows payload. */ +export const WorkflowUpdateRequestSchema = z.object({ + /** The statuses to associate with the workflows. */ + statuses: z.array(WorkflowStatusUpdateSchema).optional(), + /** The details of the workflows to update. */ + workflows: z.array(WorkflowUpdateSchema).optional(), +}); + +export type WorkflowUpdateRequest = z.infer; diff --git a/src/version2/schemas/workflowUpdateResponse.ts b/src/version2/schemas/workflowUpdateResponse.ts new file mode 100644 index 0000000000..867d68d04e --- /dev/null +++ b/src/version2/schemas/workflowUpdateResponse.ts @@ -0,0 +1,14 @@ +import { z } from 'zod'; +import { JiraWorkflowStatusSchema } from './jiraWorkflowStatus'; +import { JiraWorkflowSchema } from './jiraWorkflow'; + +export const WorkflowUpdateResponseSchema = z.object({ + /** List of updated statuses. */ + statuses: z.array(JiraWorkflowStatusSchema).optional(), + /** If there is a [asynchronous task](#async-operations) operation, as a result of this update. */ + taskId: z.string().optional(), + /** List of updated workflows. */ + workflows: z.array(JiraWorkflowSchema).optional(), +}); + +export type WorkflowUpdateResponse = z.infer; diff --git a/src/version2/schemas/workflowUpdateValidateRequestBean.ts b/src/version2/schemas/workflowUpdateValidateRequestBean.ts new file mode 100644 index 0000000000..a524e48cee --- /dev/null +++ b/src/version2/schemas/workflowUpdateValidateRequestBean.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { WorkflowUpdateRequestSchema } from './workflowUpdateRequest'; +import { ValidationOptionsForUpdateSchema } from './validationOptionsForUpdate'; + +export const WorkflowUpdateValidateRequestBeanSchema = z.object({ + payload: WorkflowUpdateRequestSchema, + validationOptions: ValidationOptionsForUpdateSchema.optional(), +}); + +export type WorkflowUpdateValidateRequestBean = z.infer; diff --git a/src/version2/schemas/workflowValidationError.ts b/src/version2/schemas/workflowValidationError.ts new file mode 100644 index 0000000000..2088f4a5fd --- /dev/null +++ b/src/version2/schemas/workflowValidationError.ts @@ -0,0 +1,30 @@ +import { z } from 'zod'; +import { WorkflowElementReferenceSchema } from './workflowElementReference'; + +/** The details about a workflow validation error. */ +export const WorkflowValidationErrorSchema = z.object({ + /** An error code. */ + code: z.string().optional(), + elementReference: WorkflowElementReferenceSchema.optional(), + /** The validation error level. */ + level: z.enum(['WARNING', 'ERROR']).optional(), + /** An error message. */ + message: z.string().optional(), + /** The type of element the error or warning references. */ + type: z + .enum([ + 'RULE', + 'STATUS', + 'STATUS_LAYOUT', + 'STATUS_PROPERTY', + 'WORKFLOW', + 'TRANSITION', + 'TRANSITION_PROPERTY', + 'SCOPE', + 'STATUS_MAPPING', + 'TRIGGER', + ]) + .optional(), +}); + +export type WorkflowValidationError = z.infer; diff --git a/src/version2/schemas/workflowValidationErrorList.ts b/src/version2/schemas/workflowValidationErrorList.ts new file mode 100644 index 0000000000..e3960515ef --- /dev/null +++ b/src/version2/schemas/workflowValidationErrorList.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; +import { WorkflowValidationErrorSchema } from './workflowValidationError'; + +export const WorkflowValidationErrorListSchema = z.object({ + /** The list of validation errors. */ + errors: z.array(WorkflowValidationErrorSchema).optional(), +}); + +export type WorkflowValidationErrorList = z.infer; diff --git a/src/version2/schemas/workflowsWithTransitionRulesDetails.ts b/src/version2/schemas/workflowsWithTransitionRulesDetails.ts new file mode 100644 index 0000000000..9bf0a22d52 --- /dev/null +++ b/src/version2/schemas/workflowsWithTransitionRulesDetails.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; +import { WorkflowTransitionRulesDetailsSchema } from './workflowTransitionRulesDetails'; + +/** Details of workflows and their transition rules to delete. */ +export const WorkflowsWithTransitionRulesDetailsSchema = z.object({ + /** The list of workflows with transition rules to delete. */ + workflows: z.array(WorkflowTransitionRulesDetailsSchema), +}); + +export type WorkflowsWithTransitionRulesDetails = z.infer; diff --git a/src/version2/schemas/workingDaysConfig.ts b/src/version2/schemas/workingDaysConfig.ts new file mode 100644 index 0000000000..e443833cab --- /dev/null +++ b/src/version2/schemas/workingDaysConfig.ts @@ -0,0 +1,18 @@ +import { z } from 'zod'; +import { NonWorkingDaySchema } from './nonWorkingDay'; + +/** Working days configuration */ +export const WorkingDaysConfigSchema = z.object({ + friday: z.boolean().optional(), + id: z.number().int().optional(), + monday: z.boolean().optional(), + nonWorkingDays: z.array(NonWorkingDaySchema).optional(), + saturday: z.boolean().optional(), + sunday: z.boolean().optional(), + thursday: z.boolean().optional(), + timezoneId: z.string().optional(), + tuesday: z.boolean().optional(), + wednesday: z.boolean().optional(), +}); + +export type WorkingDaysConfig = z.infer; diff --git a/src/version2/schemas/worklog.ts b/src/version2/schemas/worklog.ts new file mode 100644 index 0000000000..780f9cda00 --- /dev/null +++ b/src/version2/schemas/worklog.ts @@ -0,0 +1,44 @@ +import { z } from 'zod'; +import { EntityPropertySchema } from './entityProperty'; + +/** Details of a worklog. */ +export const WorklogSchema = z.object({ + /** Details of the user who created the worklog. */ + author: z.unknown().optional(), + /** A comment about the worklog. Optional when creating or updating a worklog. */ + comment: z.string().optional(), + /** The datetime on which the worklog was created. */ + created: z.string().datetime().optional(), + /** The ID of the worklog record. */ + id: z.string().optional(), + /** The ID of the issue this worklog is for. */ + issueId: z.string().optional(), + /** Details of properties for the worklog. Optional when creating or updating a worklog. */ + properties: z.array(EntityPropertySchema).optional(), + /** The URL of the worklog item. */ + self: z.string().optional(), + /** + * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a + * worklog. + */ + started: z.string().datetime().optional(), + /** + * The time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a + * worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if + * `timeSpentSecond` is provided. + */ + timeSpent: z.string().optional(), + /** + * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. + * Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. + */ + timeSpentSeconds: z.number().int().optional(), + /** Details of the user who last updated the worklog. */ + updateAuthor: z.unknown().optional(), + /** The datetime on which the worklog was last updated. */ + updated: z.string().datetime().optional(), + /** Details about any restrictions in the visibility of the worklog. Optional when creating or updating a worklog. */ + visibility: z.unknown().optional(), +}); + +export type Worklog = z.infer; diff --git a/src/version2/schemas/worklogIdsRequestBean.ts b/src/version2/schemas/worklogIdsRequestBean.ts new file mode 100644 index 0000000000..1a3f7965f0 --- /dev/null +++ b/src/version2/schemas/worklogIdsRequestBean.ts @@ -0,0 +1,8 @@ +import { z } from 'zod'; + +export const WorklogIdsRequestBeanSchema = z.object({ + /** A list of worklog IDs. */ + ids: z.array(z.number().int()), +}); + +export type WorklogIdsRequestBean = z.infer; diff --git a/src/version2/schemas/worklogsMoveRequestBean.ts b/src/version2/schemas/worklogsMoveRequestBean.ts new file mode 100644 index 0000000000..a4dbb6f0b3 --- /dev/null +++ b/src/version2/schemas/worklogsMoveRequestBean.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const WorklogsMoveRequestBeanSchema = z.object({ + /** A list of worklog IDs. */ + ids: z.array(z.number().int()).optional(), + /** The issue id or key of the destination issue */ + issueIdOrKey: z.string().optional(), +}); + +export type WorklogsMoveRequestBean = z.infer; diff --git a/src/version2/schemas/workspaceDataPolicy.ts b/src/version2/schemas/workspaceDataPolicy.ts new file mode 100644 index 0000000000..bd15892491 --- /dev/null +++ b/src/version2/schemas/workspaceDataPolicy.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +/** Details about data policy. */ +export const WorkspaceDataPolicySchema = z.object({ + /** Whether the workspace contains any content inaccessible to the requesting application. */ + anyContentBlocked: z.boolean().optional(), +}); + +export type WorkspaceDataPolicy = z.infer; diff --git a/src/version2/screenSchemes.ts b/src/version2/screenSchemes.ts index e381436a9a..54bde0e9e6 100644 --- a/src/version2/screenSchemes.ts +++ b/src/version2/screenSchemes.ts @@ -1,150 +1,92 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetScreenSchemesParameters } from './parameters/getScreenSchemesParameters'; +import type { CreateScreenSchemeParameters } from './parameters/createScreenSchemeParameters'; +import type { DeleteScreenSchemeParameters } from './parameters/deleteScreenSchemeParameters'; +import type { UpdateScreenSchemeParameters } from './parameters/updateScreenSchemeParameters'; export class ScreenSchemes { constructor(private client: Client) {} - /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of screen - * schemes. - * - * Only screen schemes used in classic projects are returned. + * schemes. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only screen schemes used in classic projects are returned. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getScreenSchemes( - parameters: Parameters.GetScreenSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of screen - * schemes. - * - * Only screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreenSchemes( - parameters?: Parameters.GetScreenSchemes, - callback?: never, - ): Promise; - async getScreenSchemes(parameters?: Parameters.GetScreenSchemes): Promise { - const config: Request = { + async getScreenSchemes(parameters: GetScreenSchemesParameters) { + const request: Request = { url: '/rest/api/2/screenscheme', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - expand: parameters?.expand, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + id: parameters.id, + expand: parameters.expand, + queryString: parameters.queryString, + orderBy: parameters.orderBy, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Creates a screen scheme. + * Creates a screen scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback?: never, - ): Promise; - async createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - ): Promise { - const name = typeof parameters === 'string' ? parameters : parameters.name; - - const config: Request = { + async createScreenScheme(parameters: CreateScreenSchemeParameters) { + const request: Request = { url: '/rest/api/2/screenscheme', method: 'POST', body: { - name, - description: typeof parameters !== 'string' && parameters.description, - screens: typeof parameters !== 'string' && parameters.screens, + description: parameters.description, + name: parameters.name, + screens: parameters.screens, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a screen scheme. Only screen schemes used in classic projects can be updated. + * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only screens schemes used in classic projects can be deleted. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback: Callback): Promise; + async deleteScreenScheme(parameters: DeleteScreenSchemeParameters) { + const request: Request = { + url: `/rest/api/2/screenscheme/${parameters.screenSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** - * Updates a screen scheme. Only screen schemes used in classic projects can be updated. + * Updates a screen scheme. Only screen schemes used in classic projects can be updated. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback?: never): Promise; - async updateScreenScheme(parameters: Parameters.UpdateScreenScheme): Promise { - const config: Request = { + async updateScreenScheme(parameters: UpdateScreenSchemeParameters) { + const request: Request = { url: `/rest/api/2/screenscheme/${parameters.screenSchemeId}`, method: 'PUT', body: { - name: parameters.name, description: parameters.description, + name: parameters.name, screens: parameters.screens, }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. - * - * Only screens schemes used in classic projects can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenScheme( - parameters: Parameters.DeleteScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. - * - * Only screens schemes used in classic projects can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenScheme(parameters: Parameters.DeleteScreenScheme | string, callback?: never): Promise; - async deleteScreenScheme(parameters: Parameters.DeleteScreenScheme | string): Promise { - const screenSchemeId = typeof parameters === 'string' ? parameters : parameters.screenSchemeId; - - const config: Request = { - url: `/rest/api/2/screenscheme/${screenSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/screenTabFields.ts b/src/version2/screenTabFields.ts index 8657457186..fc43aef8e7 100644 --- a/src/version2/screenTabFields.ts +++ b/src/version2/screenTabFields.ts @@ -1,44 +1,24 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAllScreenTabFieldsParameters } from './parameters/getAllScreenTabFieldsParameters'; +import type { AddScreenTabFieldParameters } from './parameters/addScreenTabFieldParameters'; +import type { RemoveScreenTabFieldParameters } from './parameters/removeScreenTabFieldParameters'; +import type { MoveScreenTabFieldParameters } from './parameters/moveScreenTabFieldParameters'; export class ScreenTabFields { constructor(private client: Client) {} - /** - * Returns all fields for a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Returns all fields for a screen tab. * * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type + * Screen Scheme. */ - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback: Callback, - ): Promise; - /** - * Returns all fields for a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback?: never, - ): Promise; - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - ): Promise { - const config: Request = { + async getAllScreenTabFields(parameters: GetAllScreenTabFieldsParameters) { + const request: Request = { url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, method: 'GET', query: { @@ -46,31 +26,17 @@ export class ScreenTabFields { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Adds a field to a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback: Callback, - ): Promise; - /** - * Adds a field to a screen tab. + * Adds a field to a screen tab. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback?: never, - ): Promise; - async addScreenTabField(parameters: Parameters.AddScreenTabField): Promise { - const config: Request = { + async addScreenTabField(parameters: AddScreenTabFieldParameters) { + const request: Request = { url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, method: 'POST', body: { @@ -78,55 +44,34 @@ export class ScreenTabFields { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Removes a field from a screen tab. + * Removes a field from a screen tab. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async removeScreenTabField( - parameters: Parameters.RemoveScreenTabField, - callback: Callback, - ): Promise; - /** - * Removes a field from a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeScreenTabField(parameters: Parameters.RemoveScreenTabField, callback?: never): Promise; - async removeScreenTabField(parameters: Parameters.RemoveScreenTabField): Promise { - const config: Request = { + async removeScreenTabField(parameters: RemoveScreenTabFieldParameters) { + const request: Request = { url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Moves a screen tab field. - * - * If `after` and `position` are provided in the request, `position` is ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback: Callback): Promise; - /** - * Moves a screen tab field. - * - * If `after` and `position` are provided in the request, `position` is ignored. + * Moves a screen tab field. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If `after` and `position` are provided in the request, `position` is ignored. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback?: never): Promise; - async moveScreenTabField(parameters: Parameters.MoveScreenTabField): Promise { - const config: Request = { + async moveScreenTabField(parameters: MoveScreenTabFieldParameters) { + const request: Request = { url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}/move`, method: 'POST', body: { @@ -135,6 +80,6 @@ export class ScreenTabFields { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/screenTabs.ts b/src/version2/screenTabs.ts index d7977ac41e..6567846762 100644 --- a/src/version2/screenTabs.ts +++ b/src/version2/screenTabs.ts @@ -1,109 +1,66 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetBulkScreenTabsParameters } from './parameters/getBulkScreenTabsParameters'; +import type { GetAllScreenTabsParameters } from './parameters/getAllScreenTabsParameters'; +import type { AddScreenTabParameters } from './parameters/addScreenTabParameters'; +import type { DeleteScreenTabParameters } from './parameters/deleteScreenTabParameters'; +import type { RenameScreenTabParameters } from './parameters/renameScreenTabParameters'; +import type { MoveScreenTabParameters } from './parameters/moveScreenTabParameters'; 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. + * 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). + * - **[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): Promise { - const config: Request = { + async getBulkScreenTabs(parameters: GetBulkScreenTabsParameters) { + const request: Request = { url: '/rest/api/2/screens/tabs', method: 'GET', query: { - screenId: parameters?.screenId, - tabId: parameters?.tabId, - startAt: parameters?.startAt, - maxResult: parameters?.maxResult, + screenId: parameters.screenId, + tabId: parameters.tabId, + startAt: parameters.startAt, + maxResult: parameters.maxResult, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the list of tabs for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. + * Returns the list of tabs for a screen. * + * + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type + * Screen Scheme. */ - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback: Callback, - ): Promise; - /** - * Returns the list of tabs for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback?: never, - ): Promise; - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: Request = { - url: `/rest/api/2/screens/${screenId}/tabs`, + async getAllScreenTabs(parameters: GetAllScreenTabsParameters) { + const request: Request = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs`, method: 'GET', query: { - projectKey: typeof parameters !== 'string' && parameters.projectKey, + projectKey: parameters.projectKey, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a tab for a screen. + * Creates a tab for a screen. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async addScreenTab( - parameters: Parameters.AddScreenTab, - callback: Callback, - ): Promise; - /** - * Creates a tab for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTab(parameters: Parameters.AddScreenTab, callback?: never): Promise; - async addScreenTab(parameters: Parameters.AddScreenTab): Promise { - const config: Request = { + async addScreenTab(parameters: AddScreenTabParameters) { + const request: Request = { url: `/rest/api/2/screens/${parameters.screenId}/tabs`, method: 'POST', body: { @@ -112,82 +69,55 @@ export class ScreenTabs { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates the name of a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async renameScreenTab( - parameters: Parameters.RenameScreenTab, - callback: Callback, - ): Promise; - /** - * Updates the name of a screen tab. + * Deletes a screen tab. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async renameScreenTab(parameters: Parameters.RenameScreenTab, callback?: never): Promise; - async renameScreenTab(parameters: Parameters.RenameScreenTab): Promise { - const config: Request = { + async deleteScreenTab(parameters: DeleteScreenTabParameters) { + const request: Request = { url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}`, - method: 'PUT', - body: { - id: parameters.id, - name: parameters.name, - }, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback: Callback): Promise; - /** - * Deletes a screen tab. + * Updates the name of a screen tab. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: never): Promise; - async deleteScreenTab(parameters: Parameters.DeleteScreenTab): Promise { - const config: Request = { + async renameScreenTab(parameters: RenameScreenTabParameters) { + const request: Request = { url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}`, - method: 'DELETE', + method: 'PUT', + body: { + id: parameters.id, + name: parameters.name, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Moves a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback: Callback): Promise; - /** - * Moves a screen tab. + * Moves a screen tab. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: never): Promise; - async moveScreenTab(parameters: Parameters.MoveScreenTab): Promise { - const config: Request = { + async moveScreenTab(parameters: MoveScreenTabParameters) { + const request: Request = { url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/move/${parameters.pos}`, method: 'POST', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/screens.ts b/src/version2/screens.ts index 3a1a449ff9..f6bf6d1c98 100644 --- a/src/version2/screens.ts +++ b/src/version2/screens.ts @@ -1,228 +1,139 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetScreensForFieldParameters } from './parameters/getScreensForFieldParameters'; +import type { GetScreensParameters } from './parameters/getScreensParameters'; +import type { CreateScreenParameters } from './parameters/createScreenParameters'; +import type { AddFieldToDefaultScreenParameters } from './parameters/addFieldToDefaultScreenParameters'; +import type { DeleteScreenParameters } from './parameters/deleteScreenParameters'; +import type { UpdateScreenParameters } from './parameters/updateScreenParameters'; +import type { GetAvailableScreenFieldsParameters } from './parameters/getAvailableScreenFieldsParameters'; export class Screens { constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * screens a field is used in. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback: Callback, - ): Promise; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * screens a field is used in. + * screens a field is used in. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback?: never, - ): Promise; - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: Request = { - url: `/rest/api/2/field/${fieldId}/screens`, + async getScreensForField(parameters: GetScreensForFieldParameters) { + const request: Request = { + url: `/rest/api/2/field/${parameters.fieldId}/screens`, method: 'GET', query: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - expand: typeof parameters !== 'string' && parameters.expand, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * screens or those specified by one or more screen IDs. + * screens or those specified by one or more screen IDs. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getScreens( - parameters: Parameters.GetScreens | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * screens or those specified by one or more screen IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreens(parameters?: Parameters.GetScreens, callback?: never): Promise; - async getScreens(parameters?: Parameters.GetScreens): Promise { - const config: Request = { + async getScreens(parameters: GetScreensParameters) { + const request: Request = { url: '/rest/api/2/screens', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - queryString: parameters?.queryString, - scope: parameters?.scope, - orderBy: parameters?.orderBy, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + id: parameters.id, + queryString: parameters.queryString, + scope: parameters.scope, + orderBy: parameters.orderBy, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a screen with a default field tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreen(parameters: Parameters.CreateScreen, callback: Callback): Promise; - /** - * Creates a screen with a default field tab. + * Creates a screen with a default field tab. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createScreen(parameters: Parameters.CreateScreen, callback?: never): Promise; - async createScreen(parameters: Parameters.CreateScreen): Promise { - const config: Request = { + async createScreen(parameters: CreateScreenParameters) { + const request: Request = { url: '/rest/api/2/screens', method: 'POST', body: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Adds a field to the default tab of the default screen. + * Adds a field to the default tab of the default screen. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback: Callback, - ): Promise; - /** - * Adds a field to the default tab of the default screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback?: never, - ): Promise; - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: Request = { - url: `/rest/api/2/screens/addToDefault/${fieldId}`, + async addFieldToDefaultScreen(parameters: AddFieldToDefaultScreenParameters) { + const request: Request = { + url: `/rest/api/2/screens/addToDefault/${parameters.fieldId}`, method: 'POST', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a screen. Only screens used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreen(parameters: Parameters.UpdateScreen, callback: Callback): Promise; - /** - * Updates a screen. Only screens used in classic projects can be updated. + * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Only screens used in classic projects can be deleted. */ - async updateScreen(parameters: Parameters.UpdateScreen, callback?: never): Promise; - async updateScreen(parameters: Parameters.UpdateScreen): Promise { - const config: Request = { + async deleteScreen(parameters: DeleteScreenParameters) { + const request: Request = { url: `/rest/api/2/screens/${parameters.screenId}`, - method: 'PUT', - body: { - name: parameters.name, - description: parameters.description, - }, + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. + * Updates a screen. Only screens used in classic projects can be updated. * * - * Only screens used in classic projects can be deleted. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteScreen(parameters: Parameters.DeleteScreen | string, callback: Callback): Promise; - /** - * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. - * - * Only screens used in classic projects can be deleted. - */ - async deleteScreen(parameters: Parameters.DeleteScreen | string, callback?: never): Promise; - async deleteScreen(parameters: Parameters.DeleteScreen | string): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: Request = { - url: `/rest/api/2/screens/${screenId}`, - method: 'DELETE', + async updateScreen(parameters: UpdateScreenParameters) { + const request: Request = { + url: `/rest/api/2/screens/${parameters.screenId}`, + method: 'PUT', + body: { + description: parameters.description, + name: parameters.name, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the fields that can be added to a tab on a screen. + * Returns the fields that can be added to a tab on a screen. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback: Callback, - ): Promise; - /** - * Returns the fields that can be added to a tab on a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback?: never, - ): Promise; - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: Request = { - url: `/rest/api/2/screens/${screenId}/availableFields`, + async getAvailableScreenFields(parameters: GetAvailableScreenFieldsParameters) { + const request: Request = { + url: `/rest/api/2/screens/${parameters.screenId}/availableFields`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/serverInfo.ts b/src/version2/serverInfo.ts index 7e1de1dda6..6bdf6b21d4 100644 --- a/src/version2/serverInfo.ts +++ b/src/version2/serverInfo.ts @@ -1,33 +1,21 @@ -import type * as Models from './models'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; export class ServerInfo { constructor(private client: Client) {} - - /** - * Returns information about the Jira instance. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getServerInfo(callback: Callback): Promise; /** - * Returns information about the Jira instance. - * - * This operation can be accessed anonymously. + * Returns information about the Jira instance. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getServerInfo(callback?: never): Promise; - async getServerInfo(): Promise { - const config: Request = { + async getServerInfo() { + const request: Request = { url: '/rest/api/2/serverInfo', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/serviceRegistry.ts b/src/version2/serviceRegistry.ts index c3c7f9c272..53dcb48f2e 100644 --- a/src/version2/serviceRegistry.ts +++ b/src/version2/serviceRegistry.ts @@ -1,28 +1,17 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { ServicesParameters } from './parameters/servicesParameters'; 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. + * 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 + * - **[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): Promise { - const config: Request = { + async services(parameters: ServicesParameters) { + const request: Request = { url: '/rest/atlassian-connect/1/service-registry', method: 'GET', query: { @@ -30,6 +19,6 @@ export class ServiceRegistry { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/status.ts b/src/version2/status.ts index 8fb21ac4dd..303e7841c0 100644 --- a/src/version2/status.ts +++ b/src/version2/status.ts @@ -1,204 +1,125 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { DeleteStatusesByIdParameters } from './parameters/deleteStatusesByIdParameters'; +import type { GetStatusesByIdParameters } from './parameters/getStatusesByIdParameters'; +import type { CreateStatusesParameters } from './parameters/createStatusesParameters'; +import type { UpdateStatusesParameters } from './parameters/updateStatusesParameters'; +import type { SearchParameters } from './parameters/searchParameters'; +import type { GetProjectIssueTypeUsagesForStatusParameters } from './parameters/getProjectIssueTypeUsagesForStatusParameters'; +import type { GetProjectUsagesForStatusParameters } from './parameters/getProjectUsagesForStatusParameters'; +import type { GetWorkflowUsagesForStatusParameters } from './parameters/getWorkflowUsagesForStatusParameters'; export class Status { constructor(private client: Client) {} - - /** - * Returns a list of the statuses specified by one or more status IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback: Callback, - ): Promise; /** - * Returns a list of the statuses specified by one or more status IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Deletes statuses by ID. * * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) */ - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback?: never, - ): Promise; - async getStatusesById(parameters: Parameters.GetStatusesById | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { + async deleteStatusesById(parameters: DeleteStatusesByIdParameters) { + const request: Request = { url: '/rest/api/2/statuses', - method: 'GET', + method: 'DELETE', query: { - id, - expand: typeof parameters !== 'string' && parameters.expand, + id: parameters.id, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates statuses for a global or project scope. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async createStatuses( - parameters: Parameters.CreateStatuses, - callback: Callback, - ): Promise; - /** - * Creates statuses for a global or project scope. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Returns a list of the statuses specified by one or more status IDs. * * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) */ - async createStatuses(parameters: Parameters.CreateStatuses, callback?: never): Promise; - async createStatuses(parameters: Parameters.CreateStatuses): Promise { - const config: Request = { + async getStatusesById(parameters: GetStatusesByIdParameters) { + const request: Request = { url: '/rest/api/2/statuses', - method: 'POST', - body: { - statuses: parameters.statuses, - scope: parameters.scope, + method: 'GET', + query: { + id: parameters.id, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async updateStatuses(parameters: Parameters.UpdateStatuses, callback: Callback): Promise; - /** - * Updates statuses by ID. + * Creates statuses for a global or project scope. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) */ - async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: never): Promise; - async updateStatuses(parameters: Parameters.UpdateStatuses): Promise { - const config: Request = { + async createStatuses(parameters: CreateStatusesParameters) { + const request: Request = { url: '/rest/api/2/statuses', - method: 'PUT', + method: 'POST', body: { + scope: parameters.scope, statuses: parameters.statuses, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async deleteStatusesById( - parameters: Parameters.DeleteStatusesById | string, - callback: Callback, - ): Promise; - /** - * Deletes statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Updates statuses by ID. * * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) */ - async deleteStatusesById(parameters: Parameters.DeleteStatusesById | string, callback?: never): Promise; - async deleteStatusesById(parameters: Parameters.DeleteStatusesById | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { + async updateStatuses(parameters: UpdateStatusesParameters) { + const request: Request = { url: '/rest/api/2/statuses', - method: 'DELETE', - query: { - id, + method: 'PUT', + body: { + statuses: parameters.statuses, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async search( - parameters: Parameters.Search | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/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:** + * 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. * * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) */ - async search(parameters?: Parameters.Search, callback?: never): Promise; - async search(parameters?: Parameters.Search): Promise { - const config: Request = { + async search(parameters: SearchParameters) { + const request: Request = { url: '/rest/api/2/statuses/search', method: 'GET', query: { - expand: parameters?.expand, - projectId: parameters?.projectId, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - searchString: parameters?.searchString, - statusCategory: parameters?.statusCategory, + projectId: parameters.projectId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + searchString: parameters.searchString, + statusCategory: parameters.statusCategory, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** 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, - ): Promise { - const config: Request = { + async getProjectIssueTypeUsagesForStatus(parameters: GetProjectIssueTypeUsagesForStatusParameters) { + const request: Request = { url: `/rest/api/2/statuses/${parameters.statusId}/project/${parameters.projectId}/issueTypeUsages`, method: 'GET', query: { @@ -207,23 +128,12 @@ export class Status { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** 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, - ): Promise { - const config: Request = { + async getProjectUsagesForStatus(parameters: GetProjectUsagesForStatusParameters) { + const request: Request = { url: `/rest/api/2/statuses/${parameters.statusId}/projectUsages`, method: 'GET', query: { @@ -232,23 +142,12 @@ export class Status { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** 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, - ): Promise { - const config: Request = { + async getWorkflowUsagesForStatus(parameters: GetWorkflowUsagesForStatusParameters) { + const request: Request = { url: `/rest/api/2/statuses/${parameters.statusId}/workflowUsages`, method: 'GET', query: { @@ -257,6 +156,6 @@ export class Status { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/tasks.ts b/src/version2/tasks.ts index 662040034a..d206ca6184 100644 --- a/src/version2/tasks.ts +++ b/src/version2/tasks.ts @@ -1,92 +1,52 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetTaskParameters } from './parameters/getTaskParameters'; +import type { CancelTaskParameters } from './parameters/cancelTaskParameters'; export class Tasks { constructor(private client: Client) {} - /** * Returns the status of a [long-running asynchronous - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). - * - * When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the - * operation that created the task for details. Task details are not permanently retained. As of September 2019, - * details are retained for 14 days although this period may change without notice. - * - * **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: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). * + * + * - When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the + * operation that created the task for details. Task details are not permanently retained. As of September 2019, + * details are retained for 14 days although this period may change without notice. + * - + * - **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: + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - - Creator of the task. */ - async getTask( - parameters: Parameters.GetTask | string, - callback: Callback, - ): Promise; - /** - * Returns the status of a [long-running asynchronous - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). - * - * When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the - * operation that created the task for details. Task details are not permanently retained. As of September 2019, - * details are retained for 14 days although this period may change without notice. - * - * **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: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async getTask(parameters: Parameters.GetTask | string, callback?: never): Promise; - async getTask(parameters: Parameters.GetTask | string): Promise { - const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; - - const config: Request = { - url: `/rest/api/2/task/${taskId}`, + async getTask(parameters: GetTaskParameters) { + const request: Request = { + url: `/rest/api/2/task/${parameters.taskId}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Cancels a task. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async cancelTask(parameters: Parameters.CancelTask | string, callback: Callback): Promise; - /** - * Cancels a task. + * Cancels a task. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - - Creator of the task. */ - async cancelTask(parameters: Parameters.CancelTask | string, callback?: never): Promise; - async cancelTask(parameters: Parameters.CancelTask | string): Promise { - const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; - - const config: Request = { - url: `/rest/api/2/task/${taskId}/cancel`, + async cancelTask(parameters: CancelTaskParameters) { + const request: Request = { + url: `/rest/api/2/task/${parameters.taskId}/cancel`, method: 'POST', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/teamsInPlan.ts b/src/version2/teamsInPlan.ts index c2903813ed..6315a7bee1 100644 --- a/src/version2/teamsInPlan.ts +++ b/src/version2/teamsInPlan.ts @@ -1,36 +1,26 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetTeamsParameters } from './parameters/getTeamsParameters'; +import type { AddAtlassianTeamParameters } from './parameters/addAtlassianTeamParameters'; +import type { RemoveAtlassianTeamParameters } from './parameters/removeAtlassianTeamParameters'; +import type { GetAtlassianTeamParameters } from './parameters/getAtlassianTeamParameters'; +import type { UpdateAtlassianTeamParameters } from './parameters/updateAtlassianTeamParameters'; +import type { CreatePlanOnlyTeamParameters } from './parameters/createPlanOnlyTeamParameters'; +import type { DeletePlanOnlyTeamParameters } from './parameters/deletePlanOnlyTeamParameters'; +import type { GetPlanOnlyTeamParameters } from './parameters/getPlanOnlyTeamParameters'; +import type { UpdatePlanOnlyTeamParameters } from './parameters/updatePlanOnlyTeamParameters'; 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. + * 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). + * - **[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): Promise { - const config: Request = { + async getTeams(parameters: GetTeamsParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}/team`, method: 'GET', query: { @@ -39,25 +29,17 @@ export class TeamsInPlan { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * 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). + * - **[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): Promise { - const config: Request = { + async addAtlassianTeam(parameters: AddAtlassianTeamParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}/team/atlassian`, method: 'POST', body: { @@ -69,123 +51,72 @@ export class TeamsInPlan { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns planning settings for an Atlassian team in a plan. + * 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). + * - **[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, - ): Promise { - const config: Request = { + async removeAtlassianTeam(parameters: RemoveAtlassianTeamParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, - method: 'GET', + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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 + * 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). - * - * _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._ + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateAtlassianTeam(parameters: Parameters.UpdateAtlassianTeam, callback?: never): Promise; - async updateAtlassianTeam(parameters: Parameters.UpdateAtlassianTeam): Promise { - const config: Request = { + async getAtlassianTeam(parameters: GetAtlassianTeamParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, - method: 'PUT', + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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): Promise { - const config: Request = { + * 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: UpdateAtlassianTeamParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, - method: 'DELETE', + method: 'PUT', + body: parameters.body, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * 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). + * - **[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): Promise { - const config: Request = { + async createPlanOnlyTeam(parameters: CreatePlanOnlyTeamParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}/team/planonly`, method: 'POST', body: { @@ -198,103 +129,63 @@ export class TeamsInPlan { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. + * 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). + * - **[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): Promise { - const config: Request = { + async deletePlanOnlyTeam(parameters: DeletePlanOnlyTeamParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, - method: 'GET', + method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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 + * 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). - * - * _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._ + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - 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): Promise { - const config: Request = { + async getPlanOnlyTeam(parameters: GetPlanOnlyTeamParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, - method: 'PUT', + method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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): Promise { - const config: Request = { + * 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: UpdatePlanOnlyTeamParameters) { + const request: Request = { url: `/rest/api/2/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, - method: 'DELETE', + method: 'PUT', + body: parameters.body, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/timeTracking.ts b/src/version2/timeTracking.ts index 8bf577d8d6..f30ad15c1e 100644 --- a/src/version2/timeTracking.ts +++ b/src/version2/timeTracking.ts @@ -1,163 +1,98 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { SelectTimeTrackingImplementationParameters } from './parameters/selectTimeTrackingImplementationParameters'; +import type { SetSharedTimeTrackingConfigurationParameters } from './parameters/setSharedTimeTrackingConfigurationParameters'; export class TimeTracking { constructor(private client: Client) {} - /** * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a - * successful but empty response is returned. + * successful but empty response is returned. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getSelectedTimeTrackingImplementation(callback: Callback): Promise; - /** - * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a - * successful but empty response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSelectedTimeTrackingImplementation(callback?: never): Promise; - async getSelectedTimeTrackingImplementation(): Promise { - const config: Request = { + async getSelectedTimeTrackingImplementation() { + const request: Request = { url: '/rest/api/2/configuration/timetracking', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Selects a time tracking provider. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async selectTimeTrackingImplementation( - parameters: Parameters.SelectTimeTrackingImplementation | undefined, - callback: Callback, - ): Promise; - /** - * Selects a time tracking provider. + * Selects a time tracking provider. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async selectTimeTrackingImplementation( - parameters?: Parameters.SelectTimeTrackingImplementation, - callback?: never, - ): Promise; - async selectTimeTrackingImplementation( - parameters?: Parameters.SelectTimeTrackingImplementation, - ): Promise { - const config: Request = { + async selectTimeTrackingImplementation(parameters: SelectTimeTrackingImplementationParameters) { + const request: Request = { url: '/rest/api/2/configuration/timetracking', method: 'PUT', body: { - key: parameters?.key, - name: parameters?.name, - url: parameters?.url, + key: parameters.key, + name: parameters.name, + url: parameters.url, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more * information on time tracking providers, see the documentation for the [ Time Tracking - * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableTimeTrackingImplementations( - callback: Callback, - ): Promise; - /** - * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time - * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more - * information on time tracking providers, see the documentation for the [ Time Tracking - * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. + * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAvailableTimeTrackingImplementations(callback?: never): Promise; - async getAvailableTimeTrackingImplementations(): Promise { - const config: Request = { + async getAvailableTimeTrackingImplementations() { + const request: Request = { url: '/rest/api/2/configuration/timetracking/list', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. - * For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getSharedTimeTrackingConfiguration(callback: Callback): Promise; - /** - * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. - * For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSharedTimeTrackingConfiguration(callback?: never): Promise; - async getSharedTimeTrackingConfiguration(): Promise { - const config: Request = { + async getSharedTimeTrackingConfiguration() { + const request: Request = { url: '/rest/api/2/configuration/timetracking/options', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the time tracking settings. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setSharedTimeTrackingConfiguration( - parameters: Parameters.SetSharedTimeTrackingConfiguration, - callback: Callback, - ): Promise; - /** - * Sets the time tracking settings. + * Sets the time tracking settings. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setSharedTimeTrackingConfiguration( - parameters: Parameters.SetSharedTimeTrackingConfiguration, - callback?: never, - ): Promise; - async setSharedTimeTrackingConfiguration( - parameters: Parameters.SetSharedTimeTrackingConfiguration, - ): Promise { - const config: Request = { + async setSharedTimeTrackingConfiguration(parameters: SetSharedTimeTrackingConfigurationParameters) { + const request: Request = { url: '/rest/api/2/configuration/timetracking/options', method: 'PUT', body: { - workingHoursPerDay: parameters.workingHoursPerDay, - workingDaysPerWeek: parameters.workingDaysPerWeek, - timeFormat: parameters.timeFormat, defaultUnit: parameters.defaultUnit, + timeFormat: parameters.timeFormat, + workingDaysPerWeek: parameters.workingDaysPerWeek, + workingHoursPerDay: parameters.workingHoursPerDay, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/uIModificationsApps.ts b/src/version2/uIModificationsApps.ts index b6dde1a7ef..9c70a37761 100644 --- a/src/version2/uIModificationsApps.ts +++ b/src/version2/uIModificationsApps.ts @@ -1,144 +1,99 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetUiModificationsParameters } from './parameters/getUiModificationsParameters'; +import type { CreateUiModificationParameters } from './parameters/createUiModificationParameters'; +import type { DeleteUiModificationParameters } from './parameters/deleteUiModificationParameters'; +import type { UpdateUiModificationParameters } from './parameters/updateUiModificationParameters'; export class UIModificationsApps { constructor(private client: Client) {} - /** - * Gets UI modifications. UI modifications can only be retrieved by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * Gets UI modifications. UI modifications can only be retrieved by Forge apps. * * - * 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. + * - **[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, - callback: Callback, - ): Promise; - /** - * Gets UI modifications. UI modifications can only be retrieved by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - * - * 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, - callback?: never, - ): Promise; - async getUiModifications( - parameters?: Parameters.GetUiModifications, - ): Promise { - const config: Request = { + async getUiModifications(parameters: GetUiModificationsParameters) { + const request: Request = { url: '/rest/api/2/uiModifications', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - expand: parameters?.expand, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a UI modification. UI modification can only be created by Forge apps. - * - * 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, - callback: Callback, - ): Promise; - /** - * Creates a UI modification. UI modification can only be created by Forge apps. - * - * 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. + * Creates a UI modification. UI modification can only be created by Forge apps. * + * + * - 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, - callback?: never, - ): Promise; - async createUiModification( - parameters: Parameters.CreateUiModification, - ): Promise { - const config: Request = { + async createUiModification(parameters: CreateUiModificationParameters) { + const request: Request = { url: '/rest/api/2/uiModifications', method: 'POST', body: { - name: parameters.name, - description: parameters.description, - data: parameters.data, contexts: parameters.contexts, + data: parameters.data, + description: parameters.description, + name: parameters.name, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates a UI modification. UI modification can only be updated by Forge apps. - * - * 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. + * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can + * only be deleted by Forge apps. * * - * 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. + * - **[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 updateUiModification( - parameters: Parameters.UpdateUiModification, - callback: Callback, - ): Promise; + async deleteUiModification(parameters: DeleteUiModificationParameters) { + const request: Request = { + url: `/rest/api/2/uiModifications/${parameters.uiModificationId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** - * Updates a UI modification. UI modification can only be updated by Forge apps. - * - * 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. + * Updates a UI modification. UI modification can only be updated by Forge apps. * + * + * - 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(parameters: Parameters.UpdateUiModification): Promise { - const config: Request = { + async updateUiModification(parameters: UpdateUiModificationParameters) { + const request: Request = { url: `/rest/api/2/uiModifications/${parameters.uiModificationId}`, method: 'PUT', body: { @@ -149,43 +104,6 @@ export class UIModificationsApps { }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can - * only be deleted by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - * - * 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, - callback: Callback, - ): Promise; - /** - * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can - * only be deleted by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - * - * 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, - callback?: never, - ): Promise; - async deleteUiModification(parameters: Parameters.DeleteUiModification | string): Promise { - const uiModificationId = typeof parameters === 'string' ? parameters : parameters.uiModificationId; - - const config: Request = { - url: `/rest/api/2/uiModifications/${uiModificationId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/userNavProperties.ts b/src/version2/userNavProperties.ts index 3be2c03171..59b7c34a86 100644 --- a/src/version2/userNavProperties.ts +++ b/src/version2/userNavProperties.ts @@ -1,42 +1,22 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetUserNavPropertyParameters } from './parameters/getUserNavPropertyParameters'; +import type { SetUserNavPropertyParameters } from './parameters/setUserNavPropertyParameters'; -export class UserNavProperties { +export class Usernavproperties { constructor(private client: Client) {} - /** - * Returns the value of a user nav preference. - * - * Note: This operation fetches the property key value directly from RbacClient. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. - * - Access to Jira, to get a property from the calling user's record. + * Returns the value of a user nav preference. * + * + * - Note: This operation fetches the property key value directly from RbacClient. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. + * - - Access to Jira, to get a property from the calling user's record. */ - async getUserNavProperty( - parameters: Parameters.GetUserNavProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a user nav preference. - * - * Note: This operation fetches the property key value directly from RbacClient. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. - * - Access to Jira, to get a property from the calling user's record. - */ - async getUserNavProperty( - parameters: Parameters.GetUserNavProperty, - callback?: never, - ): Promise; - async getUserNavProperty(parameters: Parameters.GetUserNavProperty): Promise { - const config: Request = { + async getUserNavProperty(parameters: GetUserNavPropertyParameters) { + const request: Request = { url: `/rest/api/2/user/nav4-opt-property/${parameters.propertyKey}`, method: 'GET', query: { @@ -44,34 +24,20 @@ export class UserNavProperties { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Sets the value of a Nav4 preference. Use this resource to store Nav4 preference data against a user in the Identity - * service. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. - * - Access to Jira, to set a property on the calling user's record. - */ - async setUserNavProperty( - parameters: Parameters.SetUserNavProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a Nav4 preference. Use this resource to store Nav4 preference data against a user in the Identity - * service. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * service. * * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. - * - Access to Jira, to set a property on the calling user's record. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. + * - - Access to Jira, to set a property on the calling user's record. */ - async setUserNavProperty(parameters: Parameters.SetUserNavProperty, callback?: never): Promise; - async setUserNavProperty(parameters: Parameters.SetUserNavProperty): Promise { - const config: Request = { + async setUserNavProperty(parameters: SetUserNavPropertyParameters) { + const request: Request = { url: `/rest/api/2/user/nav4-opt-property/${parameters.propertyKey}`, method: 'PUT', query: { @@ -79,6 +45,6 @@ export class UserNavProperties { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/userProperties.ts b/src/version2/userProperties.ts index 2715a55aea..df9560d6bf 100644 --- a/src/version2/userProperties.ts +++ b/src/version2/userProperties.ts @@ -1,94 +1,54 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetUserPropertyKeysParameters } from './parameters/getUserPropertyKeysParameters'; +import type { DeleteUserPropertyParameters } from './parameters/deleteUserPropertyParameters'; +import type { GetUserPropertyParameters } from './parameters/getUserPropertyParameters'; +import type { SetUserPropertyParameters } from './parameters/setUserPropertyParameters'; export class UserProperties { constructor(private client: Client) {} - - /** - * Returns the keys of all properties for a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on - * any user. - * - Access to Jira, to access the calling user's property keys. - */ - async getUserPropertyKeys( - parameters: Parameters.GetUserPropertyKeys | undefined, - callback: Callback, - ): Promise; /** - * Returns the keys of all properties for a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on - * any user. - * - Access to Jira, to access the calling user's property keys. + * Returns the keys of all properties for a user. * + * + * - Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on + * any user. + * - - Access to Jira, to access the calling user's property keys. */ - async getUserPropertyKeys( - parameters?: Parameters.GetUserPropertyKeys, - callback?: never, - ): Promise; - async getUserPropertyKeys(parameters?: Parameters.GetUserPropertyKeys): Promise { - const config: Request = { + async getUserPropertyKeys(parameters: GetUserPropertyKeysParameters) { + const request: Request = { url: '/rest/api/2/user/properties', method: 'GET', query: { - accountId: parameters?.accountId, - userKey: parameters?.userKey, - username: parameters?.username, + accountId: parameters.accountId, + userKey: parameters.userKey, + username: parameters.username, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the value of a user's property. If no property key is provided [Get user property - * keys](#api-rest-api-2-user-properties-get) is called. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. - * - Access to Jira, to get a property from the calling user's record. - */ - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a user's property. If no property key is provided [Get user property - * keys](#api-rest-api-2-user-properties-get) is called. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. - * - Access to Jira, to get a property from the calling user's record. + * Deletes a property from a user. * + * + * - Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any + * user. + * - - Access to Jira, to delete a property from the calling user's record. */ - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback?: never, - ): Promise; - async getUserProperty(parameters: Parameters.GetUserProperty): Promise { - const config: Request = { + async deleteUserProperty(parameters: DeleteUserPropertyParameters) { + const request: Request = { url: `/rest/api/2/user/properties/${parameters.propertyKey}`, - method: 'GET', + method: 'DELETE', query: { accountId: parameters.accountId, userKey: parameters.userKey, @@ -96,76 +56,50 @@ export class UserProperties { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the value of a user's property. Use this resource to store custom data against a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. - * - Access to Jira, to set a property on the calling user's record. - */ - async setUserProperty(parameters: Parameters.SetUserProperty, callback: Callback): Promise; - /** - * Sets the value of a user's property. Use this resource to store custom data against a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. - * - Access to Jira, to set a property on the calling user's record. + * Returns the value of a user's property. If no property key is provided [Get user property + * keys](#api-rest-api-2-user-properties-get) is called. * + * + * - Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. + * - - Access to Jira, to get a property from the calling user's record. */ - async setUserProperty(parameters: Parameters.SetUserProperty, callback?: never): Promise; - async setUserProperty(parameters: Parameters.SetUserProperty): Promise { - const config: Request = { + async getUserProperty(parameters: GetUserPropertyParameters) { + const request: Request = { url: `/rest/api/2/user/properties/${parameters.propertyKey}`, - method: 'PUT', + method: 'GET', query: { accountId: parameters.accountId, + userKey: parameters.userKey, + username: parameters.username, }, - body: parameters.propertyValue, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a property from a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any - * user. - * - Access to Jira, to delete a property from the calling user's record. + * Sets the value of a user's property. Use this resource to store custom data against a user. * + * + * - Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. + * - - Access to Jira, to set a property on the calling user's record. */ - async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback: Callback): Promise; - /** - * Deletes a property from a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any - * user. - * - Access to Jira, to delete a property from the calling user's record. - */ - async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback?: never): Promise; - async deleteUserProperty(parameters: Parameters.DeleteUserProperty): Promise { - const config: Request = { + async setUserProperty(parameters: SetUserPropertyParameters) { + const request: Request = { url: `/rest/api/2/user/properties/${parameters.propertyKey}`, - method: 'DELETE', + method: 'PUT', query: { accountId: parameters.accountId, userKey: parameters.userKey, @@ -173,6 +107,6 @@ export class UserProperties { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/userSearch.ts b/src/version2/userSearch.ts index 83ab7dedc2..72a4c07f8f 100644 --- a/src/version2/userSearch.ts +++ b/src/version2/userSearch.ts @@ -1,57 +1,37 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; -import { paramSerializer } from '../paramSerializer'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { FindBulkAssignableUsersParameters } from './parameters/findBulkAssignableUsersParameters'; +import type { FindAssignableUsersParameters } from './parameters/findAssignableUsersParameters'; +import type { FindUsersWithAllPermissionsParameters } from './parameters/findUsersWithAllPermissionsParameters'; +import type { FindUsersForPickerParameters } from './parameters/findUsersForPickerParameters'; +import type { FindUsersParameters } from './parameters/findUsersParameters'; +import type { FindUsersByQueryParameters } from './parameters/findUsersByQueryParameters'; +import type { FindUserKeysByQueryParameters } from './parameters/findUserKeysByQueryParameters'; +import type { FindUsersWithBrowsePermissionParameters } from './parameters/findUsersWithBrowsePermissionParameters'; export class UserSearch { constructor(private client: Client) {} - - /** - * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users - * whose attributes match a string. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned issues in the projects. This means the operation - * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the - * projects, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback: Callback, - ): Promise; /** * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users - * whose attributes match a string. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned issues in the projects. This means the operation - * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the - * projects, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * whose attributes match a string. * + * + * - This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned issues in the projects. This means the operation + * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in + * the projects, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * - + * - Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project specified in + * `projectKeys`. */ - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback?: never, - ): Promise; - async findBulkAssignableUsers(parameters: Parameters.FindBulkAssignableUsers): Promise { - const config: Request = { + async findBulkAssignableUsers(parameters: FindBulkAssignableUsersParameters) { + const request: Request = { url: '/rest/api/2/user/assignable/multiProjectSearch', method: 'GET', query: { @@ -64,155 +44,85 @@ export class UserSearch { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be - * assigned to: - * - * - A new issue, by providing the `projectKeyOrId`. - * - An updated issue, by providing the `issueKey` 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 - * returned in the response if they can be assigned to the issue or issue transition. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned the issue. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _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, - callback: Callback, - ): Promise; - /** - * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be - * assigned to: - * - * - A new issue, by providing the `projectKeyOrId`. - * - An updated issue, by providing the `issueKey` 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 - * returned in the response if they can be assigned to the issue or issue transition. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned the issue. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Assign issues_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) + * assigned to: * + * + * - - A new issue, by providing the `projectKeyOrId`. + * - - 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 + * returned in the response if they can be assigned to the issue or issue transition. + * - + * - This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned the issue. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * - + * - Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _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, - callback?: never, - ): Promise; - async findAssignableUsers(parameters?: Parameters.FindAssignableUsers): Promise { - const config: Request = { + async findAssignableUsers(parameters: FindAssignableUsersParameters) { + const request: Request = { url: '/rest/api/2/user/assignable/search', method: 'GET', query: { - query: parameters?.query, - sessionId: parameters?.sessionId, - username: parameters?.username, - accountId: parameters?.accountId, - project: parameters?.project, - issueKey: parameters?.issueKey, - issueId: parameters?.issueId, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - actionDescriptorId: parameters?.actionDescriptorId, - recommend: parameters?.recommend, + query: parameters.query, + sessionId: parameters.sessionId, + username: parameters.username, + accountId: parameters.accountId, + project: parameters.project, + issueKey: parameters.issueKey, + issueId: parameters.issueId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + actionDescriptorId: parameters.actionDescriptorId, + recommend: parameters.recommend, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have a set of permissions for a project or issue. - * - * If no search string is provided, a list of all users with the permissions is returned. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission for the project or - * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users - * who match the search string and have permission for the project or issue, use [Get all - * users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users - * for that project. - */ - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback: Callback, - ): Promise; - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have a set of permissions for a project or issue. - * - * If no search string is provided, a list of all users with the permissions is returned. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission for the project or - * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users - * who match the search string and have permission for the project or issue, use [Get all - * users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users - * for that project. + * Returns a list of users who fulfill these criteria: * + * + * - - Their user attributes match a search string. + * - - They have a set of permissions for a project or issue. + * - + * - If no search string is provided, a list of all users with the permissions is returned. + * - + * - This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission for the project or + * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users + * who match the search string and have permission for the project or issue, use [Get all + * users](#api-rest-api-2-users-search-get) and filter the records in your code. + * - + * - Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. + * - - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users + * for that project. */ - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback?: never, - ): Promise; - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - ): Promise { - const config: Request = { + async findUsersWithAllPermissions(parameters: FindUsersWithAllPermissionsParameters) { + const request: Request = { url: '/rest/api/2/user/permission/search', method: 'GET', query: { @@ -227,201 +137,115 @@ export class UserSearch { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude - * users from the results. - * - * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns - * only the users from that range that match the query term. This means the operation usually returns fewer users than - * specified in `maxResults`. To get all the users who match the query term, use [Get all - * users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by - * users without the required permission return search results for an exact name match only. - */ - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback: Callback, - ): Promise; - /** - * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where - * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude - * users from the results. - * - * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns - * only the users from that range that match the query term. This means the operation usually returns fewer users than - * specified in `maxResults`. To get all the users who match the query term, use [Get all - * users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by - * users without the required permission return search results for an exact name match only. + * users from the results. * + * + * - This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns + * only the users from that range that match the query term. This means the operation usually returns fewer users + * than specified in `maxResults`. To get all the users who match the query term, use [Get all + * users](#api-rest-api-2-users-search-get) and filter the records in your code. + * - + * - Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by + * users without the required permission return search results for an exact name match only. */ - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback?: never, - ): Promise; - async findUsersForPicker(parameters: Parameters.FindUsersForPicker): Promise { - const config: Request = { + async findUsersForPicker(parameters: FindUsersForPickerParameters) { + const request: Request = { url: '/rest/api/2/user/picker', method: 'GET', query: { query: parameters.query, maxResults: parameters.maxResults, showAvatar: parameters.showAvatar, - excludeAccountIds: paramSerializer('excludeAccountIds', parameters.excludeAccountIds), + exclude: parameters.exclude, + excludeAccountIds: parameters.excludeAccountIds, avatarSize: parameters.avatarSize, excludeConnectUsers: parameters.excludeConnectUsers, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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 - * search string and property, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your - * code. - * - * This operation can be accessed anonymously. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users - * without the required permission return empty search results. + * 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 + * search string and property, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your + * code. + * - + * - This operation can be accessed anonymously. + * - + * - Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by + * users without the required permission return empty search results. */ - async findUsers( - parameters: Parameters.FindUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of 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 - * search string and property, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your - * code. - * - * This operation can be accessed anonymously. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users - * without the required permission return empty search results. - */ - async findUsers(parameters?: Parameters.FindUsers, callback?: never): Promise; - async findUsers(parameters?: Parameters.FindUsers): Promise { - const config: Request = { + async findUsers(parameters: FindUsersParameters) { + const request: Request = { url: '/rest/api/2/user/search', method: 'GET', query: { - query: parameters?.query, - username: parameters?.username, - accountId: parameters?.accountId, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - property: parameters?.property, + query: parameters.query, + username: parameters.username, + accountId: parameters.accountId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + property: parameters.property, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user details. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. - * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or - * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. 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: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUsersByQuery( - parameters: Parameters.FindUsersByQuery, - callback: Callback, - ): Promise; - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user details. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. - * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or - * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. 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: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user details. * + * + * - This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - + * - The query statements are: + * - + * - - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. + * - - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or + * _PROJ-2_. + * - - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. 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: + * - + * - `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` */ - async findUsersByQuery(parameters: Parameters.FindUsersByQuery, callback?: never): Promise; - async findUsersByQuery(parameters: Parameters.FindUsersByQuery): Promise { - const config: Request = { + async findUsersByQuery(parameters: FindUsersByQueryParameters) { + const request: Request = { url: '/rest/api/2/user/search/query', method: 'GET', query: { @@ -431,172 +255,96 @@ export class UserSearch { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user keys. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. - * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or - * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. 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: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user keys. * + * + * - This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - + * - The query statements are: + * - + * - - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. + * - - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or + * _PROJ-2_. + * - - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. 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: + * - + * - `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` */ - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback: Callback, - ): Promise; - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user keys. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. - * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or - * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. 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: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback?: never, - ): Promise; - async findUserKeysByQuery(parameters: Parameters.FindUserKeysByQuery): Promise { - const config: Request = { + async findUserKeysByQuery(parameters: FindUserKeysByQueryParameters) { + const request: Request = { url: '/rest/api/2/user/search/query/key', method: 'GET', query: { query: parameters.query, startAt: parameters.startAt, - maxResult: parameters.maxResult || parameters.maxResults, + maxResult: parameters.maxResult, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have permission to browse issues. - * - * Use this resource to find users who can browse: - * - * - An issue, by providing the `issueKey`. - * - Any issue in a project, by providing the `projectKey`. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission to browse issues. This - * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the - * search string and have permission to browse issues, use [Get all users](#api-rest-api-2-users-search-get) and - * filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by - * users without the required permission return empty search results. + * Returns a list of users who fulfill these criteria: * + * + * - - Their user attributes match a search string. + * - - They have permission to browse issues. + * - + * - Use this resource to find users who can browse: + * - + * - - An issue, by providing the `issueKey`. + * - - Any issue in a project, by providing the `projectKey`. + * - + * - This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission to browse issues. + * This means the operation usually returns fewer users than specified in `maxResults`. To get all the users who + * match the search string and have permission to browse issues, use [Get all + * users](#api-rest-api-2-users-search-get) and filter the records in your code. + * - + * - Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * - + * - This operation can be accessed anonymously. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by + * users without the required permission return empty search results. */ - async findUsersWithBrowsePermission( - parameters: Parameters.FindUsersWithBrowsePermission | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have permission to browse issues. - * - * Use this resource to find users who can browse: - * - * - An issue, by providing the `issueKey`. - * - Any issue in a project, by providing the `projectKey`. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission to browse issues. This - * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the - * search string and have permission to browse issues, use [Get all users](#api-rest-api-2-users-search-get) and - * filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by - * users without the required permission return empty search results. - */ - async findUsersWithBrowsePermission( - parameters?: Parameters.FindUsersWithBrowsePermission, - callback?: never, - ): Promise; - async findUsersWithBrowsePermission( - parameters?: Parameters.FindUsersWithBrowsePermission, - ): Promise { - const config: Request = { + async findUsersWithBrowsePermission(parameters: FindUsersWithBrowsePermissionParameters) { + const request: Request = { url: '/rest/api/2/user/viewissue/search', method: 'GET', query: { - query: parameters?.query, - username: parameters?.username, - accountId: parameters?.accountId, - issueKey: parameters?.issueKey, - projectKey: parameters?.projectKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, + query: parameters.query, + username: parameters.username, + accountId: parameters.accountId, + issueKey: parameters.issueKey, + projectKey: parameters.projectKey, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/users.ts b/src/version2/users.ts index 3c66d0e797..cee20f6658 100644 --- a/src/version2/users.ts +++ b/src/version2/users.ts @@ -1,75 +1,84 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; -import { paramSerializer } from '../paramSerializer'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { RemoveUserParameters } from './parameters/removeUserParameters'; +import type { GetUserParameters } from './parameters/getUserParameters'; +import type { CreateUserParameters } from './parameters/createUserParameters'; +import type { BulkGetUsersParameters } from './parameters/bulkGetUsersParameters'; +import type { BulkGetUsersMigrationParameters } from './parameters/bulkGetUsersMigrationParameters'; +import type { ResetUserColumnsParameters } from './parameters/resetUserColumnsParameters'; +import type { GetUserDefaultColumnsParameters } from './parameters/getUserDefaultColumnsParameters'; +import type { SetUserColumnsParameters } from './parameters/setUserColumnsParameters'; +import type { GetUserEmailParameters } from './parameters/getUserEmailParameters'; +import type { GetUserEmailBulkParameters } from './parameters/getUserEmailBulkParameters'; +import type { GetUserGroupsParameters } from './parameters/getUserGroupsParameters'; +import type { GetAllUsersDefaultParameters } from './parameters/getAllUsersDefaultParameters'; +import type { GetAllUsersParameters } from './parameters/getAllUsersParameters'; export class Users { constructor(private client: Client) {} - /** - * Returns a user. - * - * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This + * operation does not delete the user's Atlassian account. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). */ - async getUser(parameters: Parameters.GetUser, callback: Callback): Promise; + async removeUser(parameters: RemoveUserParameters) { + const request: Request = { + url: '/rest/api/2/user', + method: 'DELETE', + query: { + accountId: parameters.accountId, + username: parameters.username, + key: parameters.key, + }, + }; + + return this.client.sendRequest(request); + } + /** - * Returns a user. - * - * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Returns a user. * + * + * - Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getUser(parameters: Parameters.GetUser, callback?: never): Promise; - async getUser(parameters: Parameters.GetUser): Promise { - const config: Request = { + async getUser(parameters: GetUserParameters) { + const request: Request = { url: '/rest/api/2/user', method: 'GET', query: { accountId: parameters.accountId, + username: parameters.username, + key: parameters.key, expand: parameters.expand, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is - * available this resource will be deprecated. - * - * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have - * access to Jira, the operation returns a 400 status. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createUser(parameters: Parameters.CreateUser, callback: Callback): Promise; - /** - * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is - * available this resource will be deprecated. + * available this resource will be deprecated. * * - * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have - * access to Jira, the operation returns a 400 status. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have + * access to Jira, the operation returns a 400 status. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createUser(parameters: Parameters.CreateUser, callback?: never): Promise; - async createUser(parameters: Parameters.CreateUser): Promise { - const config: Request = { + async createUser(parameters: CreateUserParameters) { + const request: Request = { url: '/rest/api/2/user', method: 'POST', body: { + applicationKeys: parameters.applicationKeys, + displayName: parameters.displayName, emailAddress: parameters.emailAddress, key: parameters.key, name: parameters.name, @@ -79,217 +88,124 @@ export class Users { }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This - * operation does not delete the user's Atlassian account. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUser(parameters: Parameters.RemoveUser, callback: Callback): Promise; - /** - * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This - * operation does not delete the user's Atlassian account. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUser(parameters: Parameters.RemoveUser, callback?: never): Promise; - async removeUser(parameters: Parameters.RemoveUser): Promise { - const config: Request = { - url: '/rest/api/2/user', - method: 'DELETE', - query: { - accountId: parameters.accountId, - username: parameters.username, - key: parameters.key, - }, - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * users specified by one or more account IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback: Callback): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * users specified by one or more account IDs. + * users specified by one or more account IDs. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback?: never): Promise; - async bulkGetUsers(parameters: Parameters.BulkGetUsers): Promise { - const config: Request = { + async bulkGetUsers(parameters: BulkGetUsersParameters) { + const request: Request = { url: '/rest/api/2/user/bulk', method: 'GET', query: { startAt: parameters.startAt, maxResults: parameters.maxResults, - accountId: paramSerializer('accountId', parameters.accountId), + username: parameters.username, + key: parameters.key, + accountId: parameters.accountId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or - * `username` parameters can be specified. + * `username` parameters can be specified. * * - * **[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:** + * Permission to access Jira. */ - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback: Callback, - ): Promise; - /** - * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or - * `username` parameters can be specified. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback?: never, - ): Promise; - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - ): Promise { - const config: Request = { + async bulkGetUsersMigration(parameters: BulkGetUsersMigrationParameters) { + const request: Request = { url: '/rest/api/2/user/bulk/migration', method: 'GET', query: { startAt: parameters.startAt, maxResults: parameters.maxResults, - username: paramSerializer('username', parameters.username), - key: paramSerializer('key', parameters.key), + username: parameters.username, + key: parameters.key, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` - * is not passed in the request, the calling user's details are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for - * any user. - * - Permission to access Jira, to get the calling user's column details. - */ - async getUserDefaultColumns( - parameters: Parameters.GetUserDefaultColumns | undefined, - callback: Callback, - ): Promise; - /** - * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` - * is not passed in the request, the calling user's details are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system + * default. If `accountId` is not passed, the calling user's default columns are reset. * * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for - * any user. - * - Permission to access Jira, to get the calling user's column details. + * - **[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 getUserDefaultColumns( - parameters?: Parameters.GetUserDefaultColumns, - callback?: never, - ): Promise; - async getUserDefaultColumns( - parameters?: Parameters.GetUserDefaultColumns, - ): Promise { - const config: Request = { + async resetUserColumns(parameters: ResetUserColumnsParameters) { + const request: Request = { url: '/rest/api/2/user/columns', - method: 'GET', + method: 'DELETE', query: { - accountId: parameters?.accountId, - username: parameters?.username, + accountId: parameters.accountId, + username: parameters.username, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * 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. - * - * **[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: 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` + * is not passed in the request, the calling user's details are returned. * * - * - _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. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for + * any user. + * - - Permission to access Jira, to get the calling user's column details. */ - async setUserColumns(parameters: Parameters.SetUserColumns, callback?: never): Promise; - async setUserColumns(parameters: Parameters.SetUserColumns): Promise { - const config: Request = { + async getUserDefaultColumns(parameters: GetUserDefaultColumnsParameters) { + const request: Request = { url: '/rest/api/2/user/columns', - method: 'PUT', + method: 'GET', query: { accountId: parameters.accountId, + username: parameters.username, }, - body: parameters.columns, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system - * default. If `accountId` is not passed, the calling user's default columns are reset. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. - * - Permission to access Jira, to set the calling user's columns. - */ - async resetUserColumns(parameters: Parameters.ResetUserColumns, callback: Callback): Promise; - /** - * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system - * default. If `accountId` is not passed, the calling user's default columns are reset. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. - * - Permission to access Jira, to set the calling user's columns. + * 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 resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: never): Promise; - async resetUserColumns(parameters: Parameters.ResetUserColumns): Promise { - const config: Request = { + async setUserColumns(parameters: SetUserColumnsParameters) { + const request: Request = { url: '/rest/api/2/user/columns', - method: 'DELETE', + method: 'PUT', query: { accountId: parameters.accountId, - username: parameters.username, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** @@ -298,34 +214,16 @@ export class Users { * [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 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?: never, - ): Promise; - async getUserEmail( - parameters: Parameters.GetUserEmail | string, - ): Promise { - const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; - - const config: Request = { + async getUserEmail(parameters: GetUserEmailParameters) { + const request: Request = { url: '/rest/api/2/user/email', method: 'GET', query: { - accountId, + accountId: parameters.accountId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** @@ -334,55 +232,26 @@ export class Users { * [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 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?: never, - ): Promise; - async getUserEmailBulk( - parameters: Parameters.GetUserEmailBulk | string, - ): Promise { - const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; - - const config: Request = { + async getUserEmailBulk(parameters: GetUserEmailBulkParameters) { + const request: Request = { url: '/rest/api/2/user/email/bulk', method: 'GET', query: { - accountId, + accountId: parameters.accountId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the groups to which a user belongs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUserGroups( - parameters: Parameters.GetUserGroups, - callback: Callback, - ): Promise; - /** - * Returns the groups to which a user belongs. + * Returns the groups to which a user belongs. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getUserGroups(parameters: Parameters.GetUserGroups, callback?: never): Promise; - async getUserGroups(parameters: Parameters.GetUserGroups): Promise { - const config: Request = { + async getUserGroups(parameters: GetUserGroupsParameters) { + const request: Request = { url: '/rest/api/2/user/groups', method: 'GET', query: { @@ -392,86 +261,54 @@ export class Users { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsersDefault( - parameters: Parameters.GetAllUsersDefault | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Atlassian account. * + * + * - Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAllUsersDefault(parameters?: Parameters.GetAllUsersDefault, callback?: never): Promise; - async getAllUsersDefault(parameters?: Parameters.GetAllUsersDefault): Promise { - const config: Request = { + async getAllUsersDefault(parameters: GetAllUsersDefaultParameters) { + const request: Request = { url: '/rest/api/2/users', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsers( - parameters: Parameters.GetAllUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Atlassian account. * + * + * - Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: never): Promise; - async getAllUsers(parameters?: Parameters.GetAllUsers): Promise { - const config: Request = { + async getAllUsers(parameters: GetAllUsersParameters) { + const request: Request = { url: '/rest/api/2/users/search', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/webhooks.ts b/src/version2/webhooks.ts index 5164dc8dcc..013e7b81a3 100644 --- a/src/version2/webhooks.ts +++ b/src/version2/webhooks.ts @@ -1,203 +1,116 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { DeleteWebhookByIdParameters } from './parameters/deleteWebhookByIdParameters'; +import type { GetDynamicWebhooksForAppParameters } from './parameters/getDynamicWebhooksForAppParameters'; +import type { RegisterDynamicWebhooksParameters } from './parameters/registerDynamicWebhooksParameters'; +import type { GetFailedWebhooksParameters } from './parameters/getFailedWebhooksParameters'; +import type { RefreshWebhooksParameters } from './parameters/refreshWebhooksParameters'; export class Webhooks { constructor(private client: Client) {} - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * webhooks registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async getDynamicWebhooksForApp( - parameters: Parameters.GetDynamicWebhooksForApp | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * webhooks registered by the calling app. + * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps + * are specified, they are ignored. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. */ - async getDynamicWebhooksForApp( - parameters?: Parameters.GetDynamicWebhooksForApp, - callback?: never, - ): Promise; - async getDynamicWebhooksForApp( - parameters?: Parameters.GetDynamicWebhooksForApp, - ): Promise { - const config: Request = { + async deleteWebhookById(parameters: DeleteWebhookByIdParameters) { + const request: Request = { url: '/rest/api/2/webhook', - method: 'GET', - query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, + method: 'DELETE', + body: { + webhookIds: parameters.webhookIds, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Registers webhooks. - * - * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the - * user who registered a dynamic webhook. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback: Callback, - ): Promise; - /** - * Registers webhooks. - * - * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the - * user who registered a dynamic webhook. + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * webhooks registered by the calling app. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. */ - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback?: never, - ): Promise; - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - ): Promise { - const config: Request = { + async getDynamicWebhooksForApp(parameters: GetDynamicWebhooksForAppParameters) { + const request: Request = { url: '/rest/api/2/webhook', - method: 'POST', - body: { - webhooks: parameters.webhooks, - url: parameters.url, + method: 'GET', + query: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps - * are specified, they are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback: Callback): Promise; - /** - * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps - * are specified, they are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + * Registers webhooks. * + * + * - **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the + * user who registered a dynamic webhook. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. */ - async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback?: never): Promise; - async deleteWebhookById(parameters: Parameters.DeleteWebhookById): Promise { - const config: Request = { + async registerDynamicWebhooks(parameters: RegisterDynamicWebhooksParameters) { + const request: Request = { url: '/rest/api/2/webhook', - method: 'DELETE', + method: 'POST', body: { - webhookIds: parameters.webhookIds, + url: parameters.url, + webhooks: parameters.webhooks, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of - * retries. - * - * After 72 hours the failure may no longer be returned by this operation. - * - * The oldest failure is returned first. - * - * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on - * the list as the `failedAfter` value or use the URL provided in `next`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. - */ - async getFailedWebhooks( - parameters: Parameters.GetFailedWebhooks | undefined, - callback: Callback, - ): Promise; - /** - * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of - * retries. - * - * After 72 hours the failure may no longer be returned by this operation. - * - * The oldest failure is returned first. - * - * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on - * the list as the `failedAfter` value or use the URL provided in `next`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. + * retries. * + * + * - After 72 hours the failure may no longer be returned by this operation. + * - + * - The oldest failure is returned first. + * - + * - This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on + * the list as the `failedAfter` value or use the URL provided in `next`. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. */ - async getFailedWebhooks( - parameters?: Parameters.GetFailedWebhooks, - callback?: never, - ): Promise; - async getFailedWebhooks(parameters?: Parameters.GetFailedWebhooks): Promise { - const config: Request = { + async getFailedWebhooks(parameters: GetFailedWebhooksParameters) { + const request: Request = { url: '/rest/api/2/webhook/failed', method: 'GET', query: { - maxResults: parameters?.maxResults, - after: parameters?.after, + maxResults: parameters.maxResults, + after: parameters.after, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to - * keep them alive. - * - * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback: Callback, - ): Promise; - /** - * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to - * keep them alive. - * - * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. + * keep them alive. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + * - Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. */ - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback?: never, - ): Promise; - async refreshWebhooks(parameters: Parameters.RefreshWebhooks): Promise { - const config: Request = { + async refreshWebhooks(parameters: RefreshWebhooksParameters) { + const request: Request = { url: '/rest/api/2/webhook/refresh', method: 'PUT', body: { @@ -205,6 +118,6 @@ export class Webhooks { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/workflowSchemeDrafts.ts b/src/version2/workflowSchemeDrafts.ts index de803200a0..e06c560d85 100644 --- a/src/version2/workflowSchemeDrafts.ts +++ b/src/version2/workflowSchemeDrafts.ts @@ -1,228 +1,148 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { CreateWorkflowSchemeDraftFromParentParameters } from './parameters/createWorkflowSchemeDraftFromParentParameters'; +import type { DeleteWorkflowSchemeDraftParameters } from './parameters/deleteWorkflowSchemeDraftParameters'; +import type { GetWorkflowSchemeDraftParameters } from './parameters/getWorkflowSchemeDraftParameters'; +import type { UpdateWorkflowSchemeDraftParameters } from './parameters/updateWorkflowSchemeDraftParameters'; +import type { DeleteDraftDefaultWorkflowParameters } from './parameters/deleteDraftDefaultWorkflowParameters'; +import type { GetDraftDefaultWorkflowParameters } from './parameters/getDraftDefaultWorkflowParameters'; +import type { UpdateDraftDefaultWorkflowParameters } from './parameters/updateDraftDefaultWorkflowParameters'; +import type { DeleteWorkflowSchemeDraftIssueTypeParameters } from './parameters/deleteWorkflowSchemeDraftIssueTypeParameters'; +import type { GetWorkflowSchemeDraftIssueTypeParameters } from './parameters/getWorkflowSchemeDraftIssueTypeParameters'; +import type { SetWorkflowSchemeDraftIssueTypeParameters } from './parameters/setWorkflowSchemeDraftIssueTypeParameters'; +import type { PublishDraftWorkflowSchemeParameters } from './parameters/publishDraftWorkflowSchemeParameters'; +import type { DeleteDraftWorkflowMappingParameters } from './parameters/deleteDraftWorkflowMappingParameters'; +import type { GetDraftWorkflowParameters } from './parameters/getDraftWorkflowParameters'; +import type { UpdateDraftWorkflowMappingParameters } from './parameters/updateDraftWorkflowMappingParameters'; export class WorkflowSchemeDrafts { constructor(private client: Client) {} - /** * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an - * active workflow scheme can only have one draft workflow scheme. + * active workflow scheme can only have one draft workflow scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback: Callback, - ): Promise; - /** - * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an - * active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback?: never, - ): Promise; - async createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/workflowscheme/${id}/createdraft`, + async createWorkflowSchemeDraftFromParent(parameters: CreateWorkflowSchemeDraftFromParentParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/createdraft`, method: 'POST', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to - * the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is - * modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow - * schemes](https://confluence.atlassian.com/x/tohKLg) for more information.\ - * Note that: + * Deletes a draft workflow scheme. * * - * - Only active workflow schemes can have draft workflow schemes. - * - An active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback: Callback, - ): Promise; + async deleteWorkflowSchemeDraft(parameters: DeleteWorkflowSchemeDraftParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** * Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to * the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is * modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow - * schemes](https://confluence.atlassian.com/x/tohKLg) for more information.\ - * Note that: - * - * - Only active workflow schemes can have draft workflow schemes. - * - An active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * schemes](https://confluence.atlassian.com/x/tohKLg) for more information. + * + * - Note that: + * - + * - - Only active workflow schemes can have draft workflow schemes. + * - - An active workflow scheme can only have one draft workflow scheme. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback?: never, - ): Promise; - async getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/workflowscheme/${id}/draft`, + async getWorkflowSchemeDraft(parameters: GetWorkflowSchemeDraftParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a - * draft is created. Note that an active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback: Callback, - ): Promise; - /** - * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a - * draft is created. Note that an active workflow scheme can only have one draft workflow scheme. + * draft is created. Note that an active workflow scheme can only have one draft workflow scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback?: never, - ): Promise; - async updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - ): Promise { - const config: Request = { + async updateWorkflowSchemeDraft(parameters: UpdateWorkflowSchemeDraftParameters) { + const request: Request = { url: `/rest/api/2/workflowscheme/${parameters.id}/draft`, method: 'PUT', body: { - name: parameters.name, - description: parameters.description, defaultWorkflow: parameters.defaultWorkflow, + description: parameters.description, + draft: parameters.draft, + id: parameters.id, issueTypeMappings: parameters.issueTypeMappings, + issueTypes: parameters.issueTypes, + lastModified: parameters.lastModified, + lastModifiedUser: parameters.lastModifiedUser, + name: parameters.name, + originalDefaultWorkflow: parameters.originalDefaultWorkflow, + originalIssueTypeMappings: parameters.originalIssueTypeMappings, + self: parameters.self, updateDraftIfNeeded: parameters.updateDraftIfNeeded, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback: Callback, - ): Promise; - /** - * Deletes a draft workflow scheme. + * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system + * workflow (the _jira_ workflow). * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback?: never, - ): Promise; - async deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/workflowscheme/${id}/draft`, + async deleteDraftDefaultWorkflow(parameters: DeleteDraftDefaultWorkflowParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/default`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue - * Types_ listed in its issue types for the workflow scheme in Jira. + * Types_ listed in its issue types for the workflow scheme in Jira. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned - * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue - * Types_ listed in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback?: never, - ): Promise; - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/workflowscheme/${id}/draft/default`, + async getDraftDefaultWorkflow(parameters: GetDraftDefaultWorkflowParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/default`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the default workflow for a workflow scheme's draft. + * Sets the default workflow for a workflow scheme's draft. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback: Callback, - ): Promise; - /** - * Sets the default workflow for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback?: never, - ): Promise; - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - ): Promise { - const config: Request = { + async updateDraftDefaultWorkflow(parameters: UpdateDraftDefaultWorkflowParameters) { + const request: Request = { url: `/rest/api/2/workflowscheme/${parameters.id}/draft/default`, method: 'PUT', body: { @@ -231,217 +151,114 @@ export class WorkflowSchemeDrafts { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system - * workflow (the _jira_ workflow). + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system - * workflow (the _jira_ workflow). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback?: never, - ): Promise; - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/workflowscheme/${id}/draft/default`, + async deleteWorkflowSchemeDraftIssueType(parameters: DeleteWorkflowSchemeDraftIssueTypeParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - ): Promise { - const config: Request = { + async getWorkflowSchemeDraftIssueType(parameters: GetWorkflowSchemeDraftIssueTypeParameters) { + const request: Request = { url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the workflow for an issue type in a workflow scheme's draft. + * Sets the workflow for an issue type in a workflow scheme's draft. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Sets the workflow for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - ): Promise { - const config: Request = { + async setWorkflowSchemeDraftIssueType(parameters: SetWorkflowSchemeDraftIssueTypeParameters) { + const request: Request = { url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, method: 'PUT', - body: parameters.details, + body: { + issueType: parameters.issueType, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + workflow: parameters.workflow, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Publishes a draft workflow scheme. * + * + * - Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues + * with the original workflow status to the new workflow status. + * - + * - This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain updates. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - ): Promise { - const config: Request = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'DELETE', + async publishDraftWorkflowScheme(parameters: PublishDraftWorkflowSchemeParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/publish`, + method: 'POST', + query: { + validateOnly: parameters.validateOnly, + }, + body: { + statusMappings: parameters.statusMappings, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Publishes a draft workflow scheme. + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. * * - * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues - * with the original workflow status to the new workflow status. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Publishes a draft workflow scheme. - * - * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues - * with the original workflow status to the new workflow status. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback?: never, - ): Promise; - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/workflowscheme/${id}/draft/publish`, - method: 'POST', + async deleteDraftWorkflowMapping(parameters: DeleteDraftWorkflowMappingParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, + method: 'DELETE', query: { - validateOnly: typeof parameters !== 'string' && parameters.validateOnly, - }, - body: { - statusMappings: typeof parameters !== 'string' && parameters.statusMappings, + workflowName: parameters.workflowName, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the workflow-issue type mappings for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback: Callback, - ): Promise; - /** - * Returns the workflow-issue type mappings for a workflow scheme's draft. + * Returns the workflow-issue type mappings for a workflow scheme's draft. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback?: never, - ): Promise; - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - ): Promise { - const config: Request = { + async getDraftWorkflow(parameters: GetDraftWorkflowParameters) { + const request: Request = { url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, method: 'GET', query: { @@ -449,35 +266,18 @@ export class WorkflowSchemeDrafts { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default - * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. + * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default - * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback?: never, - ): Promise; - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - ): Promise { - const config: Request = { + async updateDraftWorkflowMapping(parameters: UpdateDraftWorkflowMappingParameters) { + const request: Request = { url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, method: 'PUT', query: { @@ -491,38 +291,6 @@ export class WorkflowSchemeDrafts { }, }; - return this.client.sendRequest(config); - } - - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback?: never, - ): Promise; - async deleteDraftWorkflowMapping(parameters: Parameters.DeleteDraftWorkflowMapping): Promise { - const config: Request = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, - method: 'DELETE', - query: { - workflowName: parameters.workflowName, - }, - }; - - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/workflowSchemeProjectAssociations.ts b/src/version2/workflowSchemeProjectAssociations.ts index d6de553382..6ae0459ef2 100644 --- a/src/version2/workflowSchemeProjectAssociations.ts +++ b/src/version2/workflowSchemeProjectAssociations.ts @@ -1,46 +1,23 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetWorkflowSchemeProjectAssociationsParameters } from './parameters/getWorkflowSchemeProjectAssociationsParameters'; +import type { AssignSchemeToProjectParameters } from './parameters/assignSchemeToProjectParameters'; export class WorkflowSchemeProjectAssociations { constructor(private client: Client) {} - - /** - * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a - * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are - * ignored and no errors are returned. - * - * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the - * `Default Workflow Scheme` is stored means it has no ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback: Callback, - ): Promise; /** * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are - * ignored and no errors are returned. - * - * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the - * `Default Workflow Scheme` is stored means it has no ID. + * ignored and no errors 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). + * - If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the + * `Default Workflow Scheme` is stored means it has no ID. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback?: never, - ): Promise; - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - ): Promise { - const config: Request = { + async getWorkflowSchemeProjectAssociations(parameters: GetWorkflowSchemeProjectAssociationsParameters) { + const request: Request = { url: '/rest/api/2/workflowscheme/project', method: 'GET', query: { @@ -48,40 +25,27 @@ export class WorkflowSchemeProjectAssociations { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. + * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. * * - * Workflow schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Workflow schemes can only be assigned to classic projects. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async assignSchemeToProject( - parameters: Parameters.AssignSchemeToProject, - callback: Callback, - ): Promise; - /** - * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. - * - * Workflow schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignSchemeToProject(parameters: Parameters.AssignSchemeToProject, callback?: never): Promise; - async assignSchemeToProject(parameters: Parameters.AssignSchemeToProject): Promise { - const config: Request = { + async assignSchemeToProject(parameters: AssignSchemeToProjectParameters) { + const request: Request = { url: '/rest/api/2/workflowscheme/project', method: 'PUT', body: { - workflowSchemeId: parameters.workflowSchemeId, projectId: parameters.projectId, + workflowSchemeId: parameters.workflowSchemeId, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/workflowSchemes.ts b/src/version2/workflowSchemes.ts index 74c2501b35..8ce49a5dbc 100644 --- a/src/version2/workflowSchemes.ts +++ b/src/version2/workflowSchemes.ts @@ -1,73 +1,54 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetAllWorkflowSchemesParameters } from './parameters/getAllWorkflowSchemesParameters'; +import type { CreateWorkflowSchemeParameters } from './parameters/createWorkflowSchemeParameters'; +import type { ReadWorkflowSchemesParameters } from './parameters/readWorkflowSchemesParameters'; +import type { UpdateSchemesParameters } from './parameters/updateSchemesParameters'; +import type { UpdateWorkflowSchemeMappingsParameters } from './parameters/updateWorkflowSchemeMappingsParameters'; +import type { DeleteWorkflowSchemeParameters } from './parameters/deleteWorkflowSchemeParameters'; +import type { GetWorkflowSchemeParameters } from './parameters/getWorkflowSchemeParameters'; +import type { UpdateWorkflowSchemeParameters } from './parameters/updateWorkflowSchemeParameters'; +import type { DeleteDefaultWorkflowParameters } from './parameters/deleteDefaultWorkflowParameters'; +import type { GetDefaultWorkflowParameters } from './parameters/getDefaultWorkflowParameters'; +import type { UpdateDefaultWorkflowParameters } from './parameters/updateDefaultWorkflowParameters'; +import type { DeleteWorkflowSchemeIssueTypeParameters } from './parameters/deleteWorkflowSchemeIssueTypeParameters'; +import type { GetWorkflowSchemeIssueTypeParameters } from './parameters/getWorkflowSchemeIssueTypeParameters'; +import type { SetWorkflowSchemeIssueTypeParameters } from './parameters/setWorkflowSchemeIssueTypeParameters'; +import type { DeleteWorkflowMappingParameters } from './parameters/deleteWorkflowMappingParameters'; +import type { GetWorkflowParameters } from './parameters/getWorkflowParameters'; +import type { UpdateWorkflowMappingParameters } from './parameters/updateWorkflowMappingParameters'; +import type { GetProjectUsagesForWorkflowSchemeParameters } from './parameters/getProjectUsagesForWorkflowSchemeParameters'; export class WorkflowSchemes { constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * workflow schemes, not including draft workflow schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllWorkflowSchemes( - parameters: Parameters.GetAllWorkflowSchemes | undefined, - callback: Callback, - ): Promise; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * workflow schemes, not including draft workflow schemes. + * workflow schemes, not including draft workflow schemes. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAllWorkflowSchemes( - parameters?: Parameters.GetAllWorkflowSchemes, - callback?: never, - ): Promise; - async getAllWorkflowSchemes( - parameters?: Parameters.GetAllWorkflowSchemes, - ): Promise { - const config: Request = { + async getAllWorkflowSchemes(parameters: GetAllWorkflowSchemesParameters) { + const request: Request = { url: '/rest/api/2/workflowscheme', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, + startAt: parameters.startAt, + maxResults: parameters.maxResults, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Creates a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback: Callback, - ): Promise; - /** - * Creates a workflow scheme. + * Creates a workflow scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback?: never, - ): Promise; - async createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - ): Promise { - const config: Request = { + async createWorkflowScheme(parameters: CreateWorkflowSchemeParameters) { + const request: Request = { url: '/rest/api/2/workflowscheme', method: 'POST', body: { @@ -87,77 +68,43 @@ export class WorkflowSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a list of workflow schemes by providing workflow scheme IDs or project IDs. + * Returns a list of workflow schemes by providing workflow scheme IDs or project IDs. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ global permission to access all, including project-scoped, workflow schemes - * - _Administer projects_ project permissions to access project-scoped workflow schemes - */ - async readWorkflowSchemes( - parameters: Parameters.ReadWorkflowSchemes, - callback: Callback, - ): Promise; - /** - * Returns a list of workflow schemes by providing workflow scheme IDs or project IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ global permission to access all, including project-scoped, workflow schemes - * - _Administer projects_ project permissions to access project-scoped workflow schemes + * - **[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, - ): Promise { - const config: Request = { + async readWorkflowSchemes(parameters: ReadWorkflowSchemesParameters) { + const request: Request = { url: '/rest/api/2/workflowscheme/read', method: 'POST', - query: { - expand: parameters.expand, - }, body: { projectIds: parameters.projectIds, workflowSchemeIds: parameters.workflowSchemeIds, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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:** + * migrates the issues as defined in the provided mappings. * * - * - _Administer Jira_ project permission to update all, including global-scoped, workflow schemes. - * - _Administer projects_ project permission to update project-scoped workflow schemes. + * - **[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): Promise { - const config: Request = { + async updateSchemes(parameters: UpdateSchemesParameters) { + const request: Request = { url: '/rest/api/2/workflowscheme/update', method: 'POST', body: { @@ -172,41 +119,21 @@ export class WorkflowSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * 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. + * 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. + * - **[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, - ): Promise { - const config: Request = { + async updateWorkflowSchemeMappings(parameters: UpdateWorkflowSchemeMappingsParameters) { + const request: Request = { url: '/rest/api/2/workflowscheme/update/mappings', method: 'POST', body: { @@ -216,192 +143,130 @@ export class WorkflowSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a workflow scheme. + * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at + * least one project). * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback: Callback, - ): Promise; + async deleteWorkflowScheme(parameters: DeleteWorkflowSchemeParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(request); + } + /** - * Returns a workflow scheme. + * Returns a workflow scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback?: never, - ): Promise; - async getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/workflowscheme/${id}`, + async getWorkflowScheme(parameters: GetWorkflowSchemeParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}`, method: 'GET', query: { - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + returnDraftIfExists: parameters.returnDraftIfExists, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Updates a company-manged project workflow scheme, including the name, default workflow, issue type to project * mappings, and more. If the workflow scheme is active (that is, being used by at least one project), then a draft - * workflow scheme is created or updated instead, provided that `updateDraftIfNeeded` is set to `true`. + * workflow scheme is created or updated instead, provided that `updateDraftIfNeeded` is set to `true`. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback: Callback, - ): Promise; - /** - * Updates a company-manged project workflow scheme, including the name, default workflow, issue type to project - * mappings, and more. If the workflow scheme is active (that is, being used by at least one project), then a draft - * workflow scheme is created or updated instead, provided that `updateDraftIfNeeded` is set to `true`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback?: never, - ): Promise; - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - ): Promise { - const config: Request = { + async updateWorkflowScheme(parameters: UpdateWorkflowSchemeParameters) { + const request: Request = { url: `/rest/api/2/workflowscheme/${parameters.id}`, method: 'PUT', body: { - name: parameters.name, - description: parameters.description, defaultWorkflow: parameters.defaultWorkflow, + description: parameters.description, + draft: parameters.draft, + id: parameters.id, issueTypeMappings: parameters.issueTypeMappings, + issueTypes: parameters.issueTypes, + lastModified: parameters.lastModified, + lastModifiedUser: parameters.lastModifiedUser, + name: parameters.name, + originalDefaultWorkflow: parameters.originalDefaultWorkflow, + originalIssueTypeMappings: parameters.originalIssueTypeMappings, + self: parameters.self, updateDraftIfNeeded: parameters.updateDraftIfNeeded, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at - * least one project). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at - * least one project). + * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow + * (the _jira_ workflow). * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow + * scheme can be published in Jira. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback?: never, - ): Promise; - async deleteWorkflowScheme(parameters: Parameters.DeleteWorkflowScheme | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/workflowscheme/${id}`, + async deleteDefaultWorkflow(parameters: DeleteDefaultWorkflowParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/default`, method: 'DELETE', + query: { + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed - * in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue - * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed - * in its issue types for the workflow scheme in Jira. + * in its issue types for the workflow scheme in Jira. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback?: never, - ): Promise; - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/workflowscheme/${id}/default`, + async getDefaultWorkflow(parameters: GetDefaultWorkflowParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/default`, method: 'GET', query: { - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + returnDraftIfExists: parameters.returnDraftIfExists, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the default workflow for a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The - * draft workflow scheme can be published in Jira. + * Sets the default workflow for a workflow scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The + * draft workflow scheme can be published in Jira. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback: Callback, - ): Promise; - /** - * Sets the default workflow for a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The - * draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback?: never, - ): Promise; - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - ): Promise { - const config: Request = { + async updateDefaultWorkflow(parameters: UpdateDefaultWorkflowParameters) { + const request: Request = { url: `/rest/api/2/workflowscheme/${parameters.id}/default`, method: 'PUT', body: { @@ -410,79 +275,39 @@ export class WorkflowSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow - * (the _jira_ workflow). - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme - * can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow - * (the _jira_ workflow). + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. * * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme - * can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft + * workflow scheme can be published in Jira. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback?: never, - ): Promise; - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/workflowscheme/${id}/default`, + async deleteWorkflowSchemeIssueType(parameters: DeleteWorkflowSchemeIssueTypeParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, method: 'DELETE', query: { - updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme. + * Returns the issue type-workflow mapping for an issue type in a workflow scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - ): Promise { - const config: Request = { + async getWorkflowSchemeIssueType(parameters: GetWorkflowSchemeIssueTypeParameters) { + const request: Request = { url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, method: 'GET', query: { @@ -490,162 +315,88 @@ export class WorkflowSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Sets the workflow for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow - * mapping. The draft workflow scheme can be published in Jira. + * Sets the workflow for an issue type in a workflow scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow + * mapping. The draft workflow scheme can be published in Jira. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Sets the workflow for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow - * mapping. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - ): Promise { - const config: Request = { + async setWorkflowSchemeIssueType(parameters: SetWorkflowSchemeIssueTypeParameters) { + const request: Request = { url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, method: 'PUT', - body: parameters.details, + body: { + issueType: parameters.issueType, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + workflow: parameters.workflow, + }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft - * workflow scheme can be published in Jira. + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft + * workflow scheme can be published in Jira. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - ): Promise { - const config: Request = { - url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + async deleteWorkflowMapping(parameters: DeleteWorkflowMappingParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/workflow`, method: 'DELETE', query: { + workflowName: parameters.workflowName, updateDraftIfNeeded: parameters.updateDraftIfNeeded, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns the workflow-issue type mappings for a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the workflow-issue type mappings for a workflow scheme. + * Returns the workflow-issue type mappings for a workflow scheme. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback?: never, - ): Promise; - async getWorkflow( - parameters: Parameters.GetWorkflow | string, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/workflowscheme/${id}/workflow`, + async getWorkflow(parameters: GetWorkflowParameters) { + const request: Request = { + url: `/rest/api/2/workflowscheme/${parameters.id}/workflow`, method: 'GET', query: { - workflowName: typeof parameters !== 'string' && parameters.workflowName, - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + workflowName: parameters.workflowName, + returnDraftIfExists: parameters.returnDraftIfExists, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for - * the workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types - * mappings. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for - * the workflow scheme. Unmapped issues types are mapped to the default workflow. + * the workflow scheme. Unmapped issues types are mapped to the default workflow. * * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types - * mappings. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types + * mappings. The draft workflow scheme can be published in Jira. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback?: never, - ): Promise; - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - ): Promise { - const config: Request = { + async updateWorkflowMapping(parameters: UpdateWorkflowMappingParameters) { + const request: Request = { url: `/rest/api/2/workflowscheme/${parameters.id}/workflow`, method: 'PUT', query: { @@ -659,66 +410,12 @@ export class WorkflowSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback: Callback, - ): Promise; - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback?: never, - ): Promise; - async deleteWorkflowMapping(parameters: Parameters.DeleteWorkflowMapping | string): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: Request = { - url: `/rest/api/2/workflowscheme/${id}/workflow`, - method: 'DELETE', - query: { - workflowName: typeof parameters !== 'string' && parameters.workflowName, - updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config); - } - - /** 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, - ): Promise { - const config: Request = { + async getProjectUsagesForWorkflowScheme(parameters: GetProjectUsagesForWorkflowSchemeParameters) { + const request: Request = { url: `/rest/api/2/workflowscheme/${parameters.workflowSchemeId}/projectUsages`, method: 'GET', query: { @@ -727,6 +424,6 @@ export class WorkflowSchemes { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/workflowStatusCategories.ts b/src/version2/workflowStatusCategories.ts index 7b80f85c51..535368350a 100644 --- a/src/version2/workflowStatusCategories.ts +++ b/src/version2/workflowStatusCategories.ts @@ -1,67 +1,37 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetStatusCategoryParameters } from './parameters/getStatusCategoryParameters'; export class WorkflowStatusCategories { constructor(private client: Client) {} - /** - * Returns a list of all status categories. + * Returns a list of all status categories. * * - * **[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:** + * Permission to access Jira. */ - async getStatusCategories(callback: Callback): Promise; - /** - * Returns a list of all status categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategories(callback?: never): Promise; - async getStatusCategories(): Promise { - const config: Request = { + async getStatusCategories() { + const request: Request = { url: '/rest/api/2/statuscategory', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a status category. Status categories provided a mechanism for categorizing - * [statuses](#api-rest-api-2-status-idOrName-get). + * [statuses](#api-rest-api-2-status-idOrName-get). * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. */ - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback: Callback, - ): Promise; - /** - * Returns a status category. Status categories provided a mechanism for categorizing - * [statuses](#api-rest-api-2-status-idOrName-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback?: never, - ): Promise; - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - ): Promise { - const idOrKey = typeof parameters === 'string' ? parameters : parameters.idOrKey; - - const config: Request = { - url: `/rest/api/2/statuscategory/${idOrKey}`, + async getStatusCategory(parameters: GetStatusCategoryParameters) { + const request: Request = { + url: `/rest/api/2/statuscategory/${parameters.idOrKey}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/workflowStatuses.ts b/src/version2/workflowStatuses.ts index 1d93b1f752..4ec4f68dab 100644 --- a/src/version2/workflowStatuses.ts +++ b/src/version2/workflowStatuses.ts @@ -1,70 +1,47 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetStatusParameters } from './parameters/getStatusParameters'; export class WorkflowStatuses { constructor(private client: Client) {} - /** - * Returns a list of all statuses associated with active workflows. - * - * This operation can be accessed anonymously. - * - * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: _Browse - * projects_ [project - * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) for the - * project. + * Returns a list of all statuses associated with active workflows. * + * + * - This operation can be accessed anonymously. + * - + * - [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: _Browse + * projects_ [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) for the + * project. */ - async getStatuses(): Promise { - const config: Request = { + async getStatuses() { + const request: Request = { url: '/rest/api/2/status', method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Returns a status. The status must be associated with an active workflow to be returned. - * - * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the - * status by its ID may be preferable. - * - * This operation can be accessed anonymously. - * - * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: _Browse - * projects_ [project - * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) for the - * project. - */ - async getStatus( - parameters: Parameters.GetStatus | string, - callback: Callback, - ): Promise; - /** - * Returns a status. The status must be associated with an active workflow to be returned. - * - * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the - * status by its ID may be preferable. - * - * This operation can be accessed anonymously. - * - * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: _Browse - * projects_ [project - * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) for the - * project. + * Returns a status. The status must be associated with an active workflow to be returned. * + * + * - If a name is used on more than one status, only the status found first is returned. Therefore, identifying the + * status by its ID may be preferable. + * - + * - This operation can be accessed anonymously. + * - + * - [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: _Browse + * projects_ [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) for the + * project. */ - async getStatus(parameters: Parameters.GetStatus | string, callback?: never): Promise; - async getStatus(parameters: Parameters.GetStatus | string): Promise { - const idOrName = typeof parameters === 'string' ? parameters : parameters.idOrName; - - const config: Request = { - url: `/rest/api/2/status/${idOrName}`, + async getStatus(parameters: GetStatusParameters) { + const request: Request = { + url: `/rest/api/2/status/${parameters.idOrName}`, method: 'GET', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/workflowTransitionProperties.ts b/src/version2/workflowTransitionProperties.ts deleted file mode 100644 index 5b94568ef2..0000000000 --- a/src/version2/workflowTransitionProperties.ts +++ /dev/null @@ -1,194 +0,0 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; -import type { Request } from '../request'; - -export class WorkflowTransitionProperties { - constructor(private client: Client) {} - - /** - * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback: Callback, - ): Promise; - /** - * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback?: never, - ): Promise; - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - ): Promise { - const config: Request = { - url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, - method: 'GET', - query: { - includeReservedKeys: parameters.includeReservedKeys, - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - }; - - return this.client.sendRequest(config); - } - - /** - * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. - * For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. - * For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback?: never, - ): Promise; - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - ): Promise { - const config: Request = { - url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, - method: 'POST', - query: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - body: { - ...parameters, - transitionId: undefined, - key: undefined, - workflowName: undefined, - workflowMode: undefined, - }, - }; - - return this.client.sendRequest(config); - } - - /** - * Updates a workflow transition by changing the property value. Trying to update a property that does not exist - * results in a new property being added to the transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Updates a workflow transition by changing the property value. Trying to update a property that does not exist - * results in a new property being added to the transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback?: never, - ): Promise; - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - ): Promise { - const config: Request = { - url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, - method: 'PUT', - query: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - body: { - ...parameters, - transitionId: undefined, - key: undefined, - workflowName: undefined, - workflowMode: undefined, - }, - }; - - return this.client.sendRequest(config); - } - - /** - * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback?: never, - ): Promise; - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - ): Promise { - const config: Request = { - url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, - method: 'DELETE', - query: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - }; - - return this.client.sendRequest(config); - } -} diff --git a/src/version2/workflowTransitionRules.ts b/src/version2/workflowTransitionRules.ts index 2e4237be3c..8331f9e7fc 100644 --- a/src/version2/workflowTransitionRules.ts +++ b/src/version2/workflowTransitionRules.ts @@ -1,64 +1,33 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { GetWorkflowTransitionRuleConfigurationsParameters } from './parameters/getWorkflowTransitionRuleConfigurationsParameters'; +import type { UpdateWorkflowTransitionRuleConfigurationsParameters } from './parameters/updateWorkflowTransitionRuleConfigurationsParameters'; +import type { DeleteWorkflowTransitionRuleConfigurationsParameters } from './parameters/deleteWorkflowTransitionRuleConfigurationsParameters'; export class WorkflowTransitionRules { constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition - * rules: - * - * - Of one or more transition rule types, such as [workflow post - * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). - * - Matching one or more transition rule keys. - * - * Only workflows containing transition rules created by the calling - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app are returned. - * - * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be - * ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. - */ - async getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback: Callback, - ): Promise; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition - * rules: - * - * - Of one or more transition rule types, such as [workflow post - * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). - * - Matching one or more transition rule keys. - * - * Only workflows containing transition rules created by the calling - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app are returned. - * - * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be - * ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. + * rules: * + * + * - - Of one or more transition rule types, such as [workflow post + * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). + * - - Matching one or more transition rule keys. + * - + * - Only workflows containing transition rules created by the calling + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app are returned. + * - + * - Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be + * ignored. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. */ - async getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - ): Promise { - const config: Request = { + async getWorkflowTransitionRuleConfigurations(parameters: GetWorkflowTransitionRuleConfigurationsParameters) { + const request: Request = { url: '/rest/api/2/workflow/rule/config', method: 'GET', query: { @@ -73,67 +42,34 @@ export class WorkflowTransitionRules { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Updates configuration of workflow transition rules. The following rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) - * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) - * - * Only rules created by the calling - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app can be updated. - * - * To assist with app migration, this operation can be used to: - * - * - Disable a rule. - * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule - * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflow-transition-rules/#api-rest-api-2-workflow-rule-config-get). - * - * Rules are enabled if the `disabled` parameter is not provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. - */ - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - callback: Callback, - ): Promise; - /** - * Updates configuration of workflow transition rules. The following rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) - * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) - * - * Only rules created by the calling - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app can be updated. - * - * To assist with app migration, this operation can be used to: - * - * - Disable a rule. - * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule - * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflow-transition-rules/#api-rest-api-2-workflow-rule-config-get). - * - * Rules are enabled if the `disabled` parameter is not provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. + * Updates configuration of workflow transition rules. The following rule types are supported: * + * + * - - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) + * - - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) + * - + * - Only rules created by the calling + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app can be updated. + * - + * - To assist with app migration, this operation can be used to: + * - + * - - Disable a rule. + * - - Add a `tag`. Use this to filter rules in the [Get workflow transition rule + * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). + * - + * - Rules are enabled if the `disabled` parameter is not provided. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. */ - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - ): Promise { - const config: Request = { + async updateWorkflowTransitionRuleConfigurations(parameters: UpdateWorkflowTransitionRuleConfigurationsParameters) { + const request: Request = { url: '/rest/api/2/workflow/rule/config', method: 'PUT', body: { @@ -141,52 +77,30 @@ export class WorkflowTransitionRules { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Deletes workflow transition rules from one or more workflows. These rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) - * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) - * - * Only rules created by the calling Connect app can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can use this operation. + * Deletes workflow transition rules from one or more workflows. These rule types are supported: * + * + * - - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) + * - - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) + * - + * - Only rules created by the calling Connect app can be deleted. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can use this operation. */ - async deleteWorkflowTransitionRuleConfigurations( - parameters: Parameters.DeleteWorkflowTransitionRuleConfigurations | undefined, - callback: Callback, - ): Promise; - /** - * Deletes workflow transition rules from one or more workflows. These rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) - * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) - * - * Only rules created by the calling Connect app can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can use this operation. - */ - async deleteWorkflowTransitionRuleConfigurations( - parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async deleteWorkflowTransitionRuleConfigurations( - parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, - ): Promise { - const config: Request = { + async deleteWorkflowTransitionRuleConfigurations(parameters: DeleteWorkflowTransitionRuleConfigurationsParameters) { + const request: Request = { url: '/rest/api/2/workflow/rule/config/delete', method: 'PUT', body: { - workflows: parameters?.workflows, + workflows: parameters.workflows, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } } diff --git a/src/version2/workflows.ts b/src/version2/workflows.ts index 637cbed62a..218d9abee1 100644 --- a/src/version2/workflows.ts +++ b/src/version2/workflows.ts @@ -1,160 +1,44 @@ -import type * as Models from './models'; -import type * as Parameters from './parameters'; -import type { Client } from '../clients'; -import type { Callback } from '../callback'; -import { paramSerializer } from '../paramSerializer'; +import type { Client } from '../client'; import type { Request } from '../request'; +import type { DeleteInactiveWorkflowParameters } from './parameters/deleteInactiveWorkflowParameters'; +import type { GetWorkflowProjectIssueTypeUsagesParameters } from './parameters/getWorkflowProjectIssueTypeUsagesParameters'; +import type { GetProjectUsagesForWorkflowParameters } from './parameters/getProjectUsagesForWorkflowParameters'; +import type { GetWorkflowSchemeUsagesForWorkflowParameters } from './parameters/getWorkflowSchemeUsagesForWorkflowParameters'; +import type { ReadWorkflowsParameters } from './parameters/readWorkflowsParameters'; +import type { WorkflowCapabilitiesParameters } from './parameters/workflowCapabilitiesParameters'; +import type { CreateWorkflowsParameters } from './parameters/createWorkflowsParameters'; +import type { ValidateCreateWorkflowsParameters } from './parameters/validateCreateWorkflowsParameters'; +import type { SearchWorkflowsParameters } from './parameters/searchWorkflowsParameters'; +import type { UpdateWorkflowsParameters } from './parameters/updateWorkflowsParameters'; +import type { ValidateUpdateWorkflowsParameters } from './parameters/validateUpdateWorkflowsParameters'; export class Workflows { constructor(private client: Client) {} - - /** - * Creates a workflow. You can define transition rules using the shapes detailed in the following sections. If no - * transitional rules are specified the default system transition rules are used. Note: This only applies to - * company-managed scoped workflows. Use [bulk create - * workflows](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflows/#api-rest-api-2-workflows-create-post) - * to create both team and company-managed scoped workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflow( - parameters: Parameters.CreateWorkflow, - callback: Callback, - ): Promise; - /** - * Creates a workflow. You can define transition rules using the shapes detailed in the following sections. If no - * transitional rules are specified the default system transition rules are used. Note: This only applies to - * company-managed scoped workflows. Use [bulk create - * workflows](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflows/#api-rest-api-2-workflows-create-post) - * to create both team and company-managed scoped workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflow(parameters: Parameters.CreateWorkflow, callback?: never): Promise; - async createWorkflow(parameters: Parameters.CreateWorkflow): Promise { - const config: Request = { - url: '/rest/api/2/workflow', - method: 'POST', - body: { - description: parameters.description, - name: parameters.name, - statuses: parameters.statuses, - transitions: parameters.transitions, - }, - }; - - return this.client.sendRequest(config); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, - * all published classic workflows are returned. - * - * This operation does not return next-gen workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowsPaginated( - parameters: Parameters.GetWorkflowsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, - * all published classic workflows are returned. - * - * This operation does not return next-gen workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowsPaginated( - parameters?: Parameters.GetWorkflowsPaginated, - callback?: never, - ): Promise; - async getWorkflowsPaginated( - parameters?: Parameters.GetWorkflowsPaginated, - ): Promise { - const config: Request = { - url: '/rest/api/2/workflow/search', - method: 'GET', - query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - workflowName: paramSerializer('workflowName', parameters?.workflowName), - expand: parameters?.expand, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - isActive: parameters?.isActive, - }, - }; - - return this.client.sendRequest(config); - } - /** - * Deletes a workflow. - * - * The workflow cannot be deleted if it is: - * - * - An active workflow. - * - A system workflow. - * - Associated with any workflow scheme. - * - Associated with any draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback: Callback, - ): Promise; - /** - * Deletes a workflow. - * - * The workflow cannot be deleted if it is: - * - * - An active workflow. - * - A system workflow. - * - Associated with any workflow scheme. - * - Associated with any draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * Deletes a workflow. * + * + * - The workflow cannot be deleted if it is: + * - + * - - An active workflow. + * - - A system workflow. + * - - Associated with any workflow scheme. + * - - Associated with any draft workflow scheme. + * - + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback?: never, - ): Promise; - async deleteInactiveWorkflow(parameters: Parameters.DeleteInactiveWorkflow | string): Promise { - const entityId = typeof parameters === 'string' ? parameters : parameters.entityId; - - const config: Request = { - url: `/rest/api/2/workflow/${entityId}`, + async deleteInactiveWorkflow(parameters: DeleteInactiveWorkflowParameters) { + const request: Request = { + url: `/rest/api/2/workflow/${parameters.entityId}`, method: 'DELETE', }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** 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, - ): Promise { - const config: Request = { + async getWorkflowProjectIssueTypeUsages(parameters: GetWorkflowProjectIssueTypeUsagesParameters) { + const request: Request = { url: `/rest/api/2/workflow/${parameters.workflowId}/project/${parameters.projectId}/issueTypeUsages`, method: 'GET', query: { @@ -163,23 +47,12 @@ export class Workflows { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** 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, - ): Promise { - const config: Request = { + async getProjectUsagesForWorkflow(parameters: GetProjectUsagesForWorkflowParameters) { + const request: Request = { url: `/rest/api/2/workflow/${parameters.workflowId}/projectUsages`, method: 'GET', query: { @@ -188,23 +61,12 @@ export class Workflows { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** 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, - ): Promise { - const config: Request = { + async getWorkflowSchemeUsagesForWorkflow(parameters: GetWorkflowSchemeUsagesForWorkflowParameters) { + const request: Request = { url: `/rest/api/2/workflow/${parameters.workflowId}/workflowSchemes`, method: 'GET', query: { @@ -213,40 +75,24 @@ export class Workflows { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** * Returns a list of workflows and related statuses by providing workflow names, workflow IDs, or project and issue - * types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ global permission to access all, including project-scoped, workflows - * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access - * project-scoped workflows - */ - async readWorkflows( - parameters: Parameters.ReadWorkflows, - callback: Callback, - ): Promise; - /** - * Returns a list of workflows and related statuses by providing workflow names, workflow IDs, or project and issue - * types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * types. * * - * - _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 + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows */ - async readWorkflows(parameters: Parameters.ReadWorkflows, callback?: never): Promise; - async readWorkflows(parameters: Parameters.ReadWorkflows): Promise { - const config: Request = { + async readWorkflows(parameters: ReadWorkflowsParameters) { + const request: Request = { url: '/rest/api/2/workflows', method: 'POST', query: { - useTransitionLinksFormat: parameters.useTransitionLinksFormat, useApprovalConfiguration: parameters.useApprovalConfiguration, }, body: { @@ -256,7 +102,7 @@ export class Workflows { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** @@ -264,37 +110,571 @@ export class Workflows { * issue type ID pair. The response includes the scope of the workflow, defined as global/project-based, and a list of * project types that the workflow is scoped to. It also includes all rules organised into their broad categories * (conditions, validators, actions, triggers, screens) as well as the source location (Atlassian-provided, Connect, - * Forge). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to access all, including global-scoped, workflows - * - _Administer projects_ project permissions to access project-scoped workflows - */ - async workflowCapabilities( - parameters: Parameters.WorkflowCapabilities, - callback: Callback, - ): Promise; - /** - * Get the list of workflow capabilities for a specific workflow using either the workflow ID, or the project and - * issue type ID pair. The response includes the scope of the workflow, defined as global/project-based, and a list of - * project types that the workflow is scoped to. It also includes all rules organised into their broad categories - * (conditions, validators, actions, triggers, screens) as well as the source location (Atlassian-provided, Connect, - * Forge). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to access all, including global-scoped, workflows - * - _Administer projects_ project permissions to access project-scoped workflows + * Forge). * + * + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ project permission to access all, including global-scoped, workflows + * - - _Administer projects_ project permissions to access project-scoped workflows + * - + * - The current list of Atlassian-provided rules: + * - + * - #### Validators + * - + * - A validator rule that checks if a user has the required permissions to execute the transition in the workflow. + * - + * - ##### Permission validator + * - + * - A validator rule that checks if a user has the required permissions to execute the transition in the workflow. + * - + * - { + * - "ruleKey": "system:check-permission-validator", + * - "parameters": { + * - "permissionKey": "ADMINISTER_PROJECTS" + * - } + * - } + * - + * - Parameters: + * - + * - - `permissionKey` The permission required to perform the transition. Allowed values: [built-in Jira + * permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permission-schemes/#built-in-permissions). + * - + * - ##### Parent or child blocking validator + * - + * - A validator to block the child issue's transition depending on the parent issue's status. + * - + * - { + * - "ruleKey" : "system:parent-or-child-blocking-validator" + * - "parameters" : { + * - "blocker" : "PARENT" + * - "statusIds" : "1,2,3" + * - } + * - } + * - + * - Parameters: + * - + * - - `blocker` currently only supports `PARENT`. + * - - `statusIds` a comma-separated list of status IDs. + * - + * - ##### Previous status validator + * - + * - A validator that checks if an issue has transitioned through specified previous status(es) before allowing the + * current transition to occur. + * - + * - { + * - "ruleKey": "system:previous-status-validator", + * - "parameters": { + * - "previousStatusIds": "10014", + * - "mostRecentStatusOnly": "true" + * - } + * - } + * - + * - Parameters: + * - + * - - `previousStatusIds` a comma-separated list of status IDs, currently only support one ID. + * - - `mostRecentStatusOnly` when `true` only considers the most recent status for the condition evaluation. Allowed + * values: `true`, `false`. + * - + * - ##### Validate a field value + * - + * - A validation that ensures a specific field's value meets the defined criteria before allowing an issue to + * transition in the workflow. + * - + * - Depending on the rule type, the result will vary: + * - + * - ###### Field required + * - + * - { + * - "ruleKey": "system:validate-field-value", + * - "parameters": { + * - "ruleType": "fieldRequired", + * - "fieldsRequired": "assignee", + * - "ignoreContext": "true", + * - "errorMessage": "An assignee must be set!" + * - } + * - } + * - + * - Parameters: + * - + * - - `fieldsRequired` the ID of the field that is required. For a custom field, it would look like `customfield_123`. + * - - `ignoreContext` controls the impact of context settings on field validation. When set to `true`, the validator + * doesn't check a required field if its context isn't configured for the current issue. When set to `false`, + * the validator requires a field even if its context is invalid. Allowed values: `true`, `false`. + * - - `errorMessage` is the error message to display if the user does not provide a value during the transition. A + * default error message will be shown if you don't provide one (Optional). + * - + * - ###### Field changed + * - + * - { + * - "ruleKey": "system:validate-field-value", + * - "parameters": { + * - "ruleType": "fieldChanged", + * - "groupsExemptFromValidation": "6862ac20-8672-4f68-896d-4854f5efb79e", + * - "fieldKey": "versions", + * - "errorMessage": "Affect versions must be modified before transition" + * - } + * - } + * - + * - Parameters: + * - + * - - `groupsExemptFromValidation` a comma-separated list of group IDs to be exempt from the validation. + * - - `fieldKey` the ID of the field that has changed. For a custom field, it would look like `customfield_123`. + * - - `errorMessage` the error message to display if the user does not provide a value during the transition. A default + * error message will be shown if you don't provide one (Optional). + * - + * - ###### Field has a single value + * - + * - { + * - "ruleKey": "system:validate-field-value", + * - "parameters": { + * - "ruleType": "fieldHasSingleValue", + * - "fieldKey": "created", + * - "excludeSubtasks": "true" + * - } + * - } + * - + * - Parameters: + * - + * - - `fieldKey` the ID of the field to validate. For a custom field, it would look like `customfield_123`. + * - - `excludeSubtasks` Option to exclude values copied from sub-tasks. Allowed values: `true`, `false`. + * - + * - ###### Field matches regular expression + * - + * - { + * - "ruleKey": "system:validate-field-value", + * - "parameters": { + * - "ruleType": "fieldMatchesRegularExpression", + * - "regexp": "[0-9]{4}", + * - "fieldKey": "description" + * - } + * - } + * - + * - Parameters: + * - + * - - `regexp` the regular expression used to validate the field\u2019s content. + * - - `fieldKey` the ID of the field to validate. For a custom field, it would look like `customfield_123`. + * - + * - ###### Date field comparison + * - + * - { + * - "ruleKey": "system:validate-field-value", + * - "parameters": { + * - "ruleType": "dateFieldComparison", + * - "date1FieldKey": "duedate", + * - "date2FieldKey": "customfield_10054", + * - "includeTime": "true", + * - "conditionSelected": ">=" + * - } + * - } + * - + * - Parameters: + * - + * - - `date1FieldKey` the ID of the first field to compare. For a custom field, it would look like `customfield_123`. + * - - `date2FieldKey` the ID of the second field to compare. For a custom field, it would look like `customfield_123`. + * - - `includeTime` if `true`, compares both date and time. Allowed values: `true`, `false`. + * - - `conditionSelected` the condition to compare with. Allowed values: `>`, `>=`, `=`, `<=`, `<`, `!=`. + * - + * - ###### Date range comparison + * - + * - { + * - "ruleKey": "system:validate-field-value", + * - "parameters": { + * - "ruleType": "windowDateComparison", + * - "date1FieldKey": "customfield_10009", + * - "date2FieldKey": "customfield_10054", + * - "numberOfDays": "3" + * - } + * - } + * - + * - Parameters: + * - + * - - `date1FieldKey` the ID of the first field to compare. For a custom field, it would look like `customfield_123`. + * - - `date2FieldKey` the ID of the second field to compare. For a custom field, it would look like `customfield_123`. + * - - `numberOfDays` maximum number of days past the reference date (`date2FieldKey`) to pass validation. + * - + * - This rule is composed by aggregating the following legacy rules: + * - + * - - FieldRequiredValidator + * - - FieldChangedValidator + * - - FieldHasSingleValueValidator + * - - RegexpFieldValidator + * - - DateFieldValidator + * - - WindowsDateValidator + * - + * - ##### Pro forma: Forms attached validator + * - + * - Validates that one or more forms are attached to the issue. + * - + * - { + * - "ruleKey" : "system:proforma-forms-attached" + * - "parameters" : {} + * - } + * - + * - ##### Proforma: Forms submitted validator + * - + * - Validates that all forms attached to the issue have been submitted. + * - + * - { + * - "ruleKey" : "system:proforma-forms-submitted" + * - "parameters" : {} + * - } + * - + * - #### Conditions + * - + * - Conditions enable workflow rules that govern whether a transition can execute. + * - + * - ##### Check field value + * - + * - A condition rule evaluates as true if a specific field's value meets the defined criteria. This rule ensures that + * an issue can only transition to the next step in the workflow if the field's value matches the desired + * condition. + * - + * - { + * - "ruleKey": "system:check-field-value", + * - "parameters": { + * - "fieldId": "description", + * - "fieldValue": "["Done"]", + * - "comparator": "=", + * - "comparisonType": "STRING" + * - } + * - } + * - + * - Parameters: + * - + * - - `fieldId` The ID of the field to check the value of. For non-system fields, it will look like `customfield_123`. + * Note: `fieldId` is used interchangeably with the idea of `fieldKey` here, they refer to the same field. + * - - `fieldValue` the list of values to check against the field\u2019s value. + * - - `comparator` The comparison logic. Allowed values: `>`, `>=`, `=`, `<=`, `<`, `!=`. + * - - `comparisonType` The type of data being compared. Allowed values: `STRING`, `NUMBER`, `DATE`, `DATE_WITHOUT_TIME`, + * `OPTIONID`. + * - + * - ##### Restrict issue transition + * - + * - This rule ensures that issue transitions are restricted based on user accounts, roles, group memberships, and + * permissions, maintaining control over who can transition an issue. This condition evaluates as `true` if any of + * the following criteria is met. + * - + * - { + * - "ruleKey": "system:restrict-issue-transition", + * - "parameters": { + * - "accountIds": "allow-reporter,5e68ac137d64450d01a77fa0", + * - "roleIds": "10002,10004", + * - "groupIds": "703ff44a-7dc8-4f4b-9aa6-a65bf3574fa4", + * - "permissionKeys": "ADMINISTER_PROJECTS", + * - "groupCustomFields": "customfield_10028", + * - "allowUserCustomFields": "customfield_10072,customfield_10144,customfield_10007", + * - "denyUserCustomFields": "customfield_10107" + * - } + * - } + * - + * - Parameters: + * - + * - - `accountIds` a comma-separated list of the user account IDs. It also allows generic values like: `allow-assignee`, + * `allow-reporter`, and `accountIds` Note: This is only supported in team-managed projects + * - - `roleIds` a comma-separated list of role IDs. + * - - `groupIds` a comma-separated list of group IDs. + * - - `permissionKeys` a comma-separated list of permission keys. Allowed values: [built-in Jira + * permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permission-schemes/#built-in-permissions). + * - - `groupCustomFields` a comma-separated list of group custom field IDs. + * - - `allowUserCustomFields` a comma-separated list of user custom field IDs to allow for issue transition. + * - - `denyUserCustomFields` a comma-separated list of user custom field IDs to deny for issue transition. + * - + * - This rule is composed by aggregating the following legacy rules: + * - + * - - AllowOnlyAssignee + * - - AllowOnlyReporter + * - - InAnyProjectRoleCondition + * - - InProjectRoleCondition + * - - UserInAnyGroupCondition + * - - UserInGroupCondition + * - - PermissionCondtion + * - - InGroupCFCondition + * - - UserIsInCustomFieldCondition + * - + * - ##### Previous status condition + * - + * - A condition that evaluates based on an issue's previous status(es) and specific criteria. + * - + * - { + * - "ruleKey" : "system:previous-status-condition" + * - "parameters" : { + * - "previousStatusIds" : "10004", + * - "not": "true", + * - "mostRecentStatusOnly" : "true", + * - "includeCurrentStatus": "true", + * - "ignoreLoopTransitions": "true" + * - } + * - } + * - + * - Parameters: + * - + * - - `previousStatusIds` a comma-separated list of status IDs, current only support one ID. + * - - `not` indicates if the condition should be reversed. When `true` it checks that the issue has not been in the + * selected statuses. Allowed values: `true`, `false`. + * - - `mostRecentStatusOnly` when true only considers the most recent status for the condition evaluation. Allowed + * values: `true`, `false`. + * - - `includeCurrentStatus` includes the current status when evaluating if the issue has been through the selected + * statuses. Allowed values: `true`, `false`. + * - - `ignoreLoopTransitions` ignore loop transitions. Allowed values: `true`, `false`. + * - + * - ##### Parent or child blocking condition + * - + * - A condition to block the parent\u2019s issue transition depending on the child\u2019s issue status. + * - + * - { + * - "ruleKey" : "system:parent-or-child-blocking-condition" + * - "parameters" : { + * - "blocker" : "CHILD", + * - "statusIds" : "1,2,3" + * - } + * - } + * - + * - Parameters: + * - + * - - `blocker` currently only supports `CHILD`. + * - - `statusIds` a comma-separated list of status IDs. + * - + * - ##### Separation of duties + * - + * - A condition preventing the user from performing, if the user has already performed a transition on the issue. + * - + * - { + * - "ruleKey": "system:separation-of-duties", + * - "parameters": { + * - "fromStatusId": "10161", + * - "toStatusId": "10160" + * - } + * - } + * - + * - Parameters: + * - + * - - `fromStatusId` represents the status ID from which the issue is transitioning. It ensures that the user performing + * the current transition has not performed any actions when the issue was in the specified status. + * - - `toStatusId` represents the status ID to which the issue is transitioning. It ensures that the user performing the + * current transition is not the same user who has previously transitioned the issue. + * - + * - ##### Restrict transitions + * - + * - A condition preventing all users from transitioning the issue can also optionally include APIs as well. + * - + * - { + * - "ruleKey": "system:restrict-from-all-users", + * - "parameters": { + * - "restrictMode": "users" + * - } + * - } + * - + * - Parameters: + * - + * - - `restrictMode` restricts the issue transition including/excluding APIs. Allowed values: `"users"`, `"usersAndAPI"`. + * - + * - ##### Jira Service Management block until approved + * - + * - Block an issue transition until approval. Note: This is only supported in team-managed projects. + * - + * - { + * - "ruleKey": "system:jsd-approvals-block-until-approved", + * - "parameters": { + * - "approvalConfigurationJson": "{"statusExternalUuid...}" + * - } + * - } + * - + * - Parameters: + * - + * - - `approvalConfigurationJson` a stringified JSON holding the Jira Service Management approval configuration. + * - + * - ##### Jira Service Management block until rejected + * - + * - Block an issue transition until rejected. Note: This is only supported in team-managed projects. + * - + * - { + * - "ruleKey": "system:jsd-approvals-block-until-rejected", + * - "parameters": { + * - "approvalConfigurationJson": "{"statusExternalUuid...}" + * - } + * - } + * - + * - Parameters: + * - + * - - `approvalConfigurationJson` a stringified JSON holding the Jira Service Management approval configuration. + * - + * - ##### Block in progress approval + * - + * - Condition to block issue transition if there is pending approval. Note: This is only supported in company-managed + * projects. + * - + * - { + * - "ruleKey": "system:block-in-progress-approval", + * - "parameters": {} + * - } + * - + * - #### Post functions + * - + * - Post functions carry out any additional processing required after a workflow transition is executed. + * - + * - ##### Change assignee + * - + * - A post function rule that changes the assignee of an issue after a transition. + * - + * - { + * - "ruleKey": "system:change-assignee", + * - "parameters": { + * - "type": "to-selected-user", + * - "accountId": "example-account-id" + * - } + * - } + * - + * - Parameters: + * - + * - - `type` the parameter used to determine the new assignee. Allowed values: `to-selected-user`, `to-unassigned`, + * `to-current-user`, `to-current-user`, `to-default-user`, `to-default-user` + * - - `accountId` the account ID of the user to assign the issue to. This parameter is required only when the type is + * `"to-selected-user"`. + * - + * - ##### Copy field value + * - + * - A post function that automates the process of copying values between fields during a specific transition, ensuring + * data consistency and reducing manual effort. + * - + * - { + * - "ruleKey": "system:copy-value-from-other-field", + * - "parameters": { + * - "sourceFieldKey": "description", + * - "targetFieldKey": "components", + * - "issueSource": "SAME" + * - } + * - } + * - + * - Parameters: + * - + * - - `sourceFieldKey` the field key to copy from. For a custom field, it would look like `customfield_123` + * - - `targetFieldKey` the field key to copy to. For a custom field, it would look like `customfield_123` + * - - `issueSource` `SAME` or `PARENT`. Defaults to `SAME` if no value is provided. + * - + * - ##### Update field + * - + * - A post function that updates or appends a specific field with the given value. + * - + * - { + * - "ruleKey": "system:update-field", + * - "parameters": { + * - "field": "customfield_10056", + * - "value": "asdf", + * - "mode": "append" + * - } + * - } + * - + * - Parameters: + * - + * - - `field` the ID of the field to update. For a custom field, it would look like `customfield_123` + * - - `value` the value to update the field with. + * - - `mode` `append` or `replace`. Determines if a value will be appended to the current value, or if the current value + * will be replaced. + * - + * - ##### Trigger webhook + * - + * - A post function that automatically triggers a predefined webhook when a transition occurs in the workflow. + * - + * - { + * - "ruleKey": "system:trigger-webhook", + * - "parameters": { + * - "webhookId": "1" + * - } + * - } + * - + * - Parameters: + * - + * - - `webhookId` the ID of the webhook. + * - + * - #### Screen + * - + * - ##### Remind people to update fields + * - + * - A screen rule that prompts users to update a specific field when they interact with an issue screen during a + * transition. This rule is useful for ensuring that users provide or modify necessary information before moving an + * issue to the next step in the workflow. + * - + * - { + * - "ruleKey": "system:remind-people-to-update-fields", + * - "params": { + * - "remindingFieldIds": "assignee,customfield_10025", + * - "remindingMessage": "The message", + * - "remindingAlwaysAsk": "true" + * - } + * - } + * - + * - Parameters: + * - + * - - `remindingFieldIds` a comma-separated list of field IDs. Note: `fieldId` is used interchangeably with the idea of + * `fieldKey` here, they refer to the same field. + * - - `remindingMessage` the message to display when prompting the users to update the fields. + * - - `remindingAlwaysAsk` always remind to update fields. Allowed values: `true`, `false`. + * - + * - ##### Shared transition screen + * - + * - A common screen that is shared between transitions in a workflow. + * - + * - { + * - "ruleKey": "system:transition-screen", + * - "params": { + * - "screenId": "3" + * - } + * - } + * - + * - Parameters: + * - + * - - `screenId` the ID of the screen. + * - + * - #### Connect & Forge + * - + * - ##### Connect rules + * - + * - Validator/Condition/Post function for Connect app. + * - + * - { + * - "ruleKey": "connect:expression-validator", + * - "parameters": { + * - "appKey": "com.atlassian.app", + * - "config": "", + * - "id": "90ce590f-e90c-4cd3-8281-165ce41f2ac3", + * - "disabled": "false", + * - "tag": "" + * - } + * - } + * - + * - Parameters: + * - + * - - `ruleKey` Validator: `connect:expression-validator`, Condition: `connect:expression-condition`, and Post function: + * `connect:remote-workflow-function` + * - - `appKey` the reference to the Connect app + * - - `config` a JSON payload string describing the configuration + * - - `id` the ID of the rule + * - - `disabled` determine if the Connect app is disabled. Allowed values: `true`, `false`. + * - - `tag` additional tags for the Connect app + * - + * - ##### Forge rules + * - + * - Validator/Condition/Post function for Forge app. + * - + * - { + * - "ruleKey": "forge:expression-validator", + * - "parameters": { + * - "key": "ari:cloud:ecosystem::extension/{appId}/{environmentId}/static/{moduleKey}", + * - "config": "{"searchString":"workflow validator"}", + * - "id": "a865ddf6-bb3f-4a7b-9540-c2f8b3f9f6c2" + * - } + * - } + * - + * - Parameters: + * - + * - - `ruleKey` Validator: `forge:expression-validator`, Condition: `forge:expression-condition`, and Post function: + * `forge:workflow-post-function` + * - - `key` the identifier for the Forge app + * - - `config` the persistent stringified JSON configuration for the Forge rule + * - - `id` the ID of the Forge rule */ - async workflowCapabilities( - parameters: Parameters.WorkflowCapabilities, - callback?: never, - ): Promise; - async workflowCapabilities( - parameters: Parameters.WorkflowCapabilities, - ): Promise { - const config: Request = { + async workflowCapabilities(parameters: WorkflowCapabilitiesParameters) { + const request: Request = { url: '/rest/api/2/workflows/capabilities', method: 'GET', query: { @@ -304,35 +684,19 @@ export class Workflows { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Create workflows and related statuses. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows - */ - async createWorkflows( - parameters: Parameters.CreateWorkflows, - callback: Callback, - ): Promise; - /** - * Create workflows and related statuses. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Create workflows and related statuses. * * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - - _Administer projects_ project permissions to create project-scoped workflows */ - async createWorkflows( - parameters: Parameters.CreateWorkflows, - callback?: never, - ): Promise; - async createWorkflows(parameters: Parameters.CreateWorkflows): Promise { - const config: Request = { + async createWorkflows(parameters: CreateWorkflowsParameters) { + const request: Request = { url: '/rest/api/2/workflows/create', method: 'POST', body: { @@ -342,37 +706,19 @@ export class Workflows { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Validate the payload for bulk create workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows - */ - async validateCreateWorkflows( - parameters: Parameters.ValidateCreateWorkflows, - callback: Callback, - ): Promise; - /** - * Validate the payload for bulk create workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Validate the payload for bulk create workflows. * * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - - _Administer projects_ project permissions to create project-scoped workflows */ - async validateCreateWorkflows( - parameters: Parameters.ValidateCreateWorkflows, - callback?: never, - ): Promise; - async validateCreateWorkflows( - parameters: Parameters.ValidateCreateWorkflows, - ): Promise { - const config: Request = { + async validateCreateWorkflows(parameters: ValidateCreateWorkflowsParameters) { + const request: Request = { url: '/rest/api/2/workflows/create/validation', method: 'POST', body: { @@ -381,125 +727,79 @@ export class Workflows { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); + } + + /** Get the user's default workflow editor. This can be either the new editor or the legacy editor. */ + async getDefaultEditor() { + const request: Request = { + url: '/rest/api/2/workflows/defaultEditor', + method: 'GET', + }; + + return this.client.sendRequest(request); } /** * 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 + * and project workflows. If workflow names are specified in the 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): Promise { - const config: Request = { + async searchWorkflows(parameters: SearchWorkflowsParameters) { + const request: Request = { url: '/rest/api/2/workflows/search', method: 'GET', query: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - expand: parameters?.expand, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - scope: parameters?.scope, - isActive: parameters?.isActive, + 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); + return this.client.sendRequest(request); } /** - * Update workflows and related statuses. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows - */ - async updateWorkflows( - parameters: Parameters.UpdateWorkflows, - callback: Callback, - ): Promise; - /** - * Update workflows and related statuses. + * Update workflows and related statuses. * * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - - _Administer projects_ project permissions to create project-scoped workflows */ - async updateWorkflows( - parameters: Parameters.UpdateWorkflows, - callback?: never, - ): Promise; - async updateWorkflows(parameters: Parameters.UpdateWorkflows): Promise { - const config: Request = { + async updateWorkflows(parameters: UpdateWorkflowsParameters) { + const request: Request = { url: '/rest/api/2/workflows/update', method: 'POST', - query: { - expand: parameters.expand, - }, body: { statuses: parameters.statuses, workflows: parameters.workflows, }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } /** - * Validate the payload for bulk update workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows - */ - async validateUpdateWorkflows( - parameters: Parameters.ValidateUpdateWorkflows, - callback: Callback, - ): Promise; - /** - * Validate the payload for bulk update workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Validate the payload for bulk update workflows. * * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * - + * - - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - - _Administer projects_ project permissions to create project-scoped workflows */ - async validateUpdateWorkflows( - parameters: Parameters.ValidateUpdateWorkflows, - callback?: never, - ): Promise; - async validateUpdateWorkflows( - parameters: Parameters.ValidateUpdateWorkflows, - ): Promise { - const config: Request = { + async validateUpdateWorkflows(parameters: ValidateUpdateWorkflowsParameters) { + const request: Request = { url: '/rest/api/2/workflows/update/validation', method: 'POST', body: { @@ -508,6 +808,6 @@ export class Workflows { }, }; - return this.client.sendRequest(config); + return this.client.sendRequest(request); } }