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