confluence.js 1.5.1 → 1.6.0

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 (163) hide show
  1. package/CHANGELOG.md +22 -3
  2. package/README.md +1 -0
  3. package/out/api/audit.d.ts +24 -12
  4. package/out/api/audit.js.map +1 -1
  5. package/out/api/content.d.ts +18 -12
  6. package/out/api/content.js.map +1 -1
  7. package/out/api/contentAttachments.d.ts +14 -8
  8. package/out/api/contentAttachments.js.map +1 -1
  9. package/out/api/contentBody.d.ts +52 -0
  10. package/out/api/contentBody.js +27 -3
  11. package/out/api/contentBody.js.map +1 -1
  12. package/out/api/contentChildrenAndDescendants.js +2 -1
  13. package/out/api/contentChildrenAndDescendants.js.map +1 -1
  14. package/out/api/contentContentState.d.ts +30 -28
  15. package/out/api/contentContentState.js +2 -0
  16. package/out/api/contentContentState.js.map +1 -1
  17. package/out/api/contentMacroBody.d.ts +72 -2
  18. package/out/api/contentMacroBody.js +29 -0
  19. package/out/api/contentMacroBody.js.map +1 -1
  20. package/out/api/contentRestrictions.d.ts +16 -8
  21. package/out/api/contentRestrictions.js.map +1 -1
  22. package/out/api/contentStates.d.ts +120 -0
  23. package/out/api/contentStates.js +88 -0
  24. package/out/api/contentStates.js.map +1 -0
  25. package/out/api/contentWatches.d.ts +16 -8
  26. package/out/api/contentWatches.js.map +1 -1
  27. package/out/api/dynamicModules.js +1 -0
  28. package/out/api/dynamicModules.js.map +1 -1
  29. package/out/api/experimental.d.ts +2 -2
  30. package/out/api/index.d.ts +1 -0
  31. package/out/api/index.js +1 -0
  32. package/out/api/index.js.map +1 -1
  33. package/out/api/models/asyncContentBody.d.ts +30 -0
  34. package/out/api/models/asyncContentBody.js +3 -0
  35. package/out/api/models/asyncContentBody.js.map +1 -0
  36. package/out/api/models/asyncId.d.ts +3 -0
  37. package/out/api/models/asyncId.js +3 -0
  38. package/out/api/models/asyncId.js.map +1 -0
  39. package/out/api/models/contentBodyCreate.d.ts +1 -0
  40. package/out/api/models/contentStateResponse.d.ts +7 -0
  41. package/out/api/models/contentStateResponse.js +3 -0
  42. package/out/api/models/contentStateResponse.js.map +1 -0
  43. package/out/api/models/contentStateRestInput.d.ts +11 -0
  44. package/out/api/models/contentStateRestInput.js +3 -0
  45. package/out/api/models/contentStateRestInput.js.map +1 -0
  46. package/out/api/models/index.d.ts +16 -12
  47. package/out/api/models/index.js +16 -12
  48. package/out/api/models/index.js.map +1 -1
  49. package/out/api/parameters/asyncConvertContentBodyRequest.d.ts +38 -0
  50. package/out/api/parameters/asyncConvertContentBodyRequest.js +3 -0
  51. package/out/api/parameters/asyncConvertContentBodyRequest.js.map +1 -0
  52. package/out/api/parameters/asyncConvertContentBodyResponse.d.ts +4 -0
  53. package/out/api/parameters/asyncConvertContentBodyResponse.js +3 -0
  54. package/out/api/parameters/asyncConvertContentBodyResponse.js.map +1 -0
  55. package/out/api/parameters/convertContentBody.d.ts +16 -2
  56. package/out/api/parameters/getAndAsyncConvertMacroBodyByMacroId.d.ts +46 -0
  57. package/out/api/parameters/getAndAsyncConvertMacroBodyByMacroId.js +3 -0
  58. package/out/api/parameters/getAndAsyncConvertMacroBodyByMacroId.js.map +1 -0
  59. package/out/api/parameters/getAndConvertMacroBodyByMacroId.d.ts +34 -0
  60. package/out/api/parameters/getAndConvertMacroBodyByMacroId.js +3 -0
  61. package/out/api/parameters/getAndConvertMacroBodyByMacroId.js.map +1 -0
  62. package/out/api/parameters/getAvailableContentStates.d.ts +4 -2
  63. package/out/api/parameters/getContentState.d.ts +8 -4
  64. package/out/api/parameters/getSpaceContentStates.d.ts +4 -0
  65. package/out/api/parameters/getSpaceContentStates.js +3 -0
  66. package/out/api/parameters/getSpaceContentStates.js.map +1 -0
  67. package/out/api/parameters/getUser.d.ts +6 -4
  68. package/out/api/parameters/index.d.ts +5 -0
  69. package/out/api/parameters/index.js +5 -0
  70. package/out/api/parameters/index.js.map +1 -1
  71. package/out/api/parameters/movePage.d.ts +9 -5
  72. package/out/api/parameters/removeContentState.d.ts +5 -1
  73. package/out/api/parameters/setContentState.d.ts +11 -5
  74. package/out/api/relation.d.ts +8 -4
  75. package/out/api/relation.js.map +1 -1
  76. package/out/api/settings.d.ts +6 -4
  77. package/out/api/settings.js.map +1 -1
  78. package/out/api/space.d.ts +6 -4
  79. package/out/api/space.js.map +1 -1
  80. package/out/api/spaceProperties.d.ts +4 -4
  81. package/out/api/template.d.ts +16 -8
  82. package/out/api/template.js.map +1 -1
  83. package/out/clients/baseClient.js +3 -1
  84. package/out/clients/baseClient.js.map +1 -1
  85. package/out/clients/confluenceClient.d.ts +2 -1
  86. package/out/clients/confluenceClient.js +1 -0
  87. package/out/clients/confluenceClient.js.map +1 -1
  88. package/out/clients/serverClient.js.map +1 -1
  89. package/out/server/audit.js +6 -6
  90. package/out/server/audit.js.map +1 -1
  91. package/out/server/content.d.ts +34 -262
  92. package/out/server/content.js +40 -32
  93. package/out/server/content.js.map +1 -1
  94. package/out/server/contentBody.d.ts +2 -12
  95. package/out/server/contentBody.js +2 -1
  96. package/out/server/contentBody.js.map +1 -1
  97. package/out/server/group.js +3 -3
  98. package/out/server/group.js.map +1 -1
  99. package/out/server/longTask.js +2 -2
  100. package/out/server/longTask.js.map +1 -1
  101. package/out/server/parameters/convertContentBody.d.ts +16 -0
  102. package/out/server/parameters/updateAttachmentData.d.ts +8 -2
  103. package/out/server/search.d.ts +2 -22
  104. package/out/server/search.js +1 -1
  105. package/out/server/search.js.map +1 -1
  106. package/out/server/space.d.ts +12 -94
  107. package/out/server/space.js +14 -14
  108. package/out/server/space.js.map +1 -1
  109. package/out/server/user.d.ts +8 -152
  110. package/out/server/user.js +10 -10
  111. package/out/server/user.js.map +1 -1
  112. package/package.json +10 -10
  113. package/src/api/audit.ts +24 -12
  114. package/src/api/content.ts +23 -17
  115. package/src/api/contentAttachments.ts +19 -13
  116. package/src/api/contentBody.ts +102 -0
  117. package/src/api/contentChildrenAndDescendants.ts +3 -1
  118. package/src/api/contentContentState.ts +30 -28
  119. package/src/api/contentMacroBody.ts +119 -2
  120. package/src/api/contentRestrictions.ts +16 -8
  121. package/src/api/contentStates.ts +252 -0
  122. package/src/api/contentWatches.ts +16 -8
  123. package/src/api/dynamicModules.ts +1 -0
  124. package/src/api/experimental.ts +2 -2
  125. package/src/api/index.ts +1 -0
  126. package/src/api/models/asyncContentBody.ts +31 -0
  127. package/src/api/models/asyncId.ts +3 -0
  128. package/src/api/models/contentBodyCreate.ts +1 -0
  129. package/src/api/models/contentStateResponse.ts +8 -0
  130. package/src/api/models/contentStateRestInput.ts +11 -0
  131. package/src/api/models/index.ts +16 -12
  132. package/src/api/parameters/asyncConvertContentBodyRequest.ts +81 -0
  133. package/src/api/parameters/asyncConvertContentBodyResponse.ts +4 -0
  134. package/src/api/parameters/convertContentBody.ts +39 -2
  135. package/src/api/parameters/getAndAsyncConvertMacroBodyByMacroId.ts +88 -0
  136. package/src/api/parameters/getAndConvertMacroBodyByMacroId.ts +104 -0
  137. package/src/api/parameters/getAvailableContentStates.ts +5 -2
  138. package/src/api/parameters/getContentState.ts +9 -4
  139. package/src/api/parameters/getSpaceContentStates.ts +4 -0
  140. package/src/api/parameters/getUser.ts +14 -4
  141. package/src/api/parameters/index.ts +5 -0
  142. package/src/api/parameters/movePage.ts +9 -5
  143. package/src/api/parameters/removeContentState.ts +6 -1
  144. package/src/api/parameters/setContentState.ts +13 -5
  145. package/src/api/relation.ts +8 -4
  146. package/src/api/settings.ts +6 -4
  147. package/src/api/space.ts +7 -5
  148. package/src/api/spaceProperties.ts +4 -4
  149. package/src/api/template.ts +16 -8
  150. package/src/clients/baseClient.ts +5 -10
  151. package/src/clients/client.ts +1 -5
  152. package/src/clients/confluenceClient.ts +2 -0
  153. package/src/clients/serverClient.ts +1 -10
  154. package/src/server/audit.ts +6 -6
  155. package/src/server/content.ts +78 -295
  156. package/src/server/contentBody.ts +4 -13
  157. package/src/server/group.ts +3 -3
  158. package/src/server/longTask.ts +2 -2
  159. package/src/server/parameters/convertContentBody.ts +37 -0
  160. package/src/server/parameters/updateAttachmentData.ts +7 -3
  161. package/src/server/search.ts +3 -23
  162. package/src/server/space.ts +26 -108
  163. package/src/server/user.ts +18 -162
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "confluence.js",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "confluence.js is a powerful Node.JS/Browser module that allows you to interact with the Confluence API very easily",
5
5
  "author": "Vladislav Tupikin <mrrefactoring@yandex.ru>",
6
6
  "license": "MIT",
@@ -46,21 +46,21 @@
46
46
  "@types/express": "^4.17.13",
47
47
  "@types/oauth": "^0.9.1",
48
48
  "@types/sinon": "^10.0.13",
49
- "@typescript-eslint/eslint-plugin": "^5.32.0",
50
- "@typescript-eslint/parser": "^5.32.0",
51
- "ava": "^4.3.1",
52
- "dotenv": "^16.0.1",
53
- "eslint": "^8.21.0",
49
+ "@typescript-eslint/eslint-plugin": "^5.36.2",
50
+ "@typescript-eslint/parser": "^5.36.2",
51
+ "ava": "^4.3.3",
52
+ "dotenv": "^16.0.2",
53
+ "eslint": "^8.23.0",
54
54
  "eslint-config-airbnb": "^19.0.4",
55
55
  "eslint-config-airbnb-typescript": "^17.0.0",
56
- "eslint-import-resolver-typescript": "^3.4.0",
56
+ "eslint-import-resolver-typescript": "^3.5.1",
57
57
  "eslint-plugin-import": "^2.26.0",
58
58
  "prettier": "^2.7.1",
59
- "prettier-plugin-jsdoc": "^0.3.38",
59
+ "prettier-plugin-jsdoc": "^0.4.2",
60
60
  "sinon": "^14.0.0",
61
- "typedoc": "^0.23.10",
61
+ "typedoc": "^0.23.14",
62
62
  "typedoc-plugin-extras": "^2.3.0",
63
- "typescript": "^4.7.4"
63
+ "typescript": "^4.8.3"
64
64
  },
65
65
  "dependencies": {
66
66
  "atlassian-jwt": "^2.0.2",
package/src/api/audit.ts CHANGED
@@ -12,7 +12,8 @@ export class Audit {
12
12
  * like space exports, group membership changes, app installations, etc. For more information, see [Audit
13
13
  * log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the Confluence administrator's guide.
14
14
  *
15
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
15
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
16
+ * permission.
16
17
  */
17
18
  async getAuditRecords<T = Models.AuditRecordArray>(
18
19
  parameters: Parameters.GetAuditRecords | undefined,
@@ -23,7 +24,8 @@ export class Audit {
23
24
  * like space exports, group membership changes, app installations, etc. For more information, see [Audit
24
25
  * log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the Confluence administrator's guide.
25
26
  *
26
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
27
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
28
+ * permission.
27
29
  */
28
30
  async getAuditRecords<T = Models.AuditRecordArray>(
29
31
  parameters?: Parameters.GetAuditRecords,
@@ -51,7 +53,8 @@ export class Audit {
51
53
  /**
52
54
  * Creates a record in the audit log.
53
55
  *
54
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
56
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
57
+ * permission.
55
58
  */
56
59
  async createAuditRecord<T = Models.AuditRecord>(
57
60
  parameters: Parameters.CreateAuditRecord | undefined,
@@ -60,7 +63,8 @@ export class Audit {
60
63
  /**
61
64
  * Creates a record in the audit log.
62
65
  *
63
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
66
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
67
+ * permission.
64
68
  */
65
69
  async createAuditRecord<T = Models.AuditRecord>(
66
70
  parameters?: Parameters.CreateAuditRecord,
@@ -93,7 +97,8 @@ export class Audit {
93
97
  /**
94
98
  * Exports audit records as a CSV file or ZIP file.
95
99
  *
96
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
100
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
101
+ * permission.
97
102
  */
98
103
  async exportAuditRecords<T = unknown>(
99
104
  parameters: Parameters.ExportAuditRecords | undefined,
@@ -102,7 +107,8 @@ export class Audit {
102
107
  /**
103
108
  * Exports audit records as a CSV file or ZIP file.
104
109
  *
105
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
110
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
111
+ * permission.
106
112
  */
107
113
  async exportAuditRecords<T = unknown>(parameters?: Parameters.ExportAuditRecords, callback?: never): Promise<T>;
108
114
  async exportAuditRecords<T = unknown>(
@@ -127,14 +133,16 @@ export class Audit {
127
133
  * Returns the retention period for records in the audit log. The retention period is how long an audit record is kept
128
134
  * for, from creation date until it is deleted.
129
135
  *
130
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
136
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
137
+ * permission.
131
138
  */
132
139
  async getRetentionPeriod<T = Models.RetentionPeriod>(callback: Callback<T>): Promise<void>;
133
140
  /**
134
141
  * Returns the retention period for records in the audit log. The retention period is how long an audit record is kept
135
142
  * for, from creation date until it is deleted.
136
143
  *
137
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
144
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
145
+ * permission.
138
146
  */
139
147
  async getRetentionPeriod<T = Models.RetentionPeriod>(callback?: never): Promise<T>;
140
148
  async getRetentionPeriod<T = Models.RetentionPeriod>(callback?: Callback<T>): Promise<void | T> {
@@ -149,7 +157,8 @@ export class Audit {
149
157
  /**
150
158
  * Sets the retention period for records in the audit log. The retention period can be set to a maximum of 20 years.
151
159
  *
152
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
160
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
161
+ * permission.
153
162
  */
154
163
  async setRetentionPeriod<T = Models.RetentionPeriod>(
155
164
  parameters: Parameters.SetRetentionPeriod | undefined,
@@ -158,7 +167,8 @@ export class Audit {
158
167
  /**
159
168
  * Sets the retention period for records in the audit log. The retention period can be set to a maximum of 20 years.
160
169
  *
161
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
170
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
171
+ * permission.
162
172
  */
163
173
  async setRetentionPeriod<T = Models.RetentionPeriod>(
164
174
  parameters?: Parameters.SetRetentionPeriod,
@@ -188,7 +198,8 @@ export class Audit {
188
198
  * more information, see [Audit log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the
189
199
  * Confluence administrator's guide.
190
200
  *
191
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
201
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
202
+ * permission.
192
203
  */
193
204
  async getAuditRecordsForTimePeriod<T = Models.AuditRecordArray>(
194
205
  parameters: Parameters.GetAuditRecordsForTimePeriod | undefined,
@@ -202,7 +213,8 @@ export class Audit {
202
213
  * more information, see [Audit log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the
203
214
  * Confluence administrator's guide.
204
215
  *
205
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission.
216
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global
217
+ * permission.
206
218
  */
207
219
  async getAuditRecordsForTimePeriod<T = Models.AuditRecordArray>(
208
220
  parameters?: Parameters.GetAuditRecordsForTimePeriod,
@@ -113,10 +113,7 @@ export class Content {
113
113
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Archive' permission for each of the pages
114
114
  * in the corresponding space it belongs to.
115
115
  */
116
- async archivePages<T = Models.LongTask>(
117
- parameters: Parameters.ArchivePages,
118
- callback: Callback<T>
119
- ): Promise<void>;
116
+ async archivePages<T = Models.LongTask>(parameters: Parameters.ArchivePages, callback: Callback<T>): Promise<void>;
120
117
  /**
121
118
  * Archives a list of pages. The pages to be archived are specified as a list of content IDs. This API accepts the
122
119
  * archival request and returns a task ID. The archival process happens asynchronously. Use the /longtask/<taskId>
@@ -129,7 +126,10 @@ export class Content {
129
126
  * in the corresponding space it belongs to.
130
127
  */
131
128
  async archivePages<T = Models.LongTask>(parameters: Parameters.ArchivePages, callback?: never): Promise<T>;
132
- async archivePages<T = Models.LongTask>(parameters: Parameters.ArchivePages, callback?: Callback<T>): Promise<void | T> {
129
+ async archivePages<T = Models.LongTask>(
130
+ parameters: Parameters.ArchivePages,
131
+ callback?: Callback<T>,
132
+ ): Promise<void | T> {
133
133
  const config: RequestConfig = {
134
134
  url: '/api/content/archive',
135
135
  method: 'POST',
@@ -143,7 +143,8 @@ export class Content {
143
143
 
144
144
  /**
145
145
  * Publishes a legacy draft of a page created from a blueprint. Legacy drafts will eventually be removed in favor of
146
- * shared drafts. For now, this method works the same as [Publish shared draft](#api-content-blueprint-instance-draftId-put).
146
+ * shared drafts. For now, this method works the same as [Publish shared
147
+ * draft](#api-content-blueprint-instance-draftId-put).
147
148
  *
148
149
  * By default, the following objects are expanded: `body.storage`, `history`, `space`, `version`, `ancestors`.
149
150
  *
@@ -156,7 +157,8 @@ export class Content {
156
157
  ): Promise<void>;
157
158
  /**
158
159
  * Publishes a legacy draft of a page created from a blueprint. Legacy drafts will eventually be removed in favor of
159
- * shared drafts. For now, this method works the same as [Publish shared draft](#api-content-blueprint-instance-draftId-put).
160
+ * shared drafts. For now, this method works the same as [Publish shared
161
+ * draft](#api-content-blueprint-instance-draftId-put).
160
162
  *
161
163
  * By default, the following objects are expanded: `body.storage`, `history`, `space`, `version`, `ancestors`.
162
164
  *
@@ -240,9 +242,9 @@ export class Content {
240
242
  * When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The
241
243
  * URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of
242
244
  * results returned in each call. Example subsequent call (taken from example response):
243
- * ```
244
- * https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg
245
- * ```
245
+ *
246
+ * https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg
247
+ *
246
248
  * The response to this will have a `prev` URL similar to the `next` in the example response.
247
249
  *
248
250
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
@@ -259,9 +261,9 @@ export class Content {
259
261
  * When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The
260
262
  * URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of
261
263
  * results returned in each call. Example subsequent call (taken from example response):
262
- * ```
263
- * https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg
264
- * ```
264
+ *
265
+ * https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg
266
+ *
265
267
  * The response to this will have a `prev` URL similar to the `next` in the example response.
266
268
  *
267
269
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
@@ -369,11 +371,13 @@ export class Content {
369
371
  }
370
372
 
371
373
  /**
372
- * Moves a piece of content to the space's trash or purges it from the trash, depending on the content's type and status:
374
+ * Moves a piece of content to the space's trash or purges it from the trash, depending on the content's type and
375
+ * status:
373
376
  *
374
377
  * - If the content's type is `page` or `blogpost` and its status is `current`, it will be trashed.
375
378
  * - If the content's type is `page` or `blogpost` and its status is `trashed`, the content will be purged from the
376
- * trash and deleted permanently. Note, you must also set the `status` query parameter to `trashed` in your request.
379
+ * trash and deleted permanently. Note, you must also set the `status` query parameter to `trashed` in your
380
+ * request.
377
381
  * - If the content's type is `comment` or `attachment`, it will be deleted permanently without being trashed.
378
382
  *
379
383
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Delete' permission for the space that the
@@ -381,11 +385,13 @@ export class Content {
381
385
  */
382
386
  async deleteContent<T = void>(parameters: Parameters.DeleteContent, callback: Callback<T>): Promise<void>;
383
387
  /**
384
- * Moves a piece of content to the space's trash or purges it from the trash, depending on the content's type and status:
388
+ * Moves a piece of content to the space's trash or purges it from the trash, depending on the content's type and
389
+ * status:
385
390
  *
386
391
  * - If the content's type is `page` or `blogpost` and its status is `current`, it will be trashed.
387
392
  * - If the content's type is `page` or `blogpost` and its status is `trashed`, the content will be purged from the
388
- * trash and deleted permanently. Note, you must also set the `status` query parameter to `trashed` in your request.
393
+ * trash and deleted permanently. Note, you must also set the `status` query parameter to `trashed` in your
394
+ * request.
389
395
  * - If the content's type is `comment` or `attachment`, it will be deleted permanently without being trashed.
390
396
  *
391
397
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Delete' permission for the space that the
@@ -28,7 +28,10 @@ export class ContentAttachments {
28
28
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content. If the
29
29
  * content is a blog post, 'View' permission for the space is required.
30
30
  */
31
- async getAttachments<T = Models.ContentArray<Models.Attachment>>(parameters: Parameters.GetAttachments, callback?: never): Promise<T>;
31
+ async getAttachments<T = Models.ContentArray<Models.Attachment>>(
32
+ parameters: Parameters.GetAttachments,
33
+ callback?: never
34
+ ): Promise<T>;
32
35
  async getAttachments<T = Models.ContentArray<Models.Attachment>>(
33
36
  parameters: Parameters.GetAttachments,
34
37
  callback?: Callback<T>,
@@ -50,7 +53,8 @@ export class ContentAttachments {
50
53
 
51
54
  /**
52
55
  * Adds an attachment to a piece of content. This method only adds a new attachment. If you want to update an existing
53
- * attachment, use [Create or update attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put).
56
+ * attachment, use [Create or update
57
+ * attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put).
54
58
  *
55
59
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.
56
60
  */
@@ -60,7 +64,8 @@ export class ContentAttachments {
60
64
  ): Promise<void>;
61
65
  /**
62
66
  * Adds an attachment to a piece of content. This method only adds a new attachment. If you want to update an existing
63
- * attachment, use [Create or update attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put).
67
+ * attachment, use [Create or update
68
+ * attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put).
64
69
  *
65
70
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.
66
71
  */
@@ -194,10 +199,12 @@ export class ContentAttachments {
194
199
  }
195
200
 
196
201
  /**
197
- * Updates the binary data of an attachment, given the attachment ID, and optionally the comment and the minor edit field.
202
+ * Updates the binary data of an attachment, given the attachment ID, and optionally the comment and the minor edit
203
+ * field.
198
204
  *
199
- * This method is essentially the same as [Create or update attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put), except
200
- * that it matches the attachment ID rather than the name.
205
+ * This method is essentially the same as [Create or update
206
+ * attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put),
207
+ * except that it matches the attachment ID rather than the name.
201
208
  *
202
209
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.
203
210
  */
@@ -206,10 +213,12 @@ export class ContentAttachments {
206
213
  callback: Callback<T>
207
214
  ): Promise<void>;
208
215
  /**
209
- * Updates the binary data of an attachment, given the attachment ID, and optionally the comment and the minor edit field.
216
+ * Updates the binary data of an attachment, given the attachment ID, and optionally the comment and the minor edit
217
+ * field.
210
218
  *
211
- * This method is essentially the same as [Create or update attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put), except
212
- * that it matches the attachment ID rather than the name.
219
+ * This method is essentially the same as [Create or update
220
+ * attachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-wiki-rest-api-content-id-child-attachment-put),
221
+ * except that it matches the attachment ID rather than the name.
213
222
  *
214
223
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.
215
224
  */
@@ -250,10 +259,7 @@ export class ContentAttachments {
250
259
  }
251
260
 
252
261
  /** Redirects the client to a URL that serves an attachment's binary data. */
253
- async downloadAttachment<T = Buffer>(
254
- parameters: Parameters.DownloadAttachment,
255
- callback: Callback<T>
256
- ): Promise<void>;
262
+ async downloadAttachment<T = Buffer>(parameters: Parameters.DownloadAttachment, callback: Callback<T>): Promise<void>;
257
263
  /** Redirects the client to a URL that serves an attachment's binary data. */
258
264
  async downloadAttachment<T = Buffer>(parameters: Parameters.DownloadAttachment, callback?: never): Promise<T>;
259
265
  async downloadAttachment<T = Buffer>(
@@ -54,13 +54,115 @@ export class ContentBody {
54
54
  spaceKeyContext: parameters.spaceKeyContext,
55
55
  contentIdContext: parameters.contentIdContext,
56
56
  embeddedContentRender: parameters.embeddedContentRender,
57
+ expand: parameters.expand,
57
58
  },
58
59
  data: {
59
60
  value: parameters.value,
60
61
  representation: parameters.representation,
62
+ ...parameters.additionalProperties,
61
63
  },
62
64
  };
63
65
 
64
66
  return this.client.sendRequest(config, callback);
65
67
  }
68
+
69
+ /**
70
+ * Converts a content body from one format to another format asynchronously. Returns the asyncId for the asynchronous
71
+ * task.
72
+ *
73
+ * Supported conversions:
74
+ *
75
+ * - Storage: export_view
76
+ *
77
+ * No other conversions are supported at the moment. Once a conversion is completed, it will be available for 5
78
+ * minutes at the result endpoint.
79
+ *
80
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',
81
+ * 'View' permission for the space, and permission to view the content.
82
+ */
83
+ async asyncConvertContentBodyRequest<T = Models.AsyncId>(
84
+ parameters: Parameters.AsyncConvertContentBodyRequest,
85
+ callback: Callback<T>
86
+ ): Promise<void>;
87
+ /**
88
+ * Converts a content body from one format to another format asynchronously. Returns the asyncId for the asynchronous
89
+ * task.
90
+ *
91
+ * Supported conversions:
92
+ *
93
+ * - Storage: export_view
94
+ *
95
+ * No other conversions are supported at the moment. Once a conversion is completed, it will be available for 5
96
+ * minutes at the result endpoint.
97
+ *
98
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',
99
+ * 'View' permission for the space, and permission to view the content.
100
+ */
101
+ async asyncConvertContentBodyRequest<T = Models.AsyncId>(
102
+ parameters: Parameters.AsyncConvertContentBodyRequest,
103
+ callback?: never
104
+ ): Promise<T>;
105
+ async asyncConvertContentBodyRequest<T = Models.AsyncId>(
106
+ parameters: Parameters.AsyncConvertContentBodyRequest,
107
+ callback?: Callback<T>,
108
+ ): Promise<void | T> {
109
+ const config: RequestConfig = {
110
+ url: `/api/contentbody/convert/async/${parameters.to}`,
111
+ method: 'POST',
112
+ params: {
113
+ spaceKeyContext: parameters.spaceKeyContext,
114
+ contentIdContext: parameters.contentIdContext,
115
+ allowCache: parameters.allowCache,
116
+ embeddedContentRender: parameters.embeddedContentRender,
117
+ expand: parameters.expand,
118
+ },
119
+ data: {
120
+ value: parameters.value,
121
+ representation: parameters.representation,
122
+ ...parameters.additionalProperties,
123
+ },
124
+ };
125
+
126
+ return this.client.sendRequest(config, callback);
127
+ }
128
+
129
+ /**
130
+ * Returns the Asynchronous Content Body for the corresponding asyncId if the task is complete or returns the status
131
+ * of the task.
132
+ *
133
+ * After the task is completed, the result can be obtained for 5 minutes, or until an identical conversion request is
134
+ * made again, with allowCache query param set to false.
135
+ *
136
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',
137
+ * 'View' permission for the space, and permission to view the content.
138
+ */
139
+ async asyncConvertContentBodyResponse<T = Models.AsyncContentBody>(
140
+ parameters: Parameters.AsyncConvertContentBodyResponse,
141
+ callback: Callback<T>
142
+ ): Promise<void>;
143
+ /**
144
+ * Returns the Asynchronous Content Body for the corresponding asyncId if the task is complete or returns the status
145
+ * of the task.
146
+ *
147
+ * After the task is completed, the result can be obtained for 5 minutes, or until an identical conversion request is
148
+ * made again, with allowCache query param set to false.
149
+ *
150
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',
151
+ * 'View' permission for the space, and permission to view the content.
152
+ */
153
+ async asyncConvertContentBodyResponse<T = Models.AsyncContentBody>(
154
+ parameters: Parameters.AsyncConvertContentBodyResponse,
155
+ callback?: never
156
+ ): Promise<T>;
157
+ async asyncConvertContentBodyResponse<T = Models.AsyncContentBody>(
158
+ parameters: Parameters.AsyncConvertContentBodyResponse,
159
+ callback?: Callback<T>,
160
+ ): Promise<void | T> {
161
+ const config: RequestConfig = {
162
+ url: `/api/contentbody/convert/async/${parameters.id}`,
163
+ method: 'GET',
164
+ };
165
+
166
+ return this.client.sendRequest(config, callback);
167
+ }
66
168
  }
@@ -92,8 +92,10 @@ export class ContentChildrenAndDescendants {
92
92
  */
93
93
  async movePage<T = Models.MovePage>(parameters: Parameters.MovePage, callback?: never): Promise<T>;
94
94
  async movePage<T = Models.MovePage>(parameters: Parameters.MovePage, callback?: Callback<T>): Promise<void | T> {
95
+ const pageId = parameters.pageId || parameters.id;
96
+
95
97
  const config: RequestConfig = {
96
- url: `/api/content/${parameters.id}/move/${parameters.position}/${parameters.targetId}`,
98
+ url: `/api/content/${pageId}/move/${parameters.position}/${parameters.targetId}`,
97
99
  method: 'PUT',
98
100
  };
99
101
 
@@ -4,20 +4,22 @@ import { Callback } from '../callback';
4
4
  import { Client } from '../clients';
5
5
  import { RequestConfig } from '../requestConfig';
6
6
 
7
+ /** @deprecated Use {@link ContentStates} instead. */
7
8
  export class ContentContentState {
9
+ /** @deprecated */
8
10
  constructor(private client: Client) {}
9
11
 
10
12
  /**
11
- * Gets the current page status of the draft or published version of content. To specify the draft version, set the
12
- * parameter status to PUBLISHED, otherwise DRAFT.
13
+ * @deprecated Gets the current page status of the draft or published version of content. To specify the draft
14
+ * version, set the parameter status to PUBLISHED, otherwise DRAFT.
13
15
  */
14
16
  async getContentState<T = Models.ContentStateContainer>(
15
17
  parameters: Parameters.GetContentState,
16
18
  callback: Callback<T>
17
19
  ): Promise<void>;
18
20
  /**
19
- * Gets the current page status of the draft or published version of content. To specify the draft version, set the
20
- * parameter status to PUBLISHED, otherwise DRAFT.
21
+ * @deprecated Gets the current page status of the draft or published version of content. To specify the draft
22
+ * version, set the parameter status to PUBLISHED, otherwise DRAFT.
21
23
  */
22
24
  async getContentState<T = Models.ContentStateContainer>(
23
25
  parameters: Parameters.GetContentState,
@@ -39,28 +41,28 @@ export class ContentContentState {
39
41
  }
40
42
 
41
43
  /**
42
- * Sets the content state of the content specified and creates a new version (publishes the content without changing
43
- * the body) of the content with the new status. The desired type of status must be allowed. There are space suggested
44
- * statuses and custom statuses. To specify the desired new status, one can use the id of the status or the name and
45
- * color of the status. If contentStateId is defined, then name and color are ignored. If contentStateId is not
46
- * defined, name and color will be used if provided. Firstly, we will determine if a status of this name and color
47
- * exists, and if it does, that this status is used. If it does not exist, and custom statuses are allowed, a custom
48
- * status with this name and color will be created. Color can be specified in traditional english colors (teal,
49
- * magenta, lavender, etc.) or as a hex string ex: #0ff0Fd.
44
+ * @deprecated Sets the content state of the content specified and creates a new version (publishes the content
45
+ * without changing the body) of the content with the new status. The desired type of status must be allowed. There
46
+ * are space suggested statuses and custom statuses. To specify the desired new status, one can use the id of the
47
+ * status or the name and color of the status. If contentStateId is defined, then name and color are ignored. If
48
+ * contentStateId is not defined, name and color will be used if provided. Firstly, we will determine if a status of
49
+ * this name and color exists, and if it does, that this status is used. If it does not exist, and custom statuses
50
+ * are allowed, a custom status with this name and color will be created. Color can be specified in traditional
51
+ * english colors (teal, magenta, lavender, etc.) or as a hex string ex: #0ff0Fd.
50
52
  */
51
53
  async setContentState<T = Models.ContentStateContainer>(
52
54
  parameters: Parameters.SetContentState,
53
55
  callback: Callback<T>
54
56
  ): Promise<void>;
55
57
  /**
56
- * Sets the content state of the content specified and creates a new version (publishes the content without changing
57
- * the body) of the content with the new status. The desired type of status must be allowed. There are space suggested
58
- * statuses and custom statuses. To specify the desired new status, one can use the id of the status or the name and
59
- * color of the status. If contentStateId is defined, then name and color are ignored. If contentStateId is not
60
- * defined, name and color will be used if provided. Firstly, we will determine if a status of this name and color
61
- * exists, and if it does, that this status is used. If it does not exist, and custom statuses are allowed, a custom
62
- * status with this name and color will be created. Color can be specified in traditional english colors (teal,
63
- * magenta, lavender, etc.) or as a hex string ex: #0ff0Fd.
58
+ * @deprecated Sets the content state of the content specified and creates a new version (publishes the content
59
+ * without changing the body) of the content with the new status. The desired type of status must be allowed. There
60
+ * are space suggested statuses and custom statuses. To specify the desired new status, one can use the id of the
61
+ * status or the name and color of the status. If contentStateId is defined, then name and color are ignored. If
62
+ * contentStateId is not defined, name and color will be used if provided. Firstly, we will determine if a status of
63
+ * this name and color exists, and if it does, that this status is used. If it does not exist, and custom statuses
64
+ * are allowed, a custom status with this name and color will be created. Color can be specified in traditional
65
+ * english colors (teal, magenta, lavender, etc.) or as a hex string ex: #0ff0Fd.
64
66
  */
65
67
  async setContentState<T = Models.ContentStateContainer>(
66
68
  parameters: Parameters.SetContentState,
@@ -84,16 +86,16 @@ export class ContentContentState {
84
86
  }
85
87
 
86
88
  /**
87
- * Removes the content state of the content specified and creates a new version (publishes the content without
88
- * changing the body) of the content with the new status.
89
+ * @deprecated Removes the content state of the content specified and creates a new version (publishes the content
90
+ * without changing the body) of the content with the new status.
89
91
  */
90
92
  async removeContentState<T = Models.ContentStateContainer>(
91
93
  parameters: Parameters.RemoveContentState,
92
94
  callback: Callback<T>
93
95
  ): Promise<void>;
94
96
  /**
95
- * Removes the content state of the content specified and creates a new version (publishes the content without
96
- * changing the body) of the content with the new status.
97
+ * @deprecated Removes the content state of the content specified and creates a new version (publishes the content
98
+ * without changing the body) of the content with the new status.
97
99
  */
98
100
  async removeContentState<T = Models.ContentStateContainer>(
99
101
  parameters: Parameters.RemoveContentState,
@@ -111,12 +113,12 @@ export class ContentContentState {
111
113
  return this.client.sendRequest(config, callback);
112
114
  }
113
115
 
114
- /** Gets a Global Timestamp of the last time the content state was updated */
116
+ /** @deprecated Gets a Global Timestamp of the last time the content state was updated */
115
117
  async getContentStateLastUpdated<T = unknown>(
116
118
  parameters: Parameters.GetContentStateLastUpdated,
117
119
  callback: Callback<T>
118
120
  ): Promise<void>;
119
- /** Gets a Global Timestamp of the last time the content state was updated */
121
+ /** @deprecated Gets a Global Timestamp of the last time the content state was updated */
120
122
  async getContentStateLastUpdated<T = unknown>(
121
123
  parameters: Parameters.GetContentStateLastUpdated,
122
124
  callback?: never
@@ -133,12 +135,12 @@ export class ContentContentState {
133
135
  return this.client.sendRequest(config, callback);
134
136
  }
135
137
 
136
- /** Gets content states that are available for the content to be set as. */
138
+ /** @deprecated Gets content states that are available for the content to be set as. */
137
139
  async getAvailableContentStates<T = Models.AvailableContentStates>(
138
140
  parameters: Parameters.GetAvailableContentStates,
139
141
  callback: Callback<T>
140
142
  ): Promise<void>;
141
- /** Gets content states that are available for the content to be set as. */
143
+ /** @deprecated Gets content states that are available for the content to be set as. */
142
144
  async getAvailableContentStates<T = Models.AvailableContentStates>(
143
145
  parameters: Parameters.GetAvailableContentStates,
144
146
  callback?: never