@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,751 +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 FoundGroups,
10
- registerCommonValidationSchemas,
11
- } from "../models/common";
12
- import {
13
- type AddGroupBean,
14
- type Group,
15
- type PageBeanGroupDetails,
16
- type PageBeanUserDetails,
17
- registerGroupsValidationSchemas,
18
- type UpdateUserToGroupBean,
19
- } from "../models/groups";
20
- import { validationSchemaStorage } from "../validation-schema-storage";
21
- /**
22
- * This resource represents groups of users. Use it to get, create, find, and
23
- * delete groups as well as add and remove users from groups. (\[WARNING\] The
24
- * standard Atlassian group names are default names only and can be edited or
25
- * deleted. For example, an admin or Atlassian support could delete the default
26
- * group jira-software-users or rename it to jsw-users at any point. See
27
- * https://support.atlassian.com/user-management/docs/create-and-update-groups/
28
- * for details.)
29
- */
30
- export class GroupsService extends CommonHttpService {
31
- /**
32
- * Adds a user to a group.
33
- *
34
- * **[Permissions](#permissions) required:** Site administration (that is, member
35
- * of the *site-admin* [group](https://confluence.atlassian.com/x/24xjL)).
36
- *
37
- * @returns Returned if the request is successful.
38
- * @path {POST} /rest/api/3/group/user
39
- * @scopes-current manage:jira-configuration
40
- * @scopes-beta write:group:jira, read:avatar:jira, read:group:jira, read:user:jira
41
- */
42
- addUserToGroup({
43
- groupname,
44
- groupId,
45
- updateUserToGroupBean,
46
- }: {
47
- /**
48
- * As a group's name can change, use of `groupId` is recommended to identify a
49
- * group.
50
- * The name of the group. This parameter cannot be used with the `groupId`
51
- * parameter.
52
- */
53
- groupname?: string;
54
- /**
55
- * The ID of the group. This parameter cannot be used with the `groupName`
56
- * parameter.
57
- */
58
- groupId?: string;
59
- /**
60
- * The user to add to the group.
61
- *
62
- * @example {
63
- * "accountId": "5b10ac8d82e05b22cc7d4ef5"
64
- * }
65
- */
66
- updateUserToGroupBean: UpdateUserToGroupBean;
67
- }): Promise<Group> {
68
- return this.getClientInstance()
69
- .request({
70
- path: "/rest/api/3/group/user",
71
- method: "POST",
72
- query: {
73
- groupname,
74
- groupId,
75
- },
76
- headers: {
77
- "Content-Type": "application/json",
78
- },
79
- body: updateUserToGroupBean,
80
- })
81
- .then(
82
- this.getClientInstance().responseHandler({
83
- 201: {
84
- "application/json": "json",
85
- },
86
- }),
87
- )
88
- .then(
89
- commonHttpClient.castResponse<{
90
- status: 201;
91
- mediaType: "application/json";
92
- body: Group;
93
- }>(),
94
- )
95
- .then(
96
- validationSchemaStorage.validator(
97
- "GroupsService.addUserToGroup.response",
98
- ),
99
- )
100
- .then(commonHttpClient.getBody);
101
- }
102
- /**
103
- * Returns a [paginated](#pagination) list of groups.
104
- *
105
- * **[Permissions](#permissions) required:** *Browse users and groups* [global
106
- * permission](https://confluence.atlassian.com/x/x4dKLg).
107
- *
108
- * @returns Returned if the request is successful.
109
- *
110
- * example: {
111
- * "isLast": true,
112
- * "maxResults": 10,
113
- * "startAt": 0,
114
- * "total": 2,
115
- * "values": [
116
- * {
117
- * "groupId": "276f955c-63d7-42c8-9520-92d01dca0625",
118
- * "name": "jdog-developers"
119
- * },
120
- * {
121
- * "groupId": "6e87dc72-4f1f-421f-9382-2fee8b652487",
122
- * "name": "juvenal-bot"
123
- * }
124
- * ]
125
- * }
126
- * @path {GET} /rest/api/3/group/bulk
127
- * @scopes-current read:jira-user
128
- * @scopes-beta read:group:jira
129
- */
130
- bulkGetGroups({
131
- startAt,
132
- maxResults,
133
- groupId,
134
- groupName,
135
- accessType,
136
- applicationKey,
137
- }: {
138
- /** The index of the first item to return in a page of results (page offset). */
139
- startAt?: number;
140
- /** The maximum number of items to return per page. */
141
- maxResults?: number;
142
- /**
143
- * The ID of a group. To specify multiple IDs, pass multiple `groupId` parameters.
144
- * For example,
145
- * `groupId=5b10a2844c20165700ede21g&groupId=5b10ac8d82e05b22cc7d4ef5`.
146
- */
147
- groupId?: string[];
148
- /**
149
- * The name of a group. To specify multiple names, pass multiple `groupName`
150
- * parameters. For example,
151
- * `groupName=administrators&groupName=jira-software-users`.
152
- */
153
- groupName?: string[];
154
- /** The access level of a group. Valid values: 'site-admin', 'admin', 'user'. */
155
- accessType?: string;
156
- /**
157
- * The application key of the product user groups to search for. Valid values:
158
- * 'jira-servicedesk', 'jira-software', 'jira-product-discovery', 'jira-core'.
159
- */
160
- applicationKey?: string;
161
- }): Promise<PageBeanGroupDetails> {
162
- return this.getClientInstance()
163
- .request({
164
- path: "/rest/api/3/group/bulk",
165
- method: "GET",
166
- query: {
167
- startAt,
168
- maxResults,
169
- groupId,
170
- groupName,
171
- accessType,
172
- applicationKey,
173
- },
174
- })
175
- .then(
176
- this.getClientInstance().responseHandler({
177
- 200: {
178
- "application/json": "json",
179
- },
180
- }),
181
- )
182
- .then(
183
- commonHttpClient.castResponse<{
184
- status: 200;
185
- mediaType: "application/json";
186
- body: PageBeanGroupDetails;
187
- }>(),
188
- )
189
- .then(
190
- validationSchemaStorage.validator(
191
- "GroupsService.bulkGetGroups.response",
192
- ),
193
- )
194
- .then(commonHttpClient.getBody);
195
- }
196
- /**
197
- * Creates a group.
198
- *
199
- * **[Permissions](#permissions) required:** Site administration (that is, member
200
- * of the *site-admin* [group](https://confluence.atlassian.com/x/24xjL)).
201
- *
202
- * @returns Returned if the request is successful.
203
- *
204
- * example: {
205
- * "expand": "users",
206
- * "groupId": "276f955c-63d7-42c8-9520-92d01dca0625",
207
- * "name": "power-users",
208
- * "self":
209
- * "https://your-domain.atlassian.net/rest/api/3/group?groupId=276f955c-63d7-42c8-9520-92d01dca0625",
210
- * "users": {
211
- * "end-index": 0,
212
- * "items": [
213
- * {
214
- * "accountId": "5b10a2844c20165700ede21g",
215
- * "active": false,
216
- * "displayName": "Mia Krystof",
217
- * "self":
218
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
219
- * }
220
- * ],
221
- * "max-results": 50,
222
- * "size": 1,
223
- * "start-index": 0
224
- * }
225
- * }
226
- * @path {POST} /rest/api/3/group
227
- * @scopes-current manage:jira-configuration
228
- * @scopes-beta read:group:jira, read:user:jira, write:group:jira, read:avatar:jira
229
- */
230
- createGroup({
231
- addGroupBean,
232
- }: {
233
- /**
234
- * The name of the group.
235
- *
236
- * @example {
237
- * "name": "power-users"
238
- * }
239
- */
240
- addGroupBean: AddGroupBean;
241
- }): Promise<Group> {
242
- return this.getClientInstance()
243
- .request({
244
- path: "/rest/api/3/group",
245
- method: "POST",
246
- headers: {
247
- "Content-Type": "application/json",
248
- },
249
- body: addGroupBean,
250
- })
251
- .then(
252
- this.getClientInstance().responseHandler({
253
- 201: {
254
- "application/json": "json",
255
- },
256
- }),
257
- )
258
- .then(
259
- commonHttpClient.castResponse<{
260
- status: 201;
261
- mediaType: "application/json";
262
- body: Group;
263
- }>(),
264
- )
265
- .then(
266
- validationSchemaStorage.validator("GroupsService.createGroup.response"),
267
- )
268
- .then(commonHttpClient.getBody);
269
- }
270
- /**
271
- * Returns a list of groups whose names contain a query string. A list of group
272
- * names can be provided to exclude groups from the results.
273
- *
274
- * The primary use case for this resource is to populate a group picker
275
- * suggestions list. To this end, the returned object includes the `html` field
276
- * where the matched query term is highlighted in the group name with the HTML
277
- * strong tag. Also, the groups list is wrapped in a response object that contains
278
- * a header for use in the picker, specifically *Showing X of Y matching groups*.
279
- *
280
- * The list returns with the groups sorted. If no groups match the list criteria,
281
- * an empty list is returned.
282
- *
283
- * This operation can be accessed anonymously.
284
- *
285
- * **[Permissions](#permissions) required:** *Browse projects* [project
286
- * permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and
287
- * calls by users without the required permission return an empty list.
288
- *
289
- * *Browse users and groups* [global
290
- * permission](https://confluence.atlassian.com/x/x4dKLg). Without this
291
- * permission, calls where query is not an exact match to an existing group will
292
- * return an empty list.
293
- *
294
- * @returns Returned if the request is successful.
295
- *
296
- * example: {
297
- * "groups": [
298
- * {
299
- * "groupId": "276f955c-63d7-42c8-9520-92d01dca0625",
300
- * "html": "<b>j</b>dog-developers",
301
- * "name": "jdog-developers"
302
- * },
303
- * {
304
- * "groupId": "6e87dc72-4f1f-421f-9382-2fee8b652487",
305
- * "html": "<b>j</b>uvenal-bot",
306
- * "name": "juvenal-bot"
307
- * }
308
- * ],
309
- * "header": "Showing 20 of 25 matching groups",
310
- * "total": 25
311
- * }
312
- * @path {GET} /rest/api/3/groups/picker
313
- * @scopes-current read:jira-user
314
- * @scopes-beta read:group:jira
315
- */
316
- findGroups({
317
- accountId,
318
- query,
319
- exclude,
320
- excludeId,
321
- maxResults,
322
- caseInsensitive,
323
- userName,
324
- }: {
325
- /**
326
- * This parameter is deprecated, setting it does not affect the results. To find
327
- * groups containing a particular user, use [Get user
328
- * groups](#api-rest-api-3-user-groups-get).
329
- */
330
- accountId?: string;
331
- /** The string to find in group names. */
332
- query?: string;
333
- /**
334
- * As a group's name can change, use of `excludeGroupIds` is recommended to
335
- * identify a group.
336
- * A group to exclude from the result. To exclude multiple groups, provide an
337
- * ampersand-separated list. For example, `exclude=group1&exclude=group2`. This
338
- * parameter cannot be used with the `excludeGroupIds` parameter.
339
- */
340
- exclude?: string[];
341
- /**
342
- * A group ID to exclude from the result. To exclude multiple groups, provide an
343
- * ampersand-separated list. For example,
344
- * `excludeId=group1-id&excludeId=group2-id`. This parameter cannot be used with
345
- * the `excludeGroups` parameter.
346
- */
347
- excludeId?: string[];
348
- /**
349
- * The maximum number of groups to return. The maximum number of groups that can
350
- * be returned is limited by the system property `jira.ajax.autocomplete.limit`.
351
- */
352
- maxResults?: number;
353
- /** Whether the search for groups should be case insensitive. */
354
- caseInsensitive?: boolean;
355
- /**
356
- * This parameter is no longer available. See the [deprecation
357
- * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
358
- * for details.
359
- */
360
- userName?: string;
361
- }): Promise<FoundGroups> {
362
- return this.getClientInstance()
363
- .request({
364
- path: "/rest/api/3/groups/picker",
365
- method: "GET",
366
- query: {
367
- accountId,
368
- query,
369
- exclude,
370
- excludeId,
371
- maxResults,
372
- caseInsensitive,
373
- userName,
374
- },
375
- })
376
- .then(
377
- this.getClientInstance().responseHandler({
378
- 200: {
379
- "application/json": "json",
380
- },
381
- }),
382
- )
383
- .then(
384
- commonHttpClient.castResponse<{
385
- status: 200;
386
- mediaType: "application/json";
387
- body: FoundGroups;
388
- }>(),
389
- )
390
- .then(
391
- validationSchemaStorage.validator("GroupsService.findGroups.response"),
392
- )
393
- .then(commonHttpClient.getBody);
394
- }
395
- /**
396
- * This operation is deprecated, use
397
- * [`group/member`](#api-rest-api-3-group-member-get).
398
- *
399
- * Returns all users in a group.
400
- *
401
- * **[Permissions](#permissions) required:** either of:
402
- *
403
- * * *Browse users and groups* [global
404
- * permission](https://confluence.atlassian.com/x/x4dKLg).
405
- * * *Administer Jira* [global
406
- * permission](https://confluence.atlassian.com/x/x4dKLg).
407
- *
408
- * @deprecated
409
- * @returns Returned if the request is successful.
410
- * @path {GET} /rest/api/3/group
411
- * @scopes-current read:jira-user
412
- * @scopes-beta read:group:jira, read:user:jira, read:avatar:jira
413
- */
414
- getGroup({
415
- groupname,
416
- groupId,
417
- expand,
418
- }: {
419
- /**
420
- * As a group's name can change, use of `groupId` is recommended to identify a
421
- * group.
422
- * The name of the group. This parameter cannot be used with the `groupId`
423
- * parameter.
424
- */
425
- groupname?: string;
426
- /**
427
- * The ID of the group. This parameter cannot be used with the `groupName`
428
- * parameter.
429
- */
430
- groupId?: string;
431
- /** List of fields to expand. */
432
- expand?: string;
433
- }): Promise<Group> {
434
- return this.getClientInstance()
435
- .request({
436
- path: "/rest/api/3/group",
437
- method: "GET",
438
- query: {
439
- groupname,
440
- groupId,
441
- expand,
442
- },
443
- })
444
- .then(
445
- this.getClientInstance().responseHandler({
446
- 200: {
447
- "application/json": "json",
448
- },
449
- }),
450
- )
451
- .then(
452
- commonHttpClient.castResponse<{
453
- status: 200;
454
- mediaType: "application/json";
455
- body: Group;
456
- }>(),
457
- )
458
- .then(
459
- validationSchemaStorage.validator("GroupsService.getGroup.response"),
460
- )
461
- .then(commonHttpClient.getBody);
462
- }
463
- /**
464
- * Returns a [paginated](#pagination) list of all users in a group.
465
- *
466
- * Note that users are ordered by username, however the username is not returned
467
- * in the results due to privacy reasons.
468
- *
469
- * **[Permissions](#permissions) required:** either of:
470
- *
471
- * * *Browse users and groups* [global
472
- * permission](https://confluence.atlassian.com/x/x4dKLg).
473
- * * *Administer Jira* [global
474
- * permission](https://confluence.atlassian.com/x/x4dKLg).
475
- *
476
- * @returns Returned if the request is successful.
477
- *
478
- * example: {
479
- * "isLast": false,
480
- * "maxResults": 2,
481
- * "nextPage":
482
- * "https://your-domain.atlassian.net/rest/api/3/group/member?groupId=276f955c-63d7-42c8-9520-92d01dca0625&includeInactiveUsers=false&startAt=4&maxResults=2",
483
- * "self":
484
- * "https://your-domain.atlassian.net/rest/api/3/group/member?groupId=276f955c-63d7-42c8-9520-92d01dca0625&includeInactiveUsers=false&startAt=2&maxResults=2",
485
- * "startAt": 3,
486
- * "total": 5,
487
- * "values": [
488
- * {
489
- * "accountId": "5b10a2844c20165700ede21g",
490
- * "accountType": "atlassian",
491
- * "active": true,
492
- * "avatarUrls": {},
493
- * "displayName": "Mia",
494
- * "emailAddress": "mia@example.com",
495
- * "key": "",
496
- * "name": "",
497
- * "self":
498
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g",
499
- * "timeZone": "Australia/Sydney"
500
- * },
501
- * {
502
- * "accountId": "5b10a0effa615349cb016cd8",
503
- * "accountType": "atlassian",
504
- * "active": false,
505
- * "avatarUrls": {},
506
- * "displayName": "Will",
507
- * "emailAddress": "will@example.com",
508
- * "key": "",
509
- * "name": "",
510
- * "self":
511
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a0effa615349cb016cd8",
512
- * "timeZone": "Australia/Sydney"
513
- * }
514
- * ]
515
- * }
516
- * @path {GET} /rest/api/3/group/member
517
- * @scopes-current manage:jira-configuration
518
- * @scopes-beta read:group:jira, read:user:jira, read:avatar:jira
519
- */
520
- getUsersFromGroup({
521
- groupname,
522
- groupId,
523
- includeInactiveUsers,
524
- startAt,
525
- maxResults,
526
- }: {
527
- /**
528
- * As a group's name can change, use of `groupId` is recommended to identify a
529
- * group.
530
- * The name of the group. This parameter cannot be used with the `groupId`
531
- * parameter.
532
- */
533
- groupname?: string;
534
- /**
535
- * The ID of the group. This parameter cannot be used with the `groupName`
536
- * parameter.
537
- */
538
- groupId?: string;
539
- /** Include inactive users. */
540
- includeInactiveUsers?: boolean;
541
- /** The index of the first item to return in a page of results (page offset). */
542
- startAt?: number;
543
- /** The maximum number of items to return per page. */
544
- maxResults?: number;
545
- }): Promise<PageBeanUserDetails> {
546
- return this.getClientInstance()
547
- .request({
548
- path: "/rest/api/3/group/member",
549
- method: "GET",
550
- query: {
551
- groupname,
552
- groupId,
553
- includeInactiveUsers,
554
- startAt,
555
- maxResults,
556
- },
557
- })
558
- .then(
559
- this.getClientInstance().responseHandler({
560
- 200: {
561
- "application/json": "json",
562
- },
563
- }),
564
- )
565
- .then(
566
- commonHttpClient.castResponse<{
567
- status: 200;
568
- mediaType: "application/json";
569
- body: PageBeanUserDetails;
570
- }>(),
571
- )
572
- .then(
573
- validationSchemaStorage.validator(
574
- "GroupsService.getUsersFromGroup.response",
575
- ),
576
- )
577
- .then(commonHttpClient.getBody);
578
- }
579
- /**
580
- * Deletes a group.
581
- *
582
- * **[Permissions](#permissions) required:** Site administration (that is, member
583
- * of the *site-admin* strategic
584
- * [group](https://confluence.atlassian.com/x/24xjL)).
585
- *
586
- * @path {DELETE} /rest/api/3/group
587
- * @scopes-current manage:jira-configuration
588
- * @scopes-beta delete:group:jira
589
- */
590
- removeGroup({
591
- groupname,
592
- groupId,
593
- swapGroup,
594
- swapGroupId,
595
- }: {
596
- groupname?: string;
597
- /**
598
- * The ID of the group. This parameter cannot be used with the `groupname`
599
- * parameter.
600
- */
601
- groupId?: string;
602
- /**
603
- * As a group's name can change, use of `swapGroupId` is recommended to identify a
604
- * group.
605
- * The group to transfer restrictions to. Only comments and worklogs are
606
- * transferred. If restrictions are not transferred, comments and worklogs are
607
- * inaccessible after the deletion. This parameter cannot be used with the
608
- * `swapGroupId` parameter.
609
- */
610
- swapGroup?: string;
611
- /**
612
- * The ID of the group to transfer restrictions to. Only comments and worklogs are
613
- * transferred. If restrictions are not transferred, comments and worklogs are
614
- * inaccessible after the deletion. This parameter cannot be used with the
615
- * `swapGroup` parameter.
616
- */
617
- swapGroupId?: string;
618
- }): Promise<void> {
619
- return this.getClientInstance()
620
- .request({
621
- path: "/rest/api/3/group",
622
- method: "DELETE",
623
- query: {
624
- groupname,
625
- groupId,
626
- swapGroup,
627
- swapGroupId,
628
- },
629
- })
630
- .then(commonHttpClient.discardResult);
631
- }
632
- /**
633
- * Removes a user from a group.
634
- *
635
- * **[Permissions](#permissions) required:** Site administration (that is, member
636
- * of the *site-admin* [group](https://confluence.atlassian.com/x/24xjL)).
637
- *
638
- * @path {DELETE} /rest/api/3/group/user
639
- * @scopes-current manage:jira-configuration
640
- * @scopes-beta write:group:jira
641
- */
642
- removeUserFromGroup({
643
- groupname,
644
- groupId,
645
- username,
646
- accountId,
647
- }: {
648
- /**
649
- * As a group's name can change, use of `groupId` is recommended to identify a
650
- * group.
651
- * The name of the group. This parameter cannot be used with the `groupId`
652
- * parameter.
653
- */
654
- groupname?: string;
655
- /**
656
- * The ID of the group. This parameter cannot be used with the `groupName`
657
- * parameter.
658
- */
659
- groupId?: string;
660
- /**
661
- * This parameter is no longer available. See the [deprecation
662
- * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
663
- * for details.
664
- */
665
- username?: string;
666
- /**
667
- * The account ID of the user, which uniquely identifies the user across all
668
- * Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*.
669
- */
670
- accountId: string;
671
- }): Promise<void> {
672
- return this.getClientInstance()
673
- .request({
674
- path: "/rest/api/3/group/user",
675
- method: "DELETE",
676
- query: {
677
- groupname,
678
- groupId,
679
- username,
680
- accountId,
681
- },
682
- })
683
- .then(commonHttpClient.discardResult);
684
- }
685
- static initialize() {
686
- validationSchemaStorage.registerExtensible(
687
- "GroupsService.getGroup.response",
688
- z
689
- .object({
690
- status: z.literal(200),
691
- mediaType: z.literal("application/json"),
692
- body: validationSchemaStorage.lazy("Group"),
693
- })
694
- .describe("GroupsService.getGroup.response"),
695
- );
696
- validationSchemaStorage.registerExtensible(
697
- "GroupsService.createGroup.response",
698
- z
699
- .object({
700
- status: z.literal(201),
701
- mediaType: z.literal("application/json"),
702
- body: validationSchemaStorage.lazy("Group"),
703
- })
704
- .describe("GroupsService.createGroup.response"),
705
- );
706
- validationSchemaStorage.registerExtensible(
707
- "GroupsService.bulkGetGroups.response",
708
- z
709
- .object({
710
- status: z.literal(200),
711
- mediaType: z.literal("application/json"),
712
- body: validationSchemaStorage.lazy("PageBeanGroupDetails"),
713
- })
714
- .describe("GroupsService.bulkGetGroups.response"),
715
- );
716
- validationSchemaStorage.registerExtensible(
717
- "GroupsService.getUsersFromGroup.response",
718
- z
719
- .object({
720
- status: z.literal(200),
721
- mediaType: z.literal("application/json"),
722
- body: validationSchemaStorage.lazy("PageBeanUserDetails"),
723
- })
724
- .describe("GroupsService.getUsersFromGroup.response"),
725
- );
726
- validationSchemaStorage.registerExtensible(
727
- "GroupsService.addUserToGroup.response",
728
- z
729
- .object({
730
- status: z.literal(201),
731
- mediaType: z.literal("application/json"),
732
- body: validationSchemaStorage.lazy("Group"),
733
- })
734
- .describe("GroupsService.addUserToGroup.response"),
735
- );
736
- validationSchemaStorage.registerExtensible(
737
- "GroupsService.findGroups.response",
738
- z
739
- .object({
740
- status: z.literal(200),
741
- mediaType: z.literal("application/json"),
742
- body: validationSchemaStorage.lazy("FoundGroups"),
743
- })
744
- .describe("GroupsService.findGroups.response"),
745
- );
746
- validationSchemaStorage.registerOnce([
747
- registerGroupsValidationSchemas,
748
- registerCommonValidationSchemas,
749
- ]);
750
- }
751
- }