@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,394 +11,397 @@ 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-children-and-descendants */
13
13
  class ContentChildrenAndDescendantsService extends CommonHttpService_1.CommonHttpService {
14
- /**
15
- * Copies a single page and its associated properties, permissions, attachments,
16
- * and custom contents.
17
- * The `id` path parameter refers to the content ID of the page to copy. The
18
- * target of the page to be copied
19
- * is defined using the `destination` in the request body and can be one of the
20
- * following types.
21
- *
22
- * - `space`: page will be copied to the specified space as a root page on the
23
- * space
24
- * - `parent_page`: page will be copied as a child of the specified parent page
25
- * - `existing_page`: page will be copied and replace the specified page
26
- *
27
- * By default, the following objects are expanded: `space`, `history`, `version`.
28
- *
29
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Add'
30
- * permission for the space that the content will be copied in and permission to
31
- * update the content if copying to an `existing_page`.
32
- *
33
- * @returns Returned if the content is copied.
34
- * @path {POST} /wiki/rest/api/content/{id}/copy
35
- * @scopes-current write:confluence-content
36
- * @scopes-beta read:content-details:confluence, write:page:confluence
37
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-id-copy-post
38
- */
39
- copyPage({ id, expand, copyPageRequest, }) {
40
- return this.getClientInstance()
41
- .request({
42
- path: "/wiki/rest/api/content/{id}/copy",
43
- method: "POST",
44
- pathParams: {
45
- id,
46
- },
47
- query: {
48
- expand,
49
- },
50
- headers: {
51
- "Content-Type": "application/json",
52
- },
53
- body: copyPageRequest,
54
- })
55
- .then(this.getClientInstance().responseHandler({
56
- 200: {
57
- "application/json;charset=UTF-8": "json",
58
- },
59
- }))
60
- .then(commonHttpClient.castResponse())
61
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.copyPage.response"))
62
- .then(commonHttpClient.getBody);
63
- }
64
- /**
65
- * Copy page hierarchy allows the copying of an entire hierarchy of pages and
66
- * their associated properties, permissions and attachments.
67
- * The id path parameter refers to the content id of the page to copy, and the
68
- * new parent of this copied page is defined using the destinationPageId in the
69
- * request body.
70
- * The titleOptions object defines the rules of renaming page titles during the
71
- * copy;
72
- * for example, search and replace can be used in conjunction to rewrite the
73
- * copied page titles.
74
- *
75
- * Response example:
76
- * <pre><code>
77
- * {
78
- * "id" : "1180606",
79
- * "links" : {
80
- * "status" : "/rest/api/longtask/1180606"
81
- * }
82
- * }
83
- * </code></pre>
84
- * Use the /longtask/<taskId> REST API to get the copy task status.
85
- *
86
- * @returns Returns a full JSON representation of a long running task
87
- * @path {POST} /wiki/rest/api/content/{id}/pagehierarchy/copy
88
- * @scopes-current write:confluence-content
89
- * @scopes-beta read:content.metadata:confluence, write:page:confluence
90
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-id-pagehierarchy-copy-post
91
- */
92
- copyPageHierarchy({ id, copyPageHierarchyRequest, }) {
93
- return this.getClientInstance()
94
- .request({
95
- path: "/wiki/rest/api/content/{id}/pagehierarchy/copy",
96
- method: "POST",
97
- pathParams: {
98
- id,
99
- },
100
- headers: {
101
- "Content-Type": "application/json",
102
- },
103
- body: copyPageHierarchyRequest,
104
- })
105
- .then(this.getClientInstance().responseHandler({
106
- 202: {
107
- "application/json": "json",
108
- },
109
- }))
110
- .then(commonHttpClient.castResponse())
111
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.copyPageHierarchy.response"))
112
- .then(commonHttpClient.getBody);
113
- }
114
- /**
115
- * Deprecated, use [Confluence's v2
116
- * API](https://developer.atlassian.com/cloud/confluence/rest/v2/intro/).
117
- *
118
- * Returns a map of the direct children of a piece of content. A piece of content
119
- * has different types of child content, depending on its type. These are
120
- * the default parent-child content type relationships:
121
- *
122
- * - `page`: child content is `page`, `whiteboard`, `database`, `embed`, `folder`,
123
- * `comment`, `attachment`
124
- * - `whiteboard`: child content is `page`, `whiteboard`, `database`, `embed`,
125
- * `folder`, `comment`, `attachment`
126
- * - `database`: child content is `page`, `whiteboard`, `database`, `embed`,
127
- * `folder`, `comment`, `attachment`
128
- * - `embed`: child content is `page`, `whiteboard`, `database`, `embed`,
129
- * `folder`, `comment`, `attachment`
130
- * - `folder`: child content is `page`, `whiteboard`, `database`, `embed`,
131
- * `folder`, `comment`, `attachment`
132
- * - `blogpost`: child content is `comment`, `attachment`
133
- * - `attachment`: child content is `comment`
134
- * - `comment`: child content is `attachment`
135
- *
136
- * Apps can override these default relationships. Apps can also introduce
137
- * new content types that create new parent-child content relationships.
138
- *
139
- * Note, the map will always include all child content types that are valid
140
- * for the content. However, if the content has no instances of a child content
141
- * type, the map will contain an empty array for that child content type.
142
- *
143
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View'
144
- * permission for the space,
145
- * and permission to view the content if it is a page.
146
- *
147
- * @deprecated
148
- * @returns Returned if the requested content children are returned.
149
- * @path {GET} /wiki/rest/api/content/{id}/child
150
- * @scopes-current read:confluence-content.summary
151
- * @scopes-beta read:content-details:confluence
152
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-id-child-get
153
- */
154
- getContentChildren({ id, expand, parentVersion, }) {
155
- return this.getClientInstance()
156
- .request({
157
- path: "/wiki/rest/api/content/{id}/child",
158
- method: "GET",
159
- pathParams: {
160
- id,
161
- },
162
- query: {
163
- expand,
164
- parentVersion,
165
- },
166
- })
167
- .then(this.getClientInstance().responseHandler({
168
- 200: {
169
- "application/json": "json",
170
- },
171
- }))
172
- .then(commonHttpClient.castResponse())
173
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.getContentChildren.response"))
174
- .then(commonHttpClient.getBody);
175
- }
176
- /**
177
- * Deprecated, use [Confluence's v2
178
- * API](https://developer.atlassian.com/cloud/confluence/rest/v2/intro/).
179
- *
180
- * Returns all children of a given type, for a piece of content.
181
- * A piece of content has different types of child content, depending on its type:
182
- *
183
- * - `page`: child content is `page`, `whiteboard`, `database`, `embed`, `folder`,
184
- * `comment`, `attachment`
185
- * - `whiteboard`: child content is `page`, `whiteboard`, `database`, `embed`,
186
- * `folder`, `comment`, `attachment`
187
- * - `database`: child content is `page`, `whiteboard`, `database`, `embed`,
188
- * `folder`, `comment`, `attachment`
189
- * - `embed`: child content is `page`, `whiteboard`, `database`, `embed`,
190
- * `folder`, `comment`, `attachment`
191
- * - `folder`: child content is `page`, `whiteboard`, `database`, `embed`,
192
- * `folder`, `comment`, `attachment`
193
- * - `blogpost`: child content is `comment`, `attachment`
194
- * - `attachment`: child content is `comment`
195
- * - `comment`: child content is `attachment`
196
- *
197
- * Custom content types that are provided by apps can also be returned.
198
- *
199
- * Note, this method only returns direct children. To return children at all
200
- * levels, use [Get descendants by type](#api-content-id-descendant-type-get).
201
- *
202
- * Starting on Dec 10, 2024, if the expand query parameter is used with the
203
- * `body.export_view` and/or `body.styled_view` properties, then the query limit
204
- * parameter will be restricted to a maximum value of 25.
205
- *
206
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View'
207
- * permission for the space,
208
- * and permission to view the content if it is a page.
209
- *
210
- * @deprecated
211
- * @returns Returned if the requested content is returned.
212
- * @path {GET} /wiki/rest/api/content/{id}/child/{type}
213
- * @scopes-current read:confluence-content.summary
214
- * @scopes-beta read:content-details:confluence
215
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-id-child-type-get
216
- */
217
- getContentChildrenByType({ id, type, expand, parentVersion, start, limit, }) {
218
- return this.getClientInstance()
219
- .request({
220
- path: "/wiki/rest/api/content/{id}/child/{type}",
221
- method: "GET",
222
- pathParams: {
223
- id,
224
- type,
225
- },
226
- query: {
227
- expand,
228
- parentVersion,
229
- start,
230
- limit,
231
- },
232
- })
233
- .then(this.getClientInstance().responseHandler({
234
- 200: {
235
- "application/json": "json",
236
- },
237
- }))
238
- .then(commonHttpClient.castResponse())
239
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.getContentChildrenByType.response"))
240
- .then(commonHttpClient.getBody);
241
- }
242
- /**
243
- * Returns a map of the descendants of a piece of content. This is similar
244
- * to [Get content children](#api-content-id-child-get), except that this
245
- * method returns child pages at all levels, rather than just the direct
246
- * child pages.
247
- *
248
- * A piece of content has different types of descendants, depending on its type:
249
- *
250
- * - `page`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`,
251
- * `comment`, `attachment`
252
- * - `whiteboard`: descendant is `page`, `whiteboard`, `database`, `embed`,
253
- * `folder`, `comment`, `attachment`
254
- * - `database`: descendant is `page`, `whiteboard`, `database`, `embed`,
255
- * `folder`, `comment`, `attachment`
256
- * - `embed`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`,
257
- * `comment`, `attachment`
258
- * - `folder`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`,
259
- * `comment`, `attachment`
260
- * - `blogpost`: descendant is `comment`, `attachment`
261
- * - `attachment`: descendant is `comment`
262
- * - `comment`: descendant is `attachment`
263
- *
264
- * The map will always include all descendant types that are valid for the content.
265
- * However, if the content has no instances of a descendant type, the map will
266
- * contain an empty array for that descendant type.
267
- *
268
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
269
- * 'View' permission for the space, and permission to view the content if it
270
- * is a page.
271
- *
272
- * @returns Returned if the requested descendants are returned.
273
- * @path {GET} /wiki/rest/api/content/{id}/descendant
274
- * @scopes-current read:confluence-content.summary
275
- * @scopes-beta read:content-details:confluence
276
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-id-descendant-get
277
- */
278
- getContentDescendants({ id, expand, }) {
279
- return this.getClientInstance()
280
- .request({
281
- path: "/wiki/rest/api/content/{id}/descendant",
282
- method: "GET",
283
- pathParams: {
284
- id,
285
- },
286
- query: {
287
- expand,
288
- },
289
- })
290
- .then(this.getClientInstance().responseHandler({
291
- 200: {
292
- "application/json": "json",
293
- },
294
- }))
295
- .then(commonHttpClient.castResponse())
296
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.getContentDescendants.response"))
297
- .then(commonHttpClient.getBody);
298
- }
299
- /**
300
- * Returns all descendants of a given type, for a piece of content. This is
301
- * similar to [Get content children by type](#api-content-id-child-type-get),
302
- * except that this method returns child pages at all levels, rather than just
303
- * the direct child pages.
304
- *
305
- * A piece of content has different types of descendants, depending on its type:
306
- *
307
- * - `page`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`,
308
- * `comment`, `attachment`
309
- * - `whiteboard`: descendant is `page`, `whiteboard`, `database`, `embed`,
310
- * `folder`, `comment`, `attachment`
311
- * - `database`: descendant is `page`, `whiteboard`, `database`, `embed`,
312
- * `folder`, `comment`, `attachment`
313
- * - `embed`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`,
314
- * `comment`, `attachment`
315
- * - `folder`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`,
316
- * `comment`, `attachment`
317
- * - `blogpost`: descendant is `comment`, `attachment`
318
- * - `attachment`: descendant is `comment`
319
- * - `comment`: descendant is `attachment`
320
- *
321
- * Custom content types that are provided by apps can also be returned.
322
- *
323
- * Starting on Dec 10, 2024, if the expand query parameter is used with the
324
- * `body.export_view` and/or `body.styled_view` properties, then the query limit
325
- * parameter will be restricted to a maximum value of 25.
326
- *
327
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
328
- * 'View' permission for the space, and permission to view the content if it
329
- * is a page.
330
- *
331
- * @returns Returned if the requested content is returned.
332
- * @path {GET} /wiki/rest/api/content/{id}/descendant/{type}
333
- * @scopes-current read:confluence-content.summary
334
- * @scopes-beta read:content-details:confluence
335
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-id-descendant-type-get
336
- */
337
- getDescendantsOfType({ id, type, depth, expand, start, limit, }) {
338
- return this.getClientInstance()
339
- .request({
340
- path: "/wiki/rest/api/content/{id}/descendant/{type}",
341
- method: "GET",
342
- pathParams: {
343
- id,
344
- type,
345
- },
346
- query: {
347
- depth,
348
- expand,
349
- start,
350
- limit,
351
- },
352
- })
353
- .then(this.getClientInstance().responseHandler({
354
- 200: {
355
- "application/json": "json",
356
- },
357
- }))
358
- .then(commonHttpClient.castResponse())
359
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.getDescendantsOfType.response"))
360
- .then(commonHttpClient.getBody);
361
- }
362
- /**
363
- * Move a page to a new location relative to a target page:
364
- *
365
- * * `before` - move the page under the same parent as the target, before the
366
- * target in the list of children
367
- * * `after` - move the page under the same parent as the target, after the target
368
- * in the list of children
369
- * * `append` - move the page to be a child of the target
370
- *
371
- * Caution: This API can move pages to the top level of a space. Top-level pages
372
- * are difficult to find in the UI
373
- * because they do not show up in the page tree display. To avoid this, never use
374
- * `before` or `after` positions
375
- * when the `targetId` is a top-level page.
376
- *
377
- * @returns Page was successfully moved
378
- * @path {PUT} /wiki/rest/api/content/{pageId}/move/{position}/{targetId}
379
- * @scopes-current write:confluence-content
380
- * @scopes-beta write:page:confluence
381
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-pageid-move-position-targetid-put
382
- */
383
- movePage({ pageId, position, targetId, }) {
384
- return this.getClientInstance()
385
- .request({
386
- path: "/wiki/rest/api/content/{pageId}/move/{position}/{targetId}",
387
- method: "PUT",
388
- pathParams: {
389
- pageId,
390
- position,
391
- targetId,
392
- },
393
- })
394
- .then(this.getClientInstance().responseHandler({
395
- 200: {
396
- "application/json": "json",
397
- },
398
- }))
399
- .then(commonHttpClient.castResponse())
400
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.movePage.response"))
401
- .then(commonHttpClient.getBody);
14
+ constructor() {
15
+ super(...arguments);
16
+ /**
17
+ * Copies a single page and its associated properties, permissions, attachments,
18
+ * and custom contents.
19
+ * The `id` path parameter refers to the content ID of the page to copy. The
20
+ * target of the page to be copied
21
+ * is defined using the `destination` in the request body and can be one of the
22
+ * following types.
23
+ *
24
+ * - `space`: page will be copied to the specified space as a root page on the
25
+ * space
26
+ * - `parent_page`: page will be copied as a child of the specified parent page
27
+ * - `existing_page`: page will be copied and replace the specified page
28
+ *
29
+ * By default, the following objects are expanded: `space`, `history`, `version`.
30
+ *
31
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Add'
32
+ * permission for the space that the content will be copied in and permission to
33
+ * update the content if copying to an `existing_page`.
34
+ *
35
+ * @returns Returned if the content is copied.
36
+ * @path {POST} /wiki/rest/api/content/{id}/copy
37
+ * @scopes-current write:confluence-content
38
+ * @scopes-beta read:content-details:confluence, write:page:confluence
39
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-id-copy-post
40
+ */
41
+ this.copyPage = ({ id, expand, copyPageRequest, }) => {
42
+ return this.getClientInstance()
43
+ .request({
44
+ path: "/wiki/rest/api/content/{id}/copy",
45
+ method: "POST",
46
+ pathParams: {
47
+ id,
48
+ },
49
+ query: {
50
+ expand,
51
+ },
52
+ headers: {
53
+ "Content-Type": "application/json",
54
+ },
55
+ body: copyPageRequest,
56
+ })
57
+ .then(this.getClientInstance().responseHandler({
58
+ 200: {
59
+ "application/json;charset=UTF-8": "json",
60
+ },
61
+ }))
62
+ .then(commonHttpClient.castResponse())
63
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.copyPage.response"))
64
+ .then(commonHttpClient.getBody);
65
+ };
66
+ /**
67
+ * Copy page hierarchy allows the copying of an entire hierarchy of pages and
68
+ * their associated properties, permissions and attachments.
69
+ * The id path parameter refers to the content id of the page to copy, and the
70
+ * new parent of this copied page is defined using the destinationPageId in the
71
+ * request body.
72
+ * The titleOptions object defines the rules of renaming page titles during the
73
+ * copy;
74
+ * for example, search and replace can be used in conjunction to rewrite the
75
+ * copied page titles.
76
+ *
77
+ * Response example:
78
+ * <pre><code>
79
+ * {
80
+ * "id" : "1180606",
81
+ * "links" : {
82
+ * "status" : "/rest/api/longtask/1180606"
83
+ * }
84
+ * }
85
+ * </code></pre>
86
+ * Use the /longtask/<taskId> REST API to get the copy task status.
87
+ *
88
+ * @returns Returns a full JSON representation of a long running task
89
+ * @path {POST} /wiki/rest/api/content/{id}/pagehierarchy/copy
90
+ * @scopes-current write:confluence-content
91
+ * @scopes-beta read:content.metadata:confluence, write:page:confluence
92
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-id-pagehierarchy-copy-post
93
+ */
94
+ this.copyPageHierarchy = ({ id, copyPageHierarchyRequest, }) => {
95
+ return this.getClientInstance()
96
+ .request({
97
+ path: "/wiki/rest/api/content/{id}/pagehierarchy/copy",
98
+ method: "POST",
99
+ pathParams: {
100
+ id,
101
+ },
102
+ headers: {
103
+ "Content-Type": "application/json",
104
+ },
105
+ body: copyPageHierarchyRequest,
106
+ })
107
+ .then(this.getClientInstance().responseHandler({
108
+ 202: {
109
+ "application/json": "json",
110
+ },
111
+ }))
112
+ .then(commonHttpClient.castResponse())
113
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.copyPageHierarchy.response"))
114
+ .then(commonHttpClient.getBody);
115
+ };
116
+ /**
117
+ * Deprecated, use [Confluence's v2
118
+ * API](https://developer.atlassian.com/cloud/confluence/rest/v2/intro/).
119
+ *
120
+ * Returns a map of the direct children of a piece of content. A piece of content
121
+ * has different types of child content, depending on its type. These are
122
+ * the default parent-child content type relationships:
123
+ *
124
+ * - `page`: child content is `page`, `whiteboard`, `database`, `embed`, `folder`,
125
+ * `comment`, `attachment`
126
+ * - `whiteboard`: child content is `page`, `whiteboard`, `database`, `embed`,
127
+ * `folder`, `comment`, `attachment`
128
+ * - `database`: child content is `page`, `whiteboard`, `database`, `embed`,
129
+ * `folder`, `comment`, `attachment`
130
+ * - `embed`: child content is `page`, `whiteboard`, `database`, `embed`,
131
+ * `folder`, `comment`, `attachment`
132
+ * - `folder`: child content is `page`, `whiteboard`, `database`, `embed`,
133
+ * `folder`, `comment`, `attachment`
134
+ * - `blogpost`: child content is `comment`, `attachment`
135
+ * - `attachment`: child content is `comment`
136
+ * - `comment`: child content is `attachment`
137
+ *
138
+ * Apps can override these default relationships. Apps can also introduce
139
+ * new content types that create new parent-child content relationships.
140
+ *
141
+ * Note, the map will always include all child content types that are valid
142
+ * for the content. However, if the content has no instances of a child content
143
+ * type, the map will contain an empty array for that child content type.
144
+ *
145
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View'
146
+ * permission for the space,
147
+ * and permission to view the content if it is a page.
148
+ *
149
+ * @deprecated
150
+ * @returns Returned if the requested content children are returned.
151
+ * @path {GET} /wiki/rest/api/content/{id}/child
152
+ * @scopes-current read:confluence-content.summary
153
+ * @scopes-beta read:content-details:confluence
154
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-id-child-get
155
+ */
156
+ this.getContentChildren = ({ id, expand, parentVersion, }) => {
157
+ return this.getClientInstance()
158
+ .request({
159
+ path: "/wiki/rest/api/content/{id}/child",
160
+ method: "GET",
161
+ pathParams: {
162
+ id,
163
+ },
164
+ query: {
165
+ expand,
166
+ parentVersion,
167
+ },
168
+ })
169
+ .then(this.getClientInstance().responseHandler({
170
+ 200: {
171
+ "application/json": "json",
172
+ },
173
+ }))
174
+ .then(commonHttpClient.castResponse())
175
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.getContentChildren.response"))
176
+ .then(commonHttpClient.getBody);
177
+ };
178
+ /**
179
+ * Deprecated, use [Confluence's v2
180
+ * API](https://developer.atlassian.com/cloud/confluence/rest/v2/intro/).
181
+ *
182
+ * Returns all children of a given type, for a piece of content.
183
+ * A piece of content has different types of child content, depending on its type:
184
+ *
185
+ * - `page`: child content is `page`, `whiteboard`, `database`, `embed`, `folder`,
186
+ * `comment`, `attachment`
187
+ * - `whiteboard`: child content is `page`, `whiteboard`, `database`, `embed`,
188
+ * `folder`, `comment`, `attachment`
189
+ * - `database`: child content is `page`, `whiteboard`, `database`, `embed`,
190
+ * `folder`, `comment`, `attachment`
191
+ * - `embed`: child content is `page`, `whiteboard`, `database`, `embed`,
192
+ * `folder`, `comment`, `attachment`
193
+ * - `folder`: child content is `page`, `whiteboard`, `database`, `embed`,
194
+ * `folder`, `comment`, `attachment`
195
+ * - `blogpost`: child content is `comment`, `attachment`
196
+ * - `attachment`: child content is `comment`
197
+ * - `comment`: child content is `attachment`
198
+ *
199
+ * Custom content types that are provided by apps can also be returned.
200
+ *
201
+ * Note, this method only returns direct children. To return children at all
202
+ * levels, use [Get descendants by type](#api-content-id-descendant-type-get).
203
+ *
204
+ * Starting on Dec 10, 2024, if the expand query parameter is used with the
205
+ * `body.export_view` and/or `body.styled_view` properties, then the query limit
206
+ * parameter will be restricted to a maximum value of 25.
207
+ *
208
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View'
209
+ * permission for the space,
210
+ * and permission to view the content if it is a page.
211
+ *
212
+ * @deprecated
213
+ * @returns Returned if the requested content is returned.
214
+ * @path {GET} /wiki/rest/api/content/{id}/child/{type}
215
+ * @scopes-current read:confluence-content.summary
216
+ * @scopes-beta read:content-details:confluence
217
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-id-child-type-get
218
+ */
219
+ this.getContentChildrenByType = ({ id, type, expand, parentVersion, start, limit, }) => {
220
+ return this.getClientInstance()
221
+ .request({
222
+ path: "/wiki/rest/api/content/{id}/child/{type}",
223
+ method: "GET",
224
+ pathParams: {
225
+ id,
226
+ type,
227
+ },
228
+ query: {
229
+ expand,
230
+ parentVersion,
231
+ start,
232
+ limit,
233
+ },
234
+ })
235
+ .then(this.getClientInstance().responseHandler({
236
+ 200: {
237
+ "application/json": "json",
238
+ },
239
+ }))
240
+ .then(commonHttpClient.castResponse())
241
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.getContentChildrenByType.response"))
242
+ .then(commonHttpClient.getBody);
243
+ };
244
+ /**
245
+ * Returns a map of the descendants of a piece of content. This is similar
246
+ * to [Get content children](#api-content-id-child-get), except that this
247
+ * method returns child pages at all levels, rather than just the direct
248
+ * child pages.
249
+ *
250
+ * A piece of content has different types of descendants, depending on its type:
251
+ *
252
+ * - `page`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`,
253
+ * `comment`, `attachment`
254
+ * - `whiteboard`: descendant is `page`, `whiteboard`, `database`, `embed`,
255
+ * `folder`, `comment`, `attachment`
256
+ * - `database`: descendant is `page`, `whiteboard`, `database`, `embed`,
257
+ * `folder`, `comment`, `attachment`
258
+ * - `embed`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`,
259
+ * `comment`, `attachment`
260
+ * - `folder`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`,
261
+ * `comment`, `attachment`
262
+ * - `blogpost`: descendant is `comment`, `attachment`
263
+ * - `attachment`: descendant is `comment`
264
+ * - `comment`: descendant is `attachment`
265
+ *
266
+ * The map will always include all descendant types that are valid for the content.
267
+ * However, if the content has no instances of a descendant type, the map will
268
+ * contain an empty array for that descendant type.
269
+ *
270
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
271
+ * 'View' permission for the space, and permission to view the content if it
272
+ * is a page.
273
+ *
274
+ * @returns Returned if the requested descendants are returned.
275
+ * @path {GET} /wiki/rest/api/content/{id}/descendant
276
+ * @scopes-current read:confluence-content.summary
277
+ * @scopes-beta read:content-details:confluence
278
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-id-descendant-get
279
+ */
280
+ this.getContentDescendants = ({ id, expand, }) => {
281
+ return this.getClientInstance()
282
+ .request({
283
+ path: "/wiki/rest/api/content/{id}/descendant",
284
+ method: "GET",
285
+ pathParams: {
286
+ id,
287
+ },
288
+ query: {
289
+ expand,
290
+ },
291
+ })
292
+ .then(this.getClientInstance().responseHandler({
293
+ 200: {
294
+ "application/json": "json",
295
+ },
296
+ }))
297
+ .then(commonHttpClient.castResponse())
298
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.getContentDescendants.response"))
299
+ .then(commonHttpClient.getBody);
300
+ };
301
+ /**
302
+ * Returns all descendants of a given type, for a piece of content. This is
303
+ * similar to [Get content children by type](#api-content-id-child-type-get),
304
+ * except that this method returns child pages at all levels, rather than just
305
+ * the direct child pages.
306
+ *
307
+ * A piece of content has different types of descendants, depending on its type:
308
+ *
309
+ * - `page`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`,
310
+ * `comment`, `attachment`
311
+ * - `whiteboard`: descendant is `page`, `whiteboard`, `database`, `embed`,
312
+ * `folder`, `comment`, `attachment`
313
+ * - `database`: descendant is `page`, `whiteboard`, `database`, `embed`,
314
+ * `folder`, `comment`, `attachment`
315
+ * - `embed`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`,
316
+ * `comment`, `attachment`
317
+ * - `folder`: descendant is `page`, `whiteboard`, `database`, `embed`, `folder`,
318
+ * `comment`, `attachment`
319
+ * - `blogpost`: descendant is `comment`, `attachment`
320
+ * - `attachment`: descendant is `comment`
321
+ * - `comment`: descendant is `attachment`
322
+ *
323
+ * Custom content types that are provided by apps can also be returned.
324
+ *
325
+ * Starting on Dec 10, 2024, if the expand query parameter is used with the
326
+ * `body.export_view` and/or `body.styled_view` properties, then the query limit
327
+ * parameter will be restricted to a maximum value of 25.
328
+ *
329
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
330
+ * 'View' permission for the space, and permission to view the content if it
331
+ * is a page.
332
+ *
333
+ * @returns Returned if the requested content is returned.
334
+ * @path {GET} /wiki/rest/api/content/{id}/descendant/{type}
335
+ * @scopes-current read:confluence-content.summary
336
+ * @scopes-beta read:content-details:confluence
337
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-id-descendant-type-get
338
+ */
339
+ this.getDescendantsOfType = ({ id, type, depth, expand, start, limit, }) => {
340
+ return this.getClientInstance()
341
+ .request({
342
+ path: "/wiki/rest/api/content/{id}/descendant/{type}",
343
+ method: "GET",
344
+ pathParams: {
345
+ id,
346
+ type,
347
+ },
348
+ query: {
349
+ depth,
350
+ expand,
351
+ start,
352
+ limit,
353
+ },
354
+ })
355
+ .then(this.getClientInstance().responseHandler({
356
+ 200: {
357
+ "application/json": "json",
358
+ },
359
+ }))
360
+ .then(commonHttpClient.castResponse())
361
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.getDescendantsOfType.response"))
362
+ .then(commonHttpClient.getBody);
363
+ };
364
+ /**
365
+ * Move a page to a new location relative to a target page:
366
+ *
367
+ * * `before` - move the page under the same parent as the target, before the
368
+ * target in the list of children
369
+ * * `after` - move the page under the same parent as the target, after the target
370
+ * in the list of children
371
+ * * `append` - move the page to be a child of the target
372
+ *
373
+ * Caution: This API can move pages to the top level of a space. Top-level pages
374
+ * are difficult to find in the UI
375
+ * because they do not show up in the page tree display. To avoid this, never use
376
+ * `before` or `after` positions
377
+ * when the `targetId` is a top-level page.
378
+ *
379
+ * @returns Page was successfully moved
380
+ * @path {PUT} /wiki/rest/api/content/{pageId}/move/{position}/{targetId}
381
+ * @scopes-current write:confluence-content
382
+ * @scopes-beta write:page:confluence
383
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-children-and-descendants#api-wiki-rest-api-content-pageid-move-position-targetid-put
384
+ */
385
+ this.movePage = ({ pageId, position, targetId, }) => {
386
+ return this.getClientInstance()
387
+ .request({
388
+ path: "/wiki/rest/api/content/{pageId}/move/{position}/{targetId}",
389
+ method: "PUT",
390
+ pathParams: {
391
+ pageId,
392
+ position,
393
+ targetId,
394
+ },
395
+ })
396
+ .then(this.getClientInstance().responseHandler({
397
+ 200: {
398
+ "application/json": "json",
399
+ },
400
+ }))
401
+ .then(commonHttpClient.castResponse())
402
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentChildrenAndDescendantsService.movePage.response"))
403
+ .then(commonHttpClient.getBody);
404
+ };
402
405
  }
403
406
  static initialize() {
404
407
  validationSchemaStorage_1.validationSchemaStorage.registerExtensible("ContentChildrenAndDescendantsService.getContentChildren.response", zod_1.z