@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,221 +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
- registerIssueVotesValidationSchemas,
10
- type Votes,
11
- } from "../models/issue-votes";
12
- import { validationSchemaStorage } from "../validation-schema-storage";
13
- /**
14
- * This resource represents votes cast by users on an issue. Use it to get details
15
- * of votes on an issue as well as cast and withdrawal votes.
16
- */
17
- export class IssueVotesService extends CommonHttpService {
18
- /**
19
- * Adds the user's vote to an issue. This is the equivalent of the user clicking
20
- * *Vote* on an issue in Jira.
21
- *
22
- * This operation requires the **Allow users to vote on issues** option to be
23
- * *ON*. This option is set in General configuration for Jira. See [Configuring
24
- * Jira application options](https://confluence.atlassian.com/x/uYXKM) for details.
25
- *
26
- * **[Permissions](#permissions) required:**
27
- *
28
- * * *Browse projects* [project
29
- * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the
30
- * issue is in.
31
- * * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is
32
- * configured, issue-level security permission to view the issue.
33
- *
34
- * @returns Returned if the request is successful.
35
- * @path {POST} /rest/api/3/issue/{issueIdOrKey}/votes
36
- * @scopes-current write:jira-work
37
- * @scopes-beta write:issue.vote:jira
38
- */
39
- addVote({
40
- issueIdOrKey,
41
- }: {
42
- /** The ID or key of the issue. */
43
- issueIdOrKey: string;
44
- }): Promise<void> {
45
- return this.getClientInstance()
46
- .request({
47
- path: "/rest/api/3/issue/{issueIdOrKey}/votes",
48
- method: "POST",
49
- pathParams: {
50
- issueIdOrKey,
51
- },
52
- })
53
- .then(
54
- this.getClientInstance().responseHandler({
55
- 204: {
56
- "application/json": "json",
57
- },
58
- }),
59
- )
60
- .then(
61
- commonHttpClient.castResponse<{
62
- status: 204;
63
- mediaType: "application/json";
64
- body: void;
65
- }>(),
66
- )
67
- .then(
68
- validationSchemaStorage.validator("IssueVotesService.addVote.response"),
69
- )
70
- .then(commonHttpClient.getBody);
71
- }
72
- /**
73
- * Returns details about the votes on an issue.
74
- *
75
- * This operation requires the **Allow users to vote on issues** option to be
76
- * *ON*. This option is set in General configuration for Jira. See [Configuring
77
- * Jira application options](https://confluence.atlassian.com/x/uYXKM) for details.
78
- *
79
- * This operation can be accessed anonymously.
80
- *
81
- * **[Permissions](#permissions) required:**
82
- *
83
- * * *Browse projects* [project
84
- * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the
85
- * issue is ini
86
- * * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is
87
- * configured, issue-level security permission to view the issue.
88
- *
89
- * Note that users with the necessary permissions for this operation but without
90
- * the *View voters and watchers* project permissions are not returned details in
91
- * the `voters` field.
92
- *
93
- * @returns Returned if the request is successful.
94
- *
95
- * example: {
96
- * "hasVoted": true,
97
- * "self": "https://your-domain.atlassian.net/rest/api/issue/MKY-1/votes",
98
- * "voters": [
99
- * {
100
- * "accountId": "5b10a2844c20165700ede21g",
101
- * "accountType": "atlassian",
102
- * "active": false,
103
- * "avatarUrls": {
104
- * "16x16":
105
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
106
- * "24x24":
107
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
108
- * "32x32":
109
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
110
- * "48x48":
111
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
112
- * },
113
- * "displayName": "Mia Krystof",
114
- * "key": "",
115
- * "name": "",
116
- * "self":
117
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
118
- * }
119
- * ],
120
- * "votes": 24
121
- * }
122
- * @path {GET} /rest/api/3/issue/{issueIdOrKey}/votes
123
- * @scopes-current read:jira-work
124
- * @scopes-beta read:issue.vote:jira, read:user:jira, read:application-role:jira,
125
- * read:avatar:jira, read:group:jira
126
- */
127
- getVotes({
128
- issueIdOrKey,
129
- }: {
130
- /** The ID or key of the issue. */
131
- issueIdOrKey: string;
132
- }): Promise<Votes> {
133
- return this.getClientInstance()
134
- .request({
135
- path: "/rest/api/3/issue/{issueIdOrKey}/votes",
136
- method: "GET",
137
- pathParams: {
138
- issueIdOrKey,
139
- },
140
- })
141
- .then(
142
- this.getClientInstance().responseHandler({
143
- 200: {
144
- "application/json": "json",
145
- },
146
- }),
147
- )
148
- .then(
149
- commonHttpClient.castResponse<{
150
- status: 200;
151
- mediaType: "application/json";
152
- body: Votes;
153
- }>(),
154
- )
155
- .then(
156
- validationSchemaStorage.validator(
157
- "IssueVotesService.getVotes.response",
158
- ),
159
- )
160
- .then(commonHttpClient.getBody);
161
- }
162
- /**
163
- * Deletes a user's vote from an issue. This is the equivalent of the user
164
- * clicking *Unvote* on an issue in Jira.
165
- *
166
- * This operation requires the **Allow users to vote on issues** option to be
167
- * *ON*. This option is set in General configuration for Jira. See [Configuring
168
- * Jira application options](https://confluence.atlassian.com/x/uYXKM) for details.
169
- *
170
- * **[Permissions](#permissions) required:**
171
- *
172
- * * *Browse projects* [project
173
- * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the
174
- * issue is in.
175
- * * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is
176
- * configured, issue-level security permission to view the issue.
177
- *
178
- * @path {DELETE} /rest/api/3/issue/{issueIdOrKey}/votes
179
- * @scopes-current write:jira-work
180
- * @scopes-beta write:issue.vote:jira
181
- */
182
- removeVote({
183
- issueIdOrKey,
184
- }: {
185
- /** The ID or key of the issue. */
186
- issueIdOrKey: string;
187
- }): Promise<void> {
188
- return this.getClientInstance()
189
- .request({
190
- path: "/rest/api/3/issue/{issueIdOrKey}/votes",
191
- method: "DELETE",
192
- pathParams: {
193
- issueIdOrKey,
194
- },
195
- })
196
- .then(commonHttpClient.discardResult);
197
- }
198
- static initialize() {
199
- validationSchemaStorage.registerExtensible(
200
- "IssueVotesService.getVotes.response",
201
- z
202
- .object({
203
- status: z.literal(200),
204
- mediaType: z.literal("application/json"),
205
- body: validationSchemaStorage.lazy("Votes"),
206
- })
207
- .describe("IssueVotesService.getVotes.response"),
208
- );
209
- validationSchemaStorage.registerExtensible(
210
- "IssueVotesService.addVote.response",
211
- z
212
- .object({
213
- status: z.literal(204),
214
- mediaType: z.literal("application/json"),
215
- body: z.unknown(),
216
- })
217
- .describe("IssueVotesService.addVote.response"),
218
- );
219
- validationSchemaStorage.registerOnce([registerIssueVotesValidationSchemas]);
220
- }
221
- }
@@ -1,331 +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 BulkIssueIsWatching,
10
- type IssueList,
11
- registerIssueWatchersValidationSchemas,
12
- type Watchers,
13
- } from "../models/issue-watchers";
14
- import { validationSchemaStorage } from "../validation-schema-storage";
15
- /**
16
- * This resource represents users watching an issue. Use it to get details of
17
- * users watching an issue as well as start and stop a user watching an issue.
18
- */
19
- export class IssueWatchersService extends CommonHttpService {
20
- /**
21
- * Adds a user as a watcher of an issue by passing the account ID of the user. For
22
- * example, `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user
23
- * is added.
24
- *
25
- * This operation requires the **Allow users to watch issues** option to be *ON*.
26
- * This option is set in General configuration for Jira. See [Configuring Jira
27
- * application options](https://confluence.atlassian.com/x/uYXKM) for details.
28
- *
29
- * **[Permissions](#permissions) required:**
30
- *
31
- * * *Browse projects* [project
32
- * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the
33
- * issue is in.
34
- * * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is
35
- * configured, issue-level security permission to view the issue.
36
- * * To add users other than themselves to the watchlist, *Manage watcher list*
37
- * [project permission](https://confluence.atlassian.com/x/yodKLg) for the project
38
- * that the issue is in.
39
- *
40
- * @returns Returned if the request is successful.
41
- * @path {POST} /rest/api/3/issue/{issueIdOrKey}/watchers
42
- * @scopes-current write:jira-work
43
- * @scopes-beta write:issue.watcher:jira
44
- */
45
- addWatcher({
46
- issueIdOrKey,
47
- requestBody,
48
- }: {
49
- /** The ID or key of the issue. */
50
- issueIdOrKey: string;
51
- /**
52
- * The account ID of the user. Note that username cannot be used due to privacy
53
- * changes.
54
- */
55
- requestBody: string;
56
- }): Promise<void> {
57
- return this.getClientInstance()
58
- .request({
59
- path: "/rest/api/3/issue/{issueIdOrKey}/watchers",
60
- method: "POST",
61
- pathParams: {
62
- issueIdOrKey,
63
- },
64
- headers: {
65
- "Content-Type": "application/json",
66
- },
67
- body: requestBody,
68
- })
69
- .then(
70
- this.getClientInstance().responseHandler({
71
- 204: {
72
- "application/json": "json",
73
- },
74
- }),
75
- )
76
- .then(
77
- commonHttpClient.castResponse<{
78
- status: 204;
79
- mediaType: "application/json";
80
- body: void;
81
- }>(),
82
- )
83
- .then(
84
- validationSchemaStorage.validator(
85
- "IssueWatchersService.addWatcher.response",
86
- ),
87
- )
88
- .then(commonHttpClient.getBody);
89
- }
90
- /**
91
- * Returns the watchers for an issue.
92
- *
93
- * This operation requires the **Allow users to watch issues** option to be *ON*.
94
- * This option is set in General configuration for Jira. See [Configuring Jira
95
- * application options](https://confluence.atlassian.com/x/uYXKM) for details.
96
- *
97
- * This operation can be accessed anonymously.
98
- *
99
- * **[Permissions](#permissions) required:**
100
- *
101
- * * *Browse projects* [project
102
- * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the
103
- * issue is ini
104
- * * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is
105
- * configured, issue-level security permission to view the issue.
106
- * * To see details of users on the watchlist other than themselves, *View
107
- * voters and watchers* [project
108
- * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the
109
- * issue is in.
110
- *
111
- * @returns Returned if the request is successful
112
- *
113
- * example: {
114
- * "isWatching": false,
115
- * "self": "https://your-domain.atlassian.net/rest/api/3/issue/EX-1/watchers",
116
- * "watchCount": 1,
117
- * "watchers": [
118
- * {
119
- * "accountId": "5b10a2844c20165700ede21g",
120
- * "active": false,
121
- * "displayName": "Mia Krystof",
122
- * "self":
123
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
124
- * }
125
- * ]
126
- * }
127
- * @path {GET} /rest/api/3/issue/{issueIdOrKey}/watchers
128
- * @scopes-current read:jira-work
129
- * @scopes-beta read:issue.watcher:jira, read:user:jira, read:avatar:jira
130
- */
131
- getIssueWatchers({
132
- issueIdOrKey,
133
- }: {
134
- /** The ID or key of the issue. */
135
- issueIdOrKey: string;
136
- }): Promise<Watchers> {
137
- return this.getClientInstance()
138
- .request({
139
- path: "/rest/api/3/issue/{issueIdOrKey}/watchers",
140
- method: "GET",
141
- pathParams: {
142
- issueIdOrKey,
143
- },
144
- })
145
- .then(
146
- this.getClientInstance().responseHandler({
147
- 200: {
148
- "application/json": "json",
149
- },
150
- }),
151
- )
152
- .then(
153
- commonHttpClient.castResponse<{
154
- status: 200;
155
- mediaType: "application/json";
156
- body: Watchers;
157
- }>(),
158
- )
159
- .then(
160
- validationSchemaStorage.validator(
161
- "IssueWatchersService.getIssueWatchers.response",
162
- ),
163
- )
164
- .then(commonHttpClient.getBody);
165
- }
166
- /**
167
- * Returns, for the user, details of the watched status of issues from a list. If
168
- * an issue ID is invalid, the returned watched status is `false`.
169
- *
170
- * This operation requires the **Allow users to watch issues** option to be *ON*.
171
- * This option is set in General configuration for Jira. See [Configuring Jira
172
- * application options](https://confluence.atlassian.com/x/uYXKM) for details.
173
- *
174
- * **[Permissions](#permissions) required:**
175
- *
176
- * * *Browse projects* [project
177
- * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the
178
- * issue is in
179
- * * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is
180
- * configured, issue-level security permission to view the issue.
181
- *
182
- * @returns Returned if the request is successful
183
- *
184
- * example: {
185
- * "issuesIsWatching": {
186
- * "10001": true,
187
- * "10002": false,
188
- * "10005": true
189
- * }
190
- * }
191
- * @path {POST} /rest/api/3/issue/watching
192
- * @scopes-current read:jira-work
193
- * @scopes-beta read:issue.watcher:jira, read:user:jira
194
- */
195
- getIsWatchingIssueBulk({
196
- issueList,
197
- }: {
198
- /**
199
- * A list of issue IDs.
200
- *
201
- * @example {
202
- * "issueIds": [
203
- * "10001",
204
- * "10002",
205
- * "10005"
206
- * ]
207
- * }
208
- */
209
- issueList: IssueList;
210
- }): Promise<BulkIssueIsWatching> {
211
- return this.getClientInstance()
212
- .request({
213
- path: "/rest/api/3/issue/watching",
214
- method: "POST",
215
- headers: {
216
- "Content-Type": "application/json",
217
- },
218
- body: issueList,
219
- })
220
- .then(
221
- this.getClientInstance().responseHandler({
222
- 200: {
223
- "application/json": "json",
224
- },
225
- }),
226
- )
227
- .then(
228
- commonHttpClient.castResponse<{
229
- status: 200;
230
- mediaType: "application/json";
231
- body: BulkIssueIsWatching;
232
- }>(),
233
- )
234
- .then(
235
- validationSchemaStorage.validator(
236
- "IssueWatchersService.getIsWatchingIssueBulk.response",
237
- ),
238
- )
239
- .then(commonHttpClient.getBody);
240
- }
241
- /**
242
- * Deletes a user as a watcher of an issue.
243
- *
244
- * This operation requires the **Allow users to watch issues** option to be *ON*.
245
- * This option is set in General configuration for Jira. See [Configuring Jira
246
- * application options](https://confluence.atlassian.com/x/uYXKM) for details.
247
- *
248
- * **[Permissions](#permissions) required:**
249
- *
250
- * * *Browse projects* [project
251
- * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the
252
- * issue is in.
253
- * * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is
254
- * configured, issue-level security permission to view the issue.
255
- * * To remove users other than themselves from the watchlist, *Manage watcher
256
- * list* [project permission](https://confluence.atlassian.com/x/yodKLg) for the
257
- * project that the issue is in.
258
- *
259
- * @path {DELETE} /rest/api/3/issue/{issueIdOrKey}/watchers
260
- * @scopes-current write:jira-work
261
- * @scopes-beta write:issue.watcher:jira
262
- */
263
- removeWatcher({
264
- issueIdOrKey,
265
- username,
266
- accountId,
267
- }: {
268
- /** The ID or key of the issue. */
269
- issueIdOrKey: string;
270
- /**
271
- * This parameter is no longer available. See the [deprecation
272
- * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
273
- * for details.
274
- */
275
- username?: string;
276
- /**
277
- * The account ID of the user, which uniquely identifies the user across all
278
- * Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required.
279
- */
280
- accountId?: string;
281
- }): Promise<void> {
282
- return this.getClientInstance()
283
- .request({
284
- path: "/rest/api/3/issue/{issueIdOrKey}/watchers",
285
- method: "DELETE",
286
- pathParams: {
287
- issueIdOrKey,
288
- },
289
- query: {
290
- username,
291
- accountId,
292
- },
293
- })
294
- .then(commonHttpClient.discardResult);
295
- }
296
- static initialize() {
297
- validationSchemaStorage.registerExtensible(
298
- "IssueWatchersService.getIssueWatchers.response",
299
- z
300
- .object({
301
- status: z.literal(200),
302
- mediaType: z.literal("application/json"),
303
- body: validationSchemaStorage.lazy("Watchers"),
304
- })
305
- .describe("IssueWatchersService.getIssueWatchers.response"),
306
- );
307
- validationSchemaStorage.registerExtensible(
308
- "IssueWatchersService.addWatcher.response",
309
- z
310
- .object({
311
- status: z.literal(204),
312
- mediaType: z.literal("application/json"),
313
- body: z.unknown(),
314
- })
315
- .describe("IssueWatchersService.addWatcher.response"),
316
- );
317
- validationSchemaStorage.registerExtensible(
318
- "IssueWatchersService.getIsWatchingIssueBulk.response",
319
- z
320
- .object({
321
- status: z.literal(200),
322
- mediaType: z.literal("application/json"),
323
- body: validationSchemaStorage.lazy("BulkIssueIsWatching"),
324
- })
325
- .describe("IssueWatchersService.getIsWatchingIssueBulk.response"),
326
- );
327
- validationSchemaStorage.registerOnce([
328
- registerIssueWatchersValidationSchemas,
329
- ]);
330
- }
331
- }