confluence.js 1.5.0 → 1.5.3

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 (77) hide show
  1. package/CHANGELOG.md +15 -3
  2. package/README.md +3 -3
  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.js +2 -4
  10. package/out/api/contentBody.js.map +1 -1
  11. package/out/api/contentMacroBody.d.ts +4 -2
  12. package/out/api/contentMacroBody.js.map +1 -1
  13. package/out/api/contentRestrictions.d.ts +16 -8
  14. package/out/api/contentRestrictions.js.map +1 -1
  15. package/out/api/contentWatches.d.ts +16 -8
  16. package/out/api/contentWatches.js.map +1 -1
  17. package/out/api/parameters/convertContentBody.d.ts +16 -2
  18. package/out/api/relation.d.ts +8 -4
  19. package/out/api/relation.js.map +1 -1
  20. package/out/api/settings.d.ts +4 -2
  21. package/out/api/settings.js.map +1 -1
  22. package/out/api/space.d.ts +4 -2
  23. package/out/api/space.js.map +1 -1
  24. package/out/api/template.d.ts +16 -8
  25. package/out/api/template.js.map +1 -1
  26. package/out/clients/baseClient.js +3 -1
  27. package/out/clients/baseClient.js.map +1 -1
  28. package/out/clients/serverClient.js.map +1 -1
  29. package/out/server/audit.js +6 -6
  30. package/out/server/audit.js.map +1 -1
  31. package/out/server/content.d.ts +34 -262
  32. package/out/server/content.js +40 -32
  33. package/out/server/content.js.map +1 -1
  34. package/out/server/contentBody.d.ts +2 -12
  35. package/out/server/contentBody.js +2 -1
  36. package/out/server/contentBody.js.map +1 -1
  37. package/out/server/group.js +3 -3
  38. package/out/server/group.js.map +1 -1
  39. package/out/server/longTask.js +2 -2
  40. package/out/server/longTask.js.map +1 -1
  41. package/out/server/parameters/convertContentBody.d.ts +16 -0
  42. package/out/server/parameters/updateAttachmentData.d.ts +8 -2
  43. package/out/server/search.d.ts +2 -22
  44. package/out/server/search.js +1 -1
  45. package/out/server/search.js.map +1 -1
  46. package/out/server/space.d.ts +12 -94
  47. package/out/server/space.js +14 -14
  48. package/out/server/space.js.map +1 -1
  49. package/out/server/user.d.ts +8 -152
  50. package/out/server/user.js +10 -10
  51. package/out/server/user.js.map +1 -1
  52. package/package.json +14 -14
  53. package/src/api/audit.ts +24 -12
  54. package/src/api/content.ts +23 -17
  55. package/src/api/contentAttachments.ts +19 -13
  56. package/src/api/contentBody.ts +2 -0
  57. package/src/api/contentMacroBody.ts +4 -2
  58. package/src/api/contentRestrictions.ts +16 -8
  59. package/src/api/contentWatches.ts +16 -8
  60. package/src/api/parameters/convertContentBody.ts +39 -2
  61. package/src/api/relation.ts +8 -4
  62. package/src/api/settings.ts +4 -2
  63. package/src/api/space.ts +4 -2
  64. package/src/api/template.ts +16 -8
  65. package/src/clients/baseClient.ts +5 -10
  66. package/src/clients/client.ts +1 -5
  67. package/src/clients/serverClient.ts +1 -10
  68. package/src/server/audit.ts +6 -6
  69. package/src/server/content.ts +78 -295
  70. package/src/server/contentBody.ts +4 -13
  71. package/src/server/group.ts +3 -3
  72. package/src/server/longTask.ts +2 -2
  73. package/src/server/parameters/convertContentBody.ts +37 -0
  74. package/src/server/parameters/updateAttachmentData.ts +7 -3
  75. package/src/server/search.ts +3 -23
  76. package/src/server/space.ts +26 -108
  77. 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.0",
3
+ "version": "1.5.3",
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",
@@ -45,28 +45,28 @@
45
45
  "@swc-node/register": "^1.5.1",
46
46
  "@types/express": "^4.17.13",
47
47
  "@types/oauth": "^0.9.1",
48
- "@types/sinon": "^10.0.11",
49
- "@typescript-eslint/eslint-plugin": "^5.25.0",
50
- "@typescript-eslint/parser": "^5.25.0",
51
- "ava": "^4.2.0",
52
- "dotenv": "^16.0.1",
53
- "eslint": "^8.16.0",
48
+ "@types/sinon": "^10.0.13",
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": "^2.7.1",
56
+ "eslint-import-resolver-typescript": "^3.5.1",
57
57
  "eslint-plugin-import": "^2.26.0",
58
- "prettier": "^2.6.2",
59
- "prettier-plugin-jsdoc": "^0.3.38",
58
+ "prettier": "^2.7.1",
59
+ "prettier-plugin-jsdoc": "^0.4.2",
60
60
  "sinon": "^14.0.0",
61
- "typedoc": "^0.22.15",
62
- "typedoc-plugin-extras": "^2.2.3",
63
- "typescript": "^4.6.4"
61
+ "typedoc": "^0.23.14",
62
+ "typedoc-plugin-extras": "^2.3.0",
63
+ "typescript": "^4.8.2"
64
64
  },
65
65
  "dependencies": {
66
66
  "atlassian-jwt": "^2.0.2",
67
67
  "axios": "^0.27.2",
68
68
  "form-data": "^4.0.0",
69
- "oauth": "^0.9.15",
69
+ "oauth": "^0.10.0",
70
70
  "tslib": "^2.4.0"
71
71
  }
72
72
  }
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,10 +54,12 @@ 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
 
@@ -20,7 +20,8 @@ export class ContentMacroBody {
20
20
  * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and
21
21
  * transparently propagate out to all instances.
22
22
  *
23
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the macro is in.
23
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the
24
+ * macro is in.
24
25
  */
25
26
  async getMacroBodyByMacroId<T = Models.MacroInstance>(
26
27
  parameters: Parameters.GetMacroBodyByMacroId,
@@ -39,7 +40,8 @@ export class ContentMacroBody {
39
40
  * macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and
40
41
  * transparently propagate out to all instances.
41
42
  *
42
- * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the macro is in.
43
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the
44
+ * macro is in.
43
45
  */
44
46
  async getMacroBodyByMacroId<T = Models.MacroInstance>(
45
47
  parameters: Parameters.GetMacroBodyByMacroId,
@@ -262,7 +262,8 @@ export class ContentRestrictions {
262
262
  }
263
263
 
264
264
  /**
265
- * Adds a group to a content restriction. That is, grant read or update permission to the group for a piece of content.
265
+ * Adds a group to a content restriction. That is, grant read or update permission to the group for a piece of
266
+ * content.
266
267
  *
267
268
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to edit the content.
268
269
  */
@@ -271,7 +272,8 @@ export class ContentRestrictions {
271
272
  callback: Callback<T>
272
273
  ): Promise<void>;
273
274
  /**
274
- * Adds a group to a content restriction. That is, grant read or update permission to the group for a piece of content.
275
+ * Adds a group to a content restriction. That is, grant read or update permission to the group for a piece of
276
+ * content.
275
277
  *
276
278
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to edit the content.
277
279
  */
@@ -292,13 +294,15 @@ export class ContentRestrictions {
292
294
  }
293
295
 
294
296
  /**
295
- * Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of content.
297
+ * Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of
298
+ * content.
296
299
  *
297
300
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to edit the content.
298
301
  */
299
302
  async removeGroupByName<T = unknown>(parameters: Parameters.RemoveGroupByName, callback: Callback<T>): Promise<void>;
300
303
  /**
301
- * Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of content.
304
+ * Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of
305
+ * content.
302
306
  *
303
307
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to edit the content.
304
308
  */
@@ -392,13 +396,15 @@ export class ContentRestrictions {
392
396
  }
393
397
 
394
398
  /**
395
- * Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of content.
399
+ * Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of
400
+ * content.
396
401
  *
397
402
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to edit the content.
398
403
  */
399
404
  async removeGroupById<T = unknown>(parameters: Parameters.RemoveGroupById, callback: Callback<T>): Promise<void>;
400
405
  /**
401
- * Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of content.
406
+ * Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of
407
+ * content.
402
408
  *
403
409
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to edit the content.
404
410
  */
@@ -502,7 +508,8 @@ export class ContentRestrictions {
502
508
  }
503
509
 
504
510
  /**
505
- * Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of content.
511
+ * Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of
512
+ * content.
506
513
  *
507
514
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to edit the content.
508
515
  */
@@ -511,7 +518,8 @@ export class ContentRestrictions {
511
518
  callback: Callback<T>
512
519
  ): Promise<void>;
513
520
  /**
514
- * Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of content.
521
+ * Removes a group from a content restriction. That is, remove read or update permission for the group for a piece of
522
+ * content.
515
523
  *
516
524
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to edit the content.
517
525
  */
@@ -8,7 +8,8 @@ export class ContentWatches {
8
8
  constructor(private client: Client) {}
9
9
 
10
10
  /**
11
- * Returns the watches for a page. A user that watches a page will receive receive notifications when the page is updated.
11
+ * Returns the watches for a page. A user that watches a page will receive receive notifications when the page is
12
+ * updated.
12
13
  *
13
14
  * If you want to manage watches for a page, use the following `user` methods:
14
15
  *
@@ -24,7 +25,8 @@ export class ContentWatches {
24
25
  callback: Callback<T>
25
26
  ): Promise<void>;
26
27
  /**
27
- * Returns the watches for a page. A user that watches a page will receive receive notifications when the page is updated.
28
+ * Returns the watches for a page. A user that watches a page will receive receive notifications when the page is
29
+ * updated.
28
30
  *
29
31
  * If you want to manage watches for a page, use the following `user` methods:
30
32
  *
@@ -180,7 +182,8 @@ export class ContentWatches {
180
182
  * - Specify a user via a query parameter: Use the `accountId` to identify the user.
181
183
  * - Do not specify a user: The currently logged-in user will be used.
182
184
  *
183
- * Note, you must add the `X-Atlassian-Token: no-check` header when making a request, as this operation has XSRF protection.
185
+ * Note, you must add the `X-Atlassian-Token: no-check` header when making a request, as this operation has XSRF
186
+ * protection.
184
187
  *
185
188
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission
186
189
  * if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).
@@ -192,7 +195,8 @@ export class ContentWatches {
192
195
  * - Specify a user via a query parameter: Use the `accountId` to identify the user.
193
196
  * - Do not specify a user: The currently logged-in user will be used.
194
197
  *
195
- * Note, you must add the `X-Atlassian-Token: no-check` header when making a request, as this operation has XSRF protection.
198
+ * Note, you must add the `X-Atlassian-Token: no-check` header when making a request, as this operation has XSRF
199
+ * protection.
196
200
  *
197
201
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission
198
202
  * if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).
@@ -304,7 +308,8 @@ export class ContentWatches {
304
308
  * - Specify a user via a query parameter: Use the `accountId` to identify the user.
305
309
  * - Do not specify a user: The currently logged-in user will be used.
306
310
  *
307
- * Note, you must add the `X-Atlassian-Token: no-check` header when making a request, as this operation has XSRF protection.
311
+ * Note, you must add the `X-Atlassian-Token: no-check` header when making a request, as this operation has XSRF
312
+ * protection.
308
313
  *
309
314
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission
310
315
  * if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).
@@ -316,7 +321,8 @@ export class ContentWatches {
316
321
  * - Specify a user via a query parameter: Use the `accountId` to identify the user.
317
322
  * - Do not specify a user: The currently logged-in user will be used.
318
323
  *
319
- * Note, you must add the `X-Atlassian-Token: no-check` header when making a request, as this operation has XSRF protection.
324
+ * Note, you must add the `X-Atlassian-Token: no-check` header when making a request, as this operation has XSRF
325
+ * protection.
320
326
  *
321
327
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission
322
328
  * if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).
@@ -422,7 +428,8 @@ export class ContentWatches {
422
428
  * - Specify a user via a query parameter: Use the `accountId` to identify the user.
423
429
  * - Do not specify a user: The currently logged-in user will be used.
424
430
  *
425
- * Note, you must add the `X-Atlassian-Token: no-check` header when making a request, as this operation has XSRF protection.
431
+ * Note, you must add the `X-Atlassian-Token: no-check` header when making a request, as this operation has XSRF
432
+ * protection.
426
433
  *
427
434
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission
428
435
  * if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).
@@ -434,7 +441,8 @@ export class ContentWatches {
434
441
  * - Specify a user via a query parameter: Use the `accountId` to identify the user.
435
442
  * - Do not specify a user: The currently logged-in user will be used.
436
443
  *
437
- * Note, you must add the `X-Atlassian-Token: no-check` header when making a request, as this operation has XSRF protection.
444
+ * Note, you must add the `X-Atlassian-Token: no-check` header when making a request, as this operation has XSRF
445
+ * protection.
438
446
  *
439
447
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission
440
448
  * if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).
@@ -3,8 +3,43 @@ import { ContentBodyCreate } from '../models';
3
3
  export interface ConvertContentBody extends ContentBodyCreate {
4
4
  /** The name of the target format for the content body. */
5
5
  to: string;
6
- /** A multi-value parameter indicating which properties of the content to expand. */
7
- expand?: string[];
6
+
7
+ /**
8
+ * A multi-value parameter indicating which properties of the content to expand. Expands are dependent on the to
9
+ * conversion format and may be irrelevant for certain conversions (e.g. macroRenderedOutput is redundant when
10
+ * converting to view format).
11
+ *
12
+ * - `webresource` returns JS and CSS resources necessary for displaying nested content in `view` format
13
+ * - `webresource.superbatch.uris.js` returns all common JS dependencies
14
+ * - `webresource.superbatch.uris.css` returns all common CSS dependencies
15
+ * - `webresource.uris.js` returns JS dependencies specific to conversion
16
+ * - `webresource.uris.css` returns CSS dependencies specific to conversion
17
+ * - `embeddedContent` returns metadata for nested content (e.g. page included using page include macro)
18
+ * - `mediaToken` returns JWT token for retrieving attachment data from Media API
19
+ * - `macroRenderedOutput` additionally converts body to view format
20
+ */
21
+ expand?:
22
+ | 'webresource'
23
+ | 'webresource.superbatch.uris.js'
24
+ | 'webresource.superbatch.uris.css'
25
+ | 'webresource.uris.js'
26
+ | 'webresource.uris.css'
27
+ | 'embeddedContent'
28
+ | 'mediaToken'
29
+ | 'macroRenderedOutput'
30
+ | (
31
+ | 'webresource'
32
+ | 'webresource.superbatch.uris.js'
33
+ | 'webresource.superbatch.uris.css'
34
+ | 'webresource.uris.js'
35
+ | 'webresource.uris.css'
36
+ | 'embeddedContent'
37
+ | 'mediaToken'
38
+ | 'macroRenderedOutput'
39
+ )[]
40
+ | string
41
+ | string[];
42
+
8
43
  /**
9
44
  * The space key used for resolving embedded content (page includes, files, and links) in the content body. For
10
45
  * example, if the source content contains the link `<ac:link><ri:page ri:content-title="Example page" /><ac:link>`
@@ -27,4 +62,6 @@ export interface ConvertContentBody extends ContentBodyCreate {
27
62
  * - `version-at-save` renders the embedded content using the version at the time of save.
28
63
  */
29
64
  embeddedContentRender?: string;
65
+
66
+ additionalProperties?: any[];
30
67
  }
@@ -8,7 +8,8 @@ export class Relation {
8
8
  constructor(private client: Client) {}
9
9
 
10
10
  /**
11
- * Returns all target entities that have a particular relationship to the source entity. Note, relationships are one way.
11
+ * Returns all target entities that have a particular relationship to the source entity. Note, relationships are one
12
+ * way.
12
13
  *
13
14
  * For example, the following method finds all content that the current user has an 'ignore' relationship with: `GET
14
15
  * https://your-domain.atlassian.net/wiki/rest/api/relation/ignore/from/user/current/to/content` Note, 'ignore' is an
@@ -22,7 +23,8 @@ export class Relation {
22
23
  callback: Callback<T>
23
24
  ): Promise<void>;
24
25
  /**
25
- * Returns all target entities that have a particular relationship to the source entity. Note, relationships are one way.
26
+ * Returns all target entities that have a particular relationship to the source entity. Note, relationships are one
27
+ * way.
26
28
  *
27
29
  * For example, the following method finds all content that the current user has an 'ignore' relationship with: `GET
28
30
  * https://your-domain.atlassian.net/wiki/rest/api/relation/ignore/from/user/current/to/content` Note, 'ignore' is an
@@ -205,7 +207,8 @@ export class Relation {
205
207
  }
206
208
 
207
209
  /**
208
- * Returns all target entities that have a particular relationship to the source entity. Note, relationships are one way.
210
+ * Returns all target entities that have a particular relationship to the source entity. Note, relationships are one
211
+ * way.
209
212
  *
210
213
  * For example, the following method finds all users that have a 'collaborator' relationship to a piece of content
211
214
  * with an ID of '1234': `GET
@@ -220,7 +223,8 @@ export class Relation {
220
223
  callback: Callback<T>
221
224
  ): Promise<void>;
222
225
  /**
223
- * Returns all target entities that have a particular relationship to the source entity. Note, relationships are one way.
226
+ * Returns all target entities that have a particular relationship to the source entity. Note, relationships are one
227
+ * way.
224
228
  *
225
229
  * For example, the following method finds all users that have a 'collaborator' relationship to a piece of content
226
230
  * with an ID of '1234': `GET
@@ -11,7 +11,8 @@ export class Settings {
11
11
  * Returns the look and feel settings for the site or a single space. This includes attributes such as the color
12
12
  * scheme, padding, and border radius.
13
13
  *
14
- * The look and feel settings for a space can be inherited from the global look and feel settings or provided by a theme.
14
+ * The look and feel settings for a space can be inherited from the global look and feel settings or provided by a
15
+ * theme.
15
16
  *
16
17
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None
17
18
  */
@@ -23,7 +24,8 @@ export class Settings {
23
24
  * Returns the look and feel settings for the site or a single space. This includes attributes such as the color
24
25
  * scheme, padding, and border radius.
25
26
  *
26
- * The look and feel settings for a space can be inherited from the global look and feel settings or provided by a theme.
27
+ * The look and feel settings for a space can be inherited from the global look and feel settings or provided by a
28
+ * theme.
27
29
  *
28
30
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: None
29
31
  */