@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,571 +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
- * APIs related to integrating builds data with Jira Software. These APIs
11
- * are available to Atlassian Connect apps. To use these APIs you must
12
- * have the Build module see
13
- * https://developer.atlassian.com/cloud/jira/software/modules/build/
14
- * in your app's descriptor. They are also related to integrating Jira
15
- * Software Cloud with on-premises tools using
16
- * OAuth 2.0 credentials, see
17
- * https://developer.atlassian.com/cloud/jira/software/integrate-jsw-cloud-with-onpremises-tools/.
18
- */
19
- export class BuildsService extends CommonHttpService {
20
- /**
21
- * Delete the build data currently stored for the given `pipelineId` and
22
- * `buildNumber` combination.
23
- *
24
- * Deletion is performed asynchronously. The `getBuildByKey` operation can be used
25
- * to confirm that data has been
26
- * deleted successfully (if needed).
27
- *
28
- * Only Connect apps that define the `jiraBuildInfoProvider` module, and
29
- * on-premise integrations, can access this resource.
30
- * This resource requires the 'DELETE' scope for Connect apps.
31
- *
32
- * @path {DELETE} /rest/builds/0.1/pipelines/{pipelineId}/builds/{buildNumber}
33
- */
34
- deleteBuildByKey({
35
- pipelineId,
36
- buildNumber,
37
- updateSequenceNumber,
38
- authorization,
39
- }: {
40
- /** The `pipelineId` of the build to delete. */
41
- pipelineId: string;
42
- /** The `buildNumber` of the build to delete. */
43
- buildNumber: number;
44
- /**
45
- * This parameter usage is no longer supported.
46
- *
47
- * An optional `_updateSequenceNumber` to use to control deletion.
48
- *
49
- * Only stored data with an `updateSequenceNumber` less than or equal to that
50
- * provided will be deleted.
51
- * This can be used help ensure submit/delete requests are applied correctly if
52
- * issued close together.
53
- *
54
- * @deprecated
55
- */
56
- updateSequenceNumber?: number;
57
- /**
58
- * All requests must be signed with either a Connect JWT token or OAuth token for
59
- * an on-premise integration that corresponds to an app installed in Jira.
60
- *
61
- * If the Connect JWT token corresponds to an app that does not define
62
- * `jiraBuildInfoProvider` module it will be rejected with a 403.
63
- *
64
- * See https://developer.atlassian.com/blog/2015/01/understanding-jwt/ for more
65
- * details about Connect JWT tokens.
66
- * See
67
- * https://developer.atlassian.com/cloud/jira/software/integrate-jsw-cloud-with-onpremises-tools/
68
- * for details about on-premise integrations.
69
- */
70
- authorization: string;
71
- }): Promise<void> {
72
- return this.getClientInstance()
73
- .request({
74
- path: "/rest/builds/0.1/pipelines/{pipelineId}/builds/{buildNumber}",
75
- method: "DELETE",
76
- pathParams: {
77
- pipelineId,
78
- buildNumber,
79
- },
80
- query: {
81
- _updateSequenceNumber: updateSequenceNumber,
82
- },
83
- headers: {
84
- Authorization: authorization,
85
- },
86
- })
87
- .then(commonHttpClient.discardResult);
88
- }
89
- /**
90
- * Bulk delete all builds data that match the given request.
91
- *
92
- * One or more query params must be supplied to specify Properties to delete by.
93
- * Optional param `_updateSequenceNumber` is no longer supported.
94
- * If more than one Property is provided, data will be deleted that matches ALL of
95
- * the
96
- * Properties (e.g. treated as an AND).
97
- *
98
- * See the documentation for the `submitBuilds` operation for more details.
99
- *
100
- * e.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345
101
- *
102
- * Deletion is performed asynchronously. The `getBuildByKey` operation can be used
103
- * to confirm that data has been
104
- * deleted successfully (if needed).
105
- *
106
- * Only Connect apps that define the `jiraBuildInfoProvider` module, and
107
- * on-premise integrations, can access this resource.
108
- * This resource requires the 'DELETE' scope for Connect apps.
109
- *
110
- * @path {DELETE} /rest/builds/0.1/bulkByProperties
111
- */
112
- deleteBuildsByProperty({
113
- updateSequenceNumber,
114
- authorization,
115
- }: {
116
- /**
117
- * This parameter usage is no longer supported.
118
- *
119
- * An optional `_updateSequenceNumber` to use to control deletion.
120
- *
121
- * Only stored data with an `updateSequenceNumber` less than or equal to that
122
- * provided will be deleted.
123
- * This can be used help ensure submit/delete requests are applied correctly if
124
- * issued close together.
125
- *
126
- * If not provided, all stored data that matches the request will be deleted.
127
- *
128
- * @deprecated
129
- */
130
- updateSequenceNumber?: number;
131
- /**
132
- * All requests must be signed with either a Connect JWT token or OAuth token for
133
- * an on-premise integration that corresponds to an app installed in Jira.
134
- *
135
- * If the Connect JWT token corresponds to an app that does not define
136
- * `jiraBuildInfoProvider` module it will be rejected with a 403.
137
- *
138
- * See https://developer.atlassian.com/blog/2015/01/understanding-jwt/ for more
139
- * details about Connect JWT tokens.
140
- * See
141
- * https://developer.atlassian.com/cloud/jira/software/integrate-jsw-cloud-with-onpremises-tools/
142
- * for details about on-premise integrations.
143
- */
144
- authorization: string;
145
- }): Promise<void> {
146
- return this.getClientInstance()
147
- .request({
148
- path: "/rest/builds/0.1/bulkByProperties",
149
- method: "DELETE",
150
- query: {
151
- _updateSequenceNumber: updateSequenceNumber,
152
- },
153
- headers: {
154
- Authorization: authorization,
155
- },
156
- })
157
- .then(commonHttpClient.discardResult);
158
- }
159
- /**
160
- * Retrieve the currently stored build data for the given `pipelineId` and
161
- * `buildNumber` combination.
162
- *
163
- * The result will be what is currently stored, ignoring any pending updates or
164
- * deletes.
165
- *
166
- * Only Connect apps that define the `jiraBuildInfoProvider` module, and
167
- * on-premise integrations, can access this resource.
168
- * This resource requires the 'READ' scope for Connect apps.
169
- *
170
- * @returns The build data currently stored for the given key.
171
- * @path {GET} /rest/builds/0.1/pipelines/{pipelineId}/builds/{buildNumber}
172
- */
173
- getBuildByKey({
174
- pipelineId,
175
- buildNumber,
176
- authorization,
177
- }: {
178
- /** The `pipelineId` of the build. */
179
- pipelineId: string;
180
- /** The `buildNumber` of the build. */
181
- buildNumber: number;
182
- /**
183
- * All requests must be signed with either a Connect JWT token or OAuth token for
184
- * an on-premise integration that corresponds to an app installed in Jira.
185
- *
186
- * If the Connect JWT token corresponds to an app that does not define
187
- * `jiraBuildInfoProvider` module it will be rejected with a 403.
188
- *
189
- * See https://developer.atlassian.com/blog/2015/01/understanding-jwt/ for more
190
- * details about Connect JWT tokens.
191
- * See
192
- * https://developer.atlassian.com/cloud/jira/software/integrate-jsw-cloud-with-onpremises-tools/
193
- * for details about on-premise integrations.
194
- */
195
- authorization: string;
196
- }): Promise<unknown> {
197
- return this.getClientInstance()
198
- .request({
199
- path: "/rest/builds/0.1/pipelines/{pipelineId}/builds/{buildNumber}",
200
- method: "GET",
201
- pathParams: {
202
- pipelineId,
203
- buildNumber,
204
- },
205
- headers: {
206
- Authorization: authorization,
207
- },
208
- })
209
- .then(
210
- this.getClientInstance().responseHandler({
211
- 200: {
212
- "application/json": "json",
213
- },
214
- }),
215
- )
216
- .then(
217
- commonHttpClient.castResponse<{
218
- status: 200;
219
- mediaType: "application/json";
220
- body: unknown;
221
- }>(),
222
- )
223
- .then(
224
- validationSchemaStorage.validator(
225
- "BuildsService.getBuildByKey.response",
226
- ),
227
- )
228
- .then(commonHttpClient.getBody);
229
- }
230
- /**
231
- * Update / insert builds data.
232
- *
233
- * Builds are identified by the combination of `pipelineId` and `buildNumber`, and
234
- * existing build data for the same
235
- * build will be replaced if it exists and the `updateSequenceNumber` of the
236
- * existing data is less than the
237
- * incoming data.
238
- *
239
- * Submissions are performed asynchronously. Submitted data will eventually be
240
- * available in Jira; most updates are
241
- * available within a short period of time, but may take some time during peak
242
- * load and/or maintenance times.
243
- * The `getBuildByKey` operation can be used to confirm that data has been stored
244
- * successfully (if needed).
245
- *
246
- * In the case of multiple builds being submitted in one request, each is
247
- * validated individually prior to
248
- * submission. Details of which build failed submission (if any) are available in
249
- * the response object.
250
- *
251
- * Only Connect apps that define the `jiraBuildInfoProvider` module, and
252
- * on-premise integrations, can access this resource.
253
- * This resource requires the 'WRITE' scope for Connect apps.
254
- *
255
- * @returns Submission accepted. Each submitted build that is of a valid format will be
256
- * eventually available in Jira.
257
- *
258
- * Details of which builds were submitted and which failed submission (due to data
259
- * format problems etc.)
260
- * are available in the response object.
261
- * @path {POST} /rest/builds/0.1/bulk
262
- */
263
- submitBuilds({
264
- authorization,
265
- requestBody,
266
- }: {
267
- /**
268
- * All requests must be signed with either a Connect JWT token or OAuth token for
269
- * an on-premise integration that corresponds to an app installed in Jira.
270
- *
271
- * If the Connect JWT token corresponds to an app that does not define
272
- * `jiraBuildInfoProvider` module it will be rejected with a 403.
273
- *
274
- * See https://developer.atlassian.com/blog/2015/01/understanding-jwt/ for more
275
- * details about Connect JWT tokens.
276
- * See
277
- * https://developer.atlassian.com/cloud/jira/software/integrate-jsw-cloud-with-onpremises-tools/
278
- * for details about on-premise integrations.
279
- */
280
- authorization: string;
281
- /** Builds data to submit. */
282
- requestBody: {
283
- /**
284
- * Properties
285
- *
286
- * Properties assigned to build data that can then be used for delete / query
287
- * operations.
288
- *
289
- * Examples might be an account or user ID that can then be used to clean up data
290
- * if an account is removed from
291
- * the Provider system.
292
- *
293
- * Note that these properties will never be returned with build data. They are not
294
- * intended for use as
295
- * metadata to associate with a build. Internally they are stored as a hash so
296
- * that personal information etc.
297
- * is never stored within Jira.
298
- *
299
- * Properties are supplied as key/value pairs, a maximum of 5 properties can be
300
- * supplied, and keys must not
301
- * contain ':' or start with '_'.
302
- *
303
- * @example {
304
- * "accountId": "account-234",
305
- * "projectId": "project-123"
306
- * }
307
- */
308
- properties?: {
309
- [key: string]: string;
310
- };
311
- /**
312
- * A list of builds to submit to Jira.
313
- *
314
- * Each build may be associated with one or more Jira issue keys, and will be
315
- * associated with any properties
316
- * included in this request.
317
- */
318
- builds: unknown[];
319
- /**
320
- * ProviderMetadata
321
- *
322
- * Information about the provider. This is useful for auditing, logging, debugging,
323
- * and other internal uses. It is not considered private information. Hence, it
324
- * may not contain personally
325
- * identifiable information.
326
- */
327
- providerMetadata?: {
328
- /**
329
- * An optional name of the source of the builds data.
330
- *
331
- * @example Bamboo 6.10.2
332
- */
333
- product?: string;
334
- } & {
335
- [key: string]: unknown;
336
- };
337
- } & {
338
- [key: string]: unknown;
339
- };
340
- }): Promise<
341
- {
342
- /**
343
- * The keys of builds that have been accepted for submission. A build key is a
344
- * composite key that consists of
345
- * `pipelineId` and `buildNumber`.
346
- *
347
- * A build may be rejected if it was only associated with unknown issue keys, or
348
- * if the submitted data for that
349
- * build does not match the required schema.
350
- *
351
- * Note that a build that isn't updated due to it's `updateSequenceNumber` being
352
- * out of order is not
353
- * considered a failed submission.
354
- */
355
- acceptedBuilds?: ({
356
- /**
357
- * An ID that relates a sequence of builds. Depending on your system this might be
358
- * a project ID, pipeline ID,
359
- * plan key etc. - whatever logical unit you use to group a sequence of builds.
360
- *
361
- * The combination of `pipelineId` and `buildNumber` must uniquely identify the
362
- * build.
363
- *
364
- * @example my-build-plan
365
- */
366
- pipelineId: string;
367
- /**
368
- * Identifies a build within the sequence of builds identified by the build
369
- * `pipelineId`.
370
- *
371
- * Used to identify the 'most recent' build in that sequence of builds.
372
- *
373
- * The combination of `pipelineId` and `buildNumber` must uniquely identify the
374
- * build.
375
- *
376
- * @example 16
377
- */
378
- buildNumber: number;
379
- } & {
380
- [key: string]: unknown;
381
- })[];
382
- /**
383
- * Details of builds that have not been accepted for submission.
384
- *
385
- * A build may be rejected if it was only associated with unknown issue keys, or
386
- * if the submitted data for the
387
- * build does not match the required schema.
388
- */
389
- rejectedBuilds?: ({
390
- /**
391
- * BuildKey
392
- *
393
- * Fields that uniquely reference a build.
394
- */
395
- key: {
396
- /**
397
- * An ID that relates a sequence of builds. Depending on your system this might be
398
- * a project ID, pipeline ID,
399
- * plan key etc. - whatever logical unit you use to group a sequence of builds.
400
- *
401
- * The combination of `pipelineId` and `buildNumber` must uniquely identify the
402
- * build.
403
- *
404
- * @example my-build-plan
405
- */
406
- pipelineId: string;
407
- /**
408
- * Identifies a build within the sequence of builds identified by the build
409
- * `pipelineId`.
410
- *
411
- * Used to identify the 'most recent' build in that sequence of builds.
412
- *
413
- * The combination of `pipelineId` and `buildNumber` must uniquely identify the
414
- * build.
415
- *
416
- * @example 16
417
- */
418
- buildNumber: number;
419
- } & {
420
- [key: string]: unknown;
421
- };
422
- /** The error messages for the rejected build */
423
- errors: ({
424
- /** A human-readable message describing the error. */
425
- message: string;
426
- /**
427
- * An optional trace ID that can be used by Jira developers to locate the source
428
- * of the error.
429
- */
430
- errorTraceId?: string;
431
- } & {
432
- [key: string]: unknown;
433
- })[];
434
- } & {
435
- [key: string]: unknown;
436
- })[];
437
- /**
438
- * Issue keys that are not known on this Jira instance (if any).
439
- *
440
- * These may be invalid keys (e.g. `UTF-8` is sometimes incorrectly identified as
441
- * a Jira issue key), or they
442
- * may be for projects that no longer exist.
443
- *
444
- * If a build has been associated with issue keys other than those in this array
445
- * it will still be stored against
446
- * those valid keys. If a build was only associated with issue keys deemed to be
447
- * invalid it won't be persisted.
448
- */
449
- unknownIssueKeys?: string[];
450
- } & {
451
- [key: string]: unknown;
452
- }
453
- > {
454
- return this.getClientInstance()
455
- .request({
456
- path: "/rest/builds/0.1/bulk",
457
- method: "POST",
458
- headers: {
459
- Authorization: authorization,
460
- "Content-Type": "application/json",
461
- },
462
- body: requestBody,
463
- })
464
- .then(
465
- this.getClientInstance().responseHandler({
466
- 202: {
467
- "application/json": "json",
468
- },
469
- }),
470
- )
471
- .then(
472
- commonHttpClient.castResponse<{
473
- status: 202;
474
- mediaType: "application/json";
475
- body: {
476
- acceptedBuilds?: ({
477
- pipelineId: string;
478
- buildNumber: number;
479
- } & {
480
- [key: string]: unknown;
481
- })[];
482
- rejectedBuilds?: ({
483
- key: {
484
- pipelineId: string;
485
- buildNumber: number;
486
- } & {
487
- [key: string]: unknown;
488
- };
489
- errors: ({
490
- message: string;
491
- errorTraceId?: string;
492
- } & {
493
- [key: string]: unknown;
494
- })[];
495
- } & {
496
- [key: string]: unknown;
497
- })[];
498
- unknownIssueKeys?: string[];
499
- } & {
500
- [key: string]: unknown;
501
- };
502
- }>(),
503
- )
504
- .then(
505
- validationSchemaStorage.validator(
506
- "BuildsService.submitBuilds.response",
507
- ),
508
- )
509
- .then(commonHttpClient.getBody);
510
- }
511
- static initialize() {
512
- validationSchemaStorage.registerExtensible(
513
- "BuildsService.submitBuilds.response",
514
- z
515
- .object({
516
- status: z.literal(202),
517
- mediaType: z.literal("application/json"),
518
- body: z
519
- .object({
520
- acceptedBuilds: z
521
- .array(
522
- z
523
- .object({
524
- pipelineId: z.string().max(255),
525
- buildNumber: z.number().int(),
526
- })
527
- .catchall(z.unknown()),
528
- )
529
- .optional(),
530
- rejectedBuilds: z
531
- .array(
532
- z
533
- .object({
534
- key: z
535
- .object({
536
- pipelineId: z.string().max(255),
537
- buildNumber: z.number().int(),
538
- })
539
- .catchall(z.unknown()),
540
- errors: z.array(
541
- z
542
- .object({
543
- message: z.string(),
544
- errorTraceId: z.string().optional(),
545
- })
546
- .catchall(z.unknown()),
547
- ),
548
- })
549
- .catchall(z.unknown()),
550
- )
551
- .optional(),
552
- unknownIssueKeys: z
553
- .array(z.string().regex(new RegExp("^\\w{1,255}-\\d{1,255}$")))
554
- .optional(),
555
- })
556
- .catchall(z.unknown()),
557
- })
558
- .describe("BuildsService.submitBuilds.response"),
559
- );
560
- validationSchemaStorage.registerExtensible(
561
- "BuildsService.getBuildByKey.response",
562
- z
563
- .object({
564
- status: z.literal(200),
565
- mediaType: z.literal("application/json"),
566
- body: z.unknown(),
567
- })
568
- .describe("BuildsService.getBuildByKey.response"),
569
- );
570
- }
571
- }