@resolution/jira-api-client 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/package.json +10 -3
  3. package/.eslintrc.js +0 -3
  4. package/config/api-typescript-generator.config.ts +0 -91
  5. package/config/compare-schemas.ts +0 -307
  6. package/src/index.ts +0 -47
  7. package/src/openapi/platform/base-jira-platform-api-client.ts +0 -2298
  8. package/src/openapi/platform/core/common-http-client.ts +0 -723
  9. package/src/openapi/platform/core/common-http-service.ts +0 -22
  10. package/src/openapi/platform/core/common-validation-schema-storage.ts +0 -105
  11. package/src/openapi/platform/models/announcement-banner.ts +0 -59
  12. package/src/openapi/platform/models/app-data-policies.ts +0 -79
  13. package/src/openapi/platform/models/app-migration.ts +0 -172
  14. package/src/openapi/platform/models/app-properties.ts +0 -32
  15. package/src/openapi/platform/models/audit-records.ts +0 -140
  16. package/src/openapi/platform/models/avatars.ts +0 -48
  17. package/src/openapi/platform/models/classification-levels.ts +0 -58
  18. package/src/openapi/platform/models/common.ts +0 -2669
  19. package/src/openapi/platform/models/dashboards.ts +0 -849
  20. package/src/openapi/platform/models/dynamic-modules.ts +0 -121
  21. package/src/openapi/platform/models/filter-sharing.ts +0 -103
  22. package/src/openapi/platform/models/filters.ts +0 -319
  23. package/src/openapi/platform/models/group-and-user-picker.ts +0 -85
  24. package/src/openapi/platform/models/groups.ts +0 -247
  25. package/src/openapi/platform/models/issue-attachments.ts +0 -290
  26. package/src/openapi/platform/models/issue-comment-properties.ts +0 -27
  27. package/src/openapi/platform/models/issue-comments.ts +0 -91
  28. package/src/openapi/platform/models/issue-custom-field-configuration-apps.ts +0 -96
  29. package/src/openapi/platform/models/issue-custom-field-contexts.ts +0 -1072
  30. package/src/openapi/platform/models/issue-custom-field-options-apps.ts +0 -273
  31. package/src/openapi/platform/models/issue-custom-field-options.ts +0 -283
  32. package/src/openapi/platform/models/issue-custom-field-values-apps.ts +0 -118
  33. package/src/openapi/platform/models/issue-field-configurations.ts +0 -435
  34. package/src/openapi/platform/models/issue-fields.ts +0 -392
  35. package/src/openapi/platform/models/issue-link-types.ts +0 -28
  36. package/src/openapi/platform/models/issue-links.ts +0 -185
  37. package/src/openapi/platform/models/issue-notification-schemes.ts +0 -370
  38. package/src/openapi/platform/models/issue-priorities.ts +0 -196
  39. package/src/openapi/platform/models/issue-properties.ts +0 -259
  40. package/src/openapi/platform/models/issue-remote-links.ts +0 -207
  41. package/src/openapi/platform/models/issue-resolutions.ts +0 -180
  42. package/src/openapi/platform/models/issue-search.ts +0 -367
  43. package/src/openapi/platform/models/issue-security-level.ts +0 -76
  44. package/src/openapi/platform/models/issue-security-schemes.ts +0 -496
  45. package/src/openapi/platform/models/issue-type-schemes.ts +0 -290
  46. package/src/openapi/platform/models/issue-type-screen-schemes.ts +0 -286
  47. package/src/openapi/platform/models/issue-types.ts +0 -66
  48. package/src/openapi/platform/models/issue-votes.ts +0 -38
  49. package/src/openapi/platform/models/issue-watchers.ts +0 -67
  50. package/src/openapi/platform/models/issue-worklogs.ts +0 -190
  51. package/src/openapi/platform/models/issues.ts +0 -1268
  52. package/src/openapi/platform/models/jira-expressions.ts +0 -578
  53. package/src/openapi/platform/models/jira-settings.ts +0 -118
  54. package/src/openapi/platform/models/jql-functions-apps.ts +0 -128
  55. package/src/openapi/platform/models/jql.ts +0 -783
  56. package/src/openapi/platform/models/labels.ts +0 -42
  57. package/src/openapi/platform/models/license-metrics.ts +0 -68
  58. package/src/openapi/platform/models/myself.ts +0 -29
  59. package/src/openapi/platform/models/permission-schemes.ts +0 -89
  60. package/src/openapi/platform/models/permissions.ts +0 -308
  61. package/src/openapi/platform/models/priority-schemes.ts +0 -527
  62. package/src/openapi/platform/models/project-avatars.ts +0 -29
  63. package/src/openapi/platform/models/project-classification-levels.ts +0 -24
  64. package/src/openapi/platform/models/project-components.ts +0 -231
  65. package/src/openapi/platform/models/project-email.ts +0 -27
  66. package/src/openapi/platform/models/project-features.ts +0 -78
  67. package/src/openapi/platform/models/project-permission-schemes.ts +0 -43
  68. package/src/openapi/platform/models/project-role-actors.ts +0 -107
  69. package/src/openapi/platform/models/project-roles.ts +0 -76
  70. package/src/openapi/platform/models/project-types.ts +0 -36
  71. package/src/openapi/platform/models/project-versions.ts +0 -216
  72. package/src/openapi/platform/models/projects.ts +0 -429
  73. package/src/openapi/platform/models/screen-schemes.ts +0 -192
  74. package/src/openapi/platform/models/screen-tab-fields.ts +0 -45
  75. package/src/openapi/platform/models/screens.ts +0 -171
  76. package/src/openapi/platform/models/server-info.ts +0 -100
  77. package/src/openapi/platform/models/service-registry.ts +0 -68
  78. package/src/openapi/platform/models/status.ts +0 -229
  79. package/src/openapi/platform/models/time-tracking.ts +0 -38
  80. package/src/openapi/platform/models/ui-modifications-apps.ts +0 -229
  81. package/src/openapi/platform/models/user-search.ts +0 -69
  82. package/src/openapi/platform/models/users.ts +0 -121
  83. package/src/openapi/platform/models/webhooks.ts +0 -307
  84. package/src/openapi/platform/models/workflow-scheme-drafts.ts +0 -58
  85. package/src/openapi/platform/models/workflow-scheme-project-associations.ts +0 -68
  86. package/src/openapi/platform/models/workflow-schemes.ts +0 -545
  87. package/src/openapi/platform/models/workflow-transition-properties.ts +0 -33
  88. package/src/openapi/platform/models/workflow-transition-rules.ts +0 -261
  89. package/src/openapi/platform/models/workflows.ts +0 -1943
  90. package/src/openapi/platform/services/announcement-banner-service.ts +0 -142
  91. package/src/openapi/platform/services/app-data-policies-service.ts +0 -136
  92. package/src/openapi/platform/services/app-migration-service.ts +0 -289
  93. package/src/openapi/platform/services/app-properties-service.ts +0 -441
  94. package/src/openapi/platform/services/application-roles-service.ts +0 -247
  95. package/src/openapi/platform/services/audit-records-service.ts +0 -164
  96. package/src/openapi/platform/services/avatars-service.ts +0 -769
  97. package/src/openapi/platform/services/classification-levels-service.ts +0 -131
  98. package/src/openapi/platform/services/dashboards-service.ts +0 -1721
  99. package/src/openapi/platform/services/dynamic-modules-service.ts +0 -127
  100. package/src/openapi/platform/services/filter-sharing-service.ts +0 -687
  101. package/src/openapi/platform/services/filters-service.ts +0 -1901
  102. package/src/openapi/platform/services/group-and-user-picker-service.ts +0 -224
  103. package/src/openapi/platform/services/groups-service.ts +0 -751
  104. package/src/openapi/platform/services/issue-attachments-service.ts +0 -900
  105. package/src/openapi/platform/services/issue-comment-properties-service.ts +0 -324
  106. package/src/openapi/platform/services/issue-comments-service.ts +0 -812
  107. package/src/openapi/platform/services/issue-custom-field-configuration-apps-service.ts +0 -277
  108. package/src/openapi/platform/services/issue-custom-field-contexts-service.ts +0 -1339
  109. package/src/openapi/platform/services/issue-custom-field-options-apps-service.ts +0 -994
  110. package/src/openapi/platform/services/issue-custom-field-options-service.ts +0 -651
  111. package/src/openapi/platform/services/issue-custom-field-values-apps-service.ts +0 -201
  112. package/src/openapi/platform/services/issue-field-configurations-service.ts +0 -1294
  113. package/src/openapi/platform/services/issue-fields-service.ts +0 -837
  114. package/src/openapi/platform/services/issue-link-types-service.ts +0 -360
  115. package/src/openapi/platform/services/issue-links-service.ts +0 -345
  116. package/src/openapi/platform/services/issue-navigator-settings-service.ts +0 -119
  117. package/src/openapi/platform/services/issue-notification-schemes-service.ts +0 -1209
  118. package/src/openapi/platform/services/issue-priorities-service.ts +0 -575
  119. package/src/openapi/platform/services/issue-properties-service.ts +0 -606
  120. package/src/openapi/platform/services/issue-remote-links-service.ts +0 -597
  121. package/src/openapi/platform/services/issue-resolutions-service.ts +0 -534
  122. package/src/openapi/platform/services/issue-search-service.ts +0 -1139
  123. package/src/openapi/platform/services/issue-security-level-service.ts +0 -250
  124. package/src/openapi/platform/services/issue-security-schemes-service.ts +0 -1240
  125. package/src/openapi/platform/services/issue-type-properties-service.ts +0 -325
  126. package/src/openapi/platform/services/issue-type-schemes-service.ts +0 -940
  127. package/src/openapi/platform/services/issue-type-screen-schemes-service.ts +0 -994
  128. package/src/openapi/platform/services/issue-types-service.ts +0 -679
  129. package/src/openapi/platform/services/issue-votes-service.ts +0 -221
  130. package/src/openapi/platform/services/issue-watchers-service.ts +0 -331
  131. package/src/openapi/platform/services/issue-worklog-properties-service.ts +0 -348
  132. package/src/openapi/platform/services/issue-worklogs-service.ts +0 -1089
  133. package/src/openapi/platform/services/issues-service.ts +0 -3346
  134. package/src/openapi/platform/services/jira-expressions-service.ts +0 -407
  135. package/src/openapi/platform/services/jira-settings-service.ts +0 -415
  136. package/src/openapi/platform/services/jql-functions-apps-service.ts +0 -219
  137. package/src/openapi/platform/services/jql-service.ts +0 -896
  138. package/src/openapi/platform/services/labels-service.ts +0 -89
  139. package/src/openapi/platform/services/license-metrics-service.ts +0 -216
  140. package/src/openapi/platform/services/myself-service.ts +0 -520
  141. package/src/openapi/platform/services/permission-schemes-service.ts +0 -926
  142. package/src/openapi/platform/services/permissions-service.ts +0 -407
  143. package/src/openapi/platform/services/priority-schemes-service.ts +0 -1001
  144. package/src/openapi/platform/services/project-avatars-service.ts +0 -341
  145. package/src/openapi/platform/services/project-categories-service.ts +0 -318
  146. package/src/openapi/platform/services/project-classification-levels-service.ts +0 -232
  147. package/src/openapi/platform/services/project-components-service.ts +0 -1332
  148. package/src/openapi/platform/services/project-email-service.ts +0 -161
  149. package/src/openapi/platform/services/project-features-service.ts +0 -207
  150. package/src/openapi/platform/services/project-key-and-name-validation-service.ts +0 -200
  151. package/src/openapi/platform/services/project-permission-schemes-service.ts +0 -384
  152. package/src/openapi/platform/services/project-properties-service.ts +0 -320
  153. package/src/openapi/platform/services/project-role-actors-service.ts +0 -627
  154. package/src/openapi/platform/services/project-roles-service.ts +0 -867
  155. package/src/openapi/platform/services/project-types-service.ts +0 -297
  156. package/src/openapi/platform/services/project-versions-service.ts +0 -1287
  157. package/src/openapi/platform/services/projects-service.ts +0 -2196
  158. package/src/openapi/platform/services/screen-schemes-service.ts +0 -334
  159. package/src/openapi/platform/services/screen-tab-fields-service.ts +0 -276
  160. package/src/openapi/platform/services/screen-tabs-service.ts +0 -421
  161. package/src/openapi/platform/services/screens-service.ts +0 -528
  162. package/src/openapi/platform/services/server-info-service.ts +0 -88
  163. package/src/openapi/platform/services/service-registry-service.ts +0 -89
  164. package/src/openapi/platform/services/status-service.ts +0 -498
  165. package/src/openapi/platform/services/tasks-service.ts +0 -159
  166. package/src/openapi/platform/services/time-tracking-service.ts +0 -386
  167. package/src/openapi/platform/services/ui-modifications-apps-service.ts +0 -403
  168. package/src/openapi/platform/services/user-properties-service.ts +0 -413
  169. package/src/openapi/platform/services/user-search-service.ts +0 -1214
  170. package/src/openapi/platform/services/users-service.ts +0 -1108
  171. package/src/openapi/platform/services/webhooks-service.ts +0 -458
  172. package/src/openapi/platform/services/workflow-scheme-drafts-service.ts +0 -1313
  173. package/src/openapi/platform/services/workflow-scheme-project-associations-service.ts +0 -189
  174. package/src/openapi/platform/services/workflow-schemes-service.ts +0 -1617
  175. package/src/openapi/platform/services/workflow-status-categories-service.ts +0 -151
  176. package/src/openapi/platform/services/workflow-statuses-service.ts +0 -176
  177. package/src/openapi/platform/services/workflow-transition-properties-service.ts +0 -388
  178. package/src/openapi/platform/services/workflow-transition-rules-service.ts +0 -485
  179. package/src/openapi/platform/services/workflows-service.ts +0 -3477
  180. package/src/openapi/platform/validation-schema-storage.ts +0 -186
  181. package/src/openapi/software/base-jira-software-api-client.ts +0 -447
  182. package/src/openapi/software/core/common-http-client.ts +0 -723
  183. package/src/openapi/software/core/common-http-service.ts +0 -22
  184. package/src/openapi/software/core/common-validation-schema-storage.ts +0 -105
  185. package/src/openapi/software/models/board.ts +0 -918
  186. package/src/openapi/software/services/backlog-service.ts +0 -160
  187. package/src/openapi/software/services/board-service.ts +0 -4189
  188. package/src/openapi/software/services/builds-service.ts +0 -571
  189. package/src/openapi/software/services/deployments-service.ts +0 -403
  190. package/src/openapi/software/services/dev-ops-components-service.ts +0 -371
  191. package/src/openapi/software/services/development-information-service.ts +0 -2357
  192. package/src/openapi/software/services/epic-service.ts +0 -854
  193. package/src/openapi/software/services/feature-flags-service.ts +0 -303
  194. package/src/openapi/software/services/issue-service.ts +0 -529
  195. package/src/openapi/software/services/operations-service.ts +0 -741
  196. package/src/openapi/software/services/remote-links-service.ts +0 -653
  197. package/src/openapi/software/services/security-information-service.ts +0 -495
  198. package/src/openapi/software/services/sprint-service.ts +0 -969
  199. package/src/openapi/software/validation-schema-storage.ts +0 -186
  200. package/tsconfig.build.json +0 -7
  201. package/tsconfig.json +0 -4
@@ -1,679 +0,0 @@
1
- // DO NOT EDIT!
2
- // This file is generated by "api-typescript-generator".
3
- // To update this file run "yarn build:openapi".
4
- import { z } from "zod";
5
-
6
- import * as commonHttpClient from "../core/common-http-client";
7
- import { CommonHttpService } from "../core/common-http-service";
8
- import {
9
- type Avatar,
10
- type IssueTypeDetails,
11
- registerCommonValidationSchemas,
12
- } from "../models/common";
13
- import type {
14
- IssueTypeCreateBean,
15
- IssueTypeUpdateBean,
16
- } from "../models/issue-types";
17
- import { validationSchemaStorage } from "../validation-schema-storage";
18
- /**
19
- * This resource represents issues types. Use it to:
20
- *
21
- * * get, create, update, and delete issue types.
22
- * * get all issue types for a user.
23
- * * get alternative issue types.
24
- * * set an avatar for an issue type.
25
- */
26
- export class IssueTypesService extends CommonHttpService {
27
- /**
28
- * Creates an issue type and adds it to the default issue type scheme.
29
- *
30
- * **[Permissions](#permissions) required:** *Administer Jira* [global
31
- * permission](https://confluence.atlassian.com/x/x4dKLg).
32
- *
33
- * @returns Returned if the request is successful.
34
- * @path {POST} /rest/api/3/issuetype
35
- * @scopes-current manage:jira-configuration
36
- * @scopes-beta write:issue-type:jira, read:avatar:jira, read:issue-type:jira,
37
- * read:project-category:jira, read:project:jira
38
- */
39
- createIssueType({
40
- issueTypeCreateBean,
41
- }: {
42
- /**
43
- * @example {
44
- * "description": "description",
45
- * "name": "name",
46
- * "type": "standard"
47
- * }
48
- */
49
- issueTypeCreateBean: IssueTypeCreateBean;
50
- }): Promise<IssueTypeDetails> {
51
- return this.getClientInstance()
52
- .request({
53
- path: "/rest/api/3/issuetype",
54
- method: "POST",
55
- headers: {
56
- "Content-Type": "application/json",
57
- },
58
- body: issueTypeCreateBean,
59
- })
60
- .then(
61
- this.getClientInstance().responseHandler({
62
- 201: {
63
- "application/json": "json",
64
- },
65
- }),
66
- )
67
- .then(
68
- commonHttpClient.castResponse<{
69
- status: 201;
70
- mediaType: "application/json";
71
- body: IssueTypeDetails;
72
- }>(),
73
- )
74
- .then(
75
- validationSchemaStorage.validator(
76
- "IssueTypesService.createIssueType.response",
77
- ),
78
- )
79
- .then(commonHttpClient.getBody);
80
- }
81
- /**
82
- * Loads an avatar for the issue type.
83
- *
84
- * Specify the avatar's local file location in the body of the request. Also,
85
- * include the following headers:
86
- *
87
- * * `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the
88
- * request, for more information see [Special Headers](#special-request-headers).
89
- * * `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG.
90
- *
91
- * For example:
92
- * `curl --request POST \ --user email@example.com:<api_token> \ --header
93
- * 'X-Atlassian-Token: no-check' \ --header 'Content-Type: image/< image_type>' \
94
- * --data-binary "<@/path/to/file/with/your/avatar>" \ --url
95
- * 'https://your-domain.atlassian.net/rest/api/3/issuetype/{issueTypeId}'This`
96
- *
97
- * The avatar is cropped to a square. If no crop parameters are specified, the
98
- * square originates at the top left of the image. The length of the square's
99
- * sides is set to the smaller of the height or width of the image.
100
- *
101
- * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and
102
- * 48x48 in size.
103
- *
104
- * After creating the avatar, use [ Update issue
105
- * type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's displayed
106
- * avatar.
107
- *
108
- * **[Permissions](#permissions) required:** *Administer Jira* [global
109
- * permission](https://confluence.atlassian.com/x/x4dKLg).
110
- *
111
- * @returns Returned if the request is successful.
112
- *
113
- * example: {
114
- * "id": "1000",
115
- * "isDeletable": false,
116
- * "isSelected": false,
117
- * "isSystemAvatar": true,
118
- * "urls": {
119
- * "16x16": "/secure/useravatar?size=xsmall&avatarId=10040&avatarType=project",
120
- * "24x24": "/secure/useravatar?size=small&avatarId=10040&avatarType=project",
121
- * "32x32": "/secure/useravatar?size=medium&avatarId=10040&avatarType=project",
122
- * "48x48": "/secure/useravatar?avatarId=10040&avatarType=project"
123
- * }
124
- * }
125
- * @path {POST} /rest/api/3/issuetype/{id}/avatar2
126
- * @scopes-current manage:jira-configuration
127
- * @scopes-beta write:avatar:jira, write:issue-type:jira, read:avatar:jira
128
- */
129
- createIssueTypeAvatar({
130
- id,
131
- x,
132
- y,
133
- size,
134
- mediaType,
135
- requestBody,
136
- }: {
137
- /** The ID of the issue type. */
138
- id: string;
139
- /** The X coordinate of the top-left corner of the crop region. */
140
- x?: number;
141
- /** The Y coordinate of the top-left corner of the crop region. */
142
- y?: number;
143
- /** The length of each side of the crop region. */
144
- size: number;
145
- mediaType: string;
146
- requestBody: unknown;
147
- }): Promise<Avatar> {
148
- return this.getClientInstance()
149
- .request({
150
- path: "/rest/api/3/issuetype/{id}/avatar2",
151
- method: "POST",
152
- pathParams: {
153
- id,
154
- },
155
- query: {
156
- x,
157
- y,
158
- size,
159
- },
160
- headers: {
161
- "Content-Type": mediaType,
162
- },
163
- body: requestBody,
164
- })
165
- .then(
166
- this.getClientInstance().responseHandler({
167
- 201: {
168
- "application/json": "json",
169
- },
170
- }),
171
- )
172
- .then(
173
- commonHttpClient.castResponse<{
174
- status: 201;
175
- mediaType: "application/json";
176
- body: Avatar;
177
- }>(),
178
- )
179
- .then(
180
- validationSchemaStorage.validator(
181
- "IssueTypesService.createIssueTypeAvatar.response",
182
- ),
183
- )
184
- .then(commonHttpClient.getBody);
185
- }
186
- /**
187
- * Deletes the issue type. If the issue type is in use, all uses are updated with
188
- * the alternative issue type (`alternativeIssueTypeId`). A list of alternative
189
- * issue types are obtained from the [Get alternative issue
190
- * types](#api-rest-api-3-issuetype-id-alternatives-get) resource.
191
- *
192
- * **[Permissions](#permissions) required:** *Administer Jira* [global
193
- * permission](https://confluence.atlassian.com/x/x4dKLg).
194
- *
195
- * @path {DELETE} /rest/api/3/issuetype/{id}
196
- * @scopes-current manage:jira-configuration
197
- * @scopes-beta delete:issue-type:jira
198
- */
199
- deleteIssueType({
200
- id,
201
- alternativeIssueTypeId,
202
- }: {
203
- /** The ID of the issue type. */
204
- id: string;
205
- /** The ID of the replacement issue type. */
206
- alternativeIssueTypeId?: string;
207
- }): Promise<void> {
208
- return this.getClientInstance()
209
- .request({
210
- path: "/rest/api/3/issuetype/{id}",
211
- method: "DELETE",
212
- pathParams: {
213
- id,
214
- },
215
- query: {
216
- alternativeIssueTypeId,
217
- },
218
- })
219
- .then(commonHttpClient.discardResult);
220
- }
221
- /**
222
- * Returns a list of issue types that can be used to replace the issue type. The
223
- * alternative issue types are those assigned to the same workflow scheme, field
224
- * configuration scheme, and screen scheme.
225
- *
226
- * This operation can be accessed anonymously.
227
- *
228
- * **[Permissions](#permissions) required:** None.
229
- *
230
- * @returns Returned if the request is successful.
231
- *
232
- * example: [
233
- * {
234
- * "avatarId": 1,
235
- * "description": "A task that needs to be done.",
236
- * "hierarchyLevel": 0,
237
- * "iconUrl":
238
- * "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10299&avatarType=issuetype\",",
239
- * "id": "3",
240
- * "name": "Task",
241
- * "self": "https://your-domain.atlassian.net/rest/api/3/issueType/3",
242
- * "subtask": false
243
- * },
244
- * {
245
- * "avatarId": 10002,
246
- * "description": "A problem with the software.",
247
- * "entityId": "9d7dd6f7-e8b6-4247-954b-7b2c9b2a5ba2",
248
- * "hierarchyLevel": 0,
249
- * "iconUrl":
250
- * "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10316&avatarType=issuetype\",",
251
- * "id": "1",
252
- * "name": "Bug",
253
- * "scope": {
254
- * "project": {
255
- * "id": "10000"
256
- * },
257
- * "type": "PROJECT"
258
- * },
259
- * "self": "https://your-domain.atlassian.net/rest/api/3/issueType/1",
260
- * "subtask": false
261
- * }
262
- * ]
263
- * @path {GET} /rest/api/3/issuetype/{id}/alternatives
264
- * @scopes-current read:jira-work
265
- * @scopes-beta read:issue-type:jira, read:project-category:jira, read:project:jira,
266
- * read:avatar:jira
267
- */
268
- getAlternativeIssueTypes({
269
- id,
270
- }: {
271
- /** The ID of the issue type. */
272
- id: string;
273
- }): Promise<IssueTypeDetails[]> {
274
- return this.getClientInstance()
275
- .request({
276
- path: "/rest/api/3/issuetype/{id}/alternatives",
277
- method: "GET",
278
- pathParams: {
279
- id,
280
- },
281
- })
282
- .then(
283
- this.getClientInstance().responseHandler({
284
- 200: {
285
- "application/json": "json",
286
- },
287
- }),
288
- )
289
- .then(
290
- commonHttpClient.castResponse<{
291
- status: 200;
292
- mediaType: "application/json";
293
- body: IssueTypeDetails[];
294
- }>(),
295
- )
296
- .then(
297
- validationSchemaStorage.validator(
298
- "IssueTypesService.getAlternativeIssueTypes.response",
299
- ),
300
- )
301
- .then(commonHttpClient.getBody);
302
- }
303
- /**
304
- * Returns all issue types.
305
- *
306
- * This operation can be accessed anonymously.
307
- *
308
- * **[Permissions](#permissions) required:** Issue types are only returned as
309
- * follows:
310
- *
311
- * * if the user has the *Administer Jira* [global
312
- * permission](https://confluence.atlassian.com/x/x4dKLg), all issue types are
313
- * returned.
314
- * * if the user has the *Browse projects* [project
315
- * permission](https://confluence.atlassian.com/x/yodKLg) for one or more
316
- * projects, the issue types associated with the projects the user has permission
317
- * to browse are returned.
318
- *
319
- * @returns Returned if the request is successful.
320
- *
321
- * example: [
322
- * {
323
- * "avatarId": 1,
324
- * "description": "A task that needs to be done.",
325
- * "hierarchyLevel": 0,
326
- * "iconUrl":
327
- * "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10299&avatarType=issuetype\",",
328
- * "id": "3",
329
- * "name": "Task",
330
- * "self": "https://your-domain.atlassian.net/rest/api/3/issueType/3",
331
- * "subtask": false
332
- * },
333
- * {
334
- * "avatarId": 10002,
335
- * "description": "A problem with the software.",
336
- * "entityId": "9d7dd6f7-e8b6-4247-954b-7b2c9b2a5ba2",
337
- * "hierarchyLevel": 0,
338
- * "iconUrl":
339
- * "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10316&avatarType=issuetype\",",
340
- * "id": "1",
341
- * "name": "Bug",
342
- * "scope": {
343
- * "project": {
344
- * "id": "10000"
345
- * },
346
- * "type": "PROJECT"
347
- * },
348
- * "self": "https://your-domain.atlassian.net/rest/api/3/issueType/1",
349
- * "subtask": false
350
- * }
351
- * ]
352
- * @path {GET} /rest/api/3/issuetype
353
- * @scopes-current read:jira-work
354
- * @scopes-beta read:issue-type:jira, read:avatar:jira, read:project-category:jira,
355
- * read:project:jira
356
- */
357
- getIssueAllTypes(): Promise<IssueTypeDetails[]> {
358
- return this.getClientInstance()
359
- .request({
360
- path: "/rest/api/3/issuetype",
361
- method: "GET",
362
- })
363
- .then(
364
- this.getClientInstance().responseHandler({
365
- 200: {
366
- "application/json": "json",
367
- },
368
- }),
369
- )
370
- .then(
371
- commonHttpClient.castResponse<{
372
- status: 200;
373
- mediaType: "application/json";
374
- body: IssueTypeDetails[];
375
- }>(),
376
- )
377
- .then(
378
- validationSchemaStorage.validator(
379
- "IssueTypesService.getIssueAllTypes.response",
380
- ),
381
- )
382
- .then(commonHttpClient.getBody);
383
- }
384
- /**
385
- * Returns an issue type.
386
- *
387
- * This operation can be accessed anonymously.
388
- *
389
- * **[Permissions](#permissions) required:** *Browse projects* [project
390
- * permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue
391
- * type is associated with or *Administer Jira* [global
392
- * permission](https://confluence.atlassian.com/x/x4dKLg).
393
- *
394
- * @returns Returned if the request is successful.
395
- *
396
- * example: {
397
- * "avatarId": 1,
398
- * "description": "A task that needs to be done.",
399
- * "hierarchyLevel": 0,
400
- * "iconUrl":
401
- * "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10299&avatarType=issuetype\",",
402
- * "id": "3",
403
- * "name": "Task",
404
- * "self": "https://your-domain.atlassian.net/rest/api/3/issueType/3",
405
- * "subtask": false
406
- * }
407
- * @path {GET} /rest/api/3/issuetype/{id}
408
- * @scopes-current read:jira-work
409
- * @scopes-beta read:issue-type:jira, read:avatar:jira, read:project-category:jira,
410
- * read:project:jira
411
- */
412
- getIssueType({
413
- id,
414
- }: {
415
- /** The ID of the issue type. */
416
- id: string;
417
- }): Promise<IssueTypeDetails> {
418
- return this.getClientInstance()
419
- .request({
420
- path: "/rest/api/3/issuetype/{id}",
421
- method: "GET",
422
- pathParams: {
423
- id,
424
- },
425
- })
426
- .then(
427
- this.getClientInstance().responseHandler({
428
- 200: {
429
- "application/json": "json",
430
- },
431
- }),
432
- )
433
- .then(
434
- commonHttpClient.castResponse<{
435
- status: 200;
436
- mediaType: "application/json";
437
- body: IssueTypeDetails;
438
- }>(),
439
- )
440
- .then(
441
- validationSchemaStorage.validator(
442
- "IssueTypesService.getIssueType.response",
443
- ),
444
- )
445
- .then(commonHttpClient.getBody);
446
- }
447
- /**
448
- * Returns issue types for a project.
449
- *
450
- * This operation can be accessed anonymously.
451
- *
452
- * **[Permissions](#permissions) required:** *Browse projects* [project
453
- * permission](https://confluence.atlassian.com/x/yodKLg) in the relevant project
454
- * or *Administer Jira* [global
455
- * permission](https://confluence.atlassian.com/x/x4dKLg).
456
- *
457
- * @returns Returned if the request is successful.
458
- *
459
- * example: [
460
- * {
461
- * "avatarId": 10002,
462
- * "description": "A problem with the software.",
463
- * "entityId": "9d7dd6f7-e8b6-4247-954b-7b2c9b2a5ba2",
464
- * "hierarchyLevel": 0,
465
- * "iconUrl":
466
- * "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10316&avatarType=issuetype\",",
467
- * "id": "1",
468
- * "name": "Bug",
469
- * "scope": {
470
- * "project": {
471
- * "id": "10000"
472
- * },
473
- * "type": "PROJECT"
474
- * },
475
- * "self": "https://your-domain.atlassian.net/rest/api/3/issueType/1",
476
- * "subtask": false
477
- * },
478
- * {
479
- * "avatarId": 1,
480
- * "description": "A task that needs to be done.",
481
- * "hierarchyLevel": 0,
482
- * "iconUrl":
483
- * "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10299&avatarType=issuetype\",",
484
- * "id": "3",
485
- * "name": "Task",
486
- * "scope": {
487
- * "project": {
488
- * "id": "10000"
489
- * },
490
- * "type": "PROJECT"
491
- * },
492
- * "self": "https://your-domain.atlassian.net/rest/api/3/issueType/3",
493
- * "subtask": false
494
- * }
495
- * ]
496
- * @path {GET} /rest/api/3/issuetype/project
497
- * @scopes-current read:jira-work
498
- * @scopes-beta read:issue-type:jira, read:avatar:jira, read:project-category:jira,
499
- * read:project:jira
500
- */
501
- getIssueTypesForProject({
502
- projectId,
503
- level,
504
- }: {
505
- /** The ID of the project. */
506
- projectId: number;
507
- /**
508
- * The level of the issue type to filter by. Use:
509
- *
510
- * * `-1` for Subtask.
511
- * * `0` for Base.
512
- * * `1` for Epic.
513
- */
514
- level?: number;
515
- }): Promise<IssueTypeDetails[]> {
516
- return this.getClientInstance()
517
- .request({
518
- path: "/rest/api/3/issuetype/project",
519
- method: "GET",
520
- query: {
521
- projectId,
522
- level,
523
- },
524
- })
525
- .then(
526
- this.getClientInstance().responseHandler({
527
- 200: {
528
- "application/json": "json",
529
- },
530
- }),
531
- )
532
- .then(
533
- commonHttpClient.castResponse<{
534
- status: 200;
535
- mediaType: "application/json";
536
- body: IssueTypeDetails[];
537
- }>(),
538
- )
539
- .then(
540
- validationSchemaStorage.validator(
541
- "IssueTypesService.getIssueTypesForProject.response",
542
- ),
543
- )
544
- .then(commonHttpClient.getBody);
545
- }
546
- /**
547
- * Updates the issue type.
548
- *
549
- * **[Permissions](#permissions) required:** *Administer Jira* [global
550
- * permission](https://confluence.atlassian.com/x/x4dKLg).
551
- *
552
- * @returns Returned if the request is successful.
553
- * @path {PUT} /rest/api/3/issuetype/{id}
554
- * @scopes-current manage:jira-configuration
555
- * @scopes-beta write:issue-type:jira, read:avatar:jira, read:issue-type:jira,
556
- * read:project-category:jira, read:project:jira
557
- */
558
- updateIssueType({
559
- id,
560
- issueTypeUpdateBean,
561
- }: {
562
- /** The ID of the issue type. */
563
- id: string;
564
- /**
565
- * @example {
566
- * "avatarId": 1,
567
- * "description": "description",
568
- * "name": "name"
569
- * }
570
- */
571
- issueTypeUpdateBean: IssueTypeUpdateBean;
572
- }): Promise<IssueTypeDetails> {
573
- return this.getClientInstance()
574
- .request({
575
- path: "/rest/api/3/issuetype/{id}",
576
- method: "PUT",
577
- pathParams: {
578
- id,
579
- },
580
- headers: {
581
- "Content-Type": "application/json",
582
- },
583
- body: issueTypeUpdateBean,
584
- })
585
- .then(
586
- this.getClientInstance().responseHandler({
587
- 200: {
588
- "application/json": "json",
589
- },
590
- }),
591
- )
592
- .then(
593
- commonHttpClient.castResponse<{
594
- status: 200;
595
- mediaType: "application/json";
596
- body: IssueTypeDetails;
597
- }>(),
598
- )
599
- .then(
600
- validationSchemaStorage.validator(
601
- "IssueTypesService.updateIssueType.response",
602
- ),
603
- )
604
- .then(commonHttpClient.getBody);
605
- }
606
- static initialize() {
607
- validationSchemaStorage.registerExtensible(
608
- "IssueTypesService.getIssueAllTypes.response",
609
- z
610
- .object({
611
- status: z.literal(200),
612
- mediaType: z.literal("application/json"),
613
- body: z.array(validationSchemaStorage.lazy("IssueTypeDetails")),
614
- })
615
- .describe("IssueTypesService.getIssueAllTypes.response"),
616
- );
617
- validationSchemaStorage.registerExtensible(
618
- "IssueTypesService.createIssueType.response",
619
- z
620
- .object({
621
- status: z.literal(201),
622
- mediaType: z.literal("application/json"),
623
- body: validationSchemaStorage.lazy("IssueTypeDetails"),
624
- })
625
- .describe("IssueTypesService.createIssueType.response"),
626
- );
627
- validationSchemaStorage.registerExtensible(
628
- "IssueTypesService.getIssueType.response",
629
- z
630
- .object({
631
- status: z.literal(200),
632
- mediaType: z.literal("application/json"),
633
- body: validationSchemaStorage.lazy("IssueTypeDetails"),
634
- })
635
- .describe("IssueTypesService.getIssueType.response"),
636
- );
637
- validationSchemaStorage.registerExtensible(
638
- "IssueTypesService.updateIssueType.response",
639
- z
640
- .object({
641
- status: z.literal(200),
642
- mediaType: z.literal("application/json"),
643
- body: validationSchemaStorage.lazy("IssueTypeDetails"),
644
- })
645
- .describe("IssueTypesService.updateIssueType.response"),
646
- );
647
- validationSchemaStorage.registerExtensible(
648
- "IssueTypesService.getAlternativeIssueTypes.response",
649
- z
650
- .object({
651
- status: z.literal(200),
652
- mediaType: z.literal("application/json"),
653
- body: z.array(validationSchemaStorage.lazy("IssueTypeDetails")),
654
- })
655
- .describe("IssueTypesService.getAlternativeIssueTypes.response"),
656
- );
657
- validationSchemaStorage.registerExtensible(
658
- "IssueTypesService.createIssueTypeAvatar.response",
659
- z
660
- .object({
661
- status: z.literal(201),
662
- mediaType: z.literal("application/json"),
663
- body: validationSchemaStorage.lazy("Avatar"),
664
- })
665
- .describe("IssueTypesService.createIssueTypeAvatar.response"),
666
- );
667
- validationSchemaStorage.registerExtensible(
668
- "IssueTypesService.getIssueTypesForProject.response",
669
- z
670
- .object({
671
- status: z.literal(200),
672
- mediaType: z.literal("application/json"),
673
- body: z.array(validationSchemaStorage.lazy("IssueTypeDetails")),
674
- })
675
- .describe("IssueTypesService.getIssueTypesForProject.response"),
676
- );
677
- validationSchemaStorage.registerOnce([registerCommonValidationSchemas]);
678
- }
679
- }