@resolution/confluence-api-client 0.4.4 → 0.4.5
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.
- package/CHANGELOG.md +11 -0
- package/lib/openapi/v1/services/AnalyticsService.d.ts +10 -10
- package/lib/openapi/v1/services/AnalyticsService.js +62 -59
- package/lib/openapi/v1/services/AnalyticsService.js.map +1 -1
- package/lib/openapi/v1/services/AuditService.d.ts +25 -25
- package/lib/openapi/v1/services/AuditService.js +205 -202
- package/lib/openapi/v1/services/AuditService.js.map +1 -1
- package/lib/openapi/v1/services/ContentAttachmentsService.d.ts +20 -20
- package/lib/openapi/v1/services/ContentAttachmentsService.js +317 -314
- package/lib/openapi/v1/services/ContentAttachmentsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentBodyService.d.ts +15 -15
- package/lib/openapi/v1/services/ContentBodyService.js +140 -137
- package/lib/openapi/v1/services/ContentBodyService.js.map +1 -1
- package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.d.ts +27 -27
- package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.js +391 -388
- package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentCommentsService.d.ts +8 -8
- package/lib/openapi/v1/services/ContentCommentsService.js +49 -46
- package/lib/openapi/v1/services/ContentCommentsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentLabelsService.d.ts +11 -11
- package/lib/openapi/v1/services/ContentLabelsService.js +150 -147
- package/lib/openapi/v1/services/ContentLabelsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentMacroBodyService.d.ts +13 -13
- package/lib/openapi/v1/services/ContentMacroBodyService.js +155 -152
- package/lib/openapi/v1/services/ContentMacroBodyService.js.map +1 -1
- package/lib/openapi/v1/services/ContentPermissionsService.d.ts +2 -2
- package/lib/openapi/v1/services/ContentPermissionsService.js +48 -45
- package/lib/openapi/v1/services/ContentPermissionsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentPropertiesService.d.ts +18 -18
- package/lib/openapi/v1/services/ContentPropertiesService.js +237 -234
- package/lib/openapi/v1/services/ContentPropertiesService.js.map +1 -1
- package/lib/openapi/v1/services/ContentRestrictionsService.d.ts +49 -49
- package/lib/openapi/v1/services/ContentRestrictionsService.js +505 -502
- package/lib/openapi/v1/services/ContentRestrictionsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentService.d.ts +50 -50
- package/lib/openapi/v1/services/ContentService.js +475 -472
- package/lib/openapi/v1/services/ContentService.js.map +1 -1
- package/lib/openapi/v1/services/ContentStatesService.d.ts +25 -25
- package/lib/openapi/v1/services/ContentStatesService.js +359 -356
- package/lib/openapi/v1/services/ContentStatesService.js.map +1 -1
- package/lib/openapi/v1/services/ContentVersionsService.d.ts +13 -13
- package/lib/openapi/v1/services/ContentVersionsService.js +144 -141
- package/lib/openapi/v1/services/ContentVersionsService.js.map +1 -1
- package/lib/openapi/v1/services/ContentWatchesService.d.ts +57 -57
- package/lib/openapi/v1/services/ContentWatchesService.js +454 -451
- package/lib/openapi/v1/services/ContentWatchesService.js.map +1 -1
- package/lib/openapi/v1/services/DynamicModulesService.d.ts +5 -5
- package/lib/openapi/v1/services/DynamicModulesService.js +70 -67
- package/lib/openapi/v1/services/DynamicModulesService.js.map +1 -1
- package/lib/openapi/v1/services/ExperimentalService.d.ts +12 -12
- package/lib/openapi/v1/services/ExperimentalService.js +151 -148
- package/lib/openapi/v1/services/ExperimentalService.js.map +1 -1
- package/lib/openapi/v1/services/GroupService.d.ts +52 -52
- package/lib/openapi/v1/services/GroupService.js +445 -442
- package/lib/openapi/v1/services/GroupService.js.map +1 -1
- package/lib/openapi/v1/services/InlineTasksService.d.ts +20 -20
- package/lib/openapi/v1/services/InlineTasksService.js +118 -115
- package/lib/openapi/v1/services/InlineTasksService.js.map +1 -1
- package/lib/openapi/v1/services/LabelInfoService.d.ts +5 -5
- package/lib/openapi/v1/services/LabelInfoService.js +37 -34
- package/lib/openapi/v1/services/LabelInfoService.js.map +1 -1
- package/lib/openapi/v1/services/LongRunningTaskService.d.ts +8 -6
- package/lib/openapi/v1/services/LongRunningTaskService.js +67 -63
- package/lib/openapi/v1/services/LongRunningTaskService.js.map +1 -1
- package/lib/openapi/v1/services/RelationService.d.ts +37 -37
- package/lib/openapi/v1/services/RelationService.js +231 -228
- package/lib/openapi/v1/services/RelationService.js.map +1 -1
- package/lib/openapi/v1/services/SearchService.d.ts +20 -20
- package/lib/openapi/v1/services/SearchService.js +136 -133
- package/lib/openapi/v1/services/SearchService.js.map +1 -1
- package/lib/openapi/v1/services/SettingsService.d.ts +15 -15
- package/lib/openapi/v1/services/SettingsService.js +204 -201
- package/lib/openapi/v1/services/SettingsService.js.map +1 -1
- package/lib/openapi/v1/services/SpacePermissionsService.d.ts +6 -6
- package/lib/openapi/v1/services/SpacePermissionsService.js +99 -96
- package/lib/openapi/v1/services/SpacePermissionsService.js.map +1 -1
- package/lib/openapi/v1/services/SpacePropertiesService.d.ts +16 -16
- package/lib/openapi/v1/services/SpacePropertiesService.js +227 -224
- package/lib/openapi/v1/services/SpacePropertiesService.js.map +1 -1
- package/lib/openapi/v1/services/SpaceService.d.ts +38 -38
- package/lib/openapi/v1/services/SpaceService.js +320 -317
- package/lib/openapi/v1/services/SpaceService.js.map +1 -1
- package/lib/openapi/v1/services/SpaceSettingsService.d.ts +4 -4
- package/lib/openapi/v1/services/SpaceSettingsService.js +68 -65
- package/lib/openapi/v1/services/SpaceSettingsService.js.map +1 -1
- package/lib/openapi/v1/services/TemplateService.d.ts +20 -20
- package/lib/openapi/v1/services/TemplateService.js +214 -211
- package/lib/openapi/v1/services/TemplateService.js.map +1 -1
- package/lib/openapi/v1/services/ThemesService.d.ts +13 -13
- package/lib/openapi/v1/services/ThemesService.js +179 -176
- package/lib/openapi/v1/services/ThemesService.js.map +1 -1
- package/lib/openapi/v1/services/UserPropertiesService.d.ts +12 -12
- package/lib/openapi/v1/services/UserPropertiesService.js +165 -162
- package/lib/openapi/v1/services/UserPropertiesService.js.map +1 -1
- package/lib/openapi/v1/services/UsersService.d.ts +21 -21
- package/lib/openapi/v1/services/UsersService.js +229 -226
- package/lib/openapi/v1/services/UsersService.js.map +1 -1
- package/lib/openapi/v2/models/user.d.ts +0 -2
- package/lib/openapi/v2/models/user.js +0 -2
- package/lib/openapi/v2/models/user.js.map +1 -1
- package/lib/openapi/v2/services/AncestorsService.d.ts +17 -17
- package/lib/openapi/v2/services/AncestorsService.js +174 -171
- package/lib/openapi/v2/services/AncestorsService.js.map +1 -1
- package/lib/openapi/v2/services/AttachmentService.d.ts +62 -62
- package/lib/openapi/v2/services/AttachmentService.js +261 -258
- package/lib/openapi/v2/services/AttachmentService.js.map +1 -1
- package/lib/openapi/v2/services/BlogPostService.d.ts +70 -70
- package/lib/openapi/v2/services/BlogPostService.js +270 -267
- package/lib/openapi/v2/services/BlogPostService.js.map +1 -1
- package/lib/openapi/v2/services/ChildrenService.d.ts +14 -14
- package/lib/openapi/v2/services/ChildrenService.js +77 -74
- package/lib/openapi/v2/services/ChildrenService.js.map +1 -1
- package/lib/openapi/v2/services/ClassificationLevelService.d.ts +21 -21
- package/lib/openapi/v2/services/ClassificationLevelService.js +304 -301
- package/lib/openapi/v2/services/ClassificationLevelService.js.map +1 -1
- package/lib/openapi/v2/services/CommentService.d.ts +136 -136
- package/lib/openapi/v2/services/CommentService.js +635 -632
- package/lib/openapi/v2/services/CommentService.js.map +1 -1
- package/lib/openapi/v2/services/ContentPropertiesService.d.ts +128 -128
- package/lib/openapi/v2/services/ContentPropertiesService.js +1242 -1239
- package/lib/openapi/v2/services/ContentPropertiesService.js.map +1 -1
- package/lib/openapi/v2/services/ContentService.d.ts +2 -2
- package/lib/openapi/v2/services/ContentService.js +40 -37
- package/lib/openapi/v2/services/ContentService.js.map +1 -1
- package/lib/openapi/v2/services/CustomContentService.d.ts +72 -72
- package/lib/openapi/v2/services/CustomContentService.js +299 -296
- package/lib/openapi/v2/services/CustomContentService.js.map +1 -1
- package/lib/openapi/v2/services/DataPoliciesService.d.ts +10 -10
- package/lib/openapi/v2/services/DataPoliciesService.js +67 -64
- package/lib/openapi/v2/services/DataPoliciesService.js.map +1 -1
- package/lib/openapi/v2/services/DatabaseService.d.ts +17 -17
- package/lib/openapi/v2/services/DatabaseService.js +90 -87
- package/lib/openapi/v2/services/DatabaseService.js.map +1 -1
- package/lib/openapi/v2/services/LabelService.d.ts +57 -57
- package/lib/openapi/v2/services/LabelService.js +263 -260
- package/lib/openapi/v2/services/LabelService.js.map +1 -1
- package/lib/openapi/v2/services/LikeService.d.ts +36 -36
- package/lib/openapi/v2/services/LikeService.js +250 -247
- package/lib/openapi/v2/services/LikeService.js.map +1 -1
- package/lib/openapi/v2/services/OperationService.d.ts +20 -20
- package/lib/openapi/v2/services/OperationService.js +298 -295
- package/lib/openapi/v2/services/OperationService.js.map +1 -1
- package/lib/openapi/v2/services/PageService.d.ts +73 -73
- package/lib/openapi/v2/services/PageService.js +272 -269
- package/lib/openapi/v2/services/PageService.js.map +1 -1
- package/lib/openapi/v2/services/SmartLinkService.d.ts +19 -17
- package/lib/openapi/v2/services/SmartLinkService.js +92 -89
- package/lib/openapi/v2/services/SmartLinkService.js.map +1 -1
- package/lib/openapi/v2/services/SpacePermissionsService.d.ts +6 -6
- package/lib/openapi/v2/services/SpacePermissionsService.js +35 -32
- package/lib/openapi/v2/services/SpacePermissionsService.js.map +1 -1
- package/lib/openapi/v2/services/SpacePropertiesService.d.ts +15 -15
- package/lib/openapi/v2/services/SpacePropertiesService.js +165 -162
- package/lib/openapi/v2/services/SpacePropertiesService.js.map +1 -1
- package/lib/openapi/v2/services/SpaceService.d.ts +28 -28
- package/lib/openapi/v2/services/SpaceService.js +83 -80
- package/lib/openapi/v2/services/SpaceService.js.map +1 -1
- package/lib/openapi/v2/services/TaskService.d.ts +40 -40
- package/lib/openapi/v2/services/TaskService.js +120 -117
- package/lib/openapi/v2/services/TaskService.js.map +1 -1
- package/lib/openapi/v2/services/UserService.d.ts +11 -11
- package/lib/openapi/v2/services/UserService.js +91 -88
- package/lib/openapi/v2/services/UserService.js.map +1 -1
- package/lib/openapi/v2/services/VersionService.d.ts +59 -59
- package/lib/openapi/v2/services/VersionService.js +395 -392
- package/lib/openapi/v2/services/VersionService.js.map +1 -1
- package/lib/openapi/v2/services/WhiteboardService.d.ts +17 -17
- package/lib/openapi/v2/services/WhiteboardService.js +90 -87
- package/lib/openapi/v2/services/WhiteboardService.js.map +1 -1
- package/package.json +4 -3
|
@@ -11,320 +11,323 @@ const common_1 = require("../models/common");
|
|
|
11
11
|
const validationSchemaStorage_1 = require("../validationSchemaStorage");
|
|
12
12
|
/** @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-attachments */
|
|
13
13
|
class ContentAttachmentsService extends CommonHttpService_1.CommonHttpService {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
/**
|
|
17
|
+
* Adds an attachment to a piece of content. This method only adds a new
|
|
18
|
+
* attachment. If you want to update an existing attachment, use
|
|
19
|
+
* [Create or update attachments](#api-content-id-child-attachment-put).
|
|
20
|
+
*
|
|
21
|
+
* Note, you must set a `X-Atlassian-Token: nocheck` header on the request
|
|
22
|
+
* for this method, otherwise it will be blocked. This protects against XSRF
|
|
23
|
+
* attacks, which is necessary as this method accepts multipart/form-data.
|
|
24
|
+
*
|
|
25
|
+
* The media type 'multipart/form-data' is defined in [RFC
|
|
26
|
+
* 7578](https://www.ietf.org/rfc/rfc7578.txt).
|
|
27
|
+
* Most client libraries have classes that make it easier to implement
|
|
28
|
+
* multipart posts, like the
|
|
29
|
+
* [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/)
|
|
30
|
+
* Java class provided by Apache HTTP Components.
|
|
31
|
+
*
|
|
32
|
+
* Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5),
|
|
33
|
+
* in the case where the form data is text,
|
|
34
|
+
* the charset parameter for the "text/plain" Content-Type may be used to
|
|
35
|
+
* indicate the character encoding used in that part. In the case of this
|
|
36
|
+
* API endpoint, the `comment` body parameter should be sent with `type=text/plain`
|
|
37
|
+
* and `charset=utf-8` values. This will force the charset to be UTF-8.
|
|
38
|
+
*
|
|
39
|
+
* Example: This curl command attaches a file ('example.txt') to a container
|
|
40
|
+
* (id='123') with a comment and `minorEdits`=true.
|
|
41
|
+
*
|
|
42
|
+
* ``` bash
|
|
43
|
+
* curl -D- \
|
|
44
|
+
* -u admin:admin \
|
|
45
|
+
* -X POST \
|
|
46
|
+
* -H 'X-Atlassian-Token: nocheck' \
|
|
47
|
+
* -F 'file=@"example.txt"' \
|
|
48
|
+
* -F 'minorEdit="true"' \
|
|
49
|
+
* -F 'comment="Example attachment comment"; type=text/plain; charset=utf-8' \
|
|
50
|
+
* http://myhost/rest/api/content/123/child/attachment
|
|
51
|
+
* ```
|
|
52
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
|
|
53
|
+
* Permission to update the content.
|
|
54
|
+
*
|
|
55
|
+
* @returns Returned if the attachments were added to the content.
|
|
56
|
+
* @path {POST} /wiki/rest/api/content/{id}/child/attachment
|
|
57
|
+
* @scopes-current write:confluence-file
|
|
58
|
+
* @scopes-beta read:content-details:confluence, write:attachment:confluence
|
|
59
|
+
* @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-attachments#api-wiki-rest-api-content-id-child-attachment-post
|
|
60
|
+
*/
|
|
61
|
+
this.createAttachment = ({ id, status, requestBody, }) => {
|
|
62
|
+
return this.getClientInstance()
|
|
63
|
+
.request({
|
|
64
|
+
path: "/wiki/rest/api/content/{id}/child/attachment",
|
|
65
|
+
method: "POST",
|
|
66
|
+
pathParams: {
|
|
67
|
+
id,
|
|
68
|
+
},
|
|
69
|
+
query: {
|
|
70
|
+
status,
|
|
71
|
+
},
|
|
72
|
+
headers: {
|
|
73
|
+
"Content-Type": "multipart/form-data",
|
|
74
|
+
},
|
|
75
|
+
body: requestBody,
|
|
76
|
+
})
|
|
77
|
+
.then(this.getClientInstance().responseHandler({
|
|
78
|
+
200: {
|
|
79
|
+
"application/json": "json",
|
|
80
|
+
},
|
|
81
|
+
}))
|
|
82
|
+
.then(commonHttpClient.castResponse())
|
|
83
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentAttachmentsService.createAttachment.response"))
|
|
84
|
+
.then(commonHttpClient.getBody);
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Adds an attachment to a piece of content. If the attachment already exists
|
|
88
|
+
* for the content, then the attachment is updated (i.e. a new version of the
|
|
89
|
+
* attachment is created).
|
|
90
|
+
*
|
|
91
|
+
* Note, you must set a `X-Atlassian-Token: nocheck` header on the request
|
|
92
|
+
* for this method, otherwise it will be blocked. This protects against XSRF
|
|
93
|
+
* attacks, which is necessary as this method accepts multipart/form-data.
|
|
94
|
+
*
|
|
95
|
+
* The media type 'multipart/form-data' is defined in [RFC
|
|
96
|
+
* 7578](https://www.ietf.org/rfc/rfc7578.txt).
|
|
97
|
+
* Most client libraries have classes that make it easier to implement
|
|
98
|
+
* multipart posts, like the
|
|
99
|
+
* [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/)
|
|
100
|
+
* Java class provided by Apache HTTP Components.
|
|
101
|
+
*
|
|
102
|
+
* Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5),
|
|
103
|
+
* in the case where the form data is text,
|
|
104
|
+
* the charset parameter for the "text/plain" Content-Type may be used to
|
|
105
|
+
* indicate the character encoding used in that part. In the case of this
|
|
106
|
+
* API endpoint, the `comment` body parameter should be sent with `type=text/plain`
|
|
107
|
+
* and `charset=utf-8` values. This will force the charset to be UTF-8.
|
|
108
|
+
*
|
|
109
|
+
* Example: This curl command attaches a file ('example.txt') to a piece of
|
|
110
|
+
* content (id='123') with a comment and `minorEdits`=true. If the 'example.txt'
|
|
111
|
+
* file already exists, it will update it with a new version of the attachment.
|
|
112
|
+
*
|
|
113
|
+
* ``` bash
|
|
114
|
+
* curl -D- \
|
|
115
|
+
* -u admin:admin \
|
|
116
|
+
* -X PUT \
|
|
117
|
+
* -H 'X-Atlassian-Token: nocheck' \
|
|
118
|
+
* -F 'file=@"example.txt"' \
|
|
119
|
+
* -F 'minorEdit="true"' \
|
|
120
|
+
* -F 'comment="Example attachment comment"; type=text/plain; charset=utf-8' \
|
|
121
|
+
* http://myhost/rest/api/content/123/child/attachment
|
|
122
|
+
* ```
|
|
123
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
|
|
124
|
+
* Permission to update the content.
|
|
125
|
+
*
|
|
126
|
+
* @returns Returned if the attachments were added to the content.
|
|
127
|
+
* @path {PUT} /wiki/rest/api/content/{id}/child/attachment
|
|
128
|
+
* @scopes-current write:confluence-file
|
|
129
|
+
* @scopes-beta read:content-details:confluence, write:attachment:confluence
|
|
130
|
+
* @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-attachments#api-wiki-rest-api-content-id-child-attachment-put
|
|
131
|
+
*/
|
|
132
|
+
this.createOrUpdateAttachments = ({ id, status, requestBody, }) => {
|
|
133
|
+
return this.getClientInstance()
|
|
134
|
+
.request({
|
|
135
|
+
path: "/wiki/rest/api/content/{id}/child/attachment",
|
|
136
|
+
method: "PUT",
|
|
137
|
+
pathParams: {
|
|
138
|
+
id,
|
|
139
|
+
},
|
|
140
|
+
query: {
|
|
141
|
+
status,
|
|
142
|
+
},
|
|
143
|
+
headers: {
|
|
144
|
+
"Content-Type": "multipart/form-data",
|
|
145
|
+
},
|
|
146
|
+
body: requestBody,
|
|
147
|
+
})
|
|
148
|
+
.then(this.getClientInstance().responseHandler({
|
|
149
|
+
200: {
|
|
150
|
+
"application/json": "json",
|
|
151
|
+
},
|
|
152
|
+
}))
|
|
153
|
+
.then(commonHttpClient.castResponse())
|
|
154
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentAttachmentsService.createOrUpdateAttachments.response"))
|
|
155
|
+
.then(commonHttpClient.getBody);
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Redirects the client to a URL that serves an attachment's binary data.
|
|
159
|
+
*
|
|
160
|
+
* @path {GET} /wiki/rest/api/content/{id}/child/attachment/{attachmentId}/download
|
|
161
|
+
* @scopes-current readonly:content.attachment:confluence
|
|
162
|
+
* @scopes-beta read:attachment:confluence
|
|
163
|
+
* @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-attachments#api-wiki-rest-api-content-id-child-attachment-attachmentid-download-get
|
|
164
|
+
*/
|
|
165
|
+
this.downloadAttatchment = ({ id, attachmentId, version, }) => {
|
|
166
|
+
return this.getClientInstance()
|
|
167
|
+
.request({
|
|
168
|
+
path: "/wiki/rest/api/content/{id}/child/attachment/{attachmentId}/download",
|
|
169
|
+
method: "GET",
|
|
170
|
+
pathParams: {
|
|
171
|
+
id,
|
|
172
|
+
attachmentId,
|
|
173
|
+
},
|
|
174
|
+
query: {
|
|
175
|
+
version,
|
|
176
|
+
},
|
|
177
|
+
})
|
|
178
|
+
.then(commonHttpClient.discardResult);
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Deprecated, use [Confluence's v2
|
|
182
|
+
* API](https://developer.atlassian.com/cloud/confluence/rest/v2/intro/).
|
|
183
|
+
*
|
|
184
|
+
* Returns the attachments for a piece of content.
|
|
185
|
+
*
|
|
186
|
+
* By default, the following objects are expanded: `metadata`.
|
|
187
|
+
*
|
|
188
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
|
|
189
|
+
* Permission to view the content. If the content is a blog post, 'View' permission
|
|
190
|
+
* for the space is required.
|
|
191
|
+
*
|
|
192
|
+
* @deprecated
|
|
193
|
+
* @returns Returned if the requested attachments are returned.
|
|
194
|
+
* @path {GET} /wiki/rest/api/content/{id}/child/attachment
|
|
195
|
+
* @scopes-current read:confluence-content.summary
|
|
196
|
+
* @scopes-beta read:content-details:confluence
|
|
197
|
+
* @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-attachments#api-wiki-rest-api-content-id-child-attachment-get
|
|
198
|
+
*/
|
|
199
|
+
this.getAttachments = ({ id, expand, start, limit, filename, mediaType, }) => {
|
|
200
|
+
return this.getClientInstance()
|
|
201
|
+
.request({
|
|
202
|
+
path: "/wiki/rest/api/content/{id}/child/attachment",
|
|
203
|
+
method: "GET",
|
|
204
|
+
pathParams: {
|
|
205
|
+
id,
|
|
206
|
+
},
|
|
207
|
+
query: {
|
|
208
|
+
expand,
|
|
209
|
+
start,
|
|
210
|
+
limit,
|
|
211
|
+
filename,
|
|
212
|
+
mediaType,
|
|
213
|
+
},
|
|
214
|
+
})
|
|
215
|
+
.then(this.getClientInstance().responseHandler({
|
|
216
|
+
200: {
|
|
217
|
+
"application/json": "json",
|
|
218
|
+
},
|
|
219
|
+
}))
|
|
220
|
+
.then(commonHttpClient.castResponse())
|
|
221
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentAttachmentsService.getAttachments.response"))
|
|
222
|
+
.then(commonHttpClient.getBody);
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* Updates the binary data of an attachment, given the attachment ID, and
|
|
226
|
+
* optionally the comment and the minor edit field.
|
|
227
|
+
*
|
|
228
|
+
* This method is essentially the same as [Create or update
|
|
229
|
+
* attachments](#api-content-id-child-attachment-put),
|
|
230
|
+
* except that it matches the attachment ID rather than the name.
|
|
231
|
+
*
|
|
232
|
+
* Note, you must set a `X-Atlassian-Token: nocheck` header on the request
|
|
233
|
+
* for this method, otherwise it will be blocked. This protects against XSRF
|
|
234
|
+
* attacks, which is necessary as this method accepts multipart/form-data.
|
|
235
|
+
*
|
|
236
|
+
* The media type 'multipart/form-data' is defined in [RFC
|
|
237
|
+
* 7578](https://www.ietf.org/rfc/rfc7578.txt).
|
|
238
|
+
* Most client libraries have classes that make it easier to implement
|
|
239
|
+
* multipart posts, like the
|
|
240
|
+
* [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/)
|
|
241
|
+
* Java class provided by Apache HTTP Components.
|
|
242
|
+
*
|
|
243
|
+
* Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5),
|
|
244
|
+
* in the case where the form data is text,
|
|
245
|
+
* the charset parameter for the "text/plain" Content-Type may be used to
|
|
246
|
+
* indicate the character encoding used in that part. In the case of this
|
|
247
|
+
* API endpoint, the `comment` body parameter should be sent with `type=text/plain`
|
|
248
|
+
* and `charset=utf-8` values. This will force the charset to be UTF-8.
|
|
249
|
+
*
|
|
250
|
+
* Example: This curl command updates an attachment (id='att456') that is attached
|
|
251
|
+
* to a piece of content (id='123') with a comment and `minorEdits`=true.
|
|
252
|
+
*
|
|
253
|
+
* ``` bash
|
|
254
|
+
* curl -D- \
|
|
255
|
+
* -u admin:admin \
|
|
256
|
+
* -X POST \
|
|
257
|
+
* -H 'X-Atlassian-Token: nocheck' \
|
|
258
|
+
* -F 'file=@"example.txt"' \
|
|
259
|
+
* -F 'minorEdit="true"' \
|
|
260
|
+
* -F 'comment="Example attachment comment"; type=text/plain; charset=utf-8' \
|
|
261
|
+
* http://myhost/rest/api/content/123/child/attachment/att456/data
|
|
262
|
+
* ```
|
|
263
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
|
|
264
|
+
* Permission to update the content.
|
|
265
|
+
*
|
|
266
|
+
* @returns Returned if the attachment is updated.
|
|
267
|
+
* @path {POST} /wiki/rest/api/content/{id}/child/attachment/{attachmentId}/data
|
|
268
|
+
* @scopes-current write:confluence-file
|
|
269
|
+
* @scopes-beta read:content-details:confluence, write:attachment:confluence
|
|
270
|
+
* @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-attachments#api-wiki-rest-api-content-id-child-attachment-attachmentid-data-post
|
|
271
|
+
*/
|
|
272
|
+
this.updateAttachmentData = ({ id, attachmentId, requestBody, }) => {
|
|
273
|
+
return this.getClientInstance()
|
|
274
|
+
.request({
|
|
275
|
+
path: "/wiki/rest/api/content/{id}/child/attachment/{attachmentId}/data",
|
|
276
|
+
method: "POST",
|
|
277
|
+
pathParams: {
|
|
278
|
+
id,
|
|
279
|
+
attachmentId,
|
|
280
|
+
},
|
|
281
|
+
headers: {
|
|
282
|
+
"Content-Type": "multipart/form-data",
|
|
283
|
+
},
|
|
284
|
+
body: requestBody,
|
|
285
|
+
})
|
|
286
|
+
.then(this.getClientInstance().responseHandler({
|
|
287
|
+
200: {
|
|
288
|
+
"application/json": "json",
|
|
289
|
+
},
|
|
290
|
+
}))
|
|
291
|
+
.then(commonHttpClient.castResponse())
|
|
292
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentAttachmentsService.updateAttachmentData.response"))
|
|
293
|
+
.then(commonHttpClient.getBody);
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* Updates the attachment properties, i.e. the non-binary data of an attachment
|
|
297
|
+
* like the filename, media-type, comment, and parent container.
|
|
298
|
+
*
|
|
299
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
|
|
300
|
+
* Permission to update the content.
|
|
301
|
+
*
|
|
302
|
+
* @returns Returned if the attachment is updated.
|
|
303
|
+
* @path {PUT} /wiki/rest/api/content/{id}/child/attachment/{attachmentId}
|
|
304
|
+
* @scopes-current write:confluence-file, write:confluence-props
|
|
305
|
+
* @scopes-beta read:content-details:confluence, write:attachment:confluence
|
|
306
|
+
* @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-attachments#api-wiki-rest-api-content-id-child-attachment-attachmentid-put
|
|
307
|
+
*/
|
|
308
|
+
this.updateAttachmentProperties = ({ id, attachmentId, attachmentPropertiesUpdateBody, }) => {
|
|
309
|
+
return this.getClientInstance()
|
|
310
|
+
.request({
|
|
311
|
+
path: "/wiki/rest/api/content/{id}/child/attachment/{attachmentId}",
|
|
312
|
+
method: "PUT",
|
|
313
|
+
pathParams: {
|
|
314
|
+
id,
|
|
315
|
+
attachmentId,
|
|
316
|
+
},
|
|
317
|
+
headers: {
|
|
318
|
+
"Content-Type": "application/json",
|
|
319
|
+
},
|
|
320
|
+
body: attachmentPropertiesUpdateBody,
|
|
321
|
+
})
|
|
322
|
+
.then(this.getClientInstance().responseHandler({
|
|
323
|
+
200: {
|
|
324
|
+
"application/json": "json",
|
|
325
|
+
},
|
|
326
|
+
}))
|
|
327
|
+
.then(commonHttpClient.castResponse())
|
|
328
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentAttachmentsService.updateAttachmentProperties.response"))
|
|
329
|
+
.then(commonHttpClient.getBody);
|
|
330
|
+
};
|
|
328
331
|
}
|
|
329
332
|
static initialize() {
|
|
330
333
|
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("ContentAttachmentsService.getAttachments.response", zod_1.z
|