@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,498 +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 JiraStatus,
10
- type PageOfStatuses,
11
- registerStatusValidationSchemas,
12
- type StatusCreateRequest,
13
- type StatusUpdateRequest,
14
- } from "../models/status";
15
- import { validationSchemaStorage } from "../validation-schema-storage";
16
- /**
17
- * This resource represents statuses. Use it to search, get, create, delete, and
18
- * change statuses.
19
- */
20
- export class StatusService extends CommonHttpService {
21
- /**
22
- * Creates statuses for a global or project scope.
23
- *
24
- * **[Permissions](#permissions) required:**
25
- *
26
- * * *Administer projects* [project
27
- * permission.](https://confluence.atlassian.com/x/yodKLg)
28
- * * *Administer Jira* [project
29
- * permission.](https://confluence.atlassian.com/x/yodKLg)
30
- *
31
- * @returns Returned if the request is successful.
32
- *
33
- * example: [
34
- * {
35
- * "description": "The issue is resolved",
36
- * "id": "1000",
37
- * "name": "Finished",
38
- * "scope": {
39
- * "project": {
40
- * "id": "1"
41
- * },
42
- * "type": "PROJECT"
43
- * },
44
- * "statusCategory": "DONE",
45
- * "usages": [],
46
- * "workflowUsages": []
47
- * }
48
- * ]
49
- * @path {POST} /rest/api/3/statuses
50
- * @scopes-current manage:jira-configuration
51
- * @scopes-beta write:workflow:jira
52
- */
53
- createStatuses({
54
- statusCreateRequest,
55
- }: {
56
- /**
57
- * Details of the statuses being created and their scope.
58
- *
59
- * @example {
60
- * "scope": {
61
- * "project": {
62
- * "id": "1"
63
- * },
64
- * "type": "PROJECT"
65
- * },
66
- * "statuses": [
67
- * {
68
- * "description": "The issue is resolved",
69
- * "name": "Finished",
70
- * "statusCategory": "DONE"
71
- * }
72
- * ]
73
- * }
74
- */
75
- statusCreateRequest: StatusCreateRequest;
76
- }): Promise<JiraStatus[]> {
77
- return this.getClientInstance()
78
- .request({
79
- path: "/rest/api/3/statuses",
80
- method: "POST",
81
- headers: {
82
- "Content-Type": "application/json",
83
- },
84
- body: statusCreateRequest,
85
- })
86
- .then(
87
- this.getClientInstance().responseHandler({
88
- 200: {
89
- "application/json": "json",
90
- },
91
- }),
92
- )
93
- .then(
94
- commonHttpClient.castResponse<{
95
- status: 200;
96
- mediaType: "application/json";
97
- body: JiraStatus[];
98
- }>(),
99
- )
100
- .then(
101
- validationSchemaStorage.validator(
102
- "StatusService.createStatuses.response",
103
- ),
104
- )
105
- .then(commonHttpClient.getBody);
106
- }
107
- /**
108
- * Deletes statuses by ID.
109
- *
110
- * **[Permissions](#permissions) required:**
111
- *
112
- * * *Administer projects* [project
113
- * permission.](https://confluence.atlassian.com/x/yodKLg)
114
- * * *Administer Jira* [project
115
- * permission.](https://confluence.atlassian.com/x/yodKLg)
116
- *
117
- * @returns Returned if the request is successful.
118
- * @path {DELETE} /rest/api/3/statuses
119
- * @scopes-current manage:jira-configuration
120
- * @scopes-beta write:workflow:jira
121
- */
122
- deleteStatusesById({
123
- id,
124
- }: {
125
- /**
126
- * The list of status IDs. To include multiple IDs, provide an ampersand-separated
127
- * list. For example, id=10000&id=10001.
128
- *
129
- * Min items `1`, Max items `50`
130
- */
131
- id: string[];
132
- }): Promise<void> {
133
- return this.getClientInstance()
134
- .request({
135
- path: "/rest/api/3/statuses",
136
- method: "DELETE",
137
- query: {
138
- id,
139
- },
140
- })
141
- .then(
142
- this.getClientInstance().responseHandler({
143
- 204: {
144
- "application/json": "json",
145
- },
146
- }),
147
- )
148
- .then(
149
- commonHttpClient.castResponse<{
150
- status: 204;
151
- mediaType: "application/json";
152
- body: void;
153
- }>(),
154
- )
155
- .then(
156
- validationSchemaStorage.validator(
157
- "StatusService.deleteStatusesById.response",
158
- ),
159
- )
160
- .then(commonHttpClient.getBody);
161
- }
162
- /**
163
- * Returns a list of the statuses specified by one or more status IDs.
164
- *
165
- * **[Permissions](#permissions) required:**
166
- *
167
- * * *Administer projects* [project
168
- * permission.](https://confluence.atlassian.com/x/yodKLg)
169
- * * *Administer Jira* [project
170
- * permission.](https://confluence.atlassian.com/x/yodKLg)
171
- *
172
- * @returns Returned if the request is successful.
173
- *
174
- * example: [
175
- * {
176
- * "description": "The issue is resolved",
177
- * "id": "1000",
178
- * "name": "Finished",
179
- * "scope": {
180
- * "project": {
181
- * "id": "1"
182
- * },
183
- * "type": "PROJECT"
184
- * },
185
- * "statusCategory": "DONE",
186
- * "usages": [
187
- * {
188
- * "issueTypes": [
189
- * "10002"
190
- * ],
191
- * "project": {
192
- * "id": "1"
193
- * }
194
- * }
195
- * ],
196
- * "workflowUsages": [
197
- * {
198
- * "workflowId": "545d80a3-91ff-4949-8b0d-a2bc484e70e5",
199
- * "workflowName": "Workflow 1"
200
- * }
201
- * ]
202
- * }
203
- * ]
204
- * @path {GET} /rest/api/3/statuses
205
- * @scopes-current manage:jira-configuration
206
- * @scopes-beta read:workflow:jira
207
- */
208
- getStatusesById({
209
- expand,
210
- id,
211
- }: {
212
- /**
213
- * Use [expand](#expansion) to include additional information in the response.
214
- * This parameter accepts a comma-separated list. Expand options include:
215
- *
216
- * * `usages` Returns the project and issue types that use the status in their
217
- * workflow.
218
- * * `workflowUsages` Returns the workflows that use the status.
219
- */
220
- expand?: string;
221
- /**
222
- * The list of status IDs. To include multiple IDs, provide an ampersand-separated
223
- * list. For example, id=10000&id=10001.
224
- *
225
- * Min items `1`, Max items `50`
226
- */
227
- id: string[];
228
- }): Promise<JiraStatus[]> {
229
- return this.getClientInstance()
230
- .request({
231
- path: "/rest/api/3/statuses",
232
- method: "GET",
233
- query: {
234
- expand,
235
- id,
236
- },
237
- })
238
- .then(
239
- this.getClientInstance().responseHandler({
240
- 200: {
241
- "application/json": "json",
242
- },
243
- }),
244
- )
245
- .then(
246
- commonHttpClient.castResponse<{
247
- status: 200;
248
- mediaType: "application/json";
249
- body: JiraStatus[];
250
- }>(),
251
- )
252
- .then(
253
- validationSchemaStorage.validator(
254
- "StatusService.getStatusesById.response",
255
- ),
256
- )
257
- .then(commonHttpClient.getBody);
258
- }
259
- /**
260
- * Returns a
261
- * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination)
262
- * list of statuses that match a search on name or project.
263
- *
264
- * **[Permissions](#permissions) required:**
265
- *
266
- * * *Administer projects* [project
267
- * permission.](https://confluence.atlassian.com/x/yodKLg)
268
- * * *Administer Jira* [project
269
- * permission.](https://confluence.atlassian.com/x/yodKLg)
270
- *
271
- * @returns Returned if the request is successful.
272
- *
273
- * example: {
274
- * "isLast": true,
275
- * "maxResults": 2,
276
- * "nextPage":
277
- * "https://your-domain.atlassian.net/rest/api/3/statuses/search?startAt=2&maxResults=2",
278
- * "self":
279
- * "https://your-domain.atlassian.net/rest/api/3/statuses/search?startAt=0&maxResults=2",
280
- * "startAt": 0,
281
- * "total": 5,
282
- * "values": [
283
- * {
284
- * "description": "The issue is resolved",
285
- * "id": "1000",
286
- * "name": "Finished",
287
- * "scope": {
288
- * "project": {
289
- * "id": "1"
290
- * },
291
- * "type": "PROJECT"
292
- * },
293
- * "statusCategory": "DONE",
294
- * "usages": [
295
- * {
296
- * "issueTypes": [
297
- * "10002"
298
- * ],
299
- * "project": {
300
- * "id": "1"
301
- * }
302
- * }
303
- * ],
304
- * "workflowUsages": [
305
- * {
306
- * "workflowId": "545d80a3-91ff-4949-8b0d-a2bc484e70e5",
307
- * "workflowName": "Workflow 1"
308
- * }
309
- * ]
310
- * }
311
- * ]
312
- * }
313
- * @path {GET} /rest/api/3/statuses/search
314
- * @scopes-current manage:jira-configuration
315
- * @scopes-beta read:workflow:jira
316
- */
317
- search({
318
- expand,
319
- projectId,
320
- startAt,
321
- maxResults,
322
- searchString,
323
- statusCategory,
324
- }: {
325
- /**
326
- * Use [expand](#expansion) to include additional information in the response.
327
- * This parameter accepts a comma-separated list. Expand options include:
328
- *
329
- * * `usages` Returns the project and issue types that use the status in their
330
- * workflow.
331
- * * `workflowUsages` Returns the workflows that use the status.
332
- */
333
- expand?: string;
334
- /** The project the status is part of or null for global statuses. */
335
- projectId?: string;
336
- /** The index of the first item to return in a page of results (page offset). */
337
- startAt?: number;
338
- /** The maximum number of items to return per page. */
339
- maxResults?: number;
340
- /**
341
- * Term to match status names against or null to search for all statuses in the
342
- * search scope.
343
- */
344
- searchString?: string;
345
- /**
346
- * Category of the status to filter by. The supported values are: `TODO`,
347
- * `IN_PROGRESS`, and `DONE`.
348
- */
349
- statusCategory?: string;
350
- }): Promise<PageOfStatuses> {
351
- return this.getClientInstance()
352
- .request({
353
- path: "/rest/api/3/statuses/search",
354
- method: "GET",
355
- query: {
356
- expand,
357
- projectId,
358
- startAt,
359
- maxResults,
360
- searchString,
361
- statusCategory,
362
- },
363
- })
364
- .then(
365
- this.getClientInstance().responseHandler({
366
- 200: {
367
- "application/json": "json",
368
- },
369
- }),
370
- )
371
- .then(
372
- commonHttpClient.castResponse<{
373
- status: 200;
374
- mediaType: "application/json";
375
- body: PageOfStatuses;
376
- }>(),
377
- )
378
- .then(validationSchemaStorage.validator("StatusService.search.response"))
379
- .then(commonHttpClient.getBody);
380
- }
381
- /**
382
- * Updates statuses by ID.
383
- *
384
- * **[Permissions](#permissions) required:**
385
- *
386
- * * *Administer projects* [project
387
- * permission.](https://confluence.atlassian.com/x/yodKLg)
388
- * * *Administer Jira* [project
389
- * permission.](https://confluence.atlassian.com/x/yodKLg)
390
- *
391
- * @returns Returned if the request is successful.
392
- * @path {PUT} /rest/api/3/statuses
393
- * @scopes-current manage:jira-configuration
394
- * @scopes-beta write:workflow:jira
395
- */
396
- updateStatuses({
397
- statusUpdateRequest,
398
- }: {
399
- /**
400
- * The list of statuses that will be updated.
401
- *
402
- * @example {
403
- * "statuses": [
404
- * {
405
- * "description": "The issue is resolved",
406
- * "id": "1000",
407
- * "name": "Finished",
408
- * "statusCategory": "DONE"
409
- * }
410
- * ]
411
- * }
412
- */
413
- statusUpdateRequest: StatusUpdateRequest;
414
- }): Promise<void> {
415
- return this.getClientInstance()
416
- .request({
417
- path: "/rest/api/3/statuses",
418
- method: "PUT",
419
- headers: {
420
- "Content-Type": "application/json",
421
- },
422
- body: statusUpdateRequest,
423
- })
424
- .then(
425
- this.getClientInstance().responseHandler({
426
- 204: {
427
- "application/json": "json",
428
- },
429
- }),
430
- )
431
- .then(
432
- commonHttpClient.castResponse<{
433
- status: 204;
434
- mediaType: "application/json";
435
- body: void;
436
- }>(),
437
- )
438
- .then(
439
- validationSchemaStorage.validator(
440
- "StatusService.updateStatuses.response",
441
- ),
442
- )
443
- .then(commonHttpClient.getBody);
444
- }
445
- static initialize() {
446
- validationSchemaStorage.registerExtensible(
447
- "StatusService.getStatusesById.response",
448
- z
449
- .object({
450
- status: z.literal(200),
451
- mediaType: z.literal("application/json"),
452
- body: z.array(validationSchemaStorage.lazy("JiraStatus")),
453
- })
454
- .describe("StatusService.getStatusesById.response"),
455
- );
456
- validationSchemaStorage.registerExtensible(
457
- "StatusService.updateStatuses.response",
458
- z
459
- .object({
460
- status: z.literal(204),
461
- mediaType: z.literal("application/json"),
462
- body: z.unknown(),
463
- })
464
- .describe("StatusService.updateStatuses.response"),
465
- );
466
- validationSchemaStorage.registerExtensible(
467
- "StatusService.createStatuses.response",
468
- z
469
- .object({
470
- status: z.literal(200),
471
- mediaType: z.literal("application/json"),
472
- body: z.array(validationSchemaStorage.lazy("JiraStatus")),
473
- })
474
- .describe("StatusService.createStatuses.response"),
475
- );
476
- validationSchemaStorage.registerExtensible(
477
- "StatusService.deleteStatusesById.response",
478
- z
479
- .object({
480
- status: z.literal(204),
481
- mediaType: z.literal("application/json"),
482
- body: z.unknown(),
483
- })
484
- .describe("StatusService.deleteStatusesById.response"),
485
- );
486
- validationSchemaStorage.registerExtensible(
487
- "StatusService.search.response",
488
- z
489
- .object({
490
- status: z.literal(200),
491
- mediaType: z.literal("application/json"),
492
- body: validationSchemaStorage.lazy("PageOfStatuses"),
493
- })
494
- .describe("StatusService.search.response"),
495
- );
496
- validationSchemaStorage.registerOnce([registerStatusValidationSchemas]);
497
- }
498
- }
@@ -1,159 +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
- registerCommonValidationSchemas,
10
- type TaskProgressBeanObject,
11
- } from "../models/common";
12
- import { validationSchemaStorage } from "../validation-schema-storage";
13
- /**
14
- * This resource represents a [long-running asynchronous
15
- * tasks](#async-operations). Use it to obtain details about the progress of a
16
- * long-running task or cancel a long-running task.
17
- */
18
- export class TasksService extends CommonHttpService {
19
- /**
20
- * Cancels a task.
21
- *
22
- * **[Permissions](#permissions) required:** either of:
23
- *
24
- * * *Administer Jira* [global
25
- * permission](https://confluence.atlassian.com/x/x4dKLg).
26
- * * Creator of the task.
27
- *
28
- * @returns Returned if the request is successful.
29
- * @path {POST} /rest/api/3/task/{taskId}/cancel
30
- * @scopes-current write:jira-work
31
- * @scopes-beta delete:async-task:jira
32
- */
33
- cancelTask({
34
- taskId,
35
- }: {
36
- /** The ID of the task. */
37
- taskId: string;
38
- }): Promise<unknown> {
39
- return this.getClientInstance()
40
- .request({
41
- path: "/rest/api/3/task/{taskId}/cancel",
42
- method: "POST",
43
- pathParams: {
44
- taskId,
45
- },
46
- })
47
- .then(
48
- this.getClientInstance().responseHandler({
49
- 202: {
50
- "application/json": "json",
51
- },
52
- }),
53
- )
54
- .then(
55
- commonHttpClient.castResponse<{
56
- status: 202;
57
- mediaType: "application/json";
58
- body: unknown;
59
- }>(),
60
- )
61
- .then(
62
- validationSchemaStorage.validator("TasksService.cancelTask.response"),
63
- )
64
- .then(commonHttpClient.getBody);
65
- }
66
- /**
67
- * Returns the status of a [long-running asynchronous task](#async).
68
- *
69
- * When a task has finished, this operation returns the JSON blob applicable to
70
- * the task. See the documentation of the operation that created the task for
71
- * details. Task details are not permanently retained. As of September 2019,
72
- * details are retained for 14 days although this period may change without notice.
73
- *
74
- * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June
75
- * 15, 2024.
76
- *
77
- * * `read:jira-work`
78
- *
79
- * **[Permissions](#permissions) required:** either of:
80
- *
81
- * * *Administer Jira* [global
82
- * permission](https://confluence.atlassian.com/x/x4dKLg).
83
- * * Creator of the task.
84
- *
85
- * @returns Returned if the request is successful.
86
- *
87
- * example: {
88
- * "self": "https://your-domain.atlassian.net/rest/api/3/task/1",
89
- * "id": "1",
90
- * "description": "Task description",
91
- * "status": "COMPLETE",
92
- * "result": "the task result, this may be any JSON",
93
- * "submittedBy": 10000,
94
- * "progress": 100,
95
- * "elapsedRuntime": 156,
96
- * "submitted": 1501708132800,
97
- * "started": 1501708132900,
98
- * "finished": 1501708133000,
99
- * "lastUpdate": 1501708133000
100
- * }
101
- * @path {GET} /rest/api/3/task/{taskId}
102
- * @scopes-current read:jira-work
103
- * @scopes-beta
104
- */
105
- getTask({
106
- taskId,
107
- }: {
108
- /** The ID of the task. */
109
- taskId: string;
110
- }): Promise<TaskProgressBeanObject> {
111
- return this.getClientInstance()
112
- .request({
113
- path: "/rest/api/3/task/{taskId}",
114
- method: "GET",
115
- pathParams: {
116
- taskId,
117
- },
118
- })
119
- .then(
120
- this.getClientInstance().responseHandler({
121
- 200: {
122
- "application/json": "json",
123
- },
124
- }),
125
- )
126
- .then(
127
- commonHttpClient.castResponse<{
128
- status: 200;
129
- mediaType: "application/json";
130
- body: TaskProgressBeanObject;
131
- }>(),
132
- )
133
- .then(validationSchemaStorage.validator("TasksService.getTask.response"))
134
- .then(commonHttpClient.getBody);
135
- }
136
- static initialize() {
137
- validationSchemaStorage.registerExtensible(
138
- "TasksService.getTask.response",
139
- z
140
- .object({
141
- status: z.literal(200),
142
- mediaType: z.literal("application/json"),
143
- body: validationSchemaStorage.lazy("TaskProgressBeanObject"),
144
- })
145
- .describe("TasksService.getTask.response"),
146
- );
147
- validationSchemaStorage.registerExtensible(
148
- "TasksService.cancelTask.response",
149
- z
150
- .object({
151
- status: z.literal(202),
152
- mediaType: z.literal("application/json"),
153
- body: z.unknown(),
154
- })
155
- .describe("TasksService.cancelTask.response"),
156
- );
157
- validationSchemaStorage.registerOnce([registerCommonValidationSchemas]);
158
- }
159
- }