@resolution/confluence-api-client 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/lib/openapi/v1/services/AnalyticsService.d.ts +10 -10
  3. package/lib/openapi/v1/services/AnalyticsService.js +62 -59
  4. package/lib/openapi/v1/services/AnalyticsService.js.map +1 -1
  5. package/lib/openapi/v1/services/AuditService.d.ts +25 -25
  6. package/lib/openapi/v1/services/AuditService.js +205 -202
  7. package/lib/openapi/v1/services/AuditService.js.map +1 -1
  8. package/lib/openapi/v1/services/ContentAttachmentsService.d.ts +20 -20
  9. package/lib/openapi/v1/services/ContentAttachmentsService.js +317 -314
  10. package/lib/openapi/v1/services/ContentAttachmentsService.js.map +1 -1
  11. package/lib/openapi/v1/services/ContentBodyService.d.ts +15 -15
  12. package/lib/openapi/v1/services/ContentBodyService.js +140 -137
  13. package/lib/openapi/v1/services/ContentBodyService.js.map +1 -1
  14. package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.d.ts +27 -27
  15. package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.js +391 -388
  16. package/lib/openapi/v1/services/ContentChildrenAndDescendantsService.js.map +1 -1
  17. package/lib/openapi/v1/services/ContentCommentsService.d.ts +8 -8
  18. package/lib/openapi/v1/services/ContentCommentsService.js +49 -46
  19. package/lib/openapi/v1/services/ContentCommentsService.js.map +1 -1
  20. package/lib/openapi/v1/services/ContentLabelsService.d.ts +11 -11
  21. package/lib/openapi/v1/services/ContentLabelsService.js +150 -147
  22. package/lib/openapi/v1/services/ContentLabelsService.js.map +1 -1
  23. package/lib/openapi/v1/services/ContentMacroBodyService.d.ts +13 -13
  24. package/lib/openapi/v1/services/ContentMacroBodyService.js +155 -152
  25. package/lib/openapi/v1/services/ContentMacroBodyService.js.map +1 -1
  26. package/lib/openapi/v1/services/ContentPermissionsService.d.ts +2 -2
  27. package/lib/openapi/v1/services/ContentPermissionsService.js +48 -45
  28. package/lib/openapi/v1/services/ContentPermissionsService.js.map +1 -1
  29. package/lib/openapi/v1/services/ContentPropertiesService.d.ts +18 -18
  30. package/lib/openapi/v1/services/ContentPropertiesService.js +237 -234
  31. package/lib/openapi/v1/services/ContentPropertiesService.js.map +1 -1
  32. package/lib/openapi/v1/services/ContentRestrictionsService.d.ts +49 -49
  33. package/lib/openapi/v1/services/ContentRestrictionsService.js +505 -502
  34. package/lib/openapi/v1/services/ContentRestrictionsService.js.map +1 -1
  35. package/lib/openapi/v1/services/ContentService.d.ts +50 -50
  36. package/lib/openapi/v1/services/ContentService.js +475 -472
  37. package/lib/openapi/v1/services/ContentService.js.map +1 -1
  38. package/lib/openapi/v1/services/ContentStatesService.d.ts +25 -25
  39. package/lib/openapi/v1/services/ContentStatesService.js +359 -356
  40. package/lib/openapi/v1/services/ContentStatesService.js.map +1 -1
  41. package/lib/openapi/v1/services/ContentVersionsService.d.ts +13 -13
  42. package/lib/openapi/v1/services/ContentVersionsService.js +144 -141
  43. package/lib/openapi/v1/services/ContentVersionsService.js.map +1 -1
  44. package/lib/openapi/v1/services/ContentWatchesService.d.ts +57 -57
  45. package/lib/openapi/v1/services/ContentWatchesService.js +454 -451
  46. package/lib/openapi/v1/services/ContentWatchesService.js.map +1 -1
  47. package/lib/openapi/v1/services/DynamicModulesService.d.ts +5 -5
  48. package/lib/openapi/v1/services/DynamicModulesService.js +70 -67
  49. package/lib/openapi/v1/services/DynamicModulesService.js.map +1 -1
  50. package/lib/openapi/v1/services/ExperimentalService.d.ts +12 -12
  51. package/lib/openapi/v1/services/ExperimentalService.js +151 -148
  52. package/lib/openapi/v1/services/ExperimentalService.js.map +1 -1
  53. package/lib/openapi/v1/services/GroupService.d.ts +52 -52
  54. package/lib/openapi/v1/services/GroupService.js +445 -442
  55. package/lib/openapi/v1/services/GroupService.js.map +1 -1
  56. package/lib/openapi/v1/services/InlineTasksService.d.ts +20 -20
  57. package/lib/openapi/v1/services/InlineTasksService.js +118 -115
  58. package/lib/openapi/v1/services/InlineTasksService.js.map +1 -1
  59. package/lib/openapi/v1/services/LabelInfoService.d.ts +5 -5
  60. package/lib/openapi/v1/services/LabelInfoService.js +37 -34
  61. package/lib/openapi/v1/services/LabelInfoService.js.map +1 -1
  62. package/lib/openapi/v1/services/LongRunningTaskService.d.ts +8 -6
  63. package/lib/openapi/v1/services/LongRunningTaskService.js +67 -63
  64. package/lib/openapi/v1/services/LongRunningTaskService.js.map +1 -1
  65. package/lib/openapi/v1/services/RelationService.d.ts +37 -37
  66. package/lib/openapi/v1/services/RelationService.js +231 -228
  67. package/lib/openapi/v1/services/RelationService.js.map +1 -1
  68. package/lib/openapi/v1/services/SearchService.d.ts +20 -20
  69. package/lib/openapi/v1/services/SearchService.js +136 -133
  70. package/lib/openapi/v1/services/SearchService.js.map +1 -1
  71. package/lib/openapi/v1/services/SettingsService.d.ts +15 -15
  72. package/lib/openapi/v1/services/SettingsService.js +204 -201
  73. package/lib/openapi/v1/services/SettingsService.js.map +1 -1
  74. package/lib/openapi/v1/services/SpacePermissionsService.d.ts +6 -6
  75. package/lib/openapi/v1/services/SpacePermissionsService.js +99 -96
  76. package/lib/openapi/v1/services/SpacePermissionsService.js.map +1 -1
  77. package/lib/openapi/v1/services/SpacePropertiesService.d.ts +16 -16
  78. package/lib/openapi/v1/services/SpacePropertiesService.js +227 -224
  79. package/lib/openapi/v1/services/SpacePropertiesService.js.map +1 -1
  80. package/lib/openapi/v1/services/SpaceService.d.ts +38 -38
  81. package/lib/openapi/v1/services/SpaceService.js +320 -317
  82. package/lib/openapi/v1/services/SpaceService.js.map +1 -1
  83. package/lib/openapi/v1/services/SpaceSettingsService.d.ts +4 -4
  84. package/lib/openapi/v1/services/SpaceSettingsService.js +68 -65
  85. package/lib/openapi/v1/services/SpaceSettingsService.js.map +1 -1
  86. package/lib/openapi/v1/services/TemplateService.d.ts +20 -20
  87. package/lib/openapi/v1/services/TemplateService.js +214 -211
  88. package/lib/openapi/v1/services/TemplateService.js.map +1 -1
  89. package/lib/openapi/v1/services/ThemesService.d.ts +13 -13
  90. package/lib/openapi/v1/services/ThemesService.js +179 -176
  91. package/lib/openapi/v1/services/ThemesService.js.map +1 -1
  92. package/lib/openapi/v1/services/UserPropertiesService.d.ts +12 -12
  93. package/lib/openapi/v1/services/UserPropertiesService.js +165 -162
  94. package/lib/openapi/v1/services/UserPropertiesService.js.map +1 -1
  95. package/lib/openapi/v1/services/UsersService.d.ts +21 -21
  96. package/lib/openapi/v1/services/UsersService.js +229 -226
  97. package/lib/openapi/v1/services/UsersService.js.map +1 -1
  98. package/lib/openapi/v2/models/user.d.ts +0 -2
  99. package/lib/openapi/v2/models/user.js +0 -2
  100. package/lib/openapi/v2/models/user.js.map +1 -1
  101. package/lib/openapi/v2/services/AncestorsService.d.ts +17 -17
  102. package/lib/openapi/v2/services/AncestorsService.js +174 -171
  103. package/lib/openapi/v2/services/AncestorsService.js.map +1 -1
  104. package/lib/openapi/v2/services/AttachmentService.d.ts +62 -62
  105. package/lib/openapi/v2/services/AttachmentService.js +261 -258
  106. package/lib/openapi/v2/services/AttachmentService.js.map +1 -1
  107. package/lib/openapi/v2/services/BlogPostService.d.ts +70 -70
  108. package/lib/openapi/v2/services/BlogPostService.js +270 -267
  109. package/lib/openapi/v2/services/BlogPostService.js.map +1 -1
  110. package/lib/openapi/v2/services/ChildrenService.d.ts +14 -14
  111. package/lib/openapi/v2/services/ChildrenService.js +77 -74
  112. package/lib/openapi/v2/services/ChildrenService.js.map +1 -1
  113. package/lib/openapi/v2/services/ClassificationLevelService.d.ts +21 -21
  114. package/lib/openapi/v2/services/ClassificationLevelService.js +304 -301
  115. package/lib/openapi/v2/services/ClassificationLevelService.js.map +1 -1
  116. package/lib/openapi/v2/services/CommentService.d.ts +136 -136
  117. package/lib/openapi/v2/services/CommentService.js +635 -632
  118. package/lib/openapi/v2/services/CommentService.js.map +1 -1
  119. package/lib/openapi/v2/services/ContentPropertiesService.d.ts +128 -128
  120. package/lib/openapi/v2/services/ContentPropertiesService.js +1242 -1239
  121. package/lib/openapi/v2/services/ContentPropertiesService.js.map +1 -1
  122. package/lib/openapi/v2/services/ContentService.d.ts +2 -2
  123. package/lib/openapi/v2/services/ContentService.js +40 -37
  124. package/lib/openapi/v2/services/ContentService.js.map +1 -1
  125. package/lib/openapi/v2/services/CustomContentService.d.ts +72 -72
  126. package/lib/openapi/v2/services/CustomContentService.js +299 -296
  127. package/lib/openapi/v2/services/CustomContentService.js.map +1 -1
  128. package/lib/openapi/v2/services/DataPoliciesService.d.ts +10 -10
  129. package/lib/openapi/v2/services/DataPoliciesService.js +67 -64
  130. package/lib/openapi/v2/services/DataPoliciesService.js.map +1 -1
  131. package/lib/openapi/v2/services/DatabaseService.d.ts +17 -17
  132. package/lib/openapi/v2/services/DatabaseService.js +90 -87
  133. package/lib/openapi/v2/services/DatabaseService.js.map +1 -1
  134. package/lib/openapi/v2/services/LabelService.d.ts +57 -57
  135. package/lib/openapi/v2/services/LabelService.js +263 -260
  136. package/lib/openapi/v2/services/LabelService.js.map +1 -1
  137. package/lib/openapi/v2/services/LikeService.d.ts +36 -36
  138. package/lib/openapi/v2/services/LikeService.js +250 -247
  139. package/lib/openapi/v2/services/LikeService.js.map +1 -1
  140. package/lib/openapi/v2/services/OperationService.d.ts +20 -20
  141. package/lib/openapi/v2/services/OperationService.js +298 -295
  142. package/lib/openapi/v2/services/OperationService.js.map +1 -1
  143. package/lib/openapi/v2/services/PageService.d.ts +73 -73
  144. package/lib/openapi/v2/services/PageService.js +272 -269
  145. package/lib/openapi/v2/services/PageService.js.map +1 -1
  146. package/lib/openapi/v2/services/SmartLinkService.d.ts +19 -17
  147. package/lib/openapi/v2/services/SmartLinkService.js +92 -89
  148. package/lib/openapi/v2/services/SmartLinkService.js.map +1 -1
  149. package/lib/openapi/v2/services/SpacePermissionsService.d.ts +6 -6
  150. package/lib/openapi/v2/services/SpacePermissionsService.js +35 -32
  151. package/lib/openapi/v2/services/SpacePermissionsService.js.map +1 -1
  152. package/lib/openapi/v2/services/SpacePropertiesService.d.ts +15 -15
  153. package/lib/openapi/v2/services/SpacePropertiesService.js +165 -162
  154. package/lib/openapi/v2/services/SpacePropertiesService.js.map +1 -1
  155. package/lib/openapi/v2/services/SpaceService.d.ts +28 -28
  156. package/lib/openapi/v2/services/SpaceService.js +83 -80
  157. package/lib/openapi/v2/services/SpaceService.js.map +1 -1
  158. package/lib/openapi/v2/services/TaskService.d.ts +40 -40
  159. package/lib/openapi/v2/services/TaskService.js +120 -117
  160. package/lib/openapi/v2/services/TaskService.js.map +1 -1
  161. package/lib/openapi/v2/services/UserService.d.ts +11 -11
  162. package/lib/openapi/v2/services/UserService.js +91 -88
  163. package/lib/openapi/v2/services/UserService.js.map +1 -1
  164. package/lib/openapi/v2/services/VersionService.d.ts +59 -59
  165. package/lib/openapi/v2/services/VersionService.js +395 -392
  166. package/lib/openapi/v2/services/VersionService.js.map +1 -1
  167. package/lib/openapi/v2/services/WhiteboardService.d.ts +17 -17
  168. package/lib/openapi/v2/services/WhiteboardService.js +90 -87
  169. package/lib/openapi/v2/services/WhiteboardService.js.map +1 -1
  170. package/package.json +4 -3
@@ -12,362 +12,365 @@ const contentStates_1 = require("../models/contentStates");
12
12
  const validationSchemaStorage_1 = require("../validationSchemaStorage");
13
13
  /** @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states */
14
14
  class ContentStatesService extends CommonHttpService_1.CommonHttpService {
15
- /**
16
- * Creates a long running task that Removes content state from draft or published
17
- * versions of pages specified.
18
- *
19
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**
20
- * Content Edit Permission for a content to have its state removed via this
21
- * endpoint.
22
- *
23
- * @deprecated
24
- * @returns Returned if a task to remove content states is created. Returns the taskId.
25
- * This task id can be passed into /wiki/rest/api/content-states/task/{taskId}
26
- * @path {POST} /wiki/rest/api/content-states/delete
27
- * @scopes-current write:confluence-content
28
- * @scopes-beta write:content:confluence, read:content-details:confluence
29
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-states-delete-post
30
- */
31
- bulkRemoveContentStates({ status, requestBody, }) {
32
- return this.getClientInstance()
33
- .request({
34
- path: "/wiki/rest/api/content-states/delete",
35
- method: "POST",
36
- query: {
37
- status,
38
- },
39
- headers: {
40
- "Content-Type": "application/json",
41
- },
42
- body: requestBody,
43
- })
44
- .then(this.getClientInstance().responseHandler({
45
- 200: {
46
- "application/json": "json",
47
- },
48
- }))
49
- .then(commonHttpClient.castResponse())
50
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.bulkRemoveContentStates.response"))
51
- .then(commonHttpClient.getBody);
52
- }
53
- /**
54
- * Gets content states that are available for the content to be set as.
55
- * Will return all enabled Space Content States.
56
- * Will only return most the 3 most recently published custom content states to
57
- * match UI editor list.
58
- * To get all custom content states, use the /content-states endpoint.
59
- *
60
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
61
- * Permission to edit the content.
62
- *
63
- * @returns Returned if the content is found and permission is valid.
64
- * @path {GET} /wiki/rest/api/content/{id}/state/available
65
- * @scopes-current write:confluence-content
66
- * @scopes-beta write:content:confluence
67
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-id-state-available-get
68
- */
69
- getAvailableContentStates({ id, }) {
70
- return this.getClientInstance()
71
- .request({
72
- path: "/wiki/rest/api/content/{id}/state/available",
73
- method: "GET",
74
- pathParams: {
75
- id,
76
- },
77
- })
78
- .then(this.getClientInstance().responseHandler({
79
- 200: {
80
- "application/json": "json",
81
- },
82
- }))
83
- .then(commonHttpClient.castResponse())
84
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getAvailableContentStates.response"))
85
- .then(commonHttpClient.getBody);
86
- }
87
- /**
88
- * Gets the current content state of the draft or current version of content. To
89
- * specify the draft version, set
90
- * the parameter status to draft, otherwise archived or current will get the
91
- * relevant published state.
92
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
93
- * Permission to view the content.
94
- *
95
- * @returns Returned if permission allows viewing of content.
96
- * @path {GET} /wiki/rest/api/content/{id}/state
97
- * @scopes-current read:confluence-content.summary
98
- * @scopes-beta read:content-details:confluence
99
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-id-state-get
100
- */
101
- getContentState({ id, status, }) {
102
- return this.getClientInstance()
103
- .request({
104
- path: "/wiki/rest/api/content/{id}/state",
105
- method: "GET",
106
- pathParams: {
107
- id,
108
- },
109
- query: {
110
- status,
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("ContentStatesService.getContentState.response"))
120
- .then(commonHttpClient.getBody);
121
- }
122
- /**
123
- * Get object describing whether content states are allowed at all, if custom
124
- * content states or space content states
125
- * are restricted, and a list of space content states allowed for the space if
126
- * they are not restricted.
127
- *
128
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
129
- * 'Admin' permission for the space.
130
- *
131
- * @returns Returned if the requested space exists, and user has space admin permission.
132
- * @path {GET} /wiki/rest/api/space/{spaceKey}/state/settings
133
- * @scopes-current read:confluence-space.summary
134
- * @scopes-beta read:space.setting:confluence
135
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-space-spacekey-state-settings-get
136
- */
137
- getContentStateSettings({ spaceKey, }) {
138
- return this.getClientInstance()
139
- .request({
140
- path: "/wiki/rest/api/space/{spaceKey}/state/settings",
141
- method: "GET",
142
- pathParams: {
143
- spaceKey,
144
- },
145
- })
146
- .then(this.getClientInstance().responseHandler({
147
- 200: {
148
- "application/json": "json",
149
- },
150
- }))
151
- .then(commonHttpClient.castResponse())
152
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getContentStateSettings.response"))
153
- .then(commonHttpClient.getBody);
154
- }
155
- /**
156
- * Returns all content that has the provided content state in a space.
157
- *
158
- * Starting on Dec 10, 2024, if the expand query parameter is used with the
159
- * `body.export_view` and/or `body.styled_view` properties, then the query limit
160
- * parameter will be restricted to a maximum value of 25.
161
- *
162
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
163
- * 'View' permission for the space.
164
- *
165
- * @returns Returned if search was successful.
166
- * @path {GET} /wiki/rest/api/space/{spaceKey}/state/content
167
- * @scopes-current read:confluence-content.all
168
- * @scopes-beta read:content:confluence
169
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-space-spacekey-state-content-get
170
- */
171
- getContentsWithState({ spaceKey, stateId, expand, limit, start, }) {
172
- return this.getClientInstance()
173
- .request({
174
- path: "/wiki/rest/api/space/{spaceKey}/state/content",
175
- method: "GET",
176
- pathParams: {
177
- spaceKey,
178
- },
179
- query: {
180
- "state-id": stateId,
181
- expand,
182
- limit,
183
- start,
184
- },
185
- })
186
- .then(this.getClientInstance().responseHandler({
187
- 200: {
188
- "application/json": "json",
189
- },
190
- }))
191
- .then(commonHttpClient.castResponse())
192
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getContentsWithState.response"))
193
- .then(commonHttpClient.getBody);
194
- }
195
- /**
196
- * Get custom content states that authenticated user has created.
197
- *
198
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**
199
- * Must have user authentication.
200
- *
201
- * @returns Custom Content States that user has crated. Returned if user authenticated.
202
- * @path {GET} /wiki/rest/api/content-states
203
- * @scopes-current read:user.property:confluence
204
- * @scopes-beta read:user.property:confluence
205
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-states-get
206
- */
207
- getCustomContentStates() {
208
- return this.getClientInstance()
209
- .request({
210
- path: "/wiki/rest/api/content-states",
211
- method: "GET",
212
- })
213
- .then(this.getClientInstance().responseHandler({
214
- 200: {
215
- "application/json": "json",
216
- },
217
- }))
218
- .then(commonHttpClient.castResponse())
219
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getCustomContentStates.response"))
220
- .then(commonHttpClient.getBody);
221
- }
222
- /**
223
- * Get content states that are suggested in the space.
224
- *
225
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
226
- * 'View' permission for the space.
227
- *
228
- * @returns Returned if the requested space exists, and user has space view permission.
229
- * @path {GET} /wiki/rest/api/space/{spaceKey}/state
230
- * @scopes-current read:confluence-space.summary
231
- * @scopes-beta read:space.setting:confluence
232
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-space-spacekey-state-get
233
- */
234
- getSpaceContentStates({ spaceKey, }) {
235
- return this.getClientInstance()
236
- .request({
237
- path: "/wiki/rest/api/space/{spaceKey}/state",
238
- method: "GET",
239
- pathParams: {
240
- spaceKey,
241
- },
242
- })
243
- .then(this.getClientInstance().responseHandler({
244
- 200: {
245
- "application/json": "json",
246
- },
247
- }))
248
- .then(commonHttpClient.castResponse())
249
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getSpaceContentStates.response"))
250
- .then(commonHttpClient.getBody);
251
- }
252
- /**
253
- * Get Status of long running task that was previously created to remove content
254
- * states from content.
255
- * User must first create a task by passing in details to the
256
- * /wiki/rest/api/content-states DELETE endpoint.
257
- *
258
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**
259
- * Must have created long running task
260
- *
261
- * @deprecated
262
- * @returns Task found. State of task is returned
263
- * @path {GET} /wiki/rest/api/content-states/task/{taskId}
264
- * @scopes-current read:confluence-content
265
- * @scopes-beta read:content:confluence
266
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-states-task-taskid-get
267
- */
268
- getTaskUpdate({ taskId, }) {
269
- return this.getClientInstance()
270
- .request({
271
- path: "/wiki/rest/api/content-states/task/{taskId}",
272
- method: "GET",
273
- pathParams: {
274
- taskId,
275
- },
276
- })
277
- .then(this.getClientInstance().responseHandler({
278
- 200: {
279
- "application/json": "json",
280
- },
281
- }))
282
- .then(commonHttpClient.castResponse())
283
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getTaskUpdate.response"))
284
- .then(commonHttpClient.getBody);
285
- }
286
- /**
287
- * Removes the content state of the content specified and creates a new version
288
- * (publishes the content without changing the body) of the content with the new
289
- * status.
290
- *
291
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
292
- * Permission to edit the content.
293
- *
294
- * @returns Returned if content state is removed from content.
295
- * @path {DELETE} /wiki/rest/api/content/{id}/state
296
- * @scopes-current write:confluence-content
297
- * @scopes-beta write:content:confluence, read:content-details:confluence
298
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-id-state-delete
299
- */
300
- removeContentState({ id, status, }) {
301
- return this.getClientInstance()
302
- .request({
303
- path: "/wiki/rest/api/content/{id}/state",
304
- method: "DELETE",
305
- pathParams: {
306
- id,
307
- },
308
- query: {
309
- status,
310
- },
311
- })
312
- .then(this.getClientInstance().responseHandler({
313
- 200: {
314
- "application/json": "json",
315
- },
316
- }))
317
- .then(commonHttpClient.castResponse())
318
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.removeContentState.response"))
319
- .then(commonHttpClient.getBody);
320
- }
321
- /**
322
- * Sets the content state of the content specified and creates a new version
323
- * (publishes the content without changing the body) of the content with the new
324
- * state.
325
- *
326
- * You may pass in either an id of a state, or the name and color of a desired new
327
- * state.
328
- * If all 3 are passed in, id will be used.
329
- * If the name and color passed in already exist under the current user's existing
330
- * custom states, the existing state will be reused.
331
- * If custom states are disabled in the space of the content (which can be
332
- * determined by getting the content state space settings of the content's space)
333
- * then this set will fail.
334
- *
335
- * You may not remove a content state via this PUT request. You must use the
336
- * DELETE method. A specified state is required in the body of this request.
337
- *
338
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
339
- * Permission to edit the content.
340
- *
341
- * @returns Returned if content state is set successfully.
342
- * @path {PUT} /wiki/rest/api/content/{id}/state
343
- * @scopes-current write:confluence-content
344
- * @scopes-beta write:content:confluence, read:content-details:confluence
345
- * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-id-state-put
346
- */
347
- setContentState({ id, status, contentStateRestInput, }) {
348
- return this.getClientInstance()
349
- .request({
350
- path: "/wiki/rest/api/content/{id}/state",
351
- method: "PUT",
352
- pathParams: {
353
- id,
354
- },
355
- query: {
356
- status,
357
- },
358
- headers: {
359
- "Content-Type": "application/json",
360
- },
361
- body: contentStateRestInput,
362
- })
363
- .then(this.getClientInstance().responseHandler({
364
- 200: {
365
- "application/json": "json",
366
- },
367
- }))
368
- .then(commonHttpClient.castResponse())
369
- .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.setContentState.response"))
370
- .then(commonHttpClient.getBody);
15
+ constructor() {
16
+ super(...arguments);
17
+ /**
18
+ * Creates a long running task that Removes content state from draft or published
19
+ * versions of pages specified.
20
+ *
21
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**
22
+ * Content Edit Permission for a content to have its state removed via this
23
+ * endpoint.
24
+ *
25
+ * @deprecated
26
+ * @returns Returned if a task to remove content states is created. Returns the taskId.
27
+ * This task id can be passed into /wiki/rest/api/content-states/task/{taskId}
28
+ * @path {POST} /wiki/rest/api/content-states/delete
29
+ * @scopes-current write:confluence-content
30
+ * @scopes-beta write:content:confluence, read:content-details:confluence
31
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-states-delete-post
32
+ */
33
+ this.bulkRemoveContentStates = ({ status, requestBody, }) => {
34
+ return this.getClientInstance()
35
+ .request({
36
+ path: "/wiki/rest/api/content-states/delete",
37
+ method: "POST",
38
+ query: {
39
+ status,
40
+ },
41
+ headers: {
42
+ "Content-Type": "application/json",
43
+ },
44
+ body: requestBody,
45
+ })
46
+ .then(this.getClientInstance().responseHandler({
47
+ 200: {
48
+ "application/json": "json",
49
+ },
50
+ }))
51
+ .then(commonHttpClient.castResponse())
52
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.bulkRemoveContentStates.response"))
53
+ .then(commonHttpClient.getBody);
54
+ };
55
+ /**
56
+ * Gets content states that are available for the content to be set as.
57
+ * Will return all enabled Space Content States.
58
+ * Will only return most the 3 most recently published custom content states to
59
+ * match UI editor list.
60
+ * To get all custom content states, use the /content-states endpoint.
61
+ *
62
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
63
+ * Permission to edit the content.
64
+ *
65
+ * @returns Returned if the content is found and permission is valid.
66
+ * @path {GET} /wiki/rest/api/content/{id}/state/available
67
+ * @scopes-current write:confluence-content
68
+ * @scopes-beta write:content:confluence
69
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-id-state-available-get
70
+ */
71
+ this.getAvailableContentStates = ({ id, }) => {
72
+ return this.getClientInstance()
73
+ .request({
74
+ path: "/wiki/rest/api/content/{id}/state/available",
75
+ method: "GET",
76
+ pathParams: {
77
+ id,
78
+ },
79
+ })
80
+ .then(this.getClientInstance().responseHandler({
81
+ 200: {
82
+ "application/json": "json",
83
+ },
84
+ }))
85
+ .then(commonHttpClient.castResponse())
86
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getAvailableContentStates.response"))
87
+ .then(commonHttpClient.getBody);
88
+ };
89
+ /**
90
+ * Gets the current content state of the draft or current version of content. To
91
+ * specify the draft version, set
92
+ * the parameter status to draft, otherwise archived or current will get the
93
+ * relevant published state.
94
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
95
+ * Permission to view the content.
96
+ *
97
+ * @returns Returned if permission allows viewing of content.
98
+ * @path {GET} /wiki/rest/api/content/{id}/state
99
+ * @scopes-current read:confluence-content.summary
100
+ * @scopes-beta read:content-details:confluence
101
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-id-state-get
102
+ */
103
+ this.getContentState = ({ id, status, }) => {
104
+ return this.getClientInstance()
105
+ .request({
106
+ path: "/wiki/rest/api/content/{id}/state",
107
+ method: "GET",
108
+ pathParams: {
109
+ id,
110
+ },
111
+ query: {
112
+ status,
113
+ },
114
+ })
115
+ .then(this.getClientInstance().responseHandler({
116
+ 200: {
117
+ "application/json": "json",
118
+ },
119
+ }))
120
+ .then(commonHttpClient.castResponse())
121
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getContentState.response"))
122
+ .then(commonHttpClient.getBody);
123
+ };
124
+ /**
125
+ * Get object describing whether content states are allowed at all, if custom
126
+ * content states or space content states
127
+ * are restricted, and a list of space content states allowed for the space if
128
+ * they are not restricted.
129
+ *
130
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
131
+ * 'Admin' permission for the space.
132
+ *
133
+ * @returns Returned if the requested space exists, and user has space admin permission.
134
+ * @path {GET} /wiki/rest/api/space/{spaceKey}/state/settings
135
+ * @scopes-current read:confluence-space.summary
136
+ * @scopes-beta read:space.setting:confluence
137
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-space-spacekey-state-settings-get
138
+ */
139
+ this.getContentStateSettings = ({ spaceKey, }) => {
140
+ return this.getClientInstance()
141
+ .request({
142
+ path: "/wiki/rest/api/space/{spaceKey}/state/settings",
143
+ method: "GET",
144
+ pathParams: {
145
+ spaceKey,
146
+ },
147
+ })
148
+ .then(this.getClientInstance().responseHandler({
149
+ 200: {
150
+ "application/json": "json",
151
+ },
152
+ }))
153
+ .then(commonHttpClient.castResponse())
154
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getContentStateSettings.response"))
155
+ .then(commonHttpClient.getBody);
156
+ };
157
+ /**
158
+ * Returns all content that has the provided content state in a space.
159
+ *
160
+ * Starting on Dec 10, 2024, if the expand query parameter is used with the
161
+ * `body.export_view` and/or `body.styled_view` properties, then the query limit
162
+ * parameter will be restricted to a maximum value of 25.
163
+ *
164
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
165
+ * 'View' permission for the space.
166
+ *
167
+ * @returns Returned if search was successful.
168
+ * @path {GET} /wiki/rest/api/space/{spaceKey}/state/content
169
+ * @scopes-current read:confluence-content.all
170
+ * @scopes-beta read:content:confluence
171
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-space-spacekey-state-content-get
172
+ */
173
+ this.getContentsWithState = ({ spaceKey, stateId, expand, limit, start, }) => {
174
+ return this.getClientInstance()
175
+ .request({
176
+ path: "/wiki/rest/api/space/{spaceKey}/state/content",
177
+ method: "GET",
178
+ pathParams: {
179
+ spaceKey,
180
+ },
181
+ query: {
182
+ "state-id": stateId,
183
+ expand,
184
+ limit,
185
+ start,
186
+ },
187
+ })
188
+ .then(this.getClientInstance().responseHandler({
189
+ 200: {
190
+ "application/json": "json",
191
+ },
192
+ }))
193
+ .then(commonHttpClient.castResponse())
194
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getContentsWithState.response"))
195
+ .then(commonHttpClient.getBody);
196
+ };
197
+ /**
198
+ * Get custom content states that authenticated user has created.
199
+ *
200
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**
201
+ * Must have user authentication.
202
+ *
203
+ * @returns Custom Content States that user has crated. Returned if user authenticated.
204
+ * @path {GET} /wiki/rest/api/content-states
205
+ * @scopes-current read:user.property:confluence
206
+ * @scopes-beta read:user.property:confluence
207
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-states-get
208
+ */
209
+ this.getCustomContentStates = () => {
210
+ return this.getClientInstance()
211
+ .request({
212
+ path: "/wiki/rest/api/content-states",
213
+ method: "GET",
214
+ })
215
+ .then(this.getClientInstance().responseHandler({
216
+ 200: {
217
+ "application/json": "json",
218
+ },
219
+ }))
220
+ .then(commonHttpClient.castResponse())
221
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getCustomContentStates.response"))
222
+ .then(commonHttpClient.getBody);
223
+ };
224
+ /**
225
+ * Get content states that are suggested in the space.
226
+ *
227
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
228
+ * 'View' permission for the space.
229
+ *
230
+ * @returns Returned if the requested space exists, and user has space view permission.
231
+ * @path {GET} /wiki/rest/api/space/{spaceKey}/state
232
+ * @scopes-current read:confluence-space.summary
233
+ * @scopes-beta read:space.setting:confluence
234
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-space-spacekey-state-get
235
+ */
236
+ this.getSpaceContentStates = ({ spaceKey, }) => {
237
+ return this.getClientInstance()
238
+ .request({
239
+ path: "/wiki/rest/api/space/{spaceKey}/state",
240
+ method: "GET",
241
+ pathParams: {
242
+ spaceKey,
243
+ },
244
+ })
245
+ .then(this.getClientInstance().responseHandler({
246
+ 200: {
247
+ "application/json": "json",
248
+ },
249
+ }))
250
+ .then(commonHttpClient.castResponse())
251
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getSpaceContentStates.response"))
252
+ .then(commonHttpClient.getBody);
253
+ };
254
+ /**
255
+ * Get Status of long running task that was previously created to remove content
256
+ * states from content.
257
+ * User must first create a task by passing in details to the
258
+ * /wiki/rest/api/content-states DELETE endpoint.
259
+ *
260
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**
261
+ * Must have created long running task
262
+ *
263
+ * @deprecated
264
+ * @returns Task found. State of task is returned
265
+ * @path {GET} /wiki/rest/api/content-states/task/{taskId}
266
+ * @scopes-current read:confluence-content
267
+ * @scopes-beta read:content:confluence
268
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-states-task-taskid-get
269
+ */
270
+ this.getTaskUpdate = ({ taskId, }) => {
271
+ return this.getClientInstance()
272
+ .request({
273
+ path: "/wiki/rest/api/content-states/task/{taskId}",
274
+ method: "GET",
275
+ pathParams: {
276
+ taskId,
277
+ },
278
+ })
279
+ .then(this.getClientInstance().responseHandler({
280
+ 200: {
281
+ "application/json": "json",
282
+ },
283
+ }))
284
+ .then(commonHttpClient.castResponse())
285
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.getTaskUpdate.response"))
286
+ .then(commonHttpClient.getBody);
287
+ };
288
+ /**
289
+ * Removes the content state of the content specified and creates a new version
290
+ * (publishes the content without changing the body) of the content with the new
291
+ * status.
292
+ *
293
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
294
+ * Permission to edit the content.
295
+ *
296
+ * @returns Returned if content state is removed from content.
297
+ * @path {DELETE} /wiki/rest/api/content/{id}/state
298
+ * @scopes-current write:confluence-content
299
+ * @scopes-beta write:content:confluence, read:content-details:confluence
300
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-id-state-delete
301
+ */
302
+ this.removeContentState = ({ id, status, }) => {
303
+ return this.getClientInstance()
304
+ .request({
305
+ path: "/wiki/rest/api/content/{id}/state",
306
+ method: "DELETE",
307
+ pathParams: {
308
+ id,
309
+ },
310
+ query: {
311
+ status,
312
+ },
313
+ })
314
+ .then(this.getClientInstance().responseHandler({
315
+ 200: {
316
+ "application/json": "json",
317
+ },
318
+ }))
319
+ .then(commonHttpClient.castResponse())
320
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.removeContentState.response"))
321
+ .then(commonHttpClient.getBody);
322
+ };
323
+ /**
324
+ * Sets the content state of the content specified and creates a new version
325
+ * (publishes the content without changing the body) of the content with the new
326
+ * state.
327
+ *
328
+ * You may pass in either an id of a state, or the name and color of a desired new
329
+ * state.
330
+ * If all 3 are passed in, id will be used.
331
+ * If the name and color passed in already exist under the current user's existing
332
+ * custom states, the existing state will be reused.
333
+ * If custom states are disabled in the space of the content (which can be
334
+ * determined by getting the content state space settings of the content's space)
335
+ * then this set will fail.
336
+ *
337
+ * You may not remove a content state via this PUT request. You must use the
338
+ * DELETE method. A specified state is required in the body of this request.
339
+ *
340
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
341
+ * Permission to edit the content.
342
+ *
343
+ * @returns Returned if content state is set successfully.
344
+ * @path {PUT} /wiki/rest/api/content/{id}/state
345
+ * @scopes-current write:confluence-content
346
+ * @scopes-beta write:content:confluence, read:content-details:confluence
347
+ * @see https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states#api-wiki-rest-api-content-id-state-put
348
+ */
349
+ this.setContentState = ({ id, status, contentStateRestInput, }) => {
350
+ return this.getClientInstance()
351
+ .request({
352
+ path: "/wiki/rest/api/content/{id}/state",
353
+ method: "PUT",
354
+ pathParams: {
355
+ id,
356
+ },
357
+ query: {
358
+ status,
359
+ },
360
+ headers: {
361
+ "Content-Type": "application/json",
362
+ },
363
+ body: contentStateRestInput,
364
+ })
365
+ .then(this.getClientInstance().responseHandler({
366
+ 200: {
367
+ "application/json": "json",
368
+ },
369
+ }))
370
+ .then(commonHttpClient.castResponse())
371
+ .then(validationSchemaStorage_1.validationSchemaStorage.validator("ContentStatesService.setContentState.response"))
372
+ .then(commonHttpClient.getBody);
373
+ };
371
374
  }
372
375
  static initialize() {
373
376
  validationSchemaStorage_1.validationSchemaStorage.registerExtensible("ContentStatesService.getCustomContentStates.response", zod_1.z