@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,495 +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 { validationSchemaStorage } from "../validation-schema-storage";
9
- /**
10
- * Send security information to Jira Software and enable your teams to turn
11
- * unplanned vulnerabilities into planned and tracked work.
12
- *
13
- * Security is everyone's responsibility, and the security feature in Jira lets
14
- * you triage and track relevant vulnerabilities as a team. Discuss and prioritise
15
- * issues, minimise errors and duplication, and plan security work to complete in
16
- * your sprints.
17
- *
18
- * APIs related to integrating Security information with Jira Software are
19
- * available to Atlassian Connect apps. To use these APIs you must have the
20
- * Security module in your app's descriptor. Read more about Jira Software modules
21
- * [here](https://developer.atlassian.com/cloud/jira/software/about-jira-modules/).
22
- */
23
- export class SecurityInformationService extends CommonHttpService {
24
- /**
25
- * Bulk delete all linked Security Workspaces that match the given request.
26
- *
27
- * Only Connect apps that define the `jiraSecurityInfoProvider` module can access
28
- * this resource.
29
- * This resource requires the 'DELETE' scope for Connect apps.
30
- *
31
- * e.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666
32
- *
33
- * @path {DELETE} /rest/security/1.0/linkedWorkspaces/bulk
34
- */
35
- deleteLinkedWorkspaces({
36
- authorization,
37
- }: {
38
- /**
39
- * All requests must be signed with a Connect JWT token that corresponds to the
40
- * Provider app installed in Jira.
41
- *
42
- * If the JWT token corresponds to an app that does not define the Security
43
- * Information module it will be rejected with a 403.
44
- *
45
- * Read [understanding
46
- * jwt](https://developer.atlassian.com/blog/2015/01/understanding-jwt/) for more
47
- * details.
48
- */
49
- authorization: string;
50
- }): Promise<void> {
51
- return this.getClientInstance()
52
- .request({
53
- path: "/rest/security/1.0/linkedWorkspaces/bulk",
54
- method: "DELETE",
55
- headers: {
56
- Authorization: authorization,
57
- },
58
- })
59
- .then(commonHttpClient.discardResult);
60
- }
61
- /**
62
- * Bulk delete all Vulnerabilities that match the given request.
63
- *
64
- * One or more query params must be supplied to specify Properties to delete by.
65
- * If more than one Property is provided, data will be deleted that matches ALL of
66
- * the Properties (e.g. treated as an AND).
67
- * Read the POST bulk endpoint documentation for more details.
68
- *
69
- * e.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456
70
- *
71
- * Deletion is performed asynchronously. The GET vulnerability endpoint can be
72
- * used to confirm that data has been deleted successfully (if needed).
73
- *
74
- * Only Connect apps that define the `jiraSecurityInfoProvider` module can access
75
- * this resource.
76
- * This resource requires the 'DELETE' scope for Connect apps.
77
- *
78
- * @path {DELETE} /rest/security/1.0/bulkByProperties
79
- */
80
- deleteVulnerabilitiesByProperty({
81
- authorization,
82
- }: {
83
- /**
84
- * All requests must be signed with a Connect JWT token that corresponds to the
85
- * Provider app installed in Jira.
86
- *
87
- * If the JWT token corresponds to an app that does not define Security
88
- * Information module it will be rejected with a 403.
89
- *
90
- * Read more about JWT
91
- * [here](https://developer.atlassian.com/blog/2015/01/understanding-jwt/).
92
- */
93
- authorization: string;
94
- }): Promise<void> {
95
- return this.getClientInstance()
96
- .request({
97
- path: "/rest/security/1.0/bulkByProperties",
98
- method: "DELETE",
99
- headers: {
100
- Authorization: authorization,
101
- },
102
- })
103
- .then(commonHttpClient.discardResult);
104
- }
105
- /**
106
- * Delete the Vulnerability data currently stored for the given ID.
107
- *
108
- * Deletion is performed asynchronously. The GET vulnerability endpoint can be
109
- * used to confirm that data has been deleted successfully (if needed).
110
- *
111
- * Only Connect apps that define the `jiraSecurityInfoProvider` module can access
112
- * this resource.
113
- * This resource requires the 'DELETE' scope for Connect apps.
114
- *
115
- * @path {DELETE} /rest/security/1.0/vulnerability/{vulnerabilityId}
116
- */
117
- deleteVulnerabilityById({
118
- vulnerabilityId,
119
- authorization,
120
- }: {
121
- /** The ID of the Vulnerability to delete. */
122
- vulnerabilityId: string;
123
- /**
124
- * All requests must be signed with a Connect JWT token that corresponds to the
125
- * Provider app installed in Jira.
126
- *
127
- * If the JWT token corresponds to an app that does not define Security
128
- * Information module it will be rejected with a 403.
129
- *
130
- * Read more about JWT
131
- * [here](https://developer.atlassian.com/blog/2015/01/understanding-jwt/).
132
- */
133
- authorization: string;
134
- }): Promise<void> {
135
- return this.getClientInstance()
136
- .request({
137
- path: "/rest/security/1.0/vulnerability/{vulnerabilityId}",
138
- method: "DELETE",
139
- pathParams: {
140
- vulnerabilityId,
141
- },
142
- headers: {
143
- Authorization: authorization,
144
- },
145
- })
146
- .then(commonHttpClient.discardResult);
147
- }
148
- /**
149
- * Retrieve a specific Security Workspace linked to the Jira site for the given
150
- * workspace ID.
151
- *
152
- * The result will be what is currently stored, ignoring any pending updates or
153
- * deletes.
154
- *
155
- * Only Connect apps that define the `jiraSecurityInfoProvider` module can access
156
- * this resource.
157
- * This resource requires the 'READ' scope for Connect apps.
158
- *
159
- * @returns The Security Workspace information stored for the given ID.
160
- * @path {GET} /rest/security/1.0/linkedWorkspaces/{workspaceId}
161
- */
162
- getLinkedWorkspaceById({
163
- workspaceId,
164
- authorization,
165
- }: {
166
- /** The ID of the workspace to fetch. */
167
- workspaceId: string;
168
- /**
169
- * All requests must be signed with a Connect JWT token that corresponds to the
170
- * Provider app installed in Jira.
171
- *
172
- * If the JWT token corresponds to an app that does not define the Security
173
- * Information module it will be rejected with a 403.
174
- *
175
- * Read more about JWT
176
- * [here](https://developer.atlassian.com/blog/2015/01/understanding-jwt/).
177
- */
178
- authorization: string;
179
- }): Promise<unknown> {
180
- return this.getClientInstance()
181
- .request({
182
- path: "/rest/security/1.0/linkedWorkspaces/{workspaceId}",
183
- method: "GET",
184
- pathParams: {
185
- workspaceId,
186
- },
187
- headers: {
188
- Authorization: authorization,
189
- },
190
- })
191
- .then(
192
- this.getClientInstance().responseHandler({
193
- 200: {
194
- "application/json": "json",
195
- },
196
- }),
197
- )
198
- .then(
199
- commonHttpClient.castResponse<{
200
- status: 200;
201
- mediaType: "application/json";
202
- body: unknown;
203
- }>(),
204
- )
205
- .then(
206
- validationSchemaStorage.validator(
207
- "SecurityInformationService.getLinkedWorkspaceById.response",
208
- ),
209
- )
210
- .then(commonHttpClient.getBody);
211
- }
212
- /**
213
- * Retrieve all Security Workspaces linked with the Jira site.
214
- *
215
- * The result will be what is currently stored, ignoring any pending updates or
216
- * deletes.
217
- *
218
- * Only Connect apps that define the `jiraSecurityInfoProvider` module can access
219
- * this resource.
220
- * This resource requires the 'READ' scope for Connect apps.
221
- *
222
- * @returns A list of all stored workspace IDs.
223
- * @path {GET} /rest/security/1.0/linkedWorkspaces
224
- */
225
- getLinkedWorkspaces({
226
- authorization,
227
- }: {
228
- /**
229
- * All requests must be signed with a Connect JWT token that corresponds to the
230
- * Provider app installed in Jira.
231
- *
232
- * If the JWT token corresponds to an app that does not define the Security
233
- * Information module it will be rejected with a 403.
234
- *
235
- * Read more about JWT
236
- * [here](https://developer.atlassian.com/blog/2015/01/understanding-jwt/).
237
- */
238
- authorization: string;
239
- }): Promise<unknown> {
240
- return this.getClientInstance()
241
- .request({
242
- path: "/rest/security/1.0/linkedWorkspaces",
243
- method: "GET",
244
- headers: {
245
- Authorization: authorization,
246
- },
247
- })
248
- .then(
249
- this.getClientInstance().responseHandler({
250
- 200: {
251
- "application/json": "json",
252
- },
253
- }),
254
- )
255
- .then(
256
- commonHttpClient.castResponse<{
257
- status: 200;
258
- mediaType: "application/json";
259
- body: unknown;
260
- }>(),
261
- )
262
- .then(
263
- validationSchemaStorage.validator(
264
- "SecurityInformationService.getLinkedWorkspaces.response",
265
- ),
266
- )
267
- .then(commonHttpClient.getBody);
268
- }
269
- /**
270
- * Retrieve the currently stored Vulnerability data for the given ID.
271
- *
272
- * The result will be what is currently stored, ignoring any pending updates or
273
- * deletes.
274
- *
275
- * Only Connect apps that define the `jiraSecurityInfoProvider` module can access
276
- * this resource.
277
- * This resource requires the 'READ' scope for Connect apps.
278
- *
279
- * @returns The Vulnerability data currently stored for the given ID.
280
- * @path {GET} /rest/security/1.0/vulnerability/{vulnerabilityId}
281
- */
282
- getVulnerabilityById({
283
- vulnerabilityId,
284
- authorization,
285
- }: {
286
- /** The ID of the Vulnerability to fetch. */
287
- vulnerabilityId: string;
288
- /**
289
- * All requests must be signed with a Connect JWT token that corresponds to the
290
- * Provider app installed in Jira.
291
- *
292
- * If the JWT token corresponds to an app that does not define Security
293
- * Information module it will be rejected with a 403.
294
- *
295
- * Read more about JWT
296
- * [here](https://developer.atlassian.com/blog/2015/01/understanding-jwt/).
297
- */
298
- authorization: string;
299
- }): Promise<unknown> {
300
- return this.getClientInstance()
301
- .request({
302
- path: "/rest/security/1.0/vulnerability/{vulnerabilityId}",
303
- method: "GET",
304
- pathParams: {
305
- vulnerabilityId,
306
- },
307
- headers: {
308
- Authorization: authorization,
309
- },
310
- })
311
- .then(
312
- this.getClientInstance().responseHandler({
313
- 200: {
314
- "application/json": "json",
315
- },
316
- }),
317
- )
318
- .then(
319
- commonHttpClient.castResponse<{
320
- status: 200;
321
- mediaType: "application/json";
322
- body: unknown;
323
- }>(),
324
- )
325
- .then(
326
- validationSchemaStorage.validator(
327
- "SecurityInformationService.getVulnerabilityById.response",
328
- ),
329
- )
330
- .then(commonHttpClient.getBody);
331
- }
332
- /**
333
- * Update / Insert Vulnerability data.
334
- *
335
- * Vulnerabilities are identified by their ID, any existing Vulnerability data
336
- * with the same ID will be replaced if it exists and the updateSequenceNumber of
337
- * the existing data is less than the incoming data.
338
- *
339
- * Submissions are performed asynchronously. Most updates are available within a
340
- * short period of time but may take some time during peak load and/or maintenance
341
- * times. The GET vulnerability endpoint can be used to confirm that data has been
342
- * stored successfully (if needed).
343
- *
344
- * In the case of multiple Vulnerabilities being submitted in one request, each is
345
- * validated individually prior to submission. Details of Vulnerabilities that
346
- * failed submission (if any) are available in the response object.
347
- *
348
- * A maximum of 1000 vulnerabilities can be submitted in one request.
349
- *
350
- * Only Connect apps that define the `jiraSecurityInfoProvider` module can access
351
- * this resource.
352
- * This resource requires the 'WRITE' scope for Connect apps.
353
- *
354
- * @returns Submission accepted. Each Vulnerability submitted in a valid format will
355
- * eventually be available in Jira.
356
- *
357
- * Details of any Vulnerabilities that were submitted but failed submission (due
358
- * to data format problems, etc.) are available in the response object.
359
- * @path {POST} /rest/security/1.0/bulk
360
- */
361
- submitVulnerabilities({
362
- authorization,
363
- requestBody,
364
- }: {
365
- /**
366
- * All requests must be signed with a Connect JWT token that corresponds to the
367
- * Provider app installed in Jira.
368
- *
369
- * If the JWT token corresponds to an app that does not define the Security
370
- * Information module it will be rejected with a 403.
371
- *
372
- * Read more about JWT
373
- * [here](https://developer.atlassian.com/blog/2015/01/understanding-jwt/).
374
- */
375
- authorization: string;
376
- /** Vulnerability data to submit. */
377
- requestBody: unknown;
378
- }): Promise<unknown> {
379
- return this.getClientInstance()
380
- .request({
381
- path: "/rest/security/1.0/bulk",
382
- method: "POST",
383
- headers: {
384
- Authorization: authorization,
385
- "Content-Type": "application/json",
386
- },
387
- body: requestBody,
388
- })
389
- .then(
390
- this.getClientInstance().responseHandler({
391
- 202: {
392
- "application/json": "json",
393
- },
394
- }),
395
- )
396
- .then(
397
- commonHttpClient.castResponse<{
398
- status: 202;
399
- mediaType: "application/json";
400
- body: unknown;
401
- }>(),
402
- )
403
- .then(
404
- validationSchemaStorage.validator(
405
- "SecurityInformationService.submitVulnerabilities.response",
406
- ),
407
- )
408
- .then(commonHttpClient.getBody);
409
- }
410
- /**
411
- * Insert Security Workspace IDs to establish a relationship between them and the
412
- * Jira site the app is installed on. If a relationship between the workspace ID
413
- * and Jira already exists then the workspace ID will be ignored and Jira will
414
- * process the rest of the entries.
415
- *
416
- * Only Connect apps that define the `jiraSecurityInfoProvider` module can access
417
- * this resource.
418
- * This resource requires the 'WRITE' scope for Connect apps.
419
- *
420
- * @path {POST} /rest/security/1.0/linkedWorkspaces/bulk
421
- */
422
- submitWorkspaces({
423
- authorization,
424
- requestBody,
425
- }: {
426
- /**
427
- * All requests must be signed with a Connect JWT token that corresponds to the
428
- * Provider app installed in Jira.
429
- *
430
- * If the JWT token corresponds to an app that does not define the Security
431
- * Information module it will be rejected with a 403.
432
- *
433
- * Read [understanding
434
- * jwt](https://developer.atlassian.com/blog/2015/01/understanding-jwt/) for more
435
- * details.
436
- */
437
- authorization: string;
438
- /** Security Workspace IDs to submit. */
439
- requestBody: unknown;
440
- }): Promise<void> {
441
- return this.getClientInstance()
442
- .request({
443
- path: "/rest/security/1.0/linkedWorkspaces/bulk",
444
- method: "POST",
445
- headers: {
446
- Authorization: authorization,
447
- "Content-Type": "application/json",
448
- },
449
- body: requestBody,
450
- })
451
- .then(commonHttpClient.discardResult);
452
- }
453
- static initialize() {
454
- validationSchemaStorage.registerExtensible(
455
- "SecurityInformationService.submitVulnerabilities.response",
456
- z
457
- .object({
458
- status: z.literal(202),
459
- mediaType: z.literal("application/json"),
460
- body: z.unknown(),
461
- })
462
- .describe("SecurityInformationService.submitVulnerabilities.response"),
463
- );
464
- validationSchemaStorage.registerExtensible(
465
- "SecurityInformationService.getLinkedWorkspaces.response",
466
- z
467
- .object({
468
- status: z.literal(200),
469
- mediaType: z.literal("application/json"),
470
- body: z.unknown(),
471
- })
472
- .describe("SecurityInformationService.getLinkedWorkspaces.response"),
473
- );
474
- validationSchemaStorage.registerExtensible(
475
- "SecurityInformationService.getLinkedWorkspaceById.response",
476
- z
477
- .object({
478
- status: z.literal(200),
479
- mediaType: z.literal("application/json"),
480
- body: z.unknown(),
481
- })
482
- .describe("SecurityInformationService.getLinkedWorkspaceById.response"),
483
- );
484
- validationSchemaStorage.registerExtensible(
485
- "SecurityInformationService.getVulnerabilityById.response",
486
- z
487
- .object({
488
- status: z.literal(200),
489
- mediaType: z.literal("application/json"),
490
- body: z.unknown(),
491
- })
492
- .describe("SecurityInformationService.getVulnerabilityById.response"),
493
- );
494
- }
495
- }