confluence.js 2.0.0 → 2.2.0-dev20260318121920

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 (229) hide show
  1. package/CHANGELOG.md +67 -2
  2. package/README.md +168 -181
  3. package/dist/cjs/api/analytics.cjs.map +1 -1
  4. package/dist/cjs/api/audit.cjs.map +1 -1
  5. package/dist/cjs/api/content.cjs +0 -5
  6. package/dist/cjs/api/content.cjs.map +1 -1
  7. package/dist/cjs/api/contentAttachments.cjs +1 -0
  8. package/dist/cjs/api/contentAttachments.cjs.map +1 -1
  9. package/dist/cjs/api/contentBody.cjs +18 -0
  10. package/dist/cjs/api/contentBody.cjs.map +1 -1
  11. package/dist/cjs/api/contentChildrenAndDescendants.cjs +2 -0
  12. package/dist/cjs/api/contentChildrenAndDescendants.cjs.map +1 -1
  13. package/dist/cjs/api/contentComments.cjs +1 -0
  14. package/dist/cjs/api/contentComments.cjs.map +1 -1
  15. package/dist/cjs/api/contentLabels.cjs.map +1 -1
  16. package/dist/cjs/api/contentMacroBody.cjs.map +1 -1
  17. package/dist/cjs/api/contentPermissions.cjs.map +1 -1
  18. package/dist/cjs/api/contentProperties.cjs +1 -0
  19. package/dist/cjs/api/contentProperties.cjs.map +1 -1
  20. package/dist/cjs/api/contentRestrictions.cjs.map +1 -1
  21. package/dist/cjs/api/contentStates.cjs +13 -0
  22. package/dist/cjs/api/contentStates.cjs.map +1 -1
  23. package/dist/cjs/api/contentVersions.cjs.map +1 -1
  24. package/dist/cjs/api/contentWatches.cjs.map +1 -1
  25. package/dist/cjs/api/dynamicModules.cjs.map +1 -1
  26. package/dist/cjs/api/experimental.cjs.map +1 -1
  27. package/dist/cjs/api/group.cjs +18 -17
  28. package/dist/cjs/api/group.cjs.map +1 -1
  29. package/dist/cjs/api/index.cjs +2 -0
  30. package/dist/cjs/api/index.cjs.map +1 -1
  31. package/dist/cjs/api/inlineTasks.cjs +1 -0
  32. package/dist/cjs/api/inlineTasks.cjs.map +1 -1
  33. package/dist/cjs/api/labelInfo.cjs.map +1 -1
  34. package/dist/cjs/api/longRunningTask.cjs +1 -0
  35. package/dist/cjs/api/longRunningTask.cjs.map +1 -1
  36. package/dist/cjs/api/models/labeledContentType.cjs.map +1 -1
  37. package/dist/cjs/api/relation.cjs.map +1 -1
  38. package/dist/cjs/api/search.cjs +1 -0
  39. package/dist/cjs/api/search.cjs.map +1 -1
  40. package/dist/cjs/api/settings.cjs.map +1 -1
  41. package/dist/cjs/api/space.cjs +4 -2
  42. package/dist/cjs/api/space.cjs.map +1 -1
  43. package/dist/cjs/api/spacePermissions.cjs.map +1 -1
  44. package/dist/cjs/api/spaceProperties.cjs +1 -0
  45. package/dist/cjs/api/spaceProperties.cjs.map +1 -1
  46. package/dist/cjs/api/spaceSettings.cjs.map +1 -1
  47. package/dist/cjs/api/template.cjs.map +1 -1
  48. package/dist/cjs/api/themes.cjs.map +1 -1
  49. package/dist/cjs/api/userProperties.cjs +56 -0
  50. package/dist/cjs/api/userProperties.cjs.map +1 -0
  51. package/dist/cjs/api/users.cjs.map +1 -1
  52. package/dist/cjs/clients/baseClient.cjs +17 -2
  53. package/dist/cjs/clients/baseClient.cjs.map +1 -1
  54. package/dist/cjs/clients/confluenceClient.cjs +6 -0
  55. package/dist/cjs/clients/confluenceClient.cjs.map +1 -1
  56. package/dist/cjs/config.cjs +7 -4
  57. package/dist/cjs/config.cjs.map +1 -1
  58. package/dist/cjs/paramSerializer.cjs.map +1 -1
  59. package/dist/cjs/services/authenticationService/authenticationService.cjs.map +1 -1
  60. package/dist/cjs/services/authenticationService/authentications/createBasicAuthenticationToken.cjs.map +1 -1
  61. package/dist/cjs/services/authenticationService/authentications/createJWTAuthentication.cjs +1 -1
  62. package/dist/cjs/services/authenticationService/authentications/createJWTAuthentication.cjs.map +1 -1
  63. package/dist/cjs/services/authenticationService/base64Encoder.cjs.map +1 -1
  64. package/dist/esm/api/analytics.mjs.map +1 -1
  65. package/dist/esm/api/audit.mjs.map +1 -1
  66. package/dist/esm/api/content.mjs +0 -5
  67. package/dist/esm/api/content.mjs.map +1 -1
  68. package/dist/esm/api/contentAttachments.mjs +1 -0
  69. package/dist/esm/api/contentAttachments.mjs.map +1 -1
  70. package/dist/esm/api/contentBody.mjs +18 -0
  71. package/dist/esm/api/contentBody.mjs.map +1 -1
  72. package/dist/esm/api/contentChildrenAndDescendants.mjs +2 -0
  73. package/dist/esm/api/contentChildrenAndDescendants.mjs.map +1 -1
  74. package/dist/esm/api/contentComments.mjs +1 -0
  75. package/dist/esm/api/contentComments.mjs.map +1 -1
  76. package/dist/esm/api/contentLabels.mjs.map +1 -1
  77. package/dist/esm/api/contentMacroBody.mjs.map +1 -1
  78. package/dist/esm/api/contentPermissions.mjs.map +1 -1
  79. package/dist/esm/api/contentProperties.mjs +1 -0
  80. package/dist/esm/api/contentProperties.mjs.map +1 -1
  81. package/dist/esm/api/contentRestrictions.mjs.map +1 -1
  82. package/dist/esm/api/contentStates.mjs +13 -0
  83. package/dist/esm/api/contentStates.mjs.map +1 -1
  84. package/dist/esm/api/contentVersions.mjs.map +1 -1
  85. package/dist/esm/api/contentWatches.mjs.map +1 -1
  86. package/dist/esm/api/dynamicModules.mjs.map +1 -1
  87. package/dist/esm/api/experimental.mjs.map +1 -1
  88. package/dist/esm/api/group.mjs +18 -17
  89. package/dist/esm/api/group.mjs.map +1 -1
  90. package/dist/esm/api/index.mjs +1 -0
  91. package/dist/esm/api/index.mjs.map +1 -1
  92. package/dist/esm/api/inlineTasks.mjs +1 -0
  93. package/dist/esm/api/inlineTasks.mjs.map +1 -1
  94. package/dist/esm/api/labelInfo.mjs.map +1 -1
  95. package/dist/esm/api/longRunningTask.mjs +1 -0
  96. package/dist/esm/api/longRunningTask.mjs.map +1 -1
  97. package/dist/esm/api/models/labeledContentType.mjs.map +1 -1
  98. package/dist/esm/api/relation.mjs.map +1 -1
  99. package/dist/esm/api/search.mjs +1 -0
  100. package/dist/esm/api/search.mjs.map +1 -1
  101. package/dist/esm/api/settings.mjs.map +1 -1
  102. package/dist/esm/api/space.mjs +4 -2
  103. package/dist/esm/api/space.mjs.map +1 -1
  104. package/dist/esm/api/spacePermissions.mjs.map +1 -1
  105. package/dist/esm/api/spaceProperties.mjs +1 -0
  106. package/dist/esm/api/spaceProperties.mjs.map +1 -1
  107. package/dist/esm/api/spaceSettings.mjs.map +1 -1
  108. package/dist/esm/api/template.mjs.map +1 -1
  109. package/dist/esm/api/themes.mjs.map +1 -1
  110. package/dist/esm/api/userProperties.mjs +54 -0
  111. package/dist/esm/api/userProperties.mjs.map +1 -0
  112. package/dist/esm/api/users.mjs.map +1 -1
  113. package/dist/esm/clients/baseClient.mjs +18 -3
  114. package/dist/esm/clients/baseClient.mjs.map +1 -1
  115. package/dist/esm/clients/confluenceClient.mjs +6 -0
  116. package/dist/esm/clients/confluenceClient.mjs.map +1 -1
  117. package/dist/esm/config.mjs +7 -4
  118. package/dist/esm/config.mjs.map +1 -1
  119. package/dist/esm/paramSerializer.mjs.map +1 -1
  120. package/dist/esm/services/authenticationService/authenticationService.mjs.map +1 -1
  121. package/dist/esm/services/authenticationService/authentications/createBasicAuthenticationToken.mjs.map +1 -1
  122. package/dist/esm/services/authenticationService/authentications/createJWTAuthentication.mjs +1 -1
  123. package/dist/esm/services/authenticationService/authentications/createJWTAuthentication.mjs.map +1 -1
  124. package/dist/esm/services/authenticationService/base64Encoder.mjs.map +1 -1
  125. package/dist/esm/types/api/analytics.d.ts +1 -1
  126. package/dist/esm/types/api/audit.d.ts +3 -3
  127. package/dist/esm/types/api/content.d.ts +33 -7
  128. package/dist/esm/types/api/contentAttachments.d.ts +5 -1
  129. package/dist/esm/types/api/contentBody.d.ts +73 -7
  130. package/dist/esm/types/api/contentChildrenAndDescendants.d.ts +37 -5
  131. package/dist/esm/types/api/contentComments.d.ts +5 -0
  132. package/dist/esm/types/api/contentLabels.d.ts +17 -9
  133. package/dist/esm/types/api/contentMacroBody.d.ts +79 -1
  134. package/dist/esm/types/api/contentPermissions.d.ts +1 -1
  135. package/dist/esm/types/api/contentProperties.d.ts +25 -0
  136. package/dist/esm/types/api/contentRestrictions.d.ts +19 -7
  137. package/dist/esm/types/api/contentStates.d.ts +23 -5
  138. package/dist/esm/types/api/contentVersions.d.ts +9 -1
  139. package/dist/esm/types/api/contentWatches.d.ts +1 -1
  140. package/dist/esm/types/api/dynamicModules.d.ts +1 -1
  141. package/dist/esm/types/api/experimental.d.ts +21 -1
  142. package/dist/esm/types/api/group.d.ts +47 -27
  143. package/dist/esm/types/api/index.d.ts +1 -0
  144. package/dist/esm/types/api/inlineTasks.d.ts +13 -0
  145. package/dist/esm/types/api/labelInfo.d.ts +1 -1
  146. package/dist/esm/types/api/longRunningTask.d.ts +1 -1
  147. package/dist/esm/types/api/models/spaceCreate.d.ts +11 -2
  148. package/dist/esm/types/api/models/spacePrivateCreate.d.ts +11 -2
  149. package/dist/esm/types/api/parameters/bulkAsyncConvertContentBodyRequest.d.ts +58 -0
  150. package/dist/esm/types/api/parameters/bulkAsyncConvertContentBodyResponse.d.ts +4 -0
  151. package/dist/esm/types/api/parameters/deleteGroupById.d.ts +4 -0
  152. package/dist/esm/types/api/parameters/downloadAttachment.d.ts +6 -0
  153. package/dist/esm/types/api/parameters/getContentChildren.d.ts +6 -1
  154. package/dist/esm/types/api/parameters/getContentsWithState.d.ts +17 -0
  155. package/dist/esm/types/api/parameters/getGroupMembersByGroupId.d.ts +7 -0
  156. package/dist/esm/types/api/parameters/getGroupMembershipsForUser.d.ts +4 -0
  157. package/dist/esm/types/api/parameters/getTasks.d.ts +2 -0
  158. package/dist/esm/types/api/parameters/getUser.d.ts +4 -0
  159. package/dist/esm/types/api/parameters/index.d.ts +4 -0
  160. package/dist/esm/types/api/parameters/searchUser.d.ts +7 -0
  161. package/dist/esm/types/api/relation.d.ts +13 -15
  162. package/dist/esm/types/api/search.d.ts +7 -1
  163. package/dist/esm/types/api/settings.d.ts +5 -1
  164. package/dist/esm/types/api/space.d.ts +23 -7
  165. package/dist/esm/types/api/spacePermissions.d.ts +1 -1
  166. package/dist/esm/types/api/spaceProperties.d.ts +25 -0
  167. package/dist/esm/types/api/spaceSettings.d.ts +1 -1
  168. package/dist/esm/types/api/template.d.ts +1 -1
  169. package/dist/esm/types/api/themes.d.ts +1 -1
  170. package/dist/esm/types/api/userProperties.d.ts +102 -0
  171. package/dist/esm/types/api/users.d.ts +21 -9
  172. package/dist/esm/types/clients/baseClient.d.ts +1 -0
  173. package/dist/esm/types/clients/confluenceClient.d.ts +6 -1
  174. package/dist/esm/types/config.d.ts +29 -240
  175. package/eslint.config.ts +11 -16
  176. package/package.json +34 -33
  177. package/rollup.config.ts +8 -8
  178. package/src/api/analytics.ts +1 -1
  179. package/src/api/audit.ts +3 -3
  180. package/src/api/content.ts +33 -12
  181. package/src/api/contentAttachments.ts +6 -1
  182. package/src/api/contentBody.ts +113 -7
  183. package/src/api/contentChildrenAndDescendants.ts +39 -5
  184. package/src/api/contentComments.ts +5 -0
  185. package/src/api/contentLabels.ts +17 -9
  186. package/src/api/contentMacroBody.ts +79 -1
  187. package/src/api/contentPermissions.ts +1 -1
  188. package/src/api/contentProperties.ts +25 -0
  189. package/src/api/contentRestrictions.ts +19 -7
  190. package/src/api/contentStates.ts +47 -5
  191. package/src/api/contentVersions.ts +9 -1
  192. package/src/api/contentWatches.ts +1 -1
  193. package/src/api/dynamicModules.ts +1 -1
  194. package/src/api/experimental.ts +21 -1
  195. package/src/api/group.ts +96 -75
  196. package/src/api/index.ts +1 -0
  197. package/src/api/inlineTasks.ts +13 -0
  198. package/src/api/labelInfo.ts +1 -1
  199. package/src/api/longRunningTask.ts +2 -1
  200. package/src/api/models/spaceCreate.ts +11 -2
  201. package/src/api/models/spacePrivateCreate.ts +11 -2
  202. package/src/api/parameters/bulkAsyncConvertContentBodyRequest.ts +88 -0
  203. package/src/api/parameters/bulkAsyncConvertContentBodyResponse.ts +4 -0
  204. package/src/api/parameters/deleteGroupById.ts +4 -0
  205. package/src/api/parameters/downloadAttachment.ts +6 -0
  206. package/src/api/parameters/getContentChildren.ts +7 -1
  207. package/src/api/parameters/getContentsWithState.ts +17 -0
  208. package/src/api/parameters/getGroupMembersByGroupId.ts +7 -0
  209. package/src/api/parameters/getGroupMembershipsForUser.ts +4 -0
  210. package/src/api/parameters/getTasks.ts +2 -0
  211. package/src/api/parameters/getUser.ts +4 -0
  212. package/src/api/parameters/index.ts +4 -0
  213. package/src/api/parameters/searchUser.ts +7 -0
  214. package/src/api/relation.ts +13 -15
  215. package/src/api/search.ts +8 -1
  216. package/src/api/settings.ts +5 -1
  217. package/src/api/space.ts +27 -9
  218. package/src/api/spacePermissions.ts +1 -1
  219. package/src/api/spaceProperties.ts +25 -0
  220. package/src/api/spaceSettings.ts +1 -1
  221. package/src/api/template.ts +1 -1
  222. package/src/api/themes.ts +1 -1
  223. package/src/api/userProperties.ts +185 -0
  224. package/src/api/users.ts +21 -9
  225. package/src/clients/baseClient.ts +24 -8
  226. package/src/clients/confluenceClient.ts +6 -0
  227. package/src/config.ts +8 -4
  228. package/src/services/authenticationService/authentications/createJWTAuthentication.ts +1 -1
  229. package/favicon.svg +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,70 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.0] - 2026-03-18
4
+ ### **Dependencies** 📦
5
+ - Migrated `zod` from v3 to v4, including schema/runtime compatibility updates for validation and error handling.
6
+
7
+ ### **Configuration** 🔧
8
+ - `authentication.basic.email` now accepts any string value.
9
+ - Added `suppressWarnings` config option (default: `false`) to control advisory warnings.
10
+ - Added warning when `authentication.basic.email` is not a valid email: `[confluence.js] authentication.basic.email is not a valid email address; treating it as login workaround.`
11
+
12
+ ### **Documentation** 📝
13
+ - Added Confluence Server workaround docs: use login in `authentication.basic.email` and set `apiPrefix` to `/rest/api/`.
14
+ - Added explicit notice that Confluence Server approach is not officially supported and should be treated as a workaround.
15
+
16
+ ---
17
+
18
+ ## [2.1.0] - 2025-07-17
19
+ ### **Deprecations** ⚠️
20
+ - **Package dependencies**:
21
+ - Replaced deprecated `atlassian-jwt` with `@atlassian/atlassian-jwt`.
22
+ - **Content APIs**:
23
+ - Deprecated all content-related methods due to [Confluence API changes](https://developer.atlassian.com/cloud/confluence/changelog/#CHANGE-2520):
24
+ - `content.getContent`, `content.createContent`, `content.getContentById`, `content.updateContent`, `content.deleteContent`
25
+ - `content.getHistoryForContent`, `contentAttachments.getAttachments`, `contentBody.convertContentBody`
26
+ - `contentChildrenAndDescendants.getContentChildren`, `contentChildrenAndDescendants.getContentChildrenByType`
27
+ - `ContentComments`, `contentLabels.getLabelsForContent`, `ContentProperties`
28
+ - `contentVersions.getContentVersions`, `contentVersions.getContentVersion`
29
+ - **Group APIs**:
30
+ - Deprecated group-related methods:
31
+ - `group.removeGroup`, `group.getGroupByQueryParam`, `group.getGroupByName`
32
+ - `group.getMembersByQueryParam`, `group.getGroupMembers`
33
+ - **Other APIs**:
34
+ - Deprecated `InlineTasks`, `SpaceProperties`, `users.getBulkUserMigration`
35
+ - Deprecated content restriction methods:
36
+ - `contentRestrictions.getContentRestrictionStatusForGroup`
37
+ - `contentRestrictions.addGroupToContentRestriction`
38
+ - `contentRestrictions.removeGroupByName`
39
+ - Deprecated `settings.setLookAndFeelSettings`
40
+ - Deprecated space-related methods:
41
+ - `space.getSpaces`, `space.getSpace`, `space.getContentForSpace`, `space.getContentByTypeForSpace`
42
+
43
+ ### **New Features** ✨
44
+ - **New endpoints**:
45
+ - Added `contentBody.bulkAsyncConvertContentBodyResponse` and `contentBody.bulkAsyncConvertContentBodyRequest`
46
+ - Added `contentStates.getContentsWithState` method
47
+ - Introduced new `UserProperties` API
48
+ - **API improvements**:
49
+ - Added `status` property to `contentAttachments.downloadAttachment`
50
+ - Added `key` property to `longRunningTask.getTasks`
51
+ - Added `sitePermissionTypeFilter` property to `search.searchUser`
52
+ - Added `alias` property to both `space.createSpace` and `space.createPrivateSpace`
53
+ - #145 Added `start` and `limit` properties to `contentChildrenAndDescendants.getContentChildren`. Thanks to @javierbrea for requesting this feature.
54
+
55
+ ### **API Changes** 🔄
56
+ - **Experimental methods moved**:
57
+ - Moved experimental user property methods to `userProperties` namespace:
58
+ - `getUserProperties`, `getUserProperty`, `createUserProperty`, `updateUserProperty`, `deleteUserProperty`
59
+ - **Parameter fixes**:
60
+ - Simplified `group.removeGroupById` parameters (no longer requires `operationKey` and `groupId`)
61
+
62
+ ### **Other Changes**
63
+ - **Package structure**:
64
+ - Reordered `exports` in `package.json` for better module resolution
65
+
66
+ ---
67
+
3
68
  ## [2.0.0] - 2025-05-09
4
69
  ### **Breaking Changes** ⚠️
5
70
  - **Deprecated APIs removed**: APIs marked as deprecated in v1.x have been removed.
@@ -19,12 +84,12 @@
19
84
  - **Telemetry**: All telemetry/tracking code has been removed.
20
85
  - No data is collected by the package.
21
86
 
22
- ### [1.7.3] - 2024-03-04
87
+ ## [1.7.3] - 2024-03-04
23
88
 
24
89
  - Dependencies updated
25
90
  - Expand properties added for few endpoints
26
91
 
27
- ### [1.7.2] - 2023-12-01
92
+ ## [1.7.2] - 2023-12-01
28
93
 
29
94
  Changes in this version:
30
95
 
package/README.md CHANGED
@@ -1,71 +1,100 @@
1
1
  <div align="center">
2
2
  <img alt="Confluence.js logo" src="https://bad37fb3-cb50-4e0b-9035-a3e09e8afb3b.selstorage.ru/confluence.js%2Flogo.svg"/>
3
3
 
4
- <a href="https://www.npmjs.com/package/confluence.js"><img alt="NPM version" src="https://img.shields.io/npm/v/confluence.js.svg?maxAge=3600&style=flat-square" /></a>
5
- <a href="https://www.npmjs.com/package/confluence.js"><img alt="NPM downloads per month" src="https://img.shields.io/npm/dm/confluence.js.svg?maxAge=3600&style=flat-square" /></a>
6
- <a href="https://github.com/MrRefactoring/confluence.js"><img alt="build status" src="https://img.shields.io/github/actions/workflow/status/mrrefactoring/confluence.js/ci.yaml?style=flat-square"></a>
7
- <a href="https://github.com/mrrefactoring/confluence.js/blob/develop/LICENSE"><img alt="license" src="https://img.shields.io/github/license/mrrefactoring/confluence.js?color=green&style=flat-square"/></a>
4
+ <a href="https://www.npmjs.com/package/confluence.js"><img alt="NPM version" src="https://img.shields.io/npm/v/confluence.js.svg?maxAge=3600&style=flat-square" /></a>
5
+ <a href="https://www.npmjs.com/package/confluence.js"><img alt="NPM downloads per month" src="https://img.shields.io/npm/dm/confluence.js.svg?maxAge=3600&style=flat-square" /></a>
6
+ <a href="https://github.com/MrRefactoring/confluence.js"><img alt="build status" src="https://img.shields.io/github/actions/workflow/status/mrrefactoring/confluence.js/ci.yaml?style=flat-square"></a>
7
+ <a href="https://github.com/mrrefactoring/confluence.js/blob/develop/LICENSE"><img alt="license" src="https://img.shields.io/github/license/mrrefactoring/confluence.js?color=green&style=flat-square"/></a>
8
8
 
9
- <span>JavaScript / TypeScript library for Node.JS and browsers to easily interact with Atlassian Confluence API</span>
9
+ <span>JavaScript/TypeScript library for Node.js and browsers to interact with Atlassian Confluence API</span>
10
10
  </div>
11
11
 
12
12
  ## About
13
13
 
14
- confluence.js is a powerful [Node.JS](https://nodejs.org/) / Browser module that allows you to interact with the [Confluence API](https://developer.atlassian.com/cloud/confluence/rest/intro/) very easily.
14
+ Confluence.js is a powerful Node.js and browser-compatible module that provides seamless interaction with:
15
+ - [Confluence Cloud REST API](https://developer.atlassian.com/cloud/confluence/rest/)
15
16
 
16
- Usability, consistency, and performance are key focuses of confluence.js, and it also has nearly 100% coverage of the Confluence API. It receives new Confluence features shortly after they arrive in the API.
17
+ Designed for developer experience and performance, it offers full API coverage and stays updated with new Confluence features.
17
18
 
18
- ## Table of contents
19
+ ## Table of Contents
19
20
 
20
- - [Installation](#installation)
21
+ - [Getting Started](#getting-started)
22
+ - [Installation](#installation)
23
+ - [Quick Example](#quick-example)
24
+ - [Documentation](#documentation)
21
25
  - [Usage](#usage)
22
26
  - [Authentication](#authentication)
23
- - [Basic](#basic-authentication)
27
+ - [Basic Auth](#basic-authentication)
24
28
  - [OAuth 2.0](#oauth-20)
25
29
  - [JWT](#jwt)
26
- - [Your first request and using algorithm](#your-first-request-and-using-algorithm)
27
- - [`apiPrefix` config parameter](#apiprefix-config-parameter)
28
- - [Decreasing Webpack bundle size](#decreasing-webpack-bundle-size)
29
- - [Take a look at our other products](#take-a-look-at-our-other-products)
30
+ - [First Request](#first-request)
31
+ - [API Structure](#api-structure)
32
+ - [Custom API Prefix](#custom-api-prefix)
33
+ - [Confluence Server Workaround](#confluence-server-workaround)
34
+ - [Tree Shaking](#tree-shaking)
35
+ - [Other Products](#other-products)
30
36
  - [License](#license)
31
37
 
32
- ## Installation
38
+ ## Getting Started
33
39
 
34
- **Node.js 20.0.0 or newer is required.**
40
+ ### Installation
35
41
 
36
- Install with the npm:
42
+ **Requires Node.js 20.0.0 or newer**
37
43
 
38
44
  ```bash
45
+ # npm
39
46
  npm install confluence.js
40
- ```
41
-
42
- Install with the yarn:
43
47
 
44
- ```bash
48
+ # yarn
45
49
  yarn add confluence.js
50
+
51
+ # pnpm
52
+ pnpm add confluence.js
46
53
  ```
47
54
 
48
- Install with the pnpm
55
+ ### Quick Example
49
56
 
50
- ```bash
51
- pnpm add confluence.js
57
+ Create a Confluence space in 3 steps:
58
+
59
+ ```typescript
60
+ import { ConfluenceClient } from 'confluence.js';
61
+
62
+ const client = new ConfluenceClient({
63
+ host: 'https://your-domain.atlassian.net',
64
+ authentication: {
65
+ basic: {
66
+ email: 'your@email.com',
67
+ apiToken: 'YOUR_API_TOKEN', // Create one: https://id.atlassian.com/manage-profile/security/api-tokens
68
+ },
69
+ },
70
+ });
71
+
72
+ async function createSpace() {
73
+ const space = await client.space.createSpace({
74
+ name: 'Project Galaxy',
75
+ key: 'GALAXY',
76
+ });
77
+ console.log(`Space created: ${space.key}`);
78
+ }
79
+
80
+ createSpace();
52
81
  ```
53
82
 
54
- ## Usage
83
+ ## Documentation
55
84
 
56
- #### Authentication
85
+ Full API reference and guides available at:
86
+ [https://mrrefactoring.github.io/confluence.js/](https://mrrefactoring.github.io/confluence.js/)
57
87
 
58
- There are several types of authentication to gain access to the Confluence API. Let's take a look at a few of them below
88
+ ## Usage
59
89
 
60
- ##### [Basic authentication](https://developer.atlassian.com/cloud/confluence/basic-auth-for-rest-apis/)
90
+ ### Authentication
61
91
 
62
- // TODO refine
63
- Basic authentication allows you to log in with credentials.
64
- How to release API Token, read how to do it [here](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/), and use it together with email.
92
+ #### Basic Authentication
65
93
 
66
- ```typescript
67
- import { ConfluenceClient } from 'confluence.js';
94
+ 1. Create an API token: [Atlassian Account Settings](https://id.atlassian.com/manage-profile/security/api-tokens)
95
+ 2. Configure the client:
68
96
 
97
+ ```typescript
69
98
  const client = new ConfluenceClient({
70
99
  host: 'https://your-domain.atlassian.net',
71
100
  authentication: {
@@ -77,15 +106,11 @@ const client = new ConfluenceClient({
77
106
  });
78
107
  ```
79
108
 
80
- ##### [OAuth 2.0](https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/)
109
+ #### OAuth 2.0
81
110
 
82
- Only the authorization token is currently supported. To release it, you need to read the [documentation](https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/) and write your own code to get the token.
83
-
84
- Example of usage
111
+ Implement OAuth 2.0 flow using Atlassian's [documentation](https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/):
85
112
 
86
113
  ```typescript
87
- import { ConfluenceClient } from 'confluence.js';
88
-
89
114
  const client = new ConfluenceClient({
90
115
  host: 'https://your-domain.atlassian.net',
91
116
  authentication: {
@@ -96,193 +121,155 @@ const client = new ConfluenceClient({
96
121
  });
97
122
  ```
98
123
 
99
- ##### [JWT](https://developer.atlassian.com/cloud/confluence/understanding-jwt/)
124
+ #### JWT
100
125
 
101
- ```typescript
102
- import { ConfluenceClient } from 'confluence.js';
126
+ For server-to-server integration:
103
127
 
128
+ ```typescript
104
129
  const client = new ConfluenceClient({
105
130
  host: 'https://your-domain.atlassian.net',
106
131
  authentication: {
107
132
  jwt: {
108
- issuer: 'ISSUER',
109
- secret: 'shhhh',
133
+ issuer: 'your-client-id',
134
+ secret: 'your-secret-key',
110
135
  expiryTimeSeconds: 180,
111
136
  },
112
137
  },
113
138
  });
114
139
  ```
115
140
 
116
- #### Your first request and using algorithm
141
+ ### First Request
117
142
 
118
- ```typescript
119
- import { ConfluenceClient } from 'confluence.js'; // Or import ServerClient if using standalone (Server) API
143
+ Create a page in an existing space:
120
144
 
121
- const client = new ConfluenceClient({
122
- host: 'https://your-domain.atlassian.net',
123
- authentication: {
124
- basic: {
125
- email: 'YOUR_EMAIL',
126
- apiToken: 'YOUR_API_TOKEN',
145
+ ```typescript
146
+ const page = await client.content.createContent({
147
+ title: 'Project Overview',
148
+ type: 'page',
149
+ space: { key: 'GALAXY' },
150
+ body: {
151
+ storage: {
152
+ value: '<p>Welcome to our project documentation</p>',
153
+ representation: 'storage',
127
154
  },
128
155
  },
129
156
  });
130
157
 
131
- async function main() {
132
- const space = await client.space.createSpace({
133
- name: 'My new space',
134
- key: 'SPACENAME',
135
- });
158
+ console.log(`Page created: ${page.title}`);
159
+ ```
136
160
 
137
- console.log(space);
138
- }
161
+ ### API Structure
139
162
 
140
- main();
141
-
142
- // Expected output:
143
- // {
144
- // id: 558714,
145
- // key: 'SPACENAME',
146
- // name: 'My new space',
147
- // description: {
148
- // plain: {
149
- // value: '',
150
- // representation: 'plain',
151
- // embeddedContent: []
152
- // },
153
- // _expandable: {view: ''}
154
- // },
155
- // homepage: {
156
- // id: '555312',
157
- // type: 'page',
158
- // status: 'current',
159
- // title: 'My new space Home',
160
- // macroRenderedOutput: {},
161
- // extensions: {position: 581},
162
- // _expandable: {
163
- // container: '/rest/api/space/SPACENAME',
164
- // metadata: '',
165
- // restrictions: '/rest/api/content/555312/restriction/byOperation',
166
- // history: '/rest/api/content/555312/history',
167
- // body: '',
168
- // version: '',
169
- // descendants: '/rest/api/content/555312/descendant',
170
- // space: '/rest/api/space/SPACENAME',
171
- // childTypes: '',
172
- // operations: '',
173
- // schedulePublishDate: '',
174
- // children: '/rest/api/content/555312/child',
175
- // ancestors: ''
176
- // },
177
- // _links: {
178
- // self: 'https://xxx.atlassian.net/wiki/rest/api/content/555312',
179
- // tinyui: '/x/qIoI',
180
- // editui: '/pages/resumedraft.action?draftId=555312',
181
- // webui: '/spaces/SPACENAME/overview'
182
- // }
183
- // },
184
- // type: 'global',
185
- // permissions: [...],
186
- // status: 'current',
187
- // _expandable: {
188
- // settings: '/rest/api/space/SPACENAME/settings',
189
- // metadata: '',
190
- // operations: '',
191
- // lookAndFeel: '/rest/api/settings/lookandfeel?spaceKey=SPACENAME',
192
- // identifiers: '',
193
- // icon: '',
194
- // theme: '/rest/api/space/SPACENAME/theme',
195
- // history: ''
196
- // },
197
- // _links: {
198
- // context: '/wiki',
199
- // self: 'https://xxx.atlassian.net/wiki/rest/api/space/SPACENAME',
200
- // collection: '/rest/api/space',
201
- // webui: '/spaces/SPACENAME',
202
- // base: 'https://xxx.atlassian.net/wiki'
203
- // }
204
- // }
163
+ Access endpoints using `client.<group>.<method>` pattern:
164
+
165
+ ```typescript
166
+ // Get space details
167
+ const space = await client.space.getSpace({ spaceKey: 'GALAXY' });
168
+
169
+ // Search content
170
+ const results = await client.search.search({ cql: 'title~"Project"' });
205
171
  ```
206
172
 
207
- The algorithm for using the library:
173
+ <details>
174
+ <summary>🔽 Available API Groups</summary>
175
+
176
+ - [audit](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-audit/#api-group-audit)
177
+ - [analytics](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-analytics/#api-group-analytics)
178
+ - [content](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content/#api-group-content)
179
+ - [contentAttachments](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---attachments/#api-group-content---attachments)
180
+ - [contentBody](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-body/#api-group-content-body)
181
+ - [contentChildrenAndDescendants](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---children-and-descendants/#api-group-content---children-and-descendants)
182
+ - contentComments - was deprecated
183
+ - [contentMacroBody](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content---macro-body/#api-group-content---macro-body)
184
+ - [contentLabels](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-labels/#api-group-content-labels)
185
+ - [contentPermissions](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-permissions/#api-group-content-permissions)
186
+ - contentProperties - was deprecated
187
+ - [contentRestrictions](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-restrictions/#api-group-content-restrictions)
188
+ - [contentStates](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states/#api-group-content-states)
189
+ - [contentVersions](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-versions/#api-group-content-versions)
190
+ - [contentWatches](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-watches/#api-group-content-watches)
191
+ - [dynamicModules](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-dynamic-modules/#api-group-dynamic-modules)
192
+ - [experimental](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-experimental/#api-group-experimental)
193
+ - [group](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-group/#api-group-group)
194
+ - inlineTasks - was deprecated
195
+ - [labelInfo](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-label-info/#api-group-label-info)
196
+ - [longRunningTask](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-long-running-task/#api-group-long-running-task)
197
+ - [relation](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-relation/#api-group-relation)
198
+ - [search](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-search/#api-group-search)
199
+ - [settings](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-settings/#api-group-settings)
200
+ - [space](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-space/#api-group-space)
201
+ - [spacePermissions](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-space-permissions/#api-group-space-permissions)
202
+ - spaceProperties - was deprecated
203
+ - [spaceSettings](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-space-settings/#api-group-space-settings)
204
+ - [template](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-template/#api-group-template)
205
+ - [themes](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-themes/#api-group-themes)
206
+ - [users](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-users/#api-group-users)
207
+ - [userProperties](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-user-properties/#api-group-user-properties)
208
+
209
+ </details>
210
+
211
+ ### Custom API Prefix
212
+
213
+ For custom API endpoints:
208
214
 
209
215
  ```typescript
210
- client.<group>.<methodName>(parametersObject);
216
+ const client = new ConfluenceClient({
217
+ host: 'https://custom-domain.com',
218
+ apiPrefix: '/confluence-api', // Default: '/wiki/rest/api'
219
+ });
211
220
  ```
212
221
 
213
- Available groups:
214
-
215
- - [analytics](https://developer.atlassian.com/cloud/confluence/rest/api-group-analytics/)
216
- - [audit](https://developer.atlassian.com/cloud/confluence/rest/api-group-audit)
217
- - [content](https://developer.atlassian.com/cloud/confluence/rest/api-group-content/)
218
- - [contentAttachments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-group-content---attachments)
219
- - [contentBody](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-body/#api-group-content-body)
220
- - [contentChildrenAndDescendants](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---children-and-descendants/#api-group-content---children-and-descendants)
221
- - [contentComments](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-comments/#api-group-content-comments)
222
- - [contentLabels](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-labels/#api-group-content-labels)
223
- - [contentMacroBody](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---macro-body/#api-group-content---macro-body)
224
- - [contentPermissions](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-permissions/#api-group-content-permissions)
225
- - [contentProperties](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-properties/#api-group-content-properties)
226
- - [contentRestrictions](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-restrictions/#api-group-content-restrictions)
227
- - [contentStates](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-states/#api-group-content-states)
228
- - [contentVersions](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-versions/#api-group-content-versions)
229
- - [contentWatches](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-watches/#api-group-content-watches)
230
- - [dynamicModules](https://developer.atlassian.com/cloud/confluence/rest/api-group-dynamic-modules/#api-group-dynamic-modules)
231
- - [experimental](https://developer.atlassian.com/cloud/confluence/rest/api-group-experimental/#api-group-experimental)
232
- - [group](https://developer.atlassian.com/cloud/confluence/rest/api-group-group/#api-group-group)
233
- - [inlineTasks](https://developer.atlassian.com/cloud/confluence/rest/api-group-inline-tasks/#api-group-inline-tasks)
234
- - [labelInfo](https://developer.atlassian.com/cloud/confluence/rest/api-group-label-info/#api-group-label-info)
235
- - [longRunningTask](https://developer.atlassian.com/cloud/confluence/rest/api-group-long-running-task/#api-group-long-running-task)
236
- - [relation](https://developer.atlassian.com/cloud/confluence/rest/api-group-relation/#api-group-relation)
237
- - [search](https://developer.atlassian.com/cloud/confluence/rest/api-group-search/#api-group-search)
238
- - [settings](https://developer.atlassian.com/cloud/confluence/rest/api-group-settings/#api-group-settings)
239
- - [space](https://developer.atlassian.com/cloud/confluence/rest/api-group-space/#api-group-space)
240
- - [spacePermissions](https://developer.atlassian.com/cloud/confluence/rest/api-group-space-permissions/#api-group-space-permissions)
241
- - [spaceProperties](https://developer.atlassian.com/cloud/confluence/rest/api-group-space-properties/#api-group-space-properties)
242
- - [spaceSettings](https://developer.atlassian.com/cloud/confluence/rest/api-group-space-settings/#api-group-space-settings)
243
- - [template](https://developer.atlassian.com/cloud/confluence/rest/api-group-template/#api-group-template)
244
- - [themes](https://developer.atlassian.com/cloud/confluence/rest/api-group-themes/#api-group-themes)
245
- - [users](https://developer.atlassian.com/cloud/confluence/rest/api-group-users/#api-group-users)
246
-
247
- The name of the methods is the name of the endpoint in the group without spaces and in `camelCase`.
248
-
249
- The parameters depend on the specific endpoint. For more information, [see here](https://mrrefactoring.github.io/confluence.js/).
250
-
251
- #### `apiPrefix` config parameter
252
-
253
- The `apiPrefix` parameter is used to specify the prefix for the API. For example, if you use the custom domain `https://mydomain.atlassian.net/api` for API.
254
-
255
- Example of use:
222
+ ### Confluence Server Workaround
256
223
 
257
- ```typescript
258
- import { ConfluenceClient } from 'confluence.js';
224
+ This package officially targets Confluence Cloud APIs.
225
+
226
+ For Confluence Server instances, you can try this workaround:
259
227
 
228
+ ```typescript
260
229
  const client = new ConfluenceClient({
261
- host: 'https://your-domain.atlassian.net',
262
- apiPrefix: '/api',
230
+ host: 'https://your-confluence-server.example.com',
231
+ apiPrefix: '/rest/api/',
232
+ suppressWarnings: true,
233
+ authentication: {
234
+ basic: {
235
+ email: 'YOUR_LOGIN',
236
+ apiToken: 'YOUR_PASSWORD_OR_TOKEN',
237
+ },
238
+ },
263
239
  });
264
240
  ```
265
241
 
266
- ## Decreasing Webpack bundle size
242
+ Use your login in the `email` field and set `apiPrefix` to `/rest/api/`.
267
243
 
268
- If you use Webpack and need to reduce the size of the assembly, you can create your client with only the groups you use.
244
+ This approach is not officially supported and should only be used as a workaround.
245
+
246
+ ## Tree Shaking
247
+
248
+ Optimize bundle size by importing only needed modules:
269
249
 
270
250
  ```typescript
251
+ // custom-client.ts
271
252
  import { BaseClient } from 'confluence.js';
272
253
  import { Content } from 'confluence.js/api/content';
273
254
  import { Space } from 'confluence.js/api/space';
274
255
 
275
- export class CustomConfluenceClient extends BaseClient {
256
+ export class CustomClient extends BaseClient {
276
257
  content = new Content(this);
277
258
  space = new Space(this);
278
259
  }
260
+
261
+ // Usage
262
+ const client = new CustomClient({ /* config */ });
263
+ await client.space.getSpace({ spaceKey: 'GALAXY' });
279
264
  ```
280
265
 
281
- ## Take a look at our other products
266
+ ## Other Products
282
267
 
283
- * [Jira.js](https://github.com/MrRefactoring/jira.js) - A JavaScript / TypeScript wrapper for the JIRA REST API
284
- * [Trello.js](https://github.com/MrRefactoring/trello.js) - JavaScript / TypeScript library for Node.JS and browsers to easily interact with Atlassian Trello API
268
+ Explore our other Atlassian integration libraries:
269
+ - [Jira.js](https://github.com/MrRefactoring/jira.js) - Jira API wrapper
270
+ - [Trello.js](https://github.com/MrRefactoring/trello.js) - Trello API integration
285
271
 
286
272
  ## License
287
273
 
288
- Distributed under the MIT License. See `LICENSE` for more information.
274
+ MIT License © MrRefactoring
275
+ See [LICENSE](https://github.com/mrrefactoring/confluence.js/blob/develop/LICENSE) for details.
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.cjs","sources":["../../../../src/api/analytics.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Callback } from '../callback';\nimport type { Client } from '../clients';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class Analytics {\n constructor(private client: Client) {}\n\n /** Get the total number of views a piece of content has. */\n async getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback: Callback<T>): Promise<void>;\n /** Get the total number of views a piece of content has. */\n async getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback?: never): Promise<T>;\n async getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/analytics/content/${parameters.contentId}/views`,\n method: 'GET',\n params: {\n fromDate: parameters.fromDate,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /** Get the total number of distinct viewers a piece of content has. */\n async getViewers<T = Models.GetViewers>(parameters: Parameters.GetViewers, callback: Callback<T>): Promise<void>;\n /** Get the total number of distinct viewers a piece of content has. */\n async getViewers<T = Models.GetViewers>(parameters: Parameters.GetViewers, callback?: never): Promise<T>;\n async getViewers<T = Models.GetViewers>(\n parameters: Parameters.GetViewers,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/analytics/content/${parameters.contentId}/viewers`,\n method: 'GET',\n params: {\n fromDate: parameters.fromDate,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;MAMa,SAAS,CAAA;AACA,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,GAAN,MAAM;;AAM1B,IAAA,MAAM,QAAQ,CAAsB,UAA+B,EAAE,QAAsB,EAAA;AACzF,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,uBAAA,EAA0B,UAAU,CAAC,SAAS,CAAQ,MAAA,CAAA;AAC3D,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,QAAQ,EAAE,UAAU,CAAC,QAAQ;AAC9B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;;AAOlD,IAAA,MAAM,UAAU,CACd,UAAiC,EACjC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,uBAAA,EAA0B,UAAU,CAAC,SAAS,CAAU,QAAA,CAAA;AAC7D,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,QAAQ,EAAE,UAAU,CAAC,QAAQ;AAC9B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;;AAEnD;;;;"}
1
+ {"version":3,"file":"analytics.cjs","sources":["../../../../src/api/analytics.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Client } from '../clients';\nimport type { Callback } from '../callback';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class Analytics {\n constructor(private client: Client) {}\n\n /** Get the total number of views a piece of content has. */\n async getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback: Callback<T>): Promise<void>;\n /** Get the total number of views a piece of content has. */\n async getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback?: never): Promise<T>;\n async getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/analytics/content/${parameters.contentId}/views`,\n method: 'GET',\n params: {\n fromDate: parameters.fromDate,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /** Get the total number of distinct viewers a piece of content has. */\n async getViewers<T = Models.GetViewers>(parameters: Parameters.GetViewers, callback: Callback<T>): Promise<void>;\n /** Get the total number of distinct viewers a piece of content has. */\n async getViewers<T = Models.GetViewers>(parameters: Parameters.GetViewers, callback?: never): Promise<T>;\n async getViewers<T = Models.GetViewers>(\n parameters: Parameters.GetViewers,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: `/api/analytics/content/${parameters.contentId}/viewers`,\n method: 'GET',\n params: {\n fromDate: parameters.fromDate,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":";;MAMa,SAAS,CAAA;AACA,IAAA,MAAA;AAApB,IAAA,WAAA,CAAoB,MAAc,EAAA;QAAd,IAAA,CAAA,MAAM,GAAN,MAAM;IAAW;AAMrC,IAAA,MAAM,QAAQ,CAAsB,UAA+B,EAAE,QAAsB,EAAA;AACzF,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,uBAAA,EAA0B,UAAU,CAAC,SAAS,CAAA,MAAA,CAAQ;AAC3D,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,QAAQ,EAAE,UAAU,CAAC,QAAQ;AAC9B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AAMA,IAAA,MAAM,UAAU,CACd,UAAiC,EACjC,QAAsB,EAAA;AAEtB,QAAA,MAAM,MAAM,GAAkB;AAC5B,YAAA,GAAG,EAAE,CAAA,uBAAA,EAA0B,UAAU,CAAC,SAAS,CAAA,QAAA,CAAU;AAC7D,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,MAAM,EAAE;gBACN,QAAQ,EAAE,UAAU,CAAC,QAAQ;AAC9B,aAAA;SACF;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClD;AACD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"audit.cjs","sources":["../../../../src/api/audit.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Callback } from '../callback';\nimport type { Client } from '../clients';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class Audit {\n constructor(private client: Client) {}\n\n /**\n * Returns all records in the audit log, optionally for a certain date range. This contains information about events\n * like space exports, group membership changes, app installations, etc. For more information, see [Audit\n * log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the Confluence administrator's guide.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async getAuditRecords<T = Models.AuditRecordArray>(\n parameters: Parameters.GetAuditRecords | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns all records in the audit log, optionally for a certain date range. This contains information about events\n * like space exports, group membership changes, app installations, etc. For more information, see [Audit\n * log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the Confluence administrator's guide.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async getAuditRecords<T = Models.AuditRecordArray>(\n parameters?: Parameters.GetAuditRecords,\n callback?: never,\n ): Promise<T>;\n async getAuditRecords<T = Models.AuditRecordArray>(\n parameters?: Parameters.GetAuditRecords,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/audit',\n method: 'GET',\n params: {\n startDate: parameters?.startDate,\n endDate: parameters?.endDate,\n searchString: parameters?.searchString,\n start: parameters?.start,\n limit: parameters?.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Creates a record in the audit log.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async createAuditRecord<T = Models.AuditRecord>(\n parameters: Parameters.CreateAuditRecord | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Creates a record in the audit log.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async createAuditRecord<T = Models.AuditRecord>(\n parameters?: Parameters.CreateAuditRecord,\n callback?: never,\n ): Promise<T>;\n async createAuditRecord<T = Models.AuditRecord>(\n parameters?: Parameters.CreateAuditRecord,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/audit',\n method: 'POST',\n data: {\n author: parameters?.author,\n remoteAddress: parameters?.remoteAddress,\n creationDate: parameters?.creationDate,\n summary: parameters?.summary,\n description: parameters?.description,\n category: parameters?.category,\n sysAdmin: parameters?.sysAdmin,\n affectedObject: parameters?.affectedObject,\n changedValues: parameters?.changedValues,\n associatedObjects: parameters?.associatedObjects,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Exports audit records as a CSV file or ZIP file.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async exportAuditRecords<T = unknown>(\n parameters: Parameters.ExportAuditRecords | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Exports audit records as a CSV file or ZIP file.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async exportAuditRecords<T = unknown>(parameters?: Parameters.ExportAuditRecords, callback?: never): Promise<T>;\n async exportAuditRecords<T = unknown>(\n parameters?: Parameters.ExportAuditRecords,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/audit/export',\n method: 'GET',\n params: {\n startDate: parameters?.startDate,\n endDate: parameters?.endDate,\n searchString: parameters?.searchString,\n format: parameters?.format,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the retention period for records in the audit log. The retention period is how long an audit record is kept\n * for, from creation date until it is deleted.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async getRetentionPeriod<T = Models.RetentionPeriod>(callback: Callback<T>): Promise<void>;\n /**\n * Returns the retention period for records in the audit log. The retention period is how long an audit record is kept\n * for, from creation date until it is deleted.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async getRetentionPeriod<T = Models.RetentionPeriod>(callback?: never): Promise<T>;\n async getRetentionPeriod<T = Models.RetentionPeriod>(callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/audit/retention',\n method: 'GET',\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Sets the retention period for records in the audit log. The retention period can be set to a maximum of 20 years.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async setRetentionPeriod<T = Models.RetentionPeriod>(\n parameters: Parameters.SetRetentionPeriod | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Sets the retention period for records in the audit log. The retention period can be set to a maximum of 20 years.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async setRetentionPeriod<T = Models.RetentionPeriod>(\n parameters?: Parameters.SetRetentionPeriod,\n callback?: never,\n ): Promise<T>;\n async setRetentionPeriod<T = Models.RetentionPeriod>(\n parameters?: Parameters.SetRetentionPeriod,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/audit/retention',\n method: 'PUT',\n data: {\n number: parameters?.number,\n units: parameters?.units,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns records from the audit log, for a time period back from the current date. For example, you can use this\n * method to get the last 3 months of records.\n *\n * This contains information about events like space exports, group membership changes, app installations, etc. For\n * more information, see [Audit log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the\n * Confluence administrator's guide.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async getAuditRecordsForTimePeriod<T = Models.AuditRecordArray>(\n parameters: Parameters.GetAuditRecordsForTimePeriod | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns records from the audit log, for a time period back from the current date. For example, you can use this\n * method to get the last 3 months of records.\n *\n * This contains information about events like space exports, group membership changes, app installations, etc. For\n * more information, see [Audit log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the\n * Confluence administrator's guide.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async getAuditRecordsForTimePeriod<T = Models.AuditRecordArray>(\n parameters?: Parameters.GetAuditRecordsForTimePeriod,\n callback?: never,\n ): Promise<T>;\n async getAuditRecordsForTimePeriod<T = Models.AuditRecordArray>(\n parameters?: Parameters.GetAuditRecordsForTimePeriod,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/audit/since',\n method: 'GET',\n params: {\n number: parameters?.number,\n units: parameters?.units,\n searchString: parameters?.searchString,\n start: parameters?.start,\n limit: parameters?.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"audit.cjs","sources":["../../../../src/api/audit.ts"],"sourcesContent":["import type * as Models from './models';\nimport type * as Parameters from './parameters';\nimport type { Client } from '../clients';\nimport type { Callback } from '../callback';\nimport type { RequestConfig } from '../requestConfig';\n\nexport class Audit {\n constructor(private client: Client) {}\n\n /**\n * Returns all records in the audit log, optionally for a certain date range. This contains information about events\n * like space exports, group membership changes, app installations, etc. For more information, see [Audit\n * log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the Confluence administrator's guide.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async getAuditRecords<T = Models.AuditRecordArray>(\n parameters: Parameters.GetAuditRecords | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns all records in the audit log, optionally for a certain date range. This contains information about events\n * like space exports, group membership changes, app installations, etc. For more information, see [Audit\n * log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the Confluence administrator's guide.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async getAuditRecords<T = Models.AuditRecordArray>(\n parameters?: Parameters.GetAuditRecords,\n callback?: never,\n ): Promise<T>;\n async getAuditRecords<T = Models.AuditRecordArray>(\n parameters?: Parameters.GetAuditRecords,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/audit',\n method: 'GET',\n params: {\n startDate: parameters?.startDate,\n endDate: parameters?.endDate,\n searchString: parameters?.searchString,\n start: parameters?.start,\n limit: parameters?.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Creates a record in the audit log.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async createAuditRecord<T = Models.AuditRecord>(\n parameters: Parameters.CreateAuditRecord | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Creates a record in the audit log.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async createAuditRecord<T = Models.AuditRecord>(\n parameters?: Parameters.CreateAuditRecord,\n callback?: never,\n ): Promise<T>;\n async createAuditRecord<T = Models.AuditRecord>(\n parameters?: Parameters.CreateAuditRecord,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/audit',\n method: 'POST',\n data: {\n author: parameters?.author,\n remoteAddress: parameters?.remoteAddress,\n creationDate: parameters?.creationDate,\n summary: parameters?.summary,\n description: parameters?.description,\n category: parameters?.category,\n sysAdmin: parameters?.sysAdmin,\n affectedObject: parameters?.affectedObject,\n changedValues: parameters?.changedValues,\n associatedObjects: parameters?.associatedObjects,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Exports audit records as a CSV file or ZIP file.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async exportAuditRecords<T = unknown>(\n parameters: Parameters.ExportAuditRecords | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Exports audit records as a CSV file or ZIP file.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async exportAuditRecords<T = unknown>(parameters?: Parameters.ExportAuditRecords, callback?: never): Promise<T>;\n async exportAuditRecords<T = unknown>(\n parameters?: Parameters.ExportAuditRecords,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/audit/export',\n method: 'GET',\n params: {\n startDate: parameters?.startDate,\n endDate: parameters?.endDate,\n searchString: parameters?.searchString,\n format: parameters?.format,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns the retention period for records in the audit log. The retention period is how long an audit record is kept\n * for, from creation date until it is deleted.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async getRetentionPeriod<T = Models.RetentionPeriod>(callback: Callback<T>): Promise<void>;\n /**\n * Returns the retention period for records in the audit log. The retention period is how long an audit record is kept\n * for, from creation date until it is deleted.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async getRetentionPeriod<T = Models.RetentionPeriod>(callback?: never): Promise<T>;\n async getRetentionPeriod<T = Models.RetentionPeriod>(callback?: Callback<T>): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/audit/retention',\n method: 'GET',\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Sets the retention period for records in the audit log. The retention period can be set to a maximum of 1 year.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async setRetentionPeriod<T = Models.RetentionPeriod>(\n parameters: Parameters.SetRetentionPeriod | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Sets the retention period for records in the audit log. The retention period can be set to a maximum of 1 year.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async setRetentionPeriod<T = Models.RetentionPeriod>(\n parameters?: Parameters.SetRetentionPeriod,\n callback?: never,\n ): Promise<T>;\n async setRetentionPeriod<T = Models.RetentionPeriod>(\n parameters?: Parameters.SetRetentionPeriod,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/audit/retention',\n method: 'PUT',\n data: {\n number: parameters?.number,\n units: parameters?.units,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n\n /**\n * Returns records from the audit log, for a time period back from the current date. For example, you can use this\n * method to get the last 3 months of records.\n *\n * This contains information about events like space exports, group membership changes, app installations, etc. For\n * more information, see [Audit log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the\n * Confluence administrator's guide.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async getAuditRecordsForTimePeriod<T = Models.AuditRecordArray>(\n parameters: Parameters.GetAuditRecordsForTimePeriod | undefined,\n callback: Callback<T>,\n ): Promise<void>;\n /**\n * Returns records from the audit log, for a time period back from the current date. For example, you can use this\n * method to get the last 3 months of records.\n *\n * This contains information about events like space exports, group membership changes, app installations, etc. For\n * more information, see [Audit log](https://confluence.atlassian.com/confcloud/audit-log-802164269.html) in the\n * Confluence administrator's guide.\n *\n * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global\n * permission.\n */\n async getAuditRecordsForTimePeriod<T = Models.AuditRecordArray>(\n parameters?: Parameters.GetAuditRecordsForTimePeriod,\n callback?: never,\n ): Promise<T>;\n async getAuditRecordsForTimePeriod<T = Models.AuditRecordArray>(\n parameters?: Parameters.GetAuditRecordsForTimePeriod,\n callback?: Callback<T>,\n ): Promise<void | T> {\n const config: RequestConfig = {\n url: '/api/audit/since',\n method: 'GET',\n params: {\n number: parameters?.number,\n units: parameters?.units,\n searchString: parameters?.searchString,\n start: parameters?.start,\n limit: parameters?.limit,\n },\n };\n\n return this.client.sendRequest(config, callback);\n }\n}\n"],"names":[],"mappings":"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"}
@@ -78,12 +78,7 @@ class Content {
78
78
  },
79
79
  data: {
80
80
  ...parameters,
81
- version: parameters.version,
82
- title: parameters.title,
83
- type: parameters.type,
84
81
  status: parameters.bodyStatus,
85
- space: parameters.space,
86
- ancestors: parameters.ancestors,
87
82
  },
88
83
  };
89
84
  return this.client.sendRequest(config, callback);