@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,769 +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 type { Stream } from "stream";
5
- import { z } from "zod";
6
-
7
- import * as commonHttpClient from "../core/common-http-client";
8
- import { CommonHttpService } from "../core/common-http-service";
9
- import {
10
- type Avatars,
11
- registerAvatarsValidationSchemas,
12
- type StreamingResponseBody,
13
- type SystemAvatars,
14
- } from "../models/avatars";
15
- import { type Avatar, registerCommonValidationSchemas } from "../models/common";
16
- import { validationSchemaStorage } from "../validation-schema-storage";
17
- /**
18
- * This resource represents system and custom avatars. Use it to obtain the
19
- * details of system or custom avatars, add and remove avatars from a project or
20
- * issue type, and obtain avatar images.
21
- */
22
- export class AvatarsService extends CommonHttpService {
23
- /**
24
- * Deletes an avatar from a project or issue type.
25
- *
26
- * **[Permissions](#permissions) required:** *Administer Jira* [global
27
- * permission](https://confluence.atlassian.com/x/x4dKLg).
28
- *
29
- * @path {DELETE}
30
- * /rest/api/3/universal_avatar/type/{type}/owner/{owningObjectId}/avatar/{id}
31
- * @scopes-current manage:jira-configuration
32
- * @scopes-beta delete:avatar:jira
33
- */
34
- deleteAvatar({
35
- type,
36
- owningObjectId,
37
- id,
38
- }: {
39
- /** The avatar type. */
40
- type: "project" | "issuetype";
41
- /** The ID of the item the avatar is associated with. */
42
- owningObjectId: string;
43
- /** The ID of the avatar. */
44
- id: number;
45
- }): Promise<void> {
46
- return this.getClientInstance()
47
- .request({
48
- path: "/rest/api/3/universal_avatar/type/{type}/owner/{owningObjectId}/avatar/{id}",
49
- method: "DELETE",
50
- pathParams: {
51
- type,
52
- owningObjectId,
53
- id,
54
- },
55
- })
56
- .then(commonHttpClient.discardResult);
57
- }
58
- /**
59
- * Returns a list of system avatar details by owner type, where the owner types
60
- * are issue type, project, or user.
61
- *
62
- * This operation can be accessed anonymously.
63
- *
64
- * **[Permissions](#permissions) required:** None.
65
- *
66
- * @returns Returned if the request is successful.
67
- *
68
- * example: {
69
- * "system": [
70
- * {
71
- * "id": "1000",
72
- * "isDeletable": false,
73
- * "isSelected": false,
74
- * "isSystemAvatar": true,
75
- * "urls": {
76
- * "16x16":
77
- * "/secure/useravatar?size=xsmall&avatarId=10040&avatarType=project",
78
- * "24x24":
79
- * "/secure/useravatar?size=small&avatarId=10040&avatarType=project",
80
- * "32x32":
81
- * "/secure/useravatar?size=medium&avatarId=10040&avatarType=project",
82
- * "48x48": "/secure/useravatar?avatarId=10040&avatarType=project"
83
- * }
84
- * }
85
- * ]
86
- * }
87
- * @path {GET} /rest/api/3/avatar/{type}/system
88
- * @scopes-current manage:jira-configuration
89
- * @scopes-beta read:avatar:jira
90
- */
91
- getAllSystemAvatars({
92
- type,
93
- }: {
94
- /** The avatar type. */
95
- type: "issuetype" | "project" | "user";
96
- }): Promise<SystemAvatars> {
97
- return this.getClientInstance()
98
- .request({
99
- path: "/rest/api/3/avatar/{type}/system",
100
- method: "GET",
101
- pathParams: {
102
- type,
103
- },
104
- })
105
- .then(
106
- this.getClientInstance().responseHandler({
107
- 200: {
108
- "application/json": "json",
109
- },
110
- }),
111
- )
112
- .then(
113
- commonHttpClient.castResponse<{
114
- status: 200;
115
- mediaType: "application/json";
116
- body: SystemAvatars;
117
- }>(),
118
- )
119
- .then(
120
- validationSchemaStorage.validator(
121
- "AvatarsService.getAllSystemAvatars.response",
122
- ),
123
- )
124
- .then(commonHttpClient.getBody);
125
- }
126
- /**
127
- * Returns a project or issue type avatar image by ID.
128
- *
129
- * This operation can be accessed anonymously.
130
- *
131
- * **[Permissions](#permissions) required:**
132
- *
133
- * * For system avatars, none.
134
- * * For custom project avatars, *Browse projects* [project
135
- * permission](https://confluence.atlassian.com/x/yodKLg) for the project the
136
- * avatar belongs to.
137
- * * For custom issue type avatars, *Browse projects* [project
138
- * permission](https://confluence.atlassian.com/x/yodKLg) for at least one project
139
- * the issue type is used in.
140
- *
141
- * @returns * status: 200, mediaType: * /*
142
- *
143
- * Returned if the request is successful.
144
- *
145
- * * status: 200, mediaType: application/json
146
- *
147
- * Returned if the request is successful.
148
- *
149
- * * status: 200, mediaType: image/png
150
- *
151
- * Returned if the request is successful.
152
- *
153
- * * status: 200, mediaType: image/svg+xml
154
- *
155
- * Returned if the request is successful.
156
- * @path {GET} /rest/api/3/universal_avatar/view/type/{type}/avatar/{id}
157
- * @scopes-current read:jira-work
158
- * @scopes-beta read:avatar:jira
159
- */
160
- getAvatarImageById({
161
- type,
162
- id,
163
- size,
164
- format,
165
- }: {
166
- /** The icon type of the avatar. */
167
- type: "issuetype" | "project";
168
- /** The ID of the avatar. */
169
- id: number;
170
- /** The size of the avatar image. If not provided the default size is returned. */
171
- size?: "xsmall" | "small" | "medium" | "large" | "xlarge";
172
- /**
173
- * The format to return the avatar image in. If not provided the original content
174
- * format is returned.
175
- */
176
- format?: "png" | "svg";
177
- }): Promise<
178
- commonHttpClient.WithResponse<
179
- | {
180
- status: 200;
181
- mediaType: "*/*" | "image/png" | "image/svg+xml";
182
- body: Blob;
183
- }
184
- | {
185
- status: 200;
186
- mediaType: "application/json";
187
- body: StreamingResponseBody;
188
- }
189
- >
190
- > {
191
- return this.getClientInstance()
192
- .request({
193
- path: "/rest/api/3/universal_avatar/view/type/{type}/avatar/{id}",
194
- method: "GET",
195
- pathParams: {
196
- type,
197
- id,
198
- },
199
- query: {
200
- size,
201
- format,
202
- },
203
- })
204
- .then(
205
- this.getClientInstance().responseHandler({
206
- 200: {
207
- "*/*": "blob",
208
- "application/json": "json",
209
- "image/png": "blob",
210
- "image/svg+xml": "blob",
211
- },
212
- }),
213
- )
214
- .then(
215
- commonHttpClient.castResponse<
216
- | {
217
- status: 200;
218
- mediaType: "*/*" | "image/png" | "image/svg+xml";
219
- body: Blob;
220
- }
221
- | {
222
- status: 200;
223
- mediaType: "application/json";
224
- body: StreamingResponseBody;
225
- }
226
- >(),
227
- )
228
- .then(
229
- validationSchemaStorage.validator(
230
- "AvatarsService.getAvatarImageByID.response",
231
- ),
232
- );
233
- }
234
- /**
235
- * Returns the avatar image for a project or issue type.
236
- *
237
- * This operation can be accessed anonymously.
238
- *
239
- * **[Permissions](#permissions) required:**
240
- *
241
- * * For system avatars, none.
242
- * * For custom project avatars, *Browse projects* [project
243
- * permission](https://confluence.atlassian.com/x/yodKLg) for the project the
244
- * avatar belongs to.
245
- * * For custom issue type avatars, *Browse projects* [project
246
- * permission](https://confluence.atlassian.com/x/yodKLg) for at least one project
247
- * the issue type is used in.
248
- *
249
- * @returns * status: 200, mediaType: * /*
250
- *
251
- * Returned if the request is successful.
252
- *
253
- * * status: 200, mediaType: application/json
254
- *
255
- * Returned if the request is successful.
256
- *
257
- * * status: 200, mediaType: image/png
258
- *
259
- * Returned if the request is successful.
260
- *
261
- * * status: 200, mediaType: image/svg+xml
262
- *
263
- * Returned if the request is successful.
264
- * @path {GET} /rest/api/3/universal_avatar/view/type/{type}/owner/{entityId}
265
- * @scopes-current read:jira-work
266
- * @scopes-beta read:avatar:jira
267
- */
268
- getAvatarImageByOwner({
269
- type,
270
- entityId,
271
- size,
272
- format,
273
- }: {
274
- /** The icon type of the avatar. */
275
- type: "issuetype" | "project";
276
- /** The ID of the project or issue type the avatar belongs to. */
277
- entityId: string;
278
- /** The size of the avatar image. If not provided the default size is returned. */
279
- size?: "xsmall" | "small" | "medium" | "large" | "xlarge";
280
- /**
281
- * The format to return the avatar image in. If not provided the original content
282
- * format is returned.
283
- */
284
- format?: "png" | "svg";
285
- }): Promise<
286
- commonHttpClient.WithResponse<
287
- | {
288
- status: 200;
289
- mediaType: "*/*" | "image/png" | "image/svg+xml";
290
- body: Blob;
291
- }
292
- | {
293
- status: 200;
294
- mediaType: "application/json";
295
- body: StreamingResponseBody;
296
- }
297
- >
298
- > {
299
- return this.getClientInstance()
300
- .request({
301
- path: "/rest/api/3/universal_avatar/view/type/{type}/owner/{entityId}",
302
- method: "GET",
303
- pathParams: {
304
- type,
305
- entityId,
306
- },
307
- query: {
308
- size,
309
- format,
310
- },
311
- })
312
- .then(
313
- this.getClientInstance().responseHandler({
314
- 200: {
315
- "*/*": "blob",
316
- "application/json": "json",
317
- "image/png": "blob",
318
- "image/svg+xml": "blob",
319
- },
320
- }),
321
- )
322
- .then(
323
- commonHttpClient.castResponse<
324
- | {
325
- status: 200;
326
- mediaType: "*/*" | "image/png" | "image/svg+xml";
327
- body: Blob;
328
- }
329
- | {
330
- status: 200;
331
- mediaType: "application/json";
332
- body: StreamingResponseBody;
333
- }
334
- >(),
335
- )
336
- .then(
337
- validationSchemaStorage.validator(
338
- "AvatarsService.getAvatarImageByOwner.response",
339
- ),
340
- );
341
- }
342
- /**
343
- * Returns the default project or issue type avatar image.
344
- *
345
- * This operation can be accessed anonymously.
346
- *
347
- * **[Permissions](#permissions) required:** None.
348
- *
349
- * @returns * status: 200, mediaType: * /*
350
- *
351
- * Returned if the request is successful.
352
- *
353
- * * status: 200, mediaType: application/json
354
- *
355
- * Returned if the request is successful.
356
- *
357
- * * status: 200, mediaType: image/png
358
- *
359
- * Returned if the request is successful.
360
- *
361
- * * status: 200, mediaType: image/svg+xml
362
- *
363
- * Returned if the request is successful.
364
- * @path {GET} /rest/api/3/universal_avatar/view/type/{type}
365
- * @scopes-current read:jira-work
366
- * @scopes-beta read:avatar:jira
367
- */
368
- getAvatarImageByType({
369
- type,
370
- size,
371
- format,
372
- }: {
373
- /** The icon type of the avatar. */
374
- type: "issuetype" | "project";
375
- /** The size of the avatar image. If not provided the default size is returned. */
376
- size?: "xsmall" | "small" | "medium" | "large" | "xlarge";
377
- /**
378
- * The format to return the avatar image in. If not provided the original content
379
- * format is returned.
380
- */
381
- format?: "png" | "svg";
382
- }): Promise<
383
- commonHttpClient.WithResponse<
384
- | {
385
- status: 200;
386
- mediaType: "*/*" | "image/png" | "image/svg+xml";
387
- body: Blob;
388
- }
389
- | {
390
- status: 200;
391
- mediaType: "application/json";
392
- body: StreamingResponseBody;
393
- }
394
- >
395
- > {
396
- return this.getClientInstance()
397
- .request({
398
- path: "/rest/api/3/universal_avatar/view/type/{type}",
399
- method: "GET",
400
- pathParams: {
401
- type,
402
- },
403
- query: {
404
- size,
405
- format,
406
- },
407
- })
408
- .then(
409
- this.getClientInstance().responseHandler({
410
- 200: {
411
- "*/*": "blob",
412
- "application/json": "json",
413
- "image/png": "blob",
414
- "image/svg+xml": "blob",
415
- },
416
- }),
417
- )
418
- .then(
419
- commonHttpClient.castResponse<
420
- | {
421
- status: 200;
422
- mediaType: "*/*" | "image/png" | "image/svg+xml";
423
- body: Blob;
424
- }
425
- | {
426
- status: 200;
427
- mediaType: "application/json";
428
- body: StreamingResponseBody;
429
- }
430
- >(),
431
- )
432
- .then(
433
- validationSchemaStorage.validator(
434
- "AvatarsService.getAvatarImageByType.response",
435
- ),
436
- );
437
- }
438
- /**
439
- * Returns the system and custom avatars for a project or issue type.
440
- *
441
- * This operation can be accessed anonymously.
442
- *
443
- * **[Permissions](#permissions) required:**
444
- *
445
- * * for custom project avatars, *Browse projects* [project
446
- * permission](https://confluence.atlassian.com/x/yodKLg) for the project the
447
- * avatar belongs to.
448
- * * for custom issue type avatars, *Browse projects* [project
449
- * permission](https://confluence.atlassian.com/x/yodKLg) for at least one project
450
- * the issue type is used in.
451
- * * for system avatars, none.
452
- *
453
- * @returns Returned if the request is successful.
454
- *
455
- * example: {
456
- * "custom": [
457
- * {
458
- * "id": "1010",
459
- * "isDeletable": true,
460
- * "isSelected": false,
461
- * "isSystemAvatar": false,
462
- * "urls": {
463
- * "16x16":
464
- * "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10080&avatarType=project",
465
- * "24x24":
466
- * "https://your-domain.atlassian.net/secure/viewavatar?size=small&avatarId=10080&avatarType=project",
467
- * "32x32":
468
- * "https://your-domain.atlassian.net/secure/viewavatar?size=medium&avatarId=10080&avatarType=project",
469
- * "48x48":
470
- * "https://your-domain.atlassian.net/secure/viewavatar?avatarId=10080&avatarType=project"
471
- * }
472
- * }
473
- * ],
474
- * "system": [
475
- * {
476
- * "id": "1000",
477
- * "isDeletable": false,
478
- * "isSelected": false,
479
- * "isSystemAvatar": true,
480
- * "urls": {
481
- * "16x16":
482
- * "https://your-domain.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10040&avatarType=project",
483
- * "24x24":
484
- * "https://your-domain.atlassian.net/secure/viewavatar?size=small&avatarId=10040&avatarType=project",
485
- * "32x32":
486
- * "https://your-domain.atlassian.net/secure/viewavatar?size=medium&avatarId=10040&avatarType=project",
487
- * "48x48":
488
- * "https://your-domain.atlassian.net/secure/viewavatar?avatarId=10040&avatarType=project"
489
- * }
490
- * }
491
- * ]
492
- * }
493
- * @path {GET} /rest/api/3/universal_avatar/type/{type}/owner/{entityId}
494
- * @scopes-current manage:jira-configuration
495
- * @scopes-beta read:avatar:jira
496
- */
497
- getAvatars({
498
- type,
499
- entityId,
500
- }: {
501
- /** The avatar type. */
502
- type: "project" | "issuetype";
503
- /** The ID of the item the avatar is associated with. */
504
- entityId: string;
505
- }): Promise<Avatars> {
506
- return this.getClientInstance()
507
- .request({
508
- path: "/rest/api/3/universal_avatar/type/{type}/owner/{entityId}",
509
- method: "GET",
510
- pathParams: {
511
- type,
512
- entityId,
513
- },
514
- })
515
- .then(
516
- this.getClientInstance().responseHandler({
517
- 200: {
518
- "application/json": "json",
519
- },
520
- }),
521
- )
522
- .then(
523
- commonHttpClient.castResponse<{
524
- status: 200;
525
- mediaType: "application/json";
526
- body: Avatars;
527
- }>(),
528
- )
529
- .then(
530
- validationSchemaStorage.validator("AvatarsService.getAvatars.response"),
531
- )
532
- .then(commonHttpClient.getBody);
533
- }
534
- /**
535
- * Loads a custom avatar for a project or issue type.
536
- *
537
- * Specify the avatar's local file location in the body of the request. Also,
538
- * include the following headers:
539
- *
540
- * * `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the
541
- * request, for more information see [Special Headers](#special-request-headers).
542
- * * `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG.
543
- *
544
- * For example:
545
- * `curl --request POST `
546
- *
547
- * `--user email@example.com:<api_token> `
548
- *
549
- * `--header 'X-Atlassian-Token: no-check' `
550
- *
551
- * `--header 'Content-Type: image/< image_type>' `
552
- *
553
- * `--data-binary "<@/path/to/file/with/your/avatar>" `
554
- *
555
- * `--url
556
- * 'https://your-domain.atlassian.net/rest/api/3/universal_avatar/type/{type}/owner/{entityId}'`
557
- *
558
- * The avatar is cropped to a square. If no crop parameters are specified, the
559
- * square originates at the top left of the image. The length of the square's
560
- * sides is set to the smaller of the height or width of the image.
561
- *
562
- * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and
563
- * 48x48 in size.
564
- *
565
- * After creating the avatar use:
566
- *
567
- * * [Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the
568
- * issue type's displayed avatar.
569
- * * [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to
570
- * set it as the project's displayed avatar.
571
- *
572
- * **[Permissions](#permissions) required:** *Administer Jira* [global
573
- * permission](https://confluence.atlassian.com/x/x4dKLg).
574
- *
575
- * @returns Returned if the request is successful.
576
- *
577
- * example: {
578
- * "id": "1000",
579
- * "isDeletable": false,
580
- * "isSelected": false,
581
- * "isSystemAvatar": true,
582
- * "urls": {
583
- * "16x16": "/secure/useravatar?size=xsmall&avatarId=10040&avatarType=project",
584
- * "24x24": "/secure/useravatar?size=small&avatarId=10040&avatarType=project",
585
- * "32x32": "/secure/useravatar?size=medium&avatarId=10040&avatarType=project",
586
- * "48x48": "/secure/useravatar?avatarId=10040&avatarType=project"
587
- * }
588
- * }
589
- * @path {POST} /rest/api/3/universal_avatar/type/{type}/owner/{entityId}
590
- * @scopes-current manage:jira-configuration
591
- * @scopes-beta write:avatar:jira, read:avatar:jira
592
- */
593
- storeAvatar({
594
- type,
595
- entityId,
596
- x,
597
- y,
598
- size,
599
- mediaType,
600
- requestBody,
601
- }: {
602
- /** The avatar type. */
603
- type: "project" | "issuetype";
604
- /** The ID of the item the avatar is associated with. */
605
- entityId: string;
606
- /** The X coordinate of the top-left corner of the crop region. */
607
- x?: number;
608
- /** The Y coordinate of the top-left corner of the crop region. */
609
- y?: number;
610
- /** The length of each side of the crop region. */
611
- size: number;
612
- mediaType: string;
613
- requestBody: Blob | Stream;
614
- }): Promise<Avatar> {
615
- return this.getClientInstance()
616
- .request({
617
- path: "/rest/api/3/universal_avatar/type/{type}/owner/{entityId}",
618
- method: "POST",
619
- pathParams: {
620
- type,
621
- entityId,
622
- },
623
- query: {
624
- x,
625
- y,
626
- size,
627
- },
628
- headers: {
629
- "X-Atlassian-Token": "nocheck",
630
- "Content-Type": mediaType,
631
- },
632
- body: requestBody,
633
- })
634
- .then(
635
- this.getClientInstance().responseHandler({
636
- 201: {
637
- "application/json": "json",
638
- },
639
- }),
640
- )
641
- .then(
642
- commonHttpClient.castResponse<{
643
- status: 201;
644
- mediaType: "application/json";
645
- body: Avatar;
646
- }>(),
647
- )
648
- .then(
649
- validationSchemaStorage.validator(
650
- "AvatarsService.storeAvatar.response",
651
- ),
652
- )
653
- .then(commonHttpClient.getBody);
654
- }
655
- static initialize() {
656
- validationSchemaStorage.registerExtensible(
657
- "AvatarsService.getAllSystemAvatars.response",
658
- z
659
- .object({
660
- status: z.literal(200),
661
- mediaType: z.literal("application/json"),
662
- body: validationSchemaStorage.lazy("SystemAvatars"),
663
- })
664
- .describe("AvatarsService.getAllSystemAvatars.response"),
665
- );
666
- validationSchemaStorage.registerExtensible(
667
- "AvatarsService.getAvatars.response",
668
- z
669
- .object({
670
- status: z.literal(200),
671
- mediaType: z.literal("application/json"),
672
- body: validationSchemaStorage.lazy("Avatars"),
673
- })
674
- .describe("AvatarsService.getAvatars.response"),
675
- );
676
- validationSchemaStorage.registerExtensible(
677
- "AvatarsService.storeAvatar.response",
678
- z
679
- .object({
680
- status: z.literal(201),
681
- mediaType: z.literal("application/json"),
682
- body: validationSchemaStorage.lazy("Avatar"),
683
- })
684
- .describe("AvatarsService.storeAvatar.response"),
685
- );
686
- validationSchemaStorage.registerExtensible(
687
- "AvatarsService.getAvatarImageByType.response",
688
- z
689
- .object({
690
- status: z.number(),
691
- mediaType: z.string(),
692
- body: z.unknown(),
693
- })
694
- .superRefine(({ mediaType: mediaType, body: body }, ctx) => {
695
- if (mediaType === "application/json") {
696
- validationSchemaStorage.lazy("StreamingResponseBody").parse(body);
697
- } else if (
698
- mediaType === "image/png" ||
699
- mediaType === "image/svg+xml"
700
- ) {
701
- return;
702
- } else {
703
- ctx.addIssue({
704
- code: z.ZodIssueCode.custom,
705
- path: ["mediaType"],
706
- message: `Unexpected media type: ${mediaType}`,
707
- });
708
- }
709
- })
710
- .describe("AvatarsService.getAvatarImageByType.response"),
711
- );
712
- validationSchemaStorage.registerExtensible(
713
- "AvatarsService.getAvatarImageByID.response",
714
- z
715
- .object({
716
- status: z.number(),
717
- mediaType: z.string(),
718
- body: z.unknown(),
719
- })
720
- .superRefine(({ mediaType: mediaType, body: body }, ctx) => {
721
- if (mediaType === "application/json") {
722
- validationSchemaStorage.lazy("StreamingResponseBody").parse(body);
723
- } else if (
724
- mediaType === "image/png" ||
725
- mediaType === "image/svg+xml"
726
- ) {
727
- return;
728
- } else {
729
- ctx.addIssue({
730
- code: z.ZodIssueCode.custom,
731
- path: ["mediaType"],
732
- message: `Unexpected media type: ${mediaType}`,
733
- });
734
- }
735
- })
736
- .describe("AvatarsService.getAvatarImageByID.response"),
737
- );
738
- validationSchemaStorage.registerExtensible(
739
- "AvatarsService.getAvatarImageByOwner.response",
740
- z
741
- .object({
742
- status: z.number(),
743
- mediaType: z.string(),
744
- body: z.unknown(),
745
- })
746
- .superRefine(({ mediaType: mediaType, body: body }, ctx) => {
747
- if (mediaType === "application/json") {
748
- validationSchemaStorage.lazy("StreamingResponseBody").parse(body);
749
- } else if (
750
- mediaType === "image/png" ||
751
- mediaType === "image/svg+xml"
752
- ) {
753
- return;
754
- } else {
755
- ctx.addIssue({
756
- code: z.ZodIssueCode.custom,
757
- path: ["mediaType"],
758
- message: `Unexpected media type: ${mediaType}`,
759
- });
760
- }
761
- })
762
- .describe("AvatarsService.getAvatarImageByOwner.response"),
763
- );
764
- validationSchemaStorage.registerOnce([
765
- registerAvatarsValidationSchemas,
766
- registerCommonValidationSchemas,
767
- ]);
768
- }
769
- }