@resolution/confluence-api-client 0.4.4 → 0.4.6

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 (183) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +60 -1
  3. package/lib/openapi/v1/BaseConfluenceApiV1Client.d.ts +32 -33
  4. package/lib/openapi/v1/BaseConfluenceApiV1Client.js +151 -88
  5. package/lib/openapi/v1/BaseConfluenceApiV1Client.js.map +1 -1
  6. package/lib/openapi/v1/core/CommonHttpService.d.ts +2 -0
  7. package/lib/openapi/v1/core/CommonHttpService.js +9 -0
  8. package/lib/openapi/v1/core/CommonHttpService.js.map +1 -1
  9. package/lib/openapi/v1/services/AnalyticsService.d.ts +10 -10
  10. package/lib/openapi/v1/services/AnalyticsService.js +62 -59
  11. package/lib/openapi/v1/services/AnalyticsService.js.map +1 -1
  12. package/lib/openapi/v1/services/AuditService.d.ts +25 -25
  13. package/lib/openapi/v1/services/AuditService.js +205 -202
  14. package/lib/openapi/v1/services/AuditService.js.map +1 -1
  15. package/lib/openapi/v1/services/ContentAttachmentsService.d.ts +20 -20
  16. package/lib/openapi/v1/services/ContentAttachmentsService.js +317 -314
  17. package/lib/openapi/v1/services/ContentAttachmentsService.js.map +1 -1
  18. package/lib/openapi/v1/services/ContentBodyService.d.ts +15 -15
  19. package/lib/openapi/v1/services/ContentBodyService.js +140 -137
  20. package/lib/openapi/v1/services/ContentBodyService.js.map +1 -1
  21. package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.d.ts +27 -27
  22. package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.js +391 -388
  23. package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.js.map +1 -1
  24. package/lib/openapi/v1/services/ContentCommentsService.d.ts +8 -8
  25. package/lib/openapi/v1/services/ContentCommentsService.js +49 -46
  26. package/lib/openapi/v1/services/ContentCommentsService.js.map +1 -1
  27. package/lib/openapi/v1/services/ContentLabelsService.d.ts +11 -11
  28. package/lib/openapi/v1/services/ContentLabelsService.js +150 -147
  29. package/lib/openapi/v1/services/ContentLabelsService.js.map +1 -1
  30. package/lib/openapi/v1/services/ContentMacroBodyService.d.ts +13 -13
  31. package/lib/openapi/v1/services/ContentMacroBodyService.js +155 -152
  32. package/lib/openapi/v1/services/ContentMacroBodyService.js.map +1 -1
  33. package/lib/openapi/v1/services/ContentPermissionsService.d.ts +2 -2
  34. package/lib/openapi/v1/services/ContentPermissionsService.js +48 -45
  35. package/lib/openapi/v1/services/ContentPermissionsService.js.map +1 -1
  36. package/lib/openapi/v1/services/ContentPropertiesService.d.ts +18 -18
  37. package/lib/openapi/v1/services/ContentPropertiesService.js +237 -234
  38. package/lib/openapi/v1/services/ContentPropertiesService.js.map +1 -1
  39. package/lib/openapi/v1/services/ContentRestrictionsService.d.ts +49 -49
  40. package/lib/openapi/v1/services/ContentRestrictionsService.js +505 -502
  41. package/lib/openapi/v1/services/ContentRestrictionsService.js.map +1 -1
  42. package/lib/openapi/v1/services/ContentService.d.ts +50 -50
  43. package/lib/openapi/v1/services/ContentService.js +475 -472
  44. package/lib/openapi/v1/services/ContentService.js.map +1 -1
  45. package/lib/openapi/v1/services/ContentStatesService.d.ts +25 -25
  46. package/lib/openapi/v1/services/ContentStatesService.js +359 -356
  47. package/lib/openapi/v1/services/ContentStatesService.js.map +1 -1
  48. package/lib/openapi/v1/services/ContentVersionsService.d.ts +13 -13
  49. package/lib/openapi/v1/services/ContentVersionsService.js +144 -141
  50. package/lib/openapi/v1/services/ContentVersionsService.js.map +1 -1
  51. package/lib/openapi/v1/services/ContentWatchesService.d.ts +57 -57
  52. package/lib/openapi/v1/services/ContentWatchesService.js +454 -451
  53. package/lib/openapi/v1/services/ContentWatchesService.js.map +1 -1
  54. package/lib/openapi/v1/services/DynamicModulesService.d.ts +5 -5
  55. package/lib/openapi/v1/services/DynamicModulesService.js +70 -67
  56. package/lib/openapi/v1/services/DynamicModulesService.js.map +1 -1
  57. package/lib/openapi/v1/services/ExperimentalService.d.ts +12 -12
  58. package/lib/openapi/v1/services/ExperimentalService.js +151 -148
  59. package/lib/openapi/v1/services/ExperimentalService.js.map +1 -1
  60. package/lib/openapi/v1/services/GroupService.d.ts +52 -52
  61. package/lib/openapi/v1/services/GroupService.js +445 -442
  62. package/lib/openapi/v1/services/GroupService.js.map +1 -1
  63. package/lib/openapi/v1/services/InlineTasksService.d.ts +20 -20
  64. package/lib/openapi/v1/services/InlineTasksService.js +118 -115
  65. package/lib/openapi/v1/services/InlineTasksService.js.map +1 -1
  66. package/lib/openapi/v1/services/LabelInfoService.d.ts +5 -5
  67. package/lib/openapi/v1/services/LabelInfoService.js +37 -34
  68. package/lib/openapi/v1/services/LabelInfoService.js.map +1 -1
  69. package/lib/openapi/v1/services/LongRunningTaskService.d.ts +8 -6
  70. package/lib/openapi/v1/services/LongRunningTaskService.js +67 -63
  71. package/lib/openapi/v1/services/LongRunningTaskService.js.map +1 -1
  72. package/lib/openapi/v1/services/RelationService.d.ts +37 -37
  73. package/lib/openapi/v1/services/RelationService.js +231 -228
  74. package/lib/openapi/v1/services/RelationService.js.map +1 -1
  75. package/lib/openapi/v1/services/SearchService.d.ts +20 -20
  76. package/lib/openapi/v1/services/SearchService.js +136 -133
  77. package/lib/openapi/v1/services/SearchService.js.map +1 -1
  78. package/lib/openapi/v1/services/SettingsService.d.ts +15 -15
  79. package/lib/openapi/v1/services/SettingsService.js +204 -201
  80. package/lib/openapi/v1/services/SettingsService.js.map +1 -1
  81. package/lib/openapi/v1/services/SpacePermissionsService.d.ts +6 -6
  82. package/lib/openapi/v1/services/SpacePermissionsService.js +99 -96
  83. package/lib/openapi/v1/services/SpacePermissionsService.js.map +1 -1
  84. package/lib/openapi/v1/services/SpacePropertiesService.d.ts +16 -16
  85. package/lib/openapi/v1/services/SpacePropertiesService.js +227 -224
  86. package/lib/openapi/v1/services/SpacePropertiesService.js.map +1 -1
  87. package/lib/openapi/v1/services/SpaceService.d.ts +38 -38
  88. package/lib/openapi/v1/services/SpaceService.js +320 -317
  89. package/lib/openapi/v1/services/SpaceService.js.map +1 -1
  90. package/lib/openapi/v1/services/SpaceSettingsService.d.ts +4 -4
  91. package/lib/openapi/v1/services/SpaceSettingsService.js +68 -65
  92. package/lib/openapi/v1/services/SpaceSettingsService.js.map +1 -1
  93. package/lib/openapi/v1/services/TemplateService.d.ts +20 -20
  94. package/lib/openapi/v1/services/TemplateService.js +214 -211
  95. package/lib/openapi/v1/services/TemplateService.js.map +1 -1
  96. package/lib/openapi/v1/services/ThemesService.d.ts +13 -13
  97. package/lib/openapi/v1/services/ThemesService.js +179 -176
  98. package/lib/openapi/v1/services/ThemesService.js.map +1 -1
  99. package/lib/openapi/v1/services/UserPropertiesService.d.ts +12 -12
  100. package/lib/openapi/v1/services/UserPropertiesService.js +165 -162
  101. package/lib/openapi/v1/services/UserPropertiesService.js.map +1 -1
  102. package/lib/openapi/v1/services/UsersService.d.ts +21 -21
  103. package/lib/openapi/v1/services/UsersService.js +229 -226
  104. package/lib/openapi/v1/services/UsersService.js.map +1 -1
  105. package/lib/openapi/v2/BaseConfluenceApiV2Client.d.ts +23 -24
  106. package/lib/openapi/v2/BaseConfluenceApiV2Client.js +92 -47
  107. package/lib/openapi/v2/BaseConfluenceApiV2Client.js.map +1 -1
  108. package/lib/openapi/v2/core/CommonHttpService.d.ts +2 -0
  109. package/lib/openapi/v2/core/CommonHttpService.js +9 -0
  110. package/lib/openapi/v2/core/CommonHttpService.js.map +1 -1
  111. package/lib/openapi/v2/models/user.d.ts +0 -2
  112. package/lib/openapi/v2/models/user.js +0 -2
  113. package/lib/openapi/v2/models/user.js.map +1 -1
  114. package/lib/openapi/v2/services/AncestorsService.d.ts +17 -17
  115. package/lib/openapi/v2/services/AncestorsService.js +174 -171
  116. package/lib/openapi/v2/services/AncestorsService.js.map +1 -1
  117. package/lib/openapi/v2/services/AttachmentService.d.ts +62 -62
  118. package/lib/openapi/v2/services/AttachmentService.js +261 -258
  119. package/lib/openapi/v2/services/AttachmentService.js.map +1 -1
  120. package/lib/openapi/v2/services/BlogPostService.d.ts +70 -70
  121. package/lib/openapi/v2/services/BlogPostService.js +270 -267
  122. package/lib/openapi/v2/services/BlogPostService.js.map +1 -1
  123. package/lib/openapi/v2/services/ChildrenService.d.ts +14 -14
  124. package/lib/openapi/v2/services/ChildrenService.js +77 -74
  125. package/lib/openapi/v2/services/ChildrenService.js.map +1 -1
  126. package/lib/openapi/v2/services/ClassificationLevelService.d.ts +21 -21
  127. package/lib/openapi/v2/services/ClassificationLevelService.js +304 -301
  128. package/lib/openapi/v2/services/ClassificationLevelService.js.map +1 -1
  129. package/lib/openapi/v2/services/CommentService.d.ts +136 -136
  130. package/lib/openapi/v2/services/CommentService.js +635 -632
  131. package/lib/openapi/v2/services/CommentService.js.map +1 -1
  132. package/lib/openapi/v2/services/ContentPropertiesService.d.ts +128 -128
  133. package/lib/openapi/v2/services/ContentPropertiesService.js +1242 -1239
  134. package/lib/openapi/v2/services/ContentPropertiesService.js.map +1 -1
  135. package/lib/openapi/v2/services/ContentService.d.ts +2 -2
  136. package/lib/openapi/v2/services/ContentService.js +40 -37
  137. package/lib/openapi/v2/services/ContentService.js.map +1 -1
  138. package/lib/openapi/v2/services/CustomContentService.d.ts +72 -72
  139. package/lib/openapi/v2/services/CustomContentService.js +299 -296
  140. package/lib/openapi/v2/services/CustomContentService.js.map +1 -1
  141. package/lib/openapi/v2/services/DataPoliciesService.d.ts +10 -10
  142. package/lib/openapi/v2/services/DataPoliciesService.js +67 -64
  143. package/lib/openapi/v2/services/DataPoliciesService.js.map +1 -1
  144. package/lib/openapi/v2/services/DatabaseService.d.ts +17 -17
  145. package/lib/openapi/v2/services/DatabaseService.js +90 -87
  146. package/lib/openapi/v2/services/DatabaseService.js.map +1 -1
  147. package/lib/openapi/v2/services/LabelService.d.ts +57 -57
  148. package/lib/openapi/v2/services/LabelService.js +263 -260
  149. package/lib/openapi/v2/services/LabelService.js.map +1 -1
  150. package/lib/openapi/v2/services/LikeService.d.ts +36 -36
  151. package/lib/openapi/v2/services/LikeService.js +250 -247
  152. package/lib/openapi/v2/services/LikeService.js.map +1 -1
  153. package/lib/openapi/v2/services/OperationService.d.ts +20 -20
  154. package/lib/openapi/v2/services/OperationService.js +298 -295
  155. package/lib/openapi/v2/services/OperationService.js.map +1 -1
  156. package/lib/openapi/v2/services/PageService.d.ts +73 -73
  157. package/lib/openapi/v2/services/PageService.js +272 -269
  158. package/lib/openapi/v2/services/PageService.js.map +1 -1
  159. package/lib/openapi/v2/services/SmartLinkService.d.ts +19 -17
  160. package/lib/openapi/v2/services/SmartLinkService.js +92 -89
  161. package/lib/openapi/v2/services/SmartLinkService.js.map +1 -1
  162. package/lib/openapi/v2/services/SpacePermissionsService.d.ts +6 -6
  163. package/lib/openapi/v2/services/SpacePermissionsService.js +35 -32
  164. package/lib/openapi/v2/services/SpacePermissionsService.js.map +1 -1
  165. package/lib/openapi/v2/services/SpacePropertiesService.d.ts +15 -15
  166. package/lib/openapi/v2/services/SpacePropertiesService.js +165 -162
  167. package/lib/openapi/v2/services/SpacePropertiesService.js.map +1 -1
  168. package/lib/openapi/v2/services/SpaceService.d.ts +28 -28
  169. package/lib/openapi/v2/services/SpaceService.js +83 -80
  170. package/lib/openapi/v2/services/SpaceService.js.map +1 -1
  171. package/lib/openapi/v2/services/TaskService.d.ts +40 -40
  172. package/lib/openapi/v2/services/TaskService.js +120 -117
  173. package/lib/openapi/v2/services/TaskService.js.map +1 -1
  174. package/lib/openapi/v2/services/UserService.d.ts +11 -11
  175. package/lib/openapi/v2/services/UserService.js +91 -88
  176. package/lib/openapi/v2/services/UserService.js.map +1 -1
  177. package/lib/openapi/v2/services/VersionService.d.ts +59 -59
  178. package/lib/openapi/v2/services/VersionService.js +395 -392
  179. package/lib/openapi/v2/services/VersionService.js.map +1 -1
  180. package/lib/openapi/v2/services/WhiteboardService.d.ts +17 -17
  181. package/lib/openapi/v2/services/WhiteboardService.js +90 -87
  182. package/lib/openapi/v2/services/WhiteboardService.js.map +1 -1
  183. package/package.json +4 -3
@@ -12,302 +12,305 @@ const customContent_1 = require("../models/customContent");
12
12
  const validationSchemaStorage_1 = require("../validationSchemaStorage");
13
13
  /** @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content */
14
14
  class CustomContentService extends CommonHttpService_1.CommonHttpService {
15
- /**
16
- * Creates a new custom content in the given space, page, blogpost or other custom
17
- * content.
18
- *
19
- * Only one of `spaceId`, `pageId`, `blogPostId`, or `customContentId` is required
20
- * in the request body.
21
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
22
- * Permission to view the content of the page or blogpost and its corresponding
23
- * space. Permission to create custom content in the space.
24
- *
25
- * @returns Returned if the requested custom content is created successfully.
26
- * @path {POST} /custom-content
27
- * @scopes-current write:custom-content:confluence
28
- * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-custom-content-post
29
- */
30
- createCustomContent({ requestBody, }) {
31
- return this.getClientInstance()
32
- .request({
33
- path: "/custom-content",
34
- method: "POST",
35
- headers: {
36
- "Content-Type": "application/json",
37
- },
38
- body: requestBody,
39
- })
40
- .then(this.getClientInstance().responseHandler({
41
- 201: {
42
- "application/json": "json",
43
- },
44
- }))
45
- .then(commonHttpClient.castResponse())
46
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.createCustomContent.response"))
47
- .then(commonHttpClient.getBody);
48
- }
49
- /**
50
- * Delete a custom content by id.
51
- *
52
- * Deleting a custom content will either move it to the trash or permanently
53
- * delete it (purge it), depending on the apiSupport.
54
- * To permanently delete a **trashed** custom content, the endpoint must be called
55
- * with the following param `purge=true`.
56
- *
57
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
58
- * Permission to view the content of the page or blogpost and its corresponding
59
- * space.
60
- * Permission to delete custom content in the space.
61
- * Permission to administer the space (if attempting to purge).
62
- *
63
- * @path {DELETE} /custom-content/{id}
64
- * @scopes-current delete:custom-content:confluence
65
- * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-custom-content-id-delete
66
- */
67
- deleteCustomContent({ id, purge, }) {
68
- return this.getClientInstance()
69
- .request({
70
- path: "/custom-content/{id}",
71
- method: "DELETE",
72
- pathParams: {
73
- id,
74
- },
75
- query: {
76
- purge,
77
- },
78
- })
79
- .then(commonHttpClient.discardResult);
80
- }
81
- /**
82
- * Returns a specific piece of custom content.
83
- *
84
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
85
- * Permission to view the custom content, the container of the custom content, and
86
- * the corresponding space (if different from the container).
87
- *
88
- * @returns Returned if the requested custom content is returned.
89
- * @path {GET} /custom-content/{id}
90
- * @scopes-current read:custom-content:confluence
91
- * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-custom-content-id-get
92
- */
93
- getCustomContentById({ id, bodyFormat, version, includeLabels, includeProperties, includeOperations, includeVersions, includeVersion, }) {
94
- return this.getClientInstance()
95
- .request({
96
- path: "/custom-content/{id}",
97
- method: "GET",
98
- pathParams: {
99
- id,
100
- },
101
- query: {
102
- "body-format": bodyFormat,
103
- version,
104
- "include-labels": includeLabels,
105
- "include-properties": includeProperties,
106
- "include-operations": includeOperations,
107
- "include-versions": includeVersions,
108
- "include-version": includeVersion,
109
- },
110
- })
111
- .then(this.getClientInstance().responseHandler({
112
- 200: {
113
- "application/json": "json",
114
- },
115
- }))
116
- .then(commonHttpClient.castResponse())
117
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.getCustomContentById.response"))
118
- .then(commonHttpClient.getBody);
119
- }
120
- /**
121
- * Returns all custom content for a given type. The number of results is limited
122
- * by the `limit` parameter and additional results (if available)
123
- * will be available through the `next` URL present in the `Link` response header.
124
- *
125
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
126
- * Permission to view the custom content, the container of the custom content, and
127
- * the corresponding space (if different from the container).
128
- *
129
- * @returns Returned if the requested custom content is returned.
130
- * @path {GET} /custom-content
131
- * @scopes-current read:custom-content:confluence
132
- * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-custom-content-get
133
- */
134
- getCustomContentByType({ type, id, spaceId, sort, cursor, limit, bodyFormat, }) {
135
- return this.getClientInstance()
136
- .request({
137
- path: "/custom-content",
138
- method: "GET",
139
- query: {
140
- type,
141
- id,
142
- "space-id": spaceId,
143
- sort,
144
- cursor,
145
- limit,
146
- "body-format": bodyFormat,
147
- },
148
- })
149
- .then(this.getClientInstance().responseHandler({
150
- 200: {
151
- "application/json": "json",
152
- },
153
- }))
154
- .then(commonHttpClient.castResponse())
155
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.getCustomContentByType.response"))
156
- .then(commonHttpClient.getBody);
157
- }
158
- /**
159
- * Returns all custom content for a given type within a given blogpost. The number
160
- * of results is limited by the `limit` parameter and additional results (if
161
- * available)
162
- * will be available through the `next` URL present in the `Link` response header.
163
- *
164
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
165
- * Permission to view the custom content, the container of the custom content
166
- * (blog post), and the corresponding space.
167
- *
168
- * @returns Returned if the requested custom content is returned.
169
- * @path {GET} /blogposts/{id}/custom-content
170
- * @scopes-current read:custom-content:confluence
171
- * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-blogposts-id-custom-content-get
172
- */
173
- getCustomContentByTypeInBlogPost({ id, type, sort, cursor, limit, bodyFormat, }) {
174
- return this.getClientInstance()
175
- .request({
176
- path: "/blogposts/{id}/custom-content",
177
- method: "GET",
178
- pathParams: {
179
- id,
180
- },
181
- query: {
182
- type,
183
- sort,
184
- cursor,
185
- limit,
186
- "body-format": bodyFormat,
187
- },
188
- })
189
- .then(this.getClientInstance().responseHandler({
190
- 200: {
191
- "application/json": "json",
192
- },
193
- }))
194
- .then(commonHttpClient.castResponse())
195
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.getCustomContentByTypeInBlogPost.response"))
196
- .then(commonHttpClient.getBody);
197
- }
198
- /**
199
- * Returns all custom content for a given type within a given page. The number of
200
- * results is limited by the `limit` parameter and additional results (if
201
- * available)
202
- * will be available through the `next` URL present in the `Link` response header.
203
- *
204
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
205
- * Permission to view the custom content, the container of the custom content
206
- * (page), and the corresponding space.
207
- *
208
- * @returns Returned if the requested custom content is returned.
209
- * @path {GET} /pages/{id}/custom-content
210
- * @scopes-current read:custom-content:confluence
211
- * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-pages-id-custom-content-get
212
- */
213
- getCustomContentByTypeInPage({ id, type, sort, cursor, limit, bodyFormat, }) {
214
- return this.getClientInstance()
215
- .request({
216
- path: "/pages/{id}/custom-content",
217
- method: "GET",
218
- pathParams: {
219
- id,
220
- },
221
- query: {
222
- type,
223
- sort,
224
- cursor,
225
- limit,
226
- "body-format": bodyFormat,
227
- },
228
- })
229
- .then(this.getClientInstance().responseHandler({
230
- 200: {
231
- "application/json": "json",
232
- },
233
- }))
234
- .then(commonHttpClient.castResponse())
235
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.getCustomContentByTypeInPage.response"))
236
- .then(commonHttpClient.getBody);
237
- }
238
- /**
239
- * Returns all custom content for a given type within a given space. The number of
240
- * results is limited by the `limit` parameter and additional results (if
241
- * available)
242
- * will be available through the `next` URL present in the `Link` response header.
243
- *
244
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
245
- * Permission to view the custom content and the corresponding space.
246
- *
247
- * @returns Returned if the requested custom content is returned.
248
- * @path {GET} /spaces/{id}/custom-content
249
- * @scopes-current read:custom-content:confluence
250
- * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-spaces-id-custom-content-get
251
- */
252
- getCustomContentByTypeInSpace({ id, type, cursor, limit, bodyFormat, }) {
253
- return this.getClientInstance()
254
- .request({
255
- path: "/spaces/{id}/custom-content",
256
- method: "GET",
257
- pathParams: {
258
- id,
259
- },
260
- query: {
261
- type,
262
- cursor,
263
- limit,
264
- "body-format": bodyFormat,
265
- },
266
- })
267
- .then(this.getClientInstance().responseHandler({
268
- 200: {
269
- "application/json": "json",
270
- },
271
- }))
272
- .then(commonHttpClient.castResponse())
273
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.getCustomContentByTypeInSpace.response"))
274
- .then(commonHttpClient.getBody);
275
- }
276
- /**
277
- * Update a custom content by id.
278
- *
279
- * `spaceId` is always required and maximum one of `pageId`, `blogPostId`, or
280
- * `customContentId` is allowed in the request body.
281
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
282
- * Permission to view the content of the page or blogpost and its corresponding
283
- * space. Permission to update custom content in the space.
284
- *
285
- * @returns Returned if the requested custom content is updated successfully.
286
- * @path {PUT} /custom-content/{id}
287
- * @scopes-current write:custom-content:confluence
288
- * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-custom-content-id-put
289
- */
290
- updateCustomContent({ id, requestBody, }) {
291
- return this.getClientInstance()
292
- .request({
293
- path: "/custom-content/{id}",
294
- method: "PUT",
295
- pathParams: {
296
- id,
297
- },
298
- headers: {
299
- "Content-Type": "application/json",
300
- },
301
- body: requestBody,
302
- })
303
- .then(this.getClientInstance().responseHandler({
304
- 200: {
305
- "application/json": "json",
306
- },
307
- }))
308
- .then(commonHttpClient.castResponse())
309
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.updateCustomContent.response"))
310
- .then(commonHttpClient.getBody);
15
+ constructor() {
16
+ super(...arguments);
17
+ /**
18
+ * Creates a new custom content in the given space, page, blogpost or other custom
19
+ * content.
20
+ *
21
+ * Only one of `spaceId`, `pageId`, `blogPostId`, or `customContentId` is required
22
+ * in the request body.
23
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
24
+ * Permission to view the content of the page or blogpost and its corresponding
25
+ * space. Permission to create custom content in the space.
26
+ *
27
+ * @returns Returned if the requested custom content is created successfully.
28
+ * @path {POST} /custom-content
29
+ * @scopes-current write:custom-content:confluence
30
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-custom-content-post
31
+ */
32
+ this.createCustomContent = ({ requestBody, }) => {
33
+ return this.getClientInstance()
34
+ .request({
35
+ path: "/custom-content",
36
+ method: "POST",
37
+ headers: {
38
+ "Content-Type": "application/json",
39
+ },
40
+ body: requestBody,
41
+ })
42
+ .then(this.getClientInstance().responseHandler({
43
+ 201: {
44
+ "application/json": "json",
45
+ },
46
+ }))
47
+ .then(commonHttpClient.castResponse())
48
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.createCustomContent.response"))
49
+ .then(commonHttpClient.getBody);
50
+ };
51
+ /**
52
+ * Delete a custom content by id.
53
+ *
54
+ * Deleting a custom content will either move it to the trash or permanently
55
+ * delete it (purge it), depending on the apiSupport.
56
+ * To permanently delete a **trashed** custom content, the endpoint must be called
57
+ * with the following param `purge=true`.
58
+ *
59
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
60
+ * Permission to view the content of the page or blogpost and its corresponding
61
+ * space.
62
+ * Permission to delete custom content in the space.
63
+ * Permission to administer the space (if attempting to purge).
64
+ *
65
+ * @path {DELETE} /custom-content/{id}
66
+ * @scopes-current delete:custom-content:confluence
67
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-custom-content-id-delete
68
+ */
69
+ this.deleteCustomContent = ({ id, purge, }) => {
70
+ return this.getClientInstance()
71
+ .request({
72
+ path: "/custom-content/{id}",
73
+ method: "DELETE",
74
+ pathParams: {
75
+ id,
76
+ },
77
+ query: {
78
+ purge,
79
+ },
80
+ })
81
+ .then(commonHttpClient.discardResult);
82
+ };
83
+ /**
84
+ * Returns a specific piece of custom content.
85
+ *
86
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
87
+ * Permission to view the custom content, the container of the custom content, and
88
+ * the corresponding space (if different from the container).
89
+ *
90
+ * @returns Returned if the requested custom content is returned.
91
+ * @path {GET} /custom-content/{id}
92
+ * @scopes-current read:custom-content:confluence
93
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-custom-content-id-get
94
+ */
95
+ this.getCustomContentById = ({ id, bodyFormat, version, includeLabels, includeProperties, includeOperations, includeVersions, includeVersion, }) => {
96
+ return this.getClientInstance()
97
+ .request({
98
+ path: "/custom-content/{id}",
99
+ method: "GET",
100
+ pathParams: {
101
+ id,
102
+ },
103
+ query: {
104
+ "body-format": bodyFormat,
105
+ version,
106
+ "include-labels": includeLabels,
107
+ "include-properties": includeProperties,
108
+ "include-operations": includeOperations,
109
+ "include-versions": includeVersions,
110
+ "include-version": includeVersion,
111
+ },
112
+ })
113
+ .then(this.getClientInstance().responseHandler({
114
+ 200: {
115
+ "application/json": "json",
116
+ },
117
+ }))
118
+ .then(commonHttpClient.castResponse())
119
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.getCustomContentById.response"))
120
+ .then(commonHttpClient.getBody);
121
+ };
122
+ /**
123
+ * Returns all custom content for a given type. The number of results is limited
124
+ * by the `limit` parameter and additional results (if available)
125
+ * will be available through the `next` URL present in the `Link` response header.
126
+ *
127
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
128
+ * Permission to view the custom content, the container of the custom content, and
129
+ * the corresponding space (if different from the container).
130
+ *
131
+ * @returns Returned if the requested custom content is returned.
132
+ * @path {GET} /custom-content
133
+ * @scopes-current read:custom-content:confluence
134
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-custom-content-get
135
+ */
136
+ this.getCustomContentByType = ({ type, id, spaceId, sort, cursor, limit, bodyFormat, }) => {
137
+ return this.getClientInstance()
138
+ .request({
139
+ path: "/custom-content",
140
+ method: "GET",
141
+ query: {
142
+ type,
143
+ id,
144
+ "space-id": spaceId,
145
+ sort,
146
+ cursor,
147
+ limit,
148
+ "body-format": bodyFormat,
149
+ },
150
+ })
151
+ .then(this.getClientInstance().responseHandler({
152
+ 200: {
153
+ "application/json": "json",
154
+ },
155
+ }))
156
+ .then(commonHttpClient.castResponse())
157
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.getCustomContentByType.response"))
158
+ .then(commonHttpClient.getBody);
159
+ };
160
+ /**
161
+ * Returns all custom content for a given type within a given blogpost. The number
162
+ * of results is limited by the `limit` parameter and additional results (if
163
+ * available)
164
+ * will be available through the `next` URL present in the `Link` response header.
165
+ *
166
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
167
+ * Permission to view the custom content, the container of the custom content
168
+ * (blog post), and the corresponding space.
169
+ *
170
+ * @returns Returned if the requested custom content is returned.
171
+ * @path {GET} /blogposts/{id}/custom-content
172
+ * @scopes-current read:custom-content:confluence
173
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-blogposts-id-custom-content-get
174
+ */
175
+ this.getCustomContentByTypeInBlogPost = ({ id, type, sort, cursor, limit, bodyFormat, }) => {
176
+ return this.getClientInstance()
177
+ .request({
178
+ path: "/blogposts/{id}/custom-content",
179
+ method: "GET",
180
+ pathParams: {
181
+ id,
182
+ },
183
+ query: {
184
+ type,
185
+ sort,
186
+ cursor,
187
+ limit,
188
+ "body-format": bodyFormat,
189
+ },
190
+ })
191
+ .then(this.getClientInstance().responseHandler({
192
+ 200: {
193
+ "application/json": "json",
194
+ },
195
+ }))
196
+ .then(commonHttpClient.castResponse())
197
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.getCustomContentByTypeInBlogPost.response"))
198
+ .then(commonHttpClient.getBody);
199
+ };
200
+ /**
201
+ * Returns all custom content for a given type within a given page. The number of
202
+ * results is limited by the `limit` parameter and additional results (if
203
+ * available)
204
+ * will be available through the `next` URL present in the `Link` response header.
205
+ *
206
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
207
+ * Permission to view the custom content, the container of the custom content
208
+ * (page), and the corresponding space.
209
+ *
210
+ * @returns Returned if the requested custom content is returned.
211
+ * @path {GET} /pages/{id}/custom-content
212
+ * @scopes-current read:custom-content:confluence
213
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-pages-id-custom-content-get
214
+ */
215
+ this.getCustomContentByTypeInPage = ({ id, type, sort, cursor, limit, bodyFormat, }) => {
216
+ return this.getClientInstance()
217
+ .request({
218
+ path: "/pages/{id}/custom-content",
219
+ method: "GET",
220
+ pathParams: {
221
+ id,
222
+ },
223
+ query: {
224
+ type,
225
+ sort,
226
+ cursor,
227
+ limit,
228
+ "body-format": bodyFormat,
229
+ },
230
+ })
231
+ .then(this.getClientInstance().responseHandler({
232
+ 200: {
233
+ "application/json": "json",
234
+ },
235
+ }))
236
+ .then(commonHttpClient.castResponse())
237
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.getCustomContentByTypeInPage.response"))
238
+ .then(commonHttpClient.getBody);
239
+ };
240
+ /**
241
+ * Returns all custom content for a given type within a given space. The number of
242
+ * results is limited by the `limit` parameter and additional results (if
243
+ * available)
244
+ * will be available through the `next` URL present in the `Link` response header.
245
+ *
246
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
247
+ * Permission to view the custom content and the corresponding space.
248
+ *
249
+ * @returns Returned if the requested custom content is returned.
250
+ * @path {GET} /spaces/{id}/custom-content
251
+ * @scopes-current read:custom-content:confluence
252
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-spaces-id-custom-content-get
253
+ */
254
+ this.getCustomContentByTypeInSpace = ({ id, type, cursor, limit, bodyFormat, }) => {
255
+ return this.getClientInstance()
256
+ .request({
257
+ path: "/spaces/{id}/custom-content",
258
+ method: "GET",
259
+ pathParams: {
260
+ id,
261
+ },
262
+ query: {
263
+ type,
264
+ cursor,
265
+ limit,
266
+ "body-format": bodyFormat,
267
+ },
268
+ })
269
+ .then(this.getClientInstance().responseHandler({
270
+ 200: {
271
+ "application/json": "json",
272
+ },
273
+ }))
274
+ .then(commonHttpClient.castResponse())
275
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.getCustomContentByTypeInSpace.response"))
276
+ .then(commonHttpClient.getBody);
277
+ };
278
+ /**
279
+ * Update a custom content by id.
280
+ *
281
+ * `spaceId` is always required and maximum one of `pageId`, `blogPostId`, or
282
+ * `customContentId` is allowed in the request body.
283
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
284
+ * Permission to view the content of the page or blogpost and its corresponding
285
+ * space. Permission to update custom content in the space.
286
+ *
287
+ * @returns Returned if the requested custom content is updated successfully.
288
+ * @path {PUT} /custom-content/{id}
289
+ * @scopes-current write:custom-content:confluence
290
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-custom-content#api-custom-content-id-put
291
+ */
292
+ this.updateCustomContent = ({ id, requestBody, }) => {
293
+ return this.getClientInstance()
294
+ .request({
295
+ path: "/custom-content/{id}",
296
+ method: "PUT",
297
+ pathParams: {
298
+ id,
299
+ },
300
+ headers: {
301
+ "Content-Type": "application/json",
302
+ },
303
+ body: requestBody,
304
+ })
305
+ .then(this.getClientInstance().responseHandler({
306
+ 200: {
307
+ "application/json": "json",
308
+ },
309
+ }))
310
+ .then(commonHttpClient.castResponse())
311
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("CustomContentService.updateCustomContent.response"))
312
+ .then(commonHttpClient.getBody);
313
+ };
311
314
  }
312
315
  static initialize() {
313
316
  validationSchemaStorage_1.validationSchemaStorage.registerExtensible("CustomContentService.getCustomContentByTypeInBlogPost.response", zod_1.z