confluence.js 1.1.3 → 1.2.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 (151) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -0
  3. package/out/api/content.d.ts +24 -52
  4. package/out/api/content.js +14 -0
  5. package/out/api/contentAttachments.d.ts +10 -6
  6. package/out/api/contentAttachments.js +12 -0
  7. package/out/api/contentChildrenAndDescendants.d.ts +6 -24
  8. package/out/api/contentChildrenAndDescendants.js +6 -0
  9. package/out/api/contentPermissions.d.ts +6 -2
  10. package/out/api/contentPermissions.js +6 -1
  11. package/out/api/contentProperties.js +1 -0
  12. package/out/api/contentWatches.d.ts +2 -2
  13. package/out/api/experimental.d.ts +16 -0
  14. package/out/api/experimental.js +34 -0
  15. package/out/api/group.d.ts +30 -10
  16. package/out/api/group.js +31 -2
  17. package/out/api/index.d.ts +1 -0
  18. package/out/api/index.js +1 -0
  19. package/out/api/inlineTasks.d.ts +28 -0
  20. package/out/api/inlineTasks.js +21 -0
  21. package/out/api/models/getViewers.d.ts +6 -0
  22. package/out/api/models/getViewers.js +2 -0
  23. package/out/api/models/getViews.d.ts +6 -0
  24. package/out/api/models/getViews.js +2 -0
  25. package/out/api/models/groupCreate.d.ts +4 -0
  26. package/out/api/models/groupCreate.js +2 -0
  27. package/out/api/models/horizontalHeaderLookAndFeel.d.ts +11 -0
  28. package/out/api/models/horizontalHeaderLookAndFeel.js +2 -0
  29. package/out/api/models/index.d.ts +13 -4
  30. package/out/api/models/index.js +13 -4
  31. package/out/api/models/lookAndFeel.d.ts +3 -0
  32. package/out/api/models/spacePermissionCreate.d.ts +33 -0
  33. package/out/api/models/spacePermissionCreate.js +2 -0
  34. package/out/api/models/spacePermissionCustomContent.d.ts +16 -0
  35. package/out/api/models/spacePermissionCustomContent.js +2 -0
  36. package/out/api/models/spacePermissionRequest.d.ts +41 -0
  37. package/out/api/models/spacePermissionRequest.js +2 -0
  38. package/out/api/models/spacePrivateCreate.d.ts +9 -0
  39. package/out/api/models/spacePropertyCreate.d.ts +4 -0
  40. package/out/api/models/spaceUpdate.d.ts +4 -0
  41. package/out/api/models/taskStatusUpdate.d.ts +3 -0
  42. package/out/api/models/taskStatusUpdate.js +2 -0
  43. package/out/api/models/topNavigationLookAndFeel.d.ts +8 -0
  44. package/out/api/models/topNavigationLookAndFeel.js +2 -0
  45. package/out/api/parameters/addCustomContentPermissions.d.ts +5 -0
  46. package/out/api/parameters/addCustomContentPermissions.js +2 -0
  47. package/out/api/parameters/addPermissionToSpace.d.ts +5 -0
  48. package/out/api/parameters/addPermissionToSpace.js +2 -0
  49. package/out/api/parameters/addUserToGroup.d.ts +2 -1
  50. package/out/api/parameters/addUserToGroupByGroupId.d.ts +2 -1
  51. package/out/api/parameters/archivePages.d.ts +6 -0
  52. package/out/api/parameters/archivePages.js +2 -0
  53. package/out/api/parameters/checkContentPermission.d.ts +5 -0
  54. package/out/api/parameters/checkContentPermission.js +2 -0
  55. package/out/api/parameters/deleteRelationship.d.ts +38 -0
  56. package/out/api/parameters/deleteRelationship.js +2 -0
  57. package/out/api/parameters/downloadAttachment.d.ts +11 -0
  58. package/out/api/parameters/downloadAttachment.js +2 -0
  59. package/out/api/parameters/getContentProperties.d.ts +2 -0
  60. package/out/api/parameters/getDescendantsOfType.d.ts +101 -0
  61. package/out/api/parameters/getDescendantsOfType.js +89 -0
  62. package/out/api/parameters/getGroupByName.d.ts +4 -0
  63. package/out/api/parameters/getGroupByName.js +2 -0
  64. package/out/api/parameters/getGroups.d.ts +2 -0
  65. package/out/api/parameters/getTaskById.d.ts +4 -0
  66. package/out/api/parameters/getTaskById.js +2 -0
  67. package/out/api/parameters/getViewers.d.ts +6 -0
  68. package/out/api/parameters/getViewers.js +2 -0
  69. package/out/api/parameters/getViews.d.ts +6 -0
  70. package/out/api/parameters/getViews.js +2 -0
  71. package/out/api/parameters/index.d.ts +131 -116
  72. package/out/api/parameters/index.js +131 -116
  73. package/out/api/parameters/publishLegacyDraft.d.ts +3 -1
  74. package/out/api/parameters/publishSharedDraft.d.ts +3 -1
  75. package/out/api/parameters/searchByCQL.d.ts +34 -0
  76. package/out/api/parameters/searchByCQL.js +2 -0
  77. package/out/api/parameters/searchGroups.d.ts +8 -0
  78. package/out/api/parameters/searchGroups.js +2 -0
  79. package/out/api/parameters/searchUser.d.ts +20 -0
  80. package/out/api/parameters/searchUser.js +2 -0
  81. package/out/api/parameters/updateTaskById.d.ts +5 -0
  82. package/out/api/parameters/updateTaskById.js +2 -0
  83. package/out/api/relation.d.ts +12 -4
  84. package/out/api/relation.js +12 -2
  85. package/out/api/search.d.ts +12 -64
  86. package/out/api/search.js +19 -2
  87. package/out/api/settings.d.ts +2 -2
  88. package/out/api/settings.js +3 -0
  89. package/out/api/space.js +3 -0
  90. package/out/api/spacePermissions.d.ts +26 -2
  91. package/out/api/spacePermissions.js +20 -3
  92. package/out/api/spaceProperties.d.ts +4 -4
  93. package/out/api/spaceProperties.js +1 -0
  94. package/out/clients/baseClient.js +1 -1
  95. package/out/clients/confluenceClient.d.ts +2 -1
  96. package/out/clients/confluenceClient.js +1 -0
  97. package/package.json +6 -6
  98. package/src/api/content.ts +57 -52
  99. package/src/api/contentAttachments.ts +28 -6
  100. package/src/api/contentChildrenAndDescendants.ts +24 -28
  101. package/src/api/contentPermissions.ts +24 -7
  102. package/src/api/contentProperties.ts +1 -0
  103. package/src/api/contentWatches.ts +3 -3
  104. package/src/api/experimental.ts +44 -0
  105. package/src/api/group.ts +71 -19
  106. package/src/api/index.ts +1 -0
  107. package/src/api/inlineTasks.ts +52 -0
  108. package/src/api/models/getViewers.ts +6 -0
  109. package/src/api/models/getViews.ts +6 -0
  110. package/src/api/models/groupCreate.ts +4 -0
  111. package/src/api/models/horizontalHeaderLookAndFeel.ts +12 -0
  112. package/src/api/models/index.ts +13 -4
  113. package/src/api/models/lookAndFeel.ts +3 -0
  114. package/src/api/models/spacePermissionCreate.ts +34 -0
  115. package/src/api/models/spacePermissionCustomContent.ts +17 -0
  116. package/src/api/models/spacePermissionRequest.ts +42 -0
  117. package/src/api/models/spacePrivateCreate.ts +9 -0
  118. package/src/api/models/spacePropertyCreate.ts +4 -0
  119. package/src/api/models/spaceUpdate.ts +4 -0
  120. package/src/api/models/taskStatusUpdate.ts +3 -0
  121. package/src/api/models/topNavigationLookAndFeel.ts +8 -0
  122. package/src/api/parameters/addCustomContentPermissions.ts +6 -0
  123. package/src/api/parameters/addPermissionToSpace.ts +6 -0
  124. package/src/api/parameters/addUserToGroup.ts +3 -1
  125. package/src/api/parameters/addUserToGroupByGroupId.ts +3 -1
  126. package/src/api/parameters/archivePages.ts +6 -0
  127. package/src/api/parameters/checkContentPermission.ts +6 -0
  128. package/src/api/parameters/deleteRelationship.ts +38 -0
  129. package/src/api/parameters/downloadAttachment.ts +11 -0
  130. package/src/api/parameters/getContentProperties.ts +2 -0
  131. package/src/api/parameters/getDescendantsOfType.ts +102 -0
  132. package/src/api/parameters/getGroupByName.ts +4 -0
  133. package/src/api/parameters/getGroups.ts +2 -0
  134. package/src/api/parameters/getTaskById.ts +4 -0
  135. package/src/api/parameters/getViewers.ts +6 -0
  136. package/src/api/parameters/getViews.ts +6 -0
  137. package/src/api/parameters/index.ts +131 -116
  138. package/src/api/parameters/publishLegacyDraft.ts +4 -1
  139. package/src/api/parameters/publishSharedDraft.ts +4 -1
  140. package/src/api/parameters/searchByCQL.ts +34 -0
  141. package/src/api/parameters/searchGroups.ts +8 -0
  142. package/src/api/parameters/searchUser.ts +20 -0
  143. package/src/api/parameters/updateTaskById.ts +6 -0
  144. package/src/api/relation.ts +33 -8
  145. package/src/api/search.ts +53 -73
  146. package/src/api/settings.ts +6 -3
  147. package/src/api/space.ts +3 -0
  148. package/src/api/spacePermissions.ts +66 -8
  149. package/src/api/spaceProperties.ts +5 -4
  150. package/src/clients/baseClient.ts +2 -2
  151. package/src/clients/confluenceClient.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.2.0
4
+
5
+ - Cloud API
6
+ - `archivePages` method added to `Content`.
7
+ - `publishLegacyDraft` request fixed in `Content` class.
8
+ - `publishSharedDraft` request fixed in `Content` class.
9
+ - `downloadAttachment` method added to `ContentAttachments`.
10
+ - `descendantsOfType` renamed to `getDescendantsOfType` in `ContentChildrenAndDescendants`.
11
+ - `permissionCheck` renamed to `checkContentPermission` in `ContentPermissions`.
12
+ - `key` property added to `getContentProperties` request in `ContentProperties`.
13
+ - Added `Experemental` API.
14
+ - `accessType` property added to `getGroups` request in `Group`.
15
+ - `removeGroupById` method added to `Group`.
16
+ - `getGroup` renamed to `getGroupByName` in `Group`.
17
+ - `getGroupsSearch` renamed to `searchGroups` in `Group`.
18
+ - `accountId` property added to `addUserToGroupByGroupId` in `Group`.
19
+ - `accountId` property added to `addUserToGroup` in `Group`.
20
+ - `getTaskById` method added to `InlineTasks`.
21
+ - `updateTaskById` method added to `InlineTasks`.
22
+ - `GetRelationship` renamed to `getRelationship` in `Relation`.
23
+ - `delete` renamed to `deleteRelationship` in `Relation`.
24
+ - `search` renamed to `searchByCQL` in `Search`.
25
+ - `userSearch` renamed to `searchUser` in `Search`.
26
+ - `horizontalHeader`, `spaceReference`, `links` properties added to `updateLookAndFeelSettings` in `Settings`.
27
+ - `permissions` property added to `createPrivateSpace` in `Space`.
28
+ - `type` and `status` properties added to `updateSpace` in `Space`.
29
+ - `addPermission` renamed to `addPermissionToSpace` in `SpacePermissions`.
30
+ - `addCustomContentPermissions` method added to `SpacePermissions`.
31
+ - `space` property added to `createSpaceProperty` in `SpaceProperties`.
32
+
3
33
  ### 1.1.3
4
34
 
5
35
  - Vulnerabilities fixed
package/README.md CHANGED
@@ -292,6 +292,7 @@ Available groups:
292
292
  - [contentVersions](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-versions/#api-group-content-versions)
293
293
  - [contentWatches](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-watches/#api-group-content-watches)
294
294
  - [dynamicModules](https://developer.atlassian.com/cloud/confluence/rest/api-group-dynamic-modules/#api-group-dynamic-modules)
295
+ - [experimental](https://developer.atlassian.com/cloud/confluence/rest/api-group-experimental/#api-group-experimental)
295
296
  - [group](https://developer.atlassian.com/cloud/confluence/rest/api-group-group/#api-group-group)
296
297
  - [inlineTasks](https://developer.atlassian.com/cloud/confluence/rest/api-group-inline-tasks/#api-group-inline-tasks)
297
298
  - [labelInfo](https://developer.atlassian.com/cloud/confluence/rest/api-group-label-info/#api-group-label-info)
@@ -49,6 +49,30 @@ export declare class Content {
49
49
  * content will be created in, and permission to view the draft if publishing a draft.
50
50
  */
51
51
  createContent<T = Models.Content>(parameters?: Parameters.CreateContent, callback?: never): Promise<T>;
52
+ /**
53
+ * Archives a list of pages. The pages to be archived are specified as a list of content IDs. This API accepts the
54
+ * archival request and returns a task ID. The archival process happens asynchronously. Use the /longtask/<taskId>
55
+ * REST API to get the copy task status.
56
+ *
57
+ * Each content ID needs to resolve to page objects that are not already in an archived state. The content IDs need
58
+ * not belong to the same space.
59
+ *
60
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Archive' permission for each of the pages
61
+ * in the corresponding space it belongs to.
62
+ */
63
+ archivePages<T = unknown>(parameters: Parameters.ArchivePages, callback: Callback<T>): Promise<void>;
64
+ /**
65
+ * Archives a list of pages. The pages to be archived are specified as a list of content IDs. This API accepts the
66
+ * archival request and returns a task ID. The archival process happens asynchronously. Use the /longtask/<taskId>
67
+ * REST API to get the copy task status.
68
+ *
69
+ * Each content ID needs to resolve to page objects that are not already in an archived state. The content IDs need
70
+ * not belong to the same space.
71
+ *
72
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Archive' permission for each of the pages
73
+ * in the corresponding space it belongs to.
74
+ */
75
+ archivePages<T = unknown>(parameters: Parameters.ArchivePages, callback?: never): Promise<T>;
52
76
  /**
53
77
  * Publishes a legacy draft of a page created from a blueprint. Legacy drafts will eventually be removed in favor of
54
78
  * shared drafts. For now, this method works the same as [Publish shared draft](#api-content-blueprint-instance-draftId-put).
@@ -91,32 +115,6 @@ export declare class Content {
91
115
  * Returns the list of content that matches a Confluence Query Language (CQL) query. For information on CQL, see:
92
116
  * [Advanced searching using CQL](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/).
93
117
  *
94
- * Example initial call:
95
- * ```
96
- * https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25
97
- * ```
98
- *
99
- * Example response:
100
- * ```
101
- * {
102
- * "results": [
103
- * { ... },
104
- * { ... },
105
- * ...
106
- * { ... }
107
- * ],
108
- * "limit": 25,
109
- * "size": 25,
110
- * ...
111
- * "_links": {
112
- * "base": "<url>",
113
- * "context": "<url>",
114
- * "next": "/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg",
115
- * "self": "<url>"
116
- * }
117
- * }
118
- * ```
119
- *
120
118
  * When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The
121
119
  * URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of
122
120
  * results returned in each call. Example subsequent call (taken from example response):
@@ -133,32 +131,6 @@ export declare class Content {
133
131
  * Returns the list of content that matches a Confluence Query Language (CQL) query. For information on CQL, see:
134
132
  * [Advanced searching using CQL](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/).
135
133
  *
136
- * Example initial call:
137
- * ```
138
- * https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25
139
- * ```
140
- *
141
- * Example response:
142
- * ```
143
- * {
144
- * "results": [
145
- * { ... },
146
- * { ... },
147
- * ...
148
- * { ... }
149
- * ],
150
- * "limit": 25,
151
- * "size": 25,
152
- * ...
153
- * "_links": {
154
- * "base": "<url>",
155
- * "context": "<url>",
156
- * "next": "/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg",
157
- * "self": "<url>"
158
- * }
159
- * }
160
- * ```
161
- *
162
134
  * When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The
163
135
  * URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of
164
136
  * results returned in each call. Example subsequent call (taken from example response):
@@ -41,6 +41,18 @@ class Content {
41
41
  return this.client.sendRequest(config, callback, { methodName: 'createContent' });
42
42
  });
43
43
  }
44
+ archivePages(parameters, callback) {
45
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
46
+ const config = {
47
+ url: '/api/content/archive',
48
+ method: 'POST',
49
+ data: {
50
+ pages: parameters.pages,
51
+ },
52
+ };
53
+ return this.client.sendRequest(config, callback, { methodName: 'archivePages' });
54
+ });
55
+ }
44
56
  publishLegacyDraft(parameters, callback) {
45
57
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
46
58
  const config = {
@@ -49,6 +61,7 @@ class Content {
49
61
  params: {
50
62
  status: parameters.status,
51
63
  },
64
+ data: Object.assign(Object.assign({}, parameters), { version: parameters.version, title: parameters.title, type: parameters.type, status: parameters.bodyStatus, space: parameters.space, ancestors: parameters.ancestors }),
52
65
  };
53
66
  return this.client.sendRequest(config, callback, { methodName: 'publishLegacyDraft' });
54
67
  });
@@ -61,6 +74,7 @@ class Content {
61
74
  params: {
62
75
  status: parameters.status,
63
76
  },
77
+ data: Object.assign(Object.assign({}, parameters), { version: parameters.version, title: parameters.title, type: parameters.type, status: parameters.bodyStatus, space: parameters.space, ancestors: parameters.ancestors }),
64
78
  };
65
79
  return this.client.sendRequest(config, callback, { methodName: 'publishSharedDraft' });
66
80
  });
@@ -32,7 +32,7 @@ export declare class ContentAttachments {
32
32
  *
33
33
  * The media type 'multipart/form-data' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt). Most client
34
34
  * libraries have classes that make it easier to implement multipart posts, like the
35
- * [MultipartEntityBuilder](http://hc.apache.org/httpcomponents-client-5.0.x/current/httpclient5/apidocs/) Java class
35
+ * [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/) Java class
36
36
  * provided by Apache HTTP Components.
37
37
  *
38
38
  * Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5), in the case where the form data is
@@ -65,7 +65,7 @@ export declare class ContentAttachments {
65
65
  *
66
66
  * The media type 'multipart/form-data' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt). Most client
67
67
  * libraries have classes that make it easier to implement multipart posts, like the
68
- * [MultipartEntityBuilder](http://hc.apache.org/httpcomponents-client-5.0.x/current/httpclient5/apidocs/) Java class
68
+ * [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/) Java class
69
69
  * provided by Apache HTTP Components.
70
70
  *
71
71
  * Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5), in the case where the form data is
@@ -98,7 +98,7 @@ export declare class ContentAttachments {
98
98
  *
99
99
  * The media type 'multipart/form-data' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt). Most client
100
100
  * libraries have classes that make it easier to implement multipart posts, like the
101
- * [MultipartEntityBuilder](http://hc.apache.org/httpcomponents-client-5.0.x/current/httpclient5/apidocs/) Java class
101
+ * [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/) Java class
102
102
  * provided by Apache HTTP Components.
103
103
  *
104
104
  * Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5), in the case where the form data is
@@ -132,7 +132,7 @@ export declare class ContentAttachments {
132
132
  *
133
133
  * The media type 'multipart/form-data' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt). Most client
134
134
  * libraries have classes that make it easier to implement multipart posts, like the
135
- * [MultipartEntityBuilder](http://hc.apache.org/httpcomponents-client-5.0.x/current/httpclient5/apidocs/) Java class
135
+ * [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/) Java class
136
136
  * provided by Apache HTTP Components.
137
137
  *
138
138
  * Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5), in the case where the form data is
@@ -182,7 +182,7 @@ export declare class ContentAttachments {
182
182
  *
183
183
  * The media type 'multipart/form-data' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt). Most client
184
184
  * libraries have classes that make it easier to implement multipart posts, like the
185
- * [MultipartEntityBuilder](http://hc.apache.org/httpcomponents-client-5.0.x/current/httpclient5/apidocs/) Java class
185
+ * [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/) Java class
186
186
  * provided by Apache HTTP Components.
187
187
  *
188
188
  * Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5), in the case where the form data is
@@ -218,7 +218,7 @@ export declare class ContentAttachments {
218
218
  *
219
219
  * The media type 'multipart/form-data' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt). Most client
220
220
  * libraries have classes that make it easier to implement multipart posts, like the
221
- * [MultipartEntityBuilder](http://hc.apache.org/httpcomponents-client-5.0.x/current/httpclient5/apidocs/) Java class
221
+ * [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/) Java class
222
222
  * provided by Apache HTTP Components.
223
223
  *
224
224
  * Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5), in the case where the form data is
@@ -243,4 +243,8 @@ export declare class ContentAttachments {
243
243
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.
244
244
  */
245
245
  updateAttachmentData<T = Models.Content>(parameters: Parameters.UpdateAttachmentData, callback?: never): Promise<T>;
246
+ /** Redirects the client to a URL that serves an attachment's binary data. */
247
+ downloadAttachment<T = unknown>(parameters: Parameters.DownloadAttachment, callback: Callback<T>): Promise<void>;
248
+ /** Redirects the client to a URL that serves an attachment's binary data. */
249
+ downloadAttachment<T = unknown>(parameters: Parameters.DownloadAttachment, callback?: never): Promise<T>;
246
250
  }
@@ -68,5 +68,17 @@ class ContentAttachments {
68
68
  return this.client.sendRequest(config, callback, { methodName: 'updateAttachmentData' });
69
69
  });
70
70
  }
71
+ downloadAttachment(parameters, callback) {
72
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
73
+ const config = {
74
+ url: `/api/content/${parameters.id}/child/attachment/${parameters.attachmentId}/download`,
75
+ method: 'GET',
76
+ params: {
77
+ version: parameters.version,
78
+ },
79
+ };
80
+ return this.client.sendRequest(config, callback, { methodName: 'downloadAttachment' });
81
+ });
82
+ }
71
83
  }
72
84
  exports.ContentAttachments = ContentAttachments;
@@ -141,6 +141,10 @@ export declare class ContentChildrenAndDescendants {
141
141
  * permission to view the content if it is a page.
142
142
  */
143
143
  getContentDescendants<T = Models.ContentChildren>(parameters: Parameters.GetContentDescendants, callback?: never): Promise<T>;
144
+ /** @deprecated This API will be removed in the next major version. Use `getDescendantsOfType` method instead. */
145
+ descendantsOfType<T = Models.ContentArray>(parameters: Parameters.DescendantsOfType, callback: Callback<T>): Promise<void>;
146
+ /** @deprecated This API will be removed in the next major version. Use `getDescendantsOfType` method instead. */
147
+ descendantsOfType<T = Models.ContentArray>(parameters: Parameters.DescendantsOfType, callback?: never): Promise<T>;
144
148
  /**
145
149
  * Returns all descendants of a given type, for a piece of content. This is similar to [Get content children by
146
150
  * type](#api-content-id-child-type-get), except that this method returns child pages at all levels, rather than just
@@ -158,7 +162,7 @@ export declare class ContentChildrenAndDescendants {
158
162
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and
159
163
  * permission to view the content if it is a page.
160
164
  */
161
- descendantsOfType<T = Models.ContentArray>(parameters: Parameters.DescendantsOfType, callback: Callback<T>): Promise<void>;
165
+ getDescendantsOfType<T = Models.ContentArray>(parameters: Parameters.GetDescendantsOfType, callback: Callback<T>): Promise<void>;
162
166
  /**
163
167
  * Returns all descendants of a given type, for a piece of content. This is similar to [Get content children by
164
168
  * type](#api-content-id-child-type-get), except that this method returns child pages at all levels, rather than just
@@ -176,24 +180,13 @@ export declare class ContentChildrenAndDescendants {
176
180
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and
177
181
  * permission to view the content if it is a page.
178
182
  */
179
- descendantsOfType<T = Models.ContentArray>(parameters: Parameters.DescendantsOfType, callback?: never): Promise<T>;
183
+ getDescendantsOfType<T = Models.ContentArray>(parameters: Parameters.GetDescendantsOfType, callback?: never): Promise<T>;
180
184
  /**
181
185
  * Copy page hierarchy allows the copying of an entire hierarchy of pages and their associated properties, permissions
182
186
  * and attachments. The id path parameter refers to the content id of the page to copy, and the new parent of this
183
187
  * copied page is defined using the destinationPageId in the request body. The titleOptions object defines the rules
184
188
  * of renaming page titles during the copy; for example, search and replace can be used in conjunction to rewrite the
185
189
  * copied page titles.
186
- *
187
- * Response example:
188
- * <pre>
189
- * {
190
- * "id" : "1180606",
191
- * "links" : {
192
- * "status" : "/rest/api/longtask/1180606"
193
- * }
194
- * }
195
- * </pre>
196
- * Use the /longtask/<taskId> REST API to get the copy task status.
197
190
  */
198
191
  copyPageHierarchy<T = unknown>(parameters: Parameters.CopyPageHierarchy, callback: Callback<T>): Promise<void>;
199
192
  /**
@@ -202,17 +195,6 @@ export declare class ContentChildrenAndDescendants {
202
195
  * copied page is defined using the destinationPageId in the request body. The titleOptions object defines the rules
203
196
  * of renaming page titles during the copy; for example, search and replace can be used in conjunction to rewrite the
204
197
  * copied page titles.
205
- *
206
- * Response example:
207
- * <pre>
208
- * {
209
- * "id" : "1180606",
210
- * "links" : {
211
- * "status" : "/rest/api/longtask/1180606"
212
- * }
213
- * }
214
- * </pre>
215
- * Use the /longtask/<taskId> REST API to get the copy task status.
216
198
  */
217
199
  copyPageHierarchy<T = unknown>(parameters: Parameters.CopyPageHierarchy, callback?: never): Promise<T>;
218
200
  /**
@@ -55,6 +55,11 @@ class ContentChildrenAndDescendants {
55
55
  });
56
56
  }
57
57
  descendantsOfType(parameters, callback) {
58
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
59
+ return this.getDescendantsOfType(parameters, callback);
60
+ });
61
+ }
62
+ getDescendantsOfType(parameters, callback) {
58
63
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
59
64
  const config = {
60
65
  url: `/api/content/${parameters.id}/descendant/${parameters.type}`,
@@ -63,6 +68,7 @@ class ContentChildrenAndDescendants {
63
68
  depth: parameters.depth,
64
69
  start: parameters.start,
65
70
  limit: parameters.limit,
71
+ expand: parameters.expand,
66
72
  },
67
73
  };
68
74
  return this.client.sendRequest(config, callback, { methodName: 'descendantsOfType' });
@@ -5,6 +5,10 @@ import { Callback } from '../callback';
5
5
  export declare class ContentPermissions {
6
6
  private client;
7
7
  constructor(client: Client);
8
+ /** @deprecated Will be removed in the next major version. Use `checkContentPermission` method instead. */
9
+ permissionCheck<T = Models.PermissionCheckResponse>(parameters: Parameters.PermissionCheck, callback: Callback<T>): Promise<void>;
10
+ /** @deprecated Will be removed in the next major version. Use `checkContentPermission` method instead. */
11
+ permissionCheck<T = Models.PermissionCheckResponse>(parameters: Parameters.PermissionCheck, callback?: never): Promise<T>;
8
12
  /**
9
13
  * Check if a user or a group can perform an operation to the specified content. The `operation` to check must be
10
14
  * provided. The user’s account ID or the ID of the group can be provided in the `subject` to check permissions
@@ -19,7 +23,7 @@ export declare class ContentPermissions {
19
23
  * ('Can use' global permission) if checking permission for self, otherwise 'Confluence Administrator' global
20
24
  * permission is required.
21
25
  */
22
- permissionCheck<T = Models.PermissionCheckResponse>(parameters: Parameters.PermissionCheck, callback: Callback<T>): Promise<void>;
26
+ checkContentPermission<T = Models.PermissionCheckResponse>(parameters: Parameters.CheckContentPermission, callback: Callback<T>): Promise<void>;
23
27
  /**
24
28
  * Check if a user or a group can perform an operation to the specified content. The `operation` to check must be
25
29
  * provided. The user’s account ID or the ID of the group can be provided in the `subject` to check permissions
@@ -34,5 +38,5 @@ export declare class ContentPermissions {
34
38
  * ('Can use' global permission) if checking permission for self, otherwise 'Confluence Administrator' global
35
39
  * permission is required.
36
40
  */
37
- permissionCheck<T = Models.PermissionCheckResponse>(parameters: Parameters.PermissionCheck, callback?: never): Promise<T>;
41
+ checkContentPermission<T = Models.PermissionCheckResponse>(parameters: Parameters.CheckContentPermission, callback?: never): Promise<T>;
38
42
  }
@@ -7,6 +7,11 @@ class ContentPermissions {
7
7
  this.client = client;
8
8
  }
9
9
  permissionCheck(parameters, callback) {
10
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
11
+ return this.checkContentPermission(parameters, callback);
12
+ });
13
+ }
14
+ checkContentPermission(parameters, callback) {
10
15
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
11
16
  const config = {
12
17
  url: `/api/content/${parameters.id}/permission/check`,
@@ -16,7 +21,7 @@ class ContentPermissions {
16
21
  operation: parameters.operation,
17
22
  },
18
23
  };
19
- return this.client.sendRequest(config, callback, { methodName: 'permissionCheck' });
24
+ return this.client.sendRequest(config, callback, { methodName: 'checkContentPermission' });
20
25
  });
21
26
  }
22
27
  }
@@ -12,6 +12,7 @@ class ContentProperties {
12
12
  url: `/api/content/${parameters.id}/property`,
13
13
  method: 'GET',
14
14
  params: {
15
+ key: parameters.key,
15
16
  expand: parameters.expand,
16
17
  start: parameters.start,
17
18
  limit: parameters.limit,
@@ -44,7 +44,7 @@ export declare class ContentWatches {
44
44
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
45
45
  * ('Can use' global permission).
46
46
  */
47
- getWatchesForSpace<T = Models.WatchArray>(parameters: Parameters.GetWatchesForSpace, callback: Callback<T>): Promise<void>;
47
+ getWatchesForSpace<T = Models.SpaceWatchArray>(parameters: Parameters.GetWatchesForSpace, callback: Callback<T>): Promise<void>;
48
48
  /**
49
49
  * Returns all space watches for the space that the content is in. A user that watches a space will receive receive
50
50
  * notifications when any content in the space is updated.
@@ -58,7 +58,7 @@ export declare class ContentWatches {
58
58
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
59
59
  * ('Can use' global permission).
60
60
  */
61
- getWatchesForSpace<T = Models.WatchArray>(parameters: Parameters.GetWatchesForSpace, callback?: never): Promise<T>;
61
+ getWatchesForSpace<T = Models.SpaceWatchArray>(parameters: Parameters.GetWatchesForSpace, callback?: never): Promise<T>;
62
62
  /** Returns a list of watchers of a space */
63
63
  getWatchersForSpace<T = Models.SpaceWatchArray>(parameters: Parameters.GetWatchersForSpace, callback: Callback<T>): Promise<void>;
64
64
  /** Returns a list of watchers of a space */
@@ -0,0 +1,16 @@
1
+ import * as Models from './models';
2
+ import * as Parameters from './parameters';
3
+ import { Client } from '../clients';
4
+ import { Callback } from '../callback';
5
+ export declare class Experimental {
6
+ private client;
7
+ constructor(client: Client);
8
+ /** Get the total number of views a piece of content has. */
9
+ getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback: Callback<T>): Promise<void>;
10
+ /** Get the total number of views a piece of content has. */
11
+ getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback?: never): Promise<T>;
12
+ /** Get the total number of distinct viewers a piece of content has. */
13
+ getViewers<T = Models.GetViewers>(parameters: Parameters.GetViewers, callback: Callback<T>): Promise<void>;
14
+ /** Get the total number of distinct viewers a piece of content has. */
15
+ getViewers<T = Models.GetViewers>(parameters: Parameters.GetViewers, callback?: never): Promise<T>;
16
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Experimental = void 0;
4
+ const tslib_1 = require("tslib");
5
+ class Experimental {
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ getViews(parameters, callback) {
10
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
11
+ const config = {
12
+ url: `/api/analytics/content/${parameters.contentId}/views`,
13
+ method: 'GET',
14
+ params: {
15
+ fromDate: parameters.fromDate,
16
+ },
17
+ };
18
+ return this.client.sendRequest(config, callback, { methodName: 'getViews' });
19
+ });
20
+ }
21
+ getViewers(parameters, callback) {
22
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
23
+ const config = {
24
+ url: `/api/analytics/content/${parameters.contentId}/viewers`,
25
+ method: 'GET',
26
+ params: {
27
+ fromDate: parameters.fromDate,
28
+ },
29
+ };
30
+ return this.client.sendRequest(config, callback, { methodName: 'getViewers' });
31
+ });
32
+ }
33
+ }
34
+ exports.Experimental = Experimental;
@@ -71,6 +71,22 @@ export declare class Group {
71
71
  * ('Can use' global permission).
72
72
  */
73
73
  getGroupByGroupId<T = Models.Group>(parameters: Parameters.GetGroupByGroupId, callback?: never): Promise<T>;
74
+ /**
75
+ * Delete user group.
76
+ *
77
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: User must be a site admin.
78
+ */
79
+ removeGroupById<T = void>(parameters: Parameters.RemoveGroupById, callback: Callback<T>): Promise<void>;
80
+ /**
81
+ * Delete user group.
82
+ *
83
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: User must be a site admin.
84
+ */
85
+ removeGroupById<T = void>(parameters: Parameters.RemoveGroupById, callback?: never): Promise<T>;
86
+ /** @deprecated Will be removed in the next major version. Use `getGroupByName` instead. */
87
+ getGroup<T = Models.Group>(parameters: Parameters.GetGroup, callback: Callback<T>): Promise<void>;
88
+ /** @deprecated Will be removed in the next major version. Use `getGroupByName` instead. */
89
+ getGroup<T = Models.Group>(parameters: Parameters.GetGroup, callback?: never): Promise<T>;
74
90
  /**
75
91
  * Returns a user group for a given group name.
76
92
  *
@@ -79,7 +95,7 @@ export declare class Group {
79
95
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
80
96
  * ('Can use' global permission).
81
97
  */
82
- getGroup<T = Models.Group>(parameters: Parameters.GetGroup, callback: Callback<T>): Promise<void>;
98
+ getGroupByName<T = Models.Group>(parameters: Parameters.GetGroupByName, callback: Callback<T>): Promise<void>;
83
99
  /**
84
100
  * Returns a user group for a given group name.
85
101
  *
@@ -88,21 +104,21 @@ export declare class Group {
88
104
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
89
105
  * ('Can use' global permission).
90
106
  */
91
- getGroup<T = Models.Group>(parameters: Parameters.GetGroup, callback?: never): Promise<T>;
107
+ getGroupByName<T = Models.Group>(parameters: Parameters.GetGroupByName, callback?: never): Promise<T>;
92
108
  /**
93
109
  * Returns the users that are members of a group.
94
110
  *
95
111
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
96
112
  * ('Can use' global permission).
97
113
  */
98
- getMembersByQueryParam<T = Models.UserArrayWithLinks>(parameters: Parameters.GetMembersByQueryParam, callback: Callback<T>): Promise<void>;
114
+ getMembersByQueryParam<T = Models.UserArray>(parameters: Parameters.GetMembersByQueryParam, callback: Callback<T>): Promise<void>;
99
115
  /**
100
116
  * Returns the users that are members of a group.
101
117
  *
102
118
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
103
119
  * ('Can use' global permission).
104
120
  */
105
- getMembersByQueryParam<T = Models.UserArrayWithLinks>(parameters: Parameters.GetMembersByQueryParam, callback?: never): Promise<T>;
121
+ getMembersByQueryParam<T = Models.UserArray>(parameters: Parameters.GetMembersByQueryParam, callback?: never): Promise<T>;
106
122
  /**
107
123
  * Returns the users that are members of a group.
108
124
  *
@@ -111,7 +127,7 @@ export declare class Group {
111
127
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
112
128
  * ('Can use' global permission).
113
129
  */
114
- getGroupMembers<T = Models.UserArrayWithLinks>(parameters: Parameters.GetGroupMembers, callback: Callback<T>): Promise<void>;
130
+ getGroupMembers<T = Models.UserArray>(parameters: Parameters.GetGroupMembers, callback: Callback<T>): Promise<void>;
115
131
  /**
116
132
  * Returns the users that are members of a group.
117
133
  *
@@ -120,11 +136,15 @@ export declare class Group {
120
136
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
121
137
  * ('Can use' global permission).
122
138
  */
123
- getGroupMembers<T = Models.UserArrayWithLinks>(parameters: Parameters.GetGroupMembers, callback?: never): Promise<T>;
124
- /** Get search results of groups by partial query provided. */
139
+ getGroupMembers<T = Models.UserArray>(parameters: Parameters.GetGroupMembers, callback?: never): Promise<T>;
140
+ /** @deprecated Will be removed in the next major version. Use `searchGroups` instead. */
125
141
  getGroupsSearch<T = Models.GroupArrayWithLinks>(parameters: Parameters.GetGroupsSearch, callback: Callback<T>): Promise<void>;
126
- /** Get search results of groups by partial query provided. */
142
+ /** @deprecated Will be removed in the next major version. Use `searchGroups` instead. */
127
143
  getGroupsSearch<T = Models.GroupArrayWithLinks>(parameters: Parameters.GetGroupsSearch, callback?: never): Promise<T>;
144
+ /** Get search results of groups by partial query provided. */
145
+ searchGroups<T = Models.GroupArrayWithLinks>(parameters: Parameters.SearchGroups, callback: Callback<T>): Promise<void>;
146
+ /** Get search results of groups by partial query provided. */
147
+ searchGroups<T = Models.GroupArrayWithLinks>(parameters: Parameters.SearchGroups, callback?: never): Promise<T>;
128
148
  /**
129
149
  * Adds a user as a member in a group represented by its groupId
130
150
  *
@@ -157,7 +177,7 @@ export declare class Group {
157
177
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
158
178
  * ('Can use' global permission).
159
179
  */
160
- getGroupMembersByGroupId<T = Models.UserArrayWithLinks>(parameters: Parameters.GetGroupMembersByGroupId, callback: Callback<T>): Promise<void>;
180
+ getGroupMembersByGroupId<T = Models.UserArray>(parameters: Parameters.GetGroupMembersByGroupId, callback: Callback<T>): Promise<void>;
161
181
  /**
162
182
  * Returns the users that are members of a group.
163
183
  *
@@ -166,7 +186,7 @@ export declare class Group {
166
186
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
167
187
  * ('Can use' global permission).
168
188
  */
169
- getGroupMembersByGroupId<T = Models.UserArrayWithLinks>(parameters: Parameters.GetGroupMembersByGroupId, callback?: never): Promise<T>;
189
+ getGroupMembersByGroupId<T = Models.UserArray>(parameters: Parameters.GetGroupMembersByGroupId, callback?: never): Promise<T>;
170
190
  /**
171
191
  * Adds a user as a member in a group.
172
192
  *