@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,458 +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 ContainerForRegisteredWebhooks,
10
- type ContainerForWebhookIds,
11
- type FailedWebhooks,
12
- type PageBeanWebhook,
13
- registerWebhooksValidationSchemas,
14
- type WebhookRegistrationDetails,
15
- type WebhooksExpirationDate,
16
- } from "../models/webhooks";
17
- import { validationSchemaStorage } from "../validation-schema-storage";
18
- /**
19
- * This resource represents webhooks. Webhooks are calls sent to a URL when an
20
- * event occurs in Jira for issues specified by a JQL query. Only Connect and
21
- * OAuth 2.0 apps can register and manage webhooks. For more information, see
22
- * [Webhooks](https://developer.atlassian.com/cloud/jira/platform/webhooks/#registering-a-webhook-via-the-jira-rest-api-for-connect-apps).
23
- */
24
- export class WebhooksService extends CommonHttpService {
25
- /**
26
- * Removes webhooks by ID. Only webhooks registered by the calling app are
27
- * removed. If webhooks created by other apps are specified, they are ignored.
28
- *
29
- * **[Permissions](#permissions) required:** Only
30
- * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps)
31
- * and [OAuth
32
- * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps
33
- * can use this operation.
34
- *
35
- * @path {DELETE} /rest/api/3/webhook
36
- * @scopes-current read:jira-work, manage:jira-webhook
37
- * @scopes-beta delete:webhook:jira
38
- */
39
- deleteWebhookById({
40
- containerForWebhookIds,
41
- }: {
42
- /**
43
- * @example {
44
- * "webhookIds": [
45
- * 10000,
46
- * 10001,
47
- * 10042
48
- * ]
49
- * }
50
- */
51
- containerForWebhookIds: ContainerForWebhookIds;
52
- }): Promise<void> {
53
- return this.getClientInstance()
54
- .request({
55
- path: "/rest/api/3/webhook",
56
- method: "DELETE",
57
- headers: {
58
- "Content-Type": "application/json",
59
- },
60
- body: containerForWebhookIds,
61
- })
62
- .then(commonHttpClient.discardResult);
63
- }
64
- /**
65
- * Returns a [paginated](#pagination) list of the webhooks registered by the
66
- * calling app.
67
- *
68
- * **[Permissions](#permissions) required:** Only
69
- * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps)
70
- * and [OAuth
71
- * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps
72
- * can use this operation.
73
- *
74
- * @returns Returned if the request is successful.
75
- *
76
- * example: {
77
- * "isLast": true,
78
- * "maxResults": 3,
79
- * "startAt": 0,
80
- * "total": 3,
81
- * "values": [
82
- * {
83
- * "events": [
84
- * "jira:issue_updated",
85
- * "jira:issue_created"
86
- * ],
87
- * "expirationDate": "2019-06-01T12:42:30.000+0000",
88
- * "fieldIdsFilter": [
89
- * "summary",
90
- * "customfield_10029"
91
- * ],
92
- * "id": 10000,
93
- * "jqlFilter": "project = PRJ"
94
- * },
95
- * {
96
- * "events": [
97
- * "jira:issue_created"
98
- * ],
99
- * "expirationDate": "2019-06-01T12:42:30.000+0000",
100
- * "id": 10001,
101
- * "jqlFilter": "issuetype = Bug"
102
- * },
103
- * {
104
- * "events": [
105
- * "issue_property_set"
106
- * ],
107
- * "expirationDate": "2019-06-01T12:42:30.000+0000",
108
- * "id": 10002,
109
- * "issuePropertyKeysFilter": [
110
- * "my-issue-property-key"
111
- * ],
112
- * "jqlFilter": "project = PRJ"
113
- * }
114
- * ]
115
- * }
116
- * @path {GET} /rest/api/3/webhook
117
- * @scopes-current read:jira-work, manage:jira-webhook
118
- * @scopes-beta read:webhook:jira, read:jql:jira
119
- */
120
- getDynamicWebhooksForApp({
121
- startAt,
122
- maxResults,
123
- }: {
124
- /** The index of the first item to return in a page of results (page offset). */
125
- startAt?: number;
126
- /** The maximum number of items to return per page. */
127
- maxResults?: number;
128
- }): Promise<PageBeanWebhook> {
129
- return this.getClientInstance()
130
- .request({
131
- path: "/rest/api/3/webhook",
132
- method: "GET",
133
- query: {
134
- startAt,
135
- maxResults,
136
- },
137
- })
138
- .then(
139
- this.getClientInstance().responseHandler({
140
- 200: {
141
- "application/json": "json",
142
- },
143
- }),
144
- )
145
- .then(
146
- commonHttpClient.castResponse<{
147
- status: 200;
148
- mediaType: "application/json";
149
- body: PageBeanWebhook;
150
- }>(),
151
- )
152
- .then(
153
- validationSchemaStorage.validator(
154
- "WebhooksService.getDynamicWebhooksForApp.response",
155
- ),
156
- )
157
- .then(commonHttpClient.getBody);
158
- }
159
- /**
160
- * Returns webhooks that have recently failed to be delivered to the requesting
161
- * app after the maximum number of retries.
162
- *
163
- * After 72 hours the failure may no longer be returned by this operation.
164
- *
165
- * The oldest failure is returned first.
166
- *
167
- * This method uses a cursor-based pagination. To request the next page use the
168
- * failure time of the last webhook on the list as the `failedAfter` value or use
169
- * the URL provided in `next`.
170
- *
171
- * **[Permissions](#permissions) required:** Only [Connect
172
- * apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps)
173
- * can use this operation.
174
- *
175
- * @returns Returned if the request is successful.
176
- *
177
- * example: {
178
- * "values": [
179
- * {
180
- * "id": "1",
181
- * "body": "{\"data\":\"webhook data\"}",
182
- * "url": "https://example.com",
183
- * "failureTime": 1573118132000
184
- * },
185
- * {
186
- * "id": "2",
187
- * "url": "https://example.com",
188
- * "failureTime": 1573540473480
189
- * }
190
- * ],
191
- * "maxResults": 100,
192
- * "next":
193
- * "https://your-domain.atlassian.net/rest/api/3/webhook/failed?failedAfter=1573540473480&maxResults=100"
194
- * }
195
- * @path {GET} /rest/api/3/webhook/failed
196
- * @scopes-current read:jira-work, manage:jira-webhook
197
- * @scopes-beta read:issue-details:jira, read:webhook:jira, read:comment.property:jira,
198
- * read:group:jira, read:issue-type:jira, read:project-role:jira,
199
- * read:epic:jira-software
200
- */
201
- getFailedWebhooks({
202
- maxResults,
203
- after,
204
- }: {
205
- /**
206
- * The maximum number of webhooks to return per page. If obeying the maxResults
207
- * directive would result in records with the same failure time being split across
208
- * pages, the directive is ignored and all records with the same failure time
209
- * included on the page.
210
- */
211
- maxResults?: number;
212
- /**
213
- * The time after which any webhook failure must have occurred for the record to
214
- * be returned, expressed as milliseconds since the UNIX epoch.
215
- */
216
- after?: number;
217
- }): Promise<FailedWebhooks> {
218
- return this.getClientInstance()
219
- .request({
220
- path: "/rest/api/3/webhook/failed",
221
- method: "GET",
222
- query: {
223
- maxResults,
224
- after,
225
- },
226
- })
227
- .then(
228
- this.getClientInstance().responseHandler({
229
- 200: {
230
- "application/json": "json",
231
- },
232
- }),
233
- )
234
- .then(
235
- commonHttpClient.castResponse<{
236
- status: 200;
237
- mediaType: "application/json";
238
- body: FailedWebhooks;
239
- }>(),
240
- )
241
- .then(
242
- validationSchemaStorage.validator(
243
- "WebhooksService.getFailedWebhooks.response",
244
- ),
245
- )
246
- .then(commonHttpClient.getBody);
247
- }
248
- /**
249
- * Extends the life of webhook. Webhooks registered through the REST API expire
250
- * after 30 days. Call this operation to keep them alive.
251
- *
252
- * Unrecognized webhook IDs (those that are not found or belong to other apps) are
253
- * ignored.
254
- *
255
- * **[Permissions](#permissions) required:** Only
256
- * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps)
257
- * and [OAuth
258
- * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps
259
- * can use this operation.
260
- *
261
- * @returns Returned if the request is successful.
262
- *
263
- * example: {
264
- * "expirationDate": "2019-06-01T12:42:30.000+0000"
265
- * }
266
- * @path {PUT} /rest/api/3/webhook/refresh
267
- * @scopes-current read:jira-work, manage:jira-webhook
268
- * @scopes-beta write:webhook:jira, read:webhook:jira
269
- */
270
- refreshWebhooks({
271
- containerForWebhookIds,
272
- }: {
273
- /**
274
- * @example {
275
- * "webhookIds": [
276
- * 10000,
277
- * 10001,
278
- * 10042
279
- * ]
280
- * }
281
- */
282
- containerForWebhookIds: ContainerForWebhookIds;
283
- }): Promise<WebhooksExpirationDate> {
284
- return this.getClientInstance()
285
- .request({
286
- path: "/rest/api/3/webhook/refresh",
287
- method: "PUT",
288
- headers: {
289
- "Content-Type": "application/json",
290
- },
291
- body: containerForWebhookIds,
292
- })
293
- .then(
294
- this.getClientInstance().responseHandler({
295
- 200: {
296
- "application/json": "json",
297
- },
298
- }),
299
- )
300
- .then(
301
- commonHttpClient.castResponse<{
302
- status: 200;
303
- mediaType: "application/json";
304
- body: WebhooksExpirationDate;
305
- }>(),
306
- )
307
- .then(
308
- validationSchemaStorage.validator(
309
- "WebhooksService.refreshWebhooks.response",
310
- ),
311
- )
312
- .then(commonHttpClient.getBody);
313
- }
314
- /**
315
- * Registers webhooks.
316
- *
317
- * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a
318
- * match between the app owner and the user who registered a dynamic webhook.
319
- *
320
- * **[Permissions](#permissions) required:** Only
321
- * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps)
322
- * and [OAuth
323
- * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps
324
- * can use this operation.
325
- *
326
- * @returns Returned if the request is successful.
327
- *
328
- * example: {
329
- * "webhookRegistrationResult": [
330
- * {
331
- * "createdWebhookId": 1000
332
- * },
333
- * {
334
- * "errors": [
335
- * "The clause watchCount is unsupported"
336
- * ]
337
- * },
338
- * {
339
- * "createdWebhookId": 1001
340
- * }
341
- * ]
342
- * }
343
- * @path {POST} /rest/api/3/webhook
344
- * @scopes-current read:jira-work, manage:jira-webhook
345
- * @scopes-beta read:field:jira, read:project:jira, write:webhook:jira
346
- */
347
- registerDynamicWebhooks({
348
- webhookRegistrationDetails,
349
- }: {
350
- /**
351
- * @example {
352
- * "url": "https://your-app.example.com/webhook-received",
353
- * "webhooks": [
354
- * {
355
- * "events": [
356
- * "jira:issue_created",
357
- * "jira:issue_updated"
358
- * ],
359
- * "fieldIdsFilter": [
360
- * "summary",
361
- * "customfield_10029"
362
- * ],
363
- * "jqlFilter": "project = PROJ"
364
- * },
365
- * {
366
- * "events": [
367
- * "jira:issue_deleted"
368
- * ],
369
- * "jqlFilter": "project IN (PROJ, EXP) AND status = done"
370
- * },
371
- * {
372
- * "events": [
373
- * "issue_property_set"
374
- * ],
375
- * "issuePropertyKeysFilter": [
376
- * "my-issue-property-key"
377
- * ],
378
- * "jqlFilter": "project = PROJ"
379
- * }
380
- * ]
381
- * }
382
- */
383
- webhookRegistrationDetails: WebhookRegistrationDetails;
384
- }): Promise<ContainerForRegisteredWebhooks> {
385
- return this.getClientInstance()
386
- .request({
387
- path: "/rest/api/3/webhook",
388
- method: "POST",
389
- headers: {
390
- "Content-Type": "application/json",
391
- },
392
- body: webhookRegistrationDetails,
393
- })
394
- .then(
395
- this.getClientInstance().responseHandler({
396
- 200: {
397
- "application/json": "json",
398
- },
399
- }),
400
- )
401
- .then(
402
- commonHttpClient.castResponse<{
403
- status: 200;
404
- mediaType: "application/json";
405
- body: ContainerForRegisteredWebhooks;
406
- }>(),
407
- )
408
- .then(
409
- validationSchemaStorage.validator(
410
- "WebhooksService.registerDynamicWebhooks.response",
411
- ),
412
- )
413
- .then(commonHttpClient.getBody);
414
- }
415
- static initialize() {
416
- validationSchemaStorage.registerExtensible(
417
- "WebhooksService.getDynamicWebhooksForApp.response",
418
- z
419
- .object({
420
- status: z.literal(200),
421
- mediaType: z.literal("application/json"),
422
- body: validationSchemaStorage.lazy("PageBeanWebhook"),
423
- })
424
- .describe("WebhooksService.getDynamicWebhooksForApp.response"),
425
- );
426
- validationSchemaStorage.registerExtensible(
427
- "WebhooksService.registerDynamicWebhooks.response",
428
- z
429
- .object({
430
- status: z.literal(200),
431
- mediaType: z.literal("application/json"),
432
- body: validationSchemaStorage.lazy("ContainerForRegisteredWebhooks"),
433
- })
434
- .describe("WebhooksService.registerDynamicWebhooks.response"),
435
- );
436
- validationSchemaStorage.registerExtensible(
437
- "WebhooksService.getFailedWebhooks.response",
438
- z
439
- .object({
440
- status: z.literal(200),
441
- mediaType: z.literal("application/json"),
442
- body: validationSchemaStorage.lazy("FailedWebhooks"),
443
- })
444
- .describe("WebhooksService.getFailedWebhooks.response"),
445
- );
446
- validationSchemaStorage.registerExtensible(
447
- "WebhooksService.refreshWebhooks.response",
448
- z
449
- .object({
450
- status: z.literal(200),
451
- mediaType: z.literal("application/json"),
452
- body: validationSchemaStorage.lazy("WebhooksExpirationDate"),
453
- })
454
- .describe("WebhooksService.refreshWebhooks.response"),
455
- );
456
- validationSchemaStorage.registerOnce([registerWebhooksValidationSchemas]);
457
- }
458
- }