@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,520 +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 { registerCommonValidationSchemas, type User } from "../models/common";
9
- import { type Locale, registerMyselfValidationSchemas } from "../models/myself";
10
- import { validationSchemaStorage } from "../validation-schema-storage";
11
- /**
12
- * This resource represents information about the current user, such as basic
13
- * details, group membership, application roles, preferences, and locale. Use it
14
- * to get, create, update, and delete (restore default) values of the user's
15
- * preferences and locale.
16
- */
17
- export class MyselfService extends CommonHttpService {
18
- /**
19
- * Deprecated, use [ Update a user
20
- * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch)
21
- * from the user management REST API instead.
22
- *
23
- * Deletes the locale of the user, which restores the default setting.
24
- *
25
- * **[Permissions](#permissions) required:** Permission to access Jira.
26
- *
27
- * @deprecated
28
- * @returns Returned if the request is successful.
29
- * @path {DELETE} /rest/api/3/mypreferences/locale
30
- */
31
- deleteLocale(): Promise<void> {
32
- return this.getClientInstance()
33
- .request({
34
- path: "/rest/api/3/mypreferences/locale",
35
- method: "DELETE",
36
- })
37
- .then(
38
- this.getClientInstance().responseHandler({
39
- 204: {
40
- "application/json": "json",
41
- },
42
- }),
43
- )
44
- .then(
45
- commonHttpClient.castResponse<{
46
- status: 204;
47
- mediaType: "application/json";
48
- body: void;
49
- }>(),
50
- )
51
- .then(
52
- validationSchemaStorage.validator(
53
- "MyselfService.deleteLocale.response",
54
- ),
55
- )
56
- .then(commonHttpClient.getBody);
57
- }
58
- /**
59
- * Returns details for the current user.
60
- *
61
- * **[Permissions](#permissions) required:** Permission to access Jira.
62
- *
63
- * @returns Returned if the request is successful.
64
- *
65
- * example: {
66
- * "accountId": "5b10a2844c20165700ede21g",
67
- * "accountType": "atlassian",
68
- * "active": true,
69
- * "applicationRoles": {
70
- * "items": [],
71
- * "size": 1
72
- * },
73
- * "avatarUrls": {
74
- * "16x16":
75
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
76
- * "24x24":
77
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
78
- * "32x32":
79
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
80
- * "48x48":
81
- * "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
82
- * },
83
- * "displayName": "Mia Krystof",
84
- * "emailAddress": "mia@example.com",
85
- * "groups": {
86
- * "items": [],
87
- * "size": 3
88
- * },
89
- * "key": "",
90
- * "name": "",
91
- * "self":
92
- * "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g",
93
- * "timeZone": "Australia/Sydney"
94
- * }
95
- * @path {GET} /rest/api/3/myself
96
- * @scopes-current read:jira-user
97
- * @scopes-beta read:application-role:jira, read:group:jira, read:user:jira, read:avatar:jira
98
- */
99
- getCurrentUser({
100
- expand,
101
- }: {
102
- /**
103
- * Use [expand](#expansion) to include additional information about user in the
104
- * response. This parameter accepts a comma-separated list. Expand options include:
105
- *
106
- * * `groups` Returns all groups, including nested groups, the user belongs to.
107
- * * `applicationRoles` Returns the application roles the user is assigned to.
108
- */
109
- expand?: string;
110
- }): Promise<User> {
111
- return this.getClientInstance()
112
- .request({
113
- path: "/rest/api/3/myself",
114
- method: "GET",
115
- query: {
116
- expand,
117
- },
118
- })
119
- .then(
120
- this.getClientInstance().responseHandler({
121
- 200: {
122
- "application/json": "json",
123
- },
124
- }),
125
- )
126
- .then(
127
- commonHttpClient.castResponse<{
128
- status: 200;
129
- mediaType: "application/json";
130
- body: User;
131
- }>(),
132
- )
133
- .then(
134
- validationSchemaStorage.validator(
135
- "MyselfService.getCurrentUser.response",
136
- ),
137
- )
138
- .then(commonHttpClient.getBody);
139
- }
140
- /**
141
- * Returns the locale for the user.
142
- *
143
- * If the user has no language preference set (which is the default setting) or
144
- * this resource is accessed anonymous, the browser locale detected by Jira is
145
- * returned. Jira detects the browser locale using the *Accept-Language* header in
146
- * the request. However, if this doesn't match a locale available Jira, the site
147
- * default locale is returned.
148
- *
149
- * This operation can be accessed anonymously.
150
- *
151
- * **[Permissions](#permissions) required:** None.
152
- *
153
- * @returns Returned if the request is successful.
154
- *
155
- * example: {
156
- * "locale": "en_US"
157
- * }
158
- * @path {GET} /rest/api/3/mypreferences/locale
159
- * @scopes-current manage:jira-configuration
160
- * @scopes-beta read:user-configuration:jira
161
- */
162
- getLocale(): Promise<Locale> {
163
- return this.getClientInstance()
164
- .request({
165
- path: "/rest/api/3/mypreferences/locale",
166
- method: "GET",
167
- })
168
- .then(
169
- this.getClientInstance().responseHandler({
170
- 200: {
171
- "application/json": "json",
172
- },
173
- }),
174
- )
175
- .then(
176
- commonHttpClient.castResponse<{
177
- status: 200;
178
- mediaType: "application/json";
179
- body: Locale;
180
- }>(),
181
- )
182
- .then(
183
- validationSchemaStorage.validator("MyselfService.getLocale.response"),
184
- )
185
- .then(commonHttpClient.getBody);
186
- }
187
- /**
188
- * Returns the value of a preference of the current user.
189
- *
190
- * Note that these keys are deprecated:
191
- *
192
- * * *jira.user.locale* The locale of the user. By default this is not set and
193
- * the user takes the locale of the instance.
194
- * * *jira.user.timezone* The time zone of the user. By default this is not set
195
- * and the user takes the timezone of the instance.
196
- *
197
- * These system preferences keys will be deprecated by 15/07/2024. You can still
198
- * retrieve these keys, but it will not have any impact on Notification behaviour.
199
- *
200
- * * *user.notifications.watcher* Whether the user gets notified when they are
201
- * watcher.
202
- * * *user.notifications.assignee* Whether the user gets notified when they are
203
- * assignee.
204
- * * *user.notifications.reporter* Whether the user gets notified when they are
205
- * reporter.
206
- * * *user.notifications.mentions* Whether the user gets notified when they are
207
- * mentions.
208
- *
209
- * Use [ Update a user
210
- * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch)
211
- * from the user management REST API to manage timezone and locale instead.
212
- *
213
- * **[Permissions](#permissions) required:** Permission to access Jira.
214
- *
215
- * @returns Returned if the request is successful.
216
- * @path {GET} /rest/api/3/mypreferences
217
- * @scopes-current manage:jira-configuration
218
- * @scopes-beta read:user-configuration:jira
219
- */
220
- getPreference({
221
- key,
222
- }: {
223
- /** The key of the preference. */
224
- key: string;
225
- }): Promise<string> {
226
- return this.getClientInstance()
227
- .request({
228
- path: "/rest/api/3/mypreferences",
229
- method: "GET",
230
- query: {
231
- key,
232
- },
233
- })
234
- .then(
235
- this.getClientInstance().responseHandler({
236
- 200: {
237
- "application/json": "json",
238
- },
239
- }),
240
- )
241
- .then(
242
- commonHttpClient.castResponse<{
243
- status: 200;
244
- mediaType: "application/json";
245
- body: string;
246
- }>(),
247
- )
248
- .then(
249
- validationSchemaStorage.validator(
250
- "MyselfService.getPreference.response",
251
- ),
252
- )
253
- .then(commonHttpClient.getBody);
254
- }
255
- /**
256
- * Deletes a preference of the user, which restores the default value of system
257
- * defined settings.
258
- *
259
- * Note that these keys are deprecated:
260
- *
261
- * * *jira.user.locale* The locale of the user. By default, not set. The user
262
- * takes the instance locale.
263
- * * *jira.user.timezone* The time zone of the user. By default, not set. The
264
- * user takes the instance timezone.
265
- *
266
- * Use [ Update a user
267
- * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch)
268
- * from the user management REST API to manage timezone and locale instead.
269
- *
270
- * **[Permissions](#permissions) required:** Permission to access Jira.
271
- *
272
- * @path {DELETE} /rest/api/3/mypreferences
273
- * @scopes-current manage:jira-configuration
274
- * @scopes-beta delete:user-configuration:jira
275
- */
276
- removePreference({
277
- key,
278
- }: {
279
- /** The key of the preference. */
280
- key: string;
281
- }): Promise<void> {
282
- return this.getClientInstance()
283
- .request({
284
- path: "/rest/api/3/mypreferences",
285
- method: "DELETE",
286
- query: {
287
- key,
288
- },
289
- })
290
- .then(commonHttpClient.discardResult);
291
- }
292
- /**
293
- * Deprecated, use [ Update a user
294
- * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch)
295
- * from the user management REST API instead.
296
- *
297
- * Sets the locale of the user. The locale must be one supported by the instance
298
- * of Jira.
299
- *
300
- * **[Permissions](#permissions) required:** Permission to access Jira.
301
- *
302
- * @deprecated
303
- * @returns Returned if the request is successful.
304
- * @path {PUT} /rest/api/3/mypreferences/locale
305
- */
306
- setLocale({
307
- locale,
308
- }: {
309
- /**
310
- * The locale defined in a LocaleBean.
311
- *
312
- * @example {
313
- * "locale": "en_US"
314
- * }
315
- */
316
- locale: Locale;
317
- }): Promise<void> {
318
- return this.getClientInstance()
319
- .request({
320
- path: "/rest/api/3/mypreferences/locale",
321
- method: "PUT",
322
- headers: {
323
- "Content-Type": "application/json",
324
- },
325
- body: locale,
326
- })
327
- .then(
328
- this.getClientInstance().responseHandler({
329
- 204: {
330
- "application/json": "json",
331
- },
332
- }),
333
- )
334
- .then(
335
- commonHttpClient.castResponse<{
336
- status: 204;
337
- mediaType: "application/json";
338
- body: void;
339
- }>(),
340
- )
341
- .then(
342
- validationSchemaStorage.validator("MyselfService.setLocale.response"),
343
- )
344
- .then(commonHttpClient.getBody);
345
- }
346
- /**
347
- * Creates a preference for the user or updates a preference's value by sending a
348
- * plain text string. For example, `false`. An arbitrary preference can be created
349
- * with the value containing up to 255 characters. In addition, the following keys
350
- * define system preferences that can be set or created:
351
- *
352
- * * *user.notifications.mimetype* The mime type used in notifications sent to
353
- * the user. Defaults to `html`.
354
- * * *user.default.share.private* Whether new [
355
- * filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private.
356
- * Defaults to `true`.
357
- * * *user.keyboard.shortcuts.disabled* Whether keyboard shortcuts are disabled.
358
- * Defaults to `false`.
359
- * * *user.autowatch.disabled* Whether the user automatically watches issues
360
- * they create or add a comment to. By default, not set: the user takes the
361
- * instance autowatch setting.
362
- * * *user.notifiy.own.changes* Whether the user gets notified of their own
363
- * changes.
364
- *
365
- * Note that these keys are deprecated:
366
- *
367
- * * *jira.user.locale* The locale of the user. By default, not set. The user
368
- * takes the instance locale.
369
- * * *jira.user.timezone* The time zone of the user. By default, not set. The
370
- * user takes the instance timezone.
371
- *
372
- * These system preferences keys will be deprecated by 15/07/2024. You can still
373
- * use these keys to create arbitrary preferences, but it will not have any impact
374
- * on Notification behaviour.
375
- *
376
- * * *user.notifications.watcher* Whether the user gets notified when they are
377
- * watcher.
378
- * * *user.notifications.assignee* Whether the user gets notified when they are
379
- * assignee.
380
- * * *user.notifications.reporter* Whether the user gets notified when they are
381
- * reporter.
382
- * * *user.notifications.mentions* Whether the user gets notified when they are
383
- * mentions.
384
- *
385
- * Use [ Update a user
386
- * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch)
387
- * from the user management REST API to manage timezone and locale instead.
388
- *
389
- * **[Permissions](#permissions) required:** Permission to access Jira.
390
- *
391
- * @returns Returned if the request is successful.
392
- * @path {PUT} /rest/api/3/mypreferences
393
- * @scopes-current manage:jira-configuration
394
- * @scopes-beta write:user-configuration:jira
395
- */
396
- setPreference({
397
- key,
398
- mediaType = "application/json",
399
- requestBody,
400
- }: {
401
- /** The key of the preference. The maximum length is 255 characters. */
402
- key: string;
403
- } & (
404
- | {
405
- mediaType?: "application/json";
406
- /**
407
- * The value of the preference as a plain text string. The maximum length is 255
408
- * characters.
409
- */
410
- requestBody: string;
411
- }
412
- | {
413
- mediaType: "text/plain";
414
- /**
415
- * The value of the preference as a plain text string. The maximum length is 255
416
- * characters.
417
- */
418
- requestBody: string;
419
- }
420
- )): Promise<void> {
421
- return this.getClientInstance()
422
- .request({
423
- path: "/rest/api/3/mypreferences",
424
- method: "PUT",
425
- query: {
426
- key,
427
- },
428
- headers: {
429
- "Content-Type": mediaType,
430
- },
431
- body: requestBody,
432
- })
433
- .then(
434
- this.getClientInstance().responseHandler({
435
- 204: {
436
- "application/json": "json",
437
- },
438
- }),
439
- )
440
- .then(
441
- commonHttpClient.castResponse<{
442
- status: 204;
443
- mediaType: "application/json";
444
- body: void;
445
- }>(),
446
- )
447
- .then(
448
- validationSchemaStorage.validator(
449
- "MyselfService.setPreference.response",
450
- ),
451
- )
452
- .then(commonHttpClient.getBody);
453
- }
454
- static initialize() {
455
- validationSchemaStorage.registerExtensible(
456
- "MyselfService.getPreference.response",
457
- z
458
- .object({
459
- status: z.literal(200),
460
- mediaType: z.literal("application/json"),
461
- body: z.string(),
462
- })
463
- .describe("MyselfService.getPreference.response"),
464
- );
465
- validationSchemaStorage.registerExtensible(
466
- "MyselfService.setPreference.response",
467
- z
468
- .object({
469
- status: z.literal(204),
470
- mediaType: z.literal("application/json"),
471
- body: z.unknown(),
472
- })
473
- .describe("MyselfService.setPreference.response"),
474
- );
475
- validationSchemaStorage.registerExtensible(
476
- "MyselfService.getLocale.response",
477
- z
478
- .object({
479
- status: z.literal(200),
480
- mediaType: z.literal("application/json"),
481
- body: validationSchemaStorage.lazy("Locale"),
482
- })
483
- .describe("MyselfService.getLocale.response"),
484
- );
485
- validationSchemaStorage.registerExtensible(
486
- "MyselfService.setLocale.response",
487
- z
488
- .object({
489
- status: z.literal(204),
490
- mediaType: z.literal("application/json"),
491
- body: z.unknown(),
492
- })
493
- .describe("MyselfService.setLocale.response"),
494
- );
495
- validationSchemaStorage.registerExtensible(
496
- "MyselfService.deleteLocale.response",
497
- z
498
- .object({
499
- status: z.literal(204),
500
- mediaType: z.literal("application/json"),
501
- body: z.unknown(),
502
- })
503
- .describe("MyselfService.deleteLocale.response"),
504
- );
505
- validationSchemaStorage.registerExtensible(
506
- "MyselfService.getCurrentUser.response",
507
- z
508
- .object({
509
- status: z.literal(200),
510
- mediaType: z.literal("application/json"),
511
- body: validationSchemaStorage.lazy("User"),
512
- })
513
- .describe("MyselfService.getCurrentUser.response"),
514
- );
515
- validationSchemaStorage.registerOnce([
516
- registerMyselfValidationSchemas,
517
- registerCommonValidationSchemas,
518
- ]);
519
- }
520
- }