confluence.js 1.2.2 → 1.4.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 (319) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +15 -57
  3. package/out/api/analytics.d.ts +16 -0
  4. package/out/api/analytics.js +34 -0
  5. package/out/api/audit.d.ts +1 -1
  6. package/out/api/audit.js +12 -12
  7. package/out/api/content.d.ts +1 -1
  8. package/out/api/content.js +20 -20
  9. package/out/api/contentAttachments.d.ts +3 -3
  10. package/out/api/contentAttachments.js +13 -12
  11. package/out/api/contentBody.d.ts +1 -1
  12. package/out/api/contentBody.js +2 -2
  13. package/out/api/contentChildrenAndDescendants.d.ts +3 -3
  14. package/out/api/contentChildrenAndDescendants.js +16 -15
  15. package/out/api/contentComments.d.ts +1 -1
  16. package/out/api/contentComments.js +2 -2
  17. package/out/api/contentContentState.d.ts +58 -0
  18. package/out/api/contentContentState.js +63 -0
  19. package/out/api/contentLabels.d.ts +1 -1
  20. package/out/api/contentLabels.js +8 -8
  21. package/out/api/contentMacroBody.d.ts +1 -1
  22. package/out/api/contentMacroBody.js +2 -2
  23. package/out/api/contentPermissions.d.ts +1 -1
  24. package/out/api/contentPermissions.js +3 -3
  25. package/out/api/contentProperties.d.ts +1 -1
  26. package/out/api/contentProperties.js +12 -12
  27. package/out/api/contentRestrictions.d.ts +1 -1
  28. package/out/api/contentRestrictions.js +30 -30
  29. package/out/api/contentVersions.d.ts +1 -1
  30. package/out/api/contentVersions.js +8 -8
  31. package/out/api/contentWatches.d.ts +1 -1
  32. package/out/api/contentWatches.js +24 -24
  33. package/out/api/dynamicModules.d.ts +1 -1
  34. package/out/api/dynamicModules.js +6 -6
  35. package/out/api/experimental.d.ts +123 -5
  36. package/out/api/experimental.js +65 -13
  37. package/out/api/group.d.ts +1 -1
  38. package/out/api/group.js +35 -32
  39. package/out/api/index.d.ts +2 -0
  40. package/out/api/index.js +31 -29
  41. package/out/api/inlineTasks.d.ts +1 -1
  42. package/out/api/inlineTasks.js +6 -6
  43. package/out/api/labelInfo.d.ts +1 -1
  44. package/out/api/labelInfo.js +2 -2
  45. package/out/api/longRunningTask.d.ts +1 -1
  46. package/out/api/longRunningTask.js +4 -4
  47. package/out/api/models/availableContentStates.d.ts +6 -0
  48. package/out/api/models/availableContentStates.js +2 -0
  49. package/out/api/models/blueprintTemplate.d.ts +1 -1
  50. package/out/api/models/bulkUserLookup.d.ts +2 -2
  51. package/out/api/models/content.d.ts +6 -6
  52. package/out/api/models/contentHistory.d.ts +2 -2
  53. package/out/api/models/contentLookAndFeel.d.ts +1 -1
  54. package/out/api/models/contentMetadata.d.ts +1 -1
  55. package/out/api/models/contentRestriction.d.ts +2 -2
  56. package/out/api/models/contentState.d.ts +8 -0
  57. package/out/api/models/contentState.js +2 -0
  58. package/out/api/models/contentStateContainer.d.ts +5 -0
  59. package/out/api/models/contentStateContainer.js +2 -0
  60. package/out/api/models/contentStateSettings.d.ts +11 -0
  61. package/out/api/models/contentStateSettings.js +2 -0
  62. package/out/api/models/contentTemplate.d.ts +1 -1
  63. package/out/api/models/copyPageHierarchyRequest.d.ts +2 -0
  64. package/out/api/models/copyPageRequest.d.ts +1 -1
  65. package/out/api/models/horizontalHeaderLookAndFeel.d.ts +1 -1
  66. package/out/api/models/index.d.ts +8 -0
  67. package/out/api/models/index.js +166 -158
  68. package/out/api/models/labelArray.d.ts +1 -1
  69. package/out/api/models/longTask.d.ts +8 -0
  70. package/out/api/models/longTask.js +2 -0
  71. package/out/api/models/longTaskStatusArray.d.ts +1 -1
  72. package/out/api/models/lookAndFeel.d.ts +2 -2
  73. package/out/api/models/migratedUserArray.d.ts +1 -1
  74. package/out/api/models/relation.d.ts +1 -1
  75. package/out/api/models/relationArray.d.ts +1 -1
  76. package/out/api/models/searchPageResponseSearchResult.d.ts +1 -1
  77. package/out/api/models/searchResult.d.ts +2 -2
  78. package/out/api/models/space.d.ts +4 -4
  79. package/out/api/models/spaceArray.d.ts +1 -1
  80. package/out/api/models/spacePermission.d.ts +1 -1
  81. package/out/api/models/spacePermissionCreate.d.ts +1 -1
  82. package/out/api/models/spacePermissionRequest.d.ts +1 -1
  83. package/out/api/models/spacePermissionV2.d.ts +1 -1
  84. package/out/api/models/spacePropertyArray.d.ts +1 -1
  85. package/out/api/models/spaceWatchArray.d.ts +1 -1
  86. package/out/api/models/themeArray.d.ts +1 -1
  87. package/out/api/models/user.d.ts +2 -2
  88. package/out/api/models/userAnonymous.d.ts +1 -1
  89. package/out/api/models/userProperty.d.ts +13 -0
  90. package/out/api/models/userProperty.js +2 -0
  91. package/out/api/models/userPropertyCreate.d.ts +4 -0
  92. package/out/api/models/userPropertyCreate.js +2 -0
  93. package/out/api/models/userPropertyKeyArray.d.ts +10 -0
  94. package/out/api/models/userPropertyKeyArray.js +2 -0
  95. package/out/api/models/userPropertyUpdate.d.ts +4 -0
  96. package/out/api/models/userPropertyUpdate.js +2 -0
  97. package/out/api/models/usersUserKeys.d.ts +1 -1
  98. package/out/api/models/version.d.ts +2 -2
  99. package/out/api/models/versionArray.d.ts +1 -1
  100. package/out/api/models/watchArray.d.ts +1 -1
  101. package/out/api/parameters/createUserProperty.d.ts +10 -0
  102. package/out/api/parameters/createUserProperty.js +2 -0
  103. package/out/api/parameters/deletePageTree.d.ts +4 -0
  104. package/out/api/parameters/deletePageTree.js +2 -0
  105. package/out/api/parameters/deleteUserProperty.d.ts +9 -0
  106. package/out/api/parameters/deleteUserProperty.js +2 -0
  107. package/out/api/parameters/getAvailableContentStates.d.ts +4 -0
  108. package/out/api/parameters/getAvailableContentStates.js +2 -0
  109. package/out/api/parameters/getContentState.d.ts +6 -0
  110. package/out/api/parameters/getContentState.js +2 -0
  111. package/out/api/parameters/getContentStateLastUpdated.d.ts +4 -0
  112. package/out/api/parameters/getContentStateLastUpdated.js +2 -0
  113. package/out/api/parameters/getContentStateSettings.d.ts +4 -0
  114. package/out/api/parameters/getContentStateSettings.js +2 -0
  115. package/out/api/parameters/getGroupMembersByGroupId.d.ts +5 -0
  116. package/out/api/parameters/getMembersByQueryParam.d.ts +5 -0
  117. package/out/api/parameters/getSpaces.d.ts +1 -1
  118. package/out/api/parameters/getUserProperties.d.ts +8 -0
  119. package/out/api/parameters/getUserProperties.js +2 -0
  120. package/out/api/parameters/getUserProperty.d.ts +6 -0
  121. package/out/api/parameters/getUserProperty.js +2 -0
  122. package/out/api/parameters/index.d.ts +12 -0
  123. package/out/api/parameters/index.js +170 -158
  124. package/out/api/parameters/removeContentState.d.ts +4 -0
  125. package/out/api/parameters/removeContentState.js +2 -0
  126. package/out/api/parameters/searchGroups.d.ts +5 -0
  127. package/out/api/parameters/setContentState.d.ts +8 -0
  128. package/out/api/parameters/setContentState.js +2 -0
  129. package/out/api/parameters/updateUserProperty.d.ts +10 -0
  130. package/out/api/parameters/updateUserProperty.js +2 -0
  131. package/out/api/relation.d.ts +1 -1
  132. package/out/api/relation.js +12 -12
  133. package/out/api/search.d.ts +3 -3
  134. package/out/api/search.js +7 -6
  135. package/out/api/settings.d.ts +5 -1
  136. package/out/api/settings.js +21 -12
  137. package/out/api/space.d.ts +1 -1
  138. package/out/api/space.js +21 -17
  139. package/out/api/spacePermissions.d.ts +1 -1
  140. package/out/api/spacePermissions.js +7 -7
  141. package/out/api/spaceProperties.d.ts +1 -1
  142. package/out/api/spaceProperties.js +12 -12
  143. package/out/api/spaceSettings.d.ts +1 -1
  144. package/out/api/spaceSettings.js +4 -4
  145. package/out/api/template.d.ts +1 -1
  146. package/out/api/template.js +12 -12
  147. package/out/api/themes.d.ts +1 -1
  148. package/out/api/themes.js +12 -12
  149. package/out/api/users.d.ts +3 -3
  150. package/out/api/users.js +16 -16
  151. package/out/clients/baseClient.d.ts +3 -6
  152. package/out/clients/baseClient.js +16 -38
  153. package/out/clients/client.d.ts +2 -3
  154. package/out/clients/confluenceClient.d.ts +3 -1
  155. package/out/clients/confluenceClient.js +2 -0
  156. package/out/clients/index.js +4 -4
  157. package/out/config.d.ts +8 -4
  158. package/out/index.js +4 -4
  159. package/out/paramSerializer.d.ts +1 -0
  160. package/out/paramSerializer.js +16 -0
  161. package/out/server/audit.d.ts +1 -1
  162. package/out/server/audit.js +6 -6
  163. package/out/server/content.d.ts +1 -1
  164. package/out/server/content.js +32 -32
  165. package/out/server/contentBody.d.ts +1 -1
  166. package/out/server/contentBody.js +1 -1
  167. package/out/server/group.d.ts +1 -1
  168. package/out/server/group.js +3 -3
  169. package/out/server/index.js +8 -8
  170. package/out/server/longTask.d.ts +1 -1
  171. package/out/server/longTask.js +2 -2
  172. package/out/server/models/content.d.ts +6 -6
  173. package/out/server/models/contentChildren.d.ts +1 -1
  174. package/out/server/models/contentHistory.d.ts +2 -2
  175. package/out/server/models/contentLookAndFeel.d.ts +1 -1
  176. package/out/server/models/contentRestriction.d.ts +2 -2
  177. package/out/server/models/index.js +60 -60
  178. package/out/server/models/lookAndFeel.d.ts +2 -2
  179. package/out/server/models/searchResult.d.ts +2 -2
  180. package/out/server/models/space.d.ts +3 -3
  181. package/out/server/models/spacePermission.d.ts +1 -1
  182. package/out/server/models/user.d.ts +1 -1
  183. package/out/server/models/version.d.ts +1 -1
  184. package/out/server/parameters/index.js +64 -64
  185. package/out/server/search.d.ts +1 -1
  186. package/out/server/search.js +1 -1
  187. package/out/server/space.d.ts +1 -1
  188. package/out/server/space.js +14 -14
  189. package/out/server/user.d.ts +1 -1
  190. package/out/server/user.js +10 -10
  191. package/out/services/authenticationService/authenticationService.js +4 -1
  192. package/out/services/authenticationService/authentications/createPATAuthenticationToken.d.ts +2 -0
  193. package/out/services/authenticationService/authentications/createPATAuthenticationToken.js +10 -0
  194. package/out/services/authenticationService/authentications/index.d.ts +1 -0
  195. package/out/services/authenticationService/authentications/index.js +4 -3
  196. package/out/services/authenticationService/index.js +1 -1
  197. package/package.json +30 -27
  198. package/src/api/analytics.ts +44 -0
  199. package/src/api/audit.ts +7 -7
  200. package/src/api/content.ts +11 -11
  201. package/src/api/contentAttachments.ts +11 -10
  202. package/src/api/contentBody.ts +2 -2
  203. package/src/api/contentChildrenAndDescendants.ts +15 -11
  204. package/src/api/contentComments.ts +2 -2
  205. package/src/api/contentContentState.ts +157 -0
  206. package/src/api/contentLabels.ts +5 -5
  207. package/src/api/contentMacroBody.ts +2 -2
  208. package/src/api/contentPermissions.ts +2 -2
  209. package/src/api/contentProperties.ts +7 -7
  210. package/src/api/contentRestrictions.ts +16 -16
  211. package/src/api/contentVersions.ts +5 -5
  212. package/src/api/contentWatches.ts +13 -13
  213. package/src/api/dynamicModules.ts +4 -4
  214. package/src/api/experimental.ts +216 -13
  215. package/src/api/group.ts +20 -16
  216. package/src/api/index.ts +2 -0
  217. package/src/api/inlineTasks.ts +4 -4
  218. package/src/api/labelInfo.ts +2 -2
  219. package/src/api/longRunningTask.ts +3 -3
  220. package/src/api/models/availableContentStates.ts +7 -0
  221. package/src/api/models/blueprintTemplate.ts +1 -1
  222. package/src/api/models/bulkUserLookup.ts +2 -2
  223. package/src/api/models/content.ts +6 -6
  224. package/src/api/models/contentHistory.ts +2 -2
  225. package/src/api/models/contentLookAndFeel.ts +1 -1
  226. package/src/api/models/contentMetadata.ts +1 -1
  227. package/src/api/models/contentRestriction.ts +2 -2
  228. package/src/api/models/contentState.ts +8 -0
  229. package/src/api/models/contentStateContainer.ts +6 -0
  230. package/src/api/models/contentStateSettings.ts +12 -0
  231. package/src/api/models/contentTemplate.ts +1 -1
  232. package/src/api/models/copyPageHierarchyRequest.ts +2 -0
  233. package/src/api/models/copyPageRequest.ts +1 -1
  234. package/src/api/models/horizontalHeaderLookAndFeel.ts +1 -1
  235. package/src/api/models/index.ts +8 -0
  236. package/src/api/models/labelArray.ts +1 -1
  237. package/src/api/models/longTask.ts +8 -0
  238. package/src/api/models/longTaskStatusArray.ts +1 -1
  239. package/src/api/models/lookAndFeel.ts +2 -2
  240. package/src/api/models/migratedUserArray.ts +1 -1
  241. package/src/api/models/relation.ts +1 -1
  242. package/src/api/models/relationArray.ts +1 -1
  243. package/src/api/models/searchPageResponseSearchResult.ts +1 -1
  244. package/src/api/models/searchResult.ts +2 -2
  245. package/src/api/models/space.ts +4 -4
  246. package/src/api/models/spaceArray.ts +1 -1
  247. package/src/api/models/spacePermission.ts +1 -1
  248. package/src/api/models/spacePermissionCreate.ts +1 -1
  249. package/src/api/models/spacePermissionRequest.ts +1 -1
  250. package/src/api/models/spacePermissionV2.ts +1 -1
  251. package/src/api/models/spacePropertyArray.ts +1 -1
  252. package/src/api/models/spaceWatchArray.ts +1 -1
  253. package/src/api/models/themeArray.ts +1 -1
  254. package/src/api/models/user.ts +2 -2
  255. package/src/api/models/userAnonymous.ts +1 -1
  256. package/src/api/models/userProperty.ts +14 -0
  257. package/src/api/models/userPropertyCreate.ts +4 -0
  258. package/src/api/models/userPropertyKeyArray.ts +11 -0
  259. package/src/api/models/userPropertyUpdate.ts +4 -0
  260. package/src/api/models/usersUserKeys.ts +1 -1
  261. package/src/api/models/version.ts +2 -2
  262. package/src/api/models/versionArray.ts +1 -1
  263. package/src/api/models/watchArray.ts +1 -1
  264. package/src/api/parameters/createUserProperty.ts +11 -0
  265. package/src/api/parameters/deletePageTree.ts +4 -0
  266. package/src/api/parameters/deleteUserProperty.ts +9 -0
  267. package/src/api/parameters/getAvailableContentStates.ts +4 -0
  268. package/src/api/parameters/getContentState.ts +6 -0
  269. package/src/api/parameters/getContentStateLastUpdated.ts +4 -0
  270. package/src/api/parameters/getContentStateSettings.ts +4 -0
  271. package/src/api/parameters/getGroupMembersByGroupId.ts +5 -0
  272. package/src/api/parameters/getMembersByQueryParam.ts +5 -0
  273. package/src/api/parameters/getSpaces.ts +31 -1
  274. package/src/api/parameters/getUserProperties.ts +8 -0
  275. package/src/api/parameters/getUserProperty.ts +6 -0
  276. package/src/api/parameters/index.ts +12 -0
  277. package/src/api/parameters/removeContentState.ts +4 -0
  278. package/src/api/parameters/searchGroups.ts +5 -0
  279. package/src/api/parameters/setContentState.ts +8 -0
  280. package/src/api/parameters/updateUserProperty.ts +11 -0
  281. package/src/api/relation.ts +6 -6
  282. package/src/api/search.ts +7 -5
  283. package/src/api/settings.ts +29 -7
  284. package/src/api/space.ts +14 -10
  285. package/src/api/spacePermissions.ts +4 -4
  286. package/src/api/spaceProperties.ts +7 -7
  287. package/src/api/spaceSettings.ts +3 -3
  288. package/src/api/template.ts +7 -7
  289. package/src/api/themes.ts +7 -7
  290. package/src/api/users.ts +12 -12
  291. package/src/clients/baseClient.ts +12 -64
  292. package/src/clients/client.ts +2 -3
  293. package/src/clients/confluenceClient.ts +4 -0
  294. package/src/config.ts +9 -4
  295. package/src/paramSerializer.ts +15 -0
  296. package/src/server/audit.ts +2 -2
  297. package/src/server/content.ts +2 -2
  298. package/src/server/contentBody.ts +1 -1
  299. package/src/server/group.ts +2 -2
  300. package/src/server/longTask.ts +2 -2
  301. package/src/server/models/content.ts +6 -6
  302. package/src/server/models/contentChildren.ts +1 -1
  303. package/src/server/models/contentHistory.ts +2 -2
  304. package/src/server/models/contentLookAndFeel.ts +1 -1
  305. package/src/server/models/contentRestriction.ts +2 -2
  306. package/src/server/models/lookAndFeel.ts +2 -2
  307. package/src/server/models/searchResult.ts +2 -2
  308. package/src/server/models/space.ts +3 -3
  309. package/src/server/models/spacePermission.ts +1 -1
  310. package/src/server/models/user.ts +1 -1
  311. package/src/server/models/version.ts +1 -1
  312. package/src/server/search.ts +2 -2
  313. package/src/server/space.ts +2 -2
  314. package/src/server/user.ts +2 -2
  315. package/src/services/authenticationService/authenticationService.ts +5 -0
  316. package/src/services/authenticationService/authentications/createBasicAuthenticationToken.ts +1 -1
  317. package/src/services/authenticationService/authentications/createPATAuthenticationToken.ts +5 -0
  318. package/src/services/authenticationService/authentications/index.ts +1 -0
  319. package/tsconfig.lint.json +7 -0
package/out/api/users.js CHANGED
@@ -7,7 +7,7 @@ class Users {
7
7
  this.client = client;
8
8
  }
9
9
  getUser(parameters, callback) {
10
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
10
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
11
  const config = {
12
12
  url: '/api/user',
13
13
  method: 'GET',
@@ -18,11 +18,11 @@ class Users {
18
18
  expand: parameters.expand,
19
19
  },
20
20
  };
21
- return this.client.sendRequest(config, callback, { methodName: 'getUser' });
21
+ return this.client.sendRequest(config, callback);
22
22
  });
23
23
  }
24
24
  getAnonymousUser(parameters, callback) {
25
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
25
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
26
  const config = {
27
27
  url: '/api/user/anonymous',
28
28
  method: 'GET',
@@ -30,11 +30,11 @@ class Users {
30
30
  expand: parameters === null || parameters === void 0 ? void 0 : parameters.expand,
31
31
  },
32
32
  };
33
- return this.client.sendRequest(config, callback, { methodName: 'getAnonymousUser' });
33
+ return this.client.sendRequest(config, callback);
34
34
  });
35
35
  }
36
36
  getCurrentUser(parameters, callback) {
37
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
37
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
38
38
  const config = {
39
39
  url: '/api/user/current',
40
40
  method: 'GET',
@@ -42,11 +42,11 @@ class Users {
42
42
  expand: parameters === null || parameters === void 0 ? void 0 : parameters.expand,
43
43
  },
44
44
  };
45
- return this.client.sendRequest(config, callback, { methodName: 'getCurrentUser' });
45
+ return this.client.sendRequest(config, callback);
46
46
  });
47
47
  }
48
48
  getGroupMembershipsForUser(parameters, callback) {
49
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
49
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
50
50
  const config = {
51
51
  url: '/api/user/memberof',
52
52
  method: 'GET',
@@ -58,11 +58,11 @@ class Users {
58
58
  limit: parameters.limit,
59
59
  },
60
60
  };
61
- return this.client.sendRequest(config, callback, { methodName: 'getGroupMembershipsForUser' });
61
+ return this.client.sendRequest(config, callback);
62
62
  });
63
63
  }
64
64
  getBulkUserLookup(parameters, callback) {
65
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
65
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
66
66
  const config = {
67
67
  url: '/api/user/bulk',
68
68
  method: 'GET',
@@ -72,11 +72,11 @@ class Users {
72
72
  limit: parameters.limit,
73
73
  },
74
74
  };
75
- return this.client.sendRequest(config, callback, { methodName: 'getBulkUserLookup' });
75
+ return this.client.sendRequest(config, callback);
76
76
  });
77
77
  }
78
78
  getPrivacyUnsafeUserEmail(parameters, callback) {
79
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
79
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
80
80
  const config = {
81
81
  url: '/api/user/email',
82
82
  method: 'GET',
@@ -84,11 +84,11 @@ class Users {
84
84
  accountId: parameters.accountId,
85
85
  },
86
86
  };
87
- return this.client.sendRequest(config, callback, { methodName: 'getPrivacyUnsafeUserEmail' });
87
+ return this.client.sendRequest(config, callback);
88
88
  });
89
89
  }
90
90
  getPrivacyUnsafeUserEmailBulk(parameters, callback) {
91
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
91
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
92
92
  const config = {
93
93
  url: '/api/user/email/bulk',
94
94
  method: 'GET',
@@ -96,11 +96,11 @@ class Users {
96
96
  accountId: parameters.accountId,
97
97
  },
98
98
  };
99
- return this.client.sendRequest(config, callback, { methodName: 'getPrivacyUnsafeUserEmailBulk' });
99
+ return this.client.sendRequest(config, callback);
100
100
  });
101
101
  }
102
102
  getBulkUserMigration(parameters, callback) {
103
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
103
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
104
104
  const config = {
105
105
  url: '/api/user/bulk/migration',
106
106
  method: 'GET',
@@ -111,7 +111,7 @@ class Users {
111
111
  limit: parameters.limit,
112
112
  },
113
113
  };
114
- return this.client.sendRequest(config, callback, { methodName: 'getBulkUserMigration' });
114
+ return this.client.sendRequest(config, callback);
115
115
  });
116
116
  }
117
117
  }
@@ -1,19 +1,16 @@
1
- import { Telemetry } from 'telemetry.confluence.js';
2
- import type { Client } from './client';
3
1
  import type { Callback } from '../callback';
2
+ import type { Client } from './client';
4
3
  import type { Config } from '../config';
5
4
  import type { RequestConfig } from '../requestConfig';
6
5
  export declare class BaseClient implements Client {
7
6
  #private;
8
7
  protected readonly config: Config;
9
- private telemetryClient;
10
8
  protected urlSuffix: string;
11
9
  constructor(config: Config);
12
10
  protected paramSerializer(parameters: Record<string, any>): string;
13
11
  protected encode(value: string): string;
14
12
  protected removeUndefinedProperties(obj: Record<string, any>): Record<string, any>;
15
13
  private get instance();
16
- sendRequest<T>(requestConfig: RequestConfig, callback: never, telemetryData?: Partial<Telemetry>): Promise<T>;
17
- sendRequest<T>(requestConfig: RequestConfig, callback: Callback<T>, telemetryData?: Partial<Telemetry>): Promise<void>;
18
- private get authenticationType();
14
+ sendRequest<T>(requestConfig: RequestConfig, callback: never, telemetryData?: any): Promise<T>;
15
+ sendRequest<T>(requestConfig: RequestConfig, callback: Callback<T>, telemetryData?: any): Promise<void>;
19
16
  }
@@ -3,9 +3,8 @@ var _BaseClient_instance;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.BaseClient = void 0;
5
5
  const tslib_1 = require("tslib");
6
- const axios_1 = require("axios");
7
- const telemetry_confluence_js_1 = require("telemetry.confluence.js");
8
6
  const authenticationService_1 = require("../services/authenticationService");
7
+ const axios_1 = require("axios");
9
8
  const ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token';
10
9
  const ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE = 'no-check';
11
10
  class BaseClient {
@@ -13,13 +12,12 @@ class BaseClient {
13
12
  this.config = config;
14
13
  _BaseClient_instance.set(this, void 0);
15
14
  this.urlSuffix = '/wiki/rest/';
16
- this.telemetryClient = new telemetry_confluence_js_1.TelemetryClient(config.telemetry);
17
15
  }
18
16
  paramSerializer(parameters) {
19
17
  const parts = [];
20
18
  Object.entries(parameters).forEach(([key, value]) => {
21
19
  if (value === null || typeof value === 'undefined') {
22
- return undefined;
20
+ return;
23
21
  }
24
22
  if (Array.isArray(value)) {
25
23
  // eslint-disable-next-line no-param-reassign
@@ -33,8 +31,12 @@ class BaseClient {
33
31
  // eslint-disable-next-line no-param-reassign
34
32
  value = JSON.stringify(value);
35
33
  }
34
+ else if (value instanceof Function) {
35
+ const part = value();
36
+ return part && parts.push(part);
37
+ }
36
38
  parts.push(`${this.encode(key)}=${this.encode(value)}`);
37
- return undefined;
39
+ return;
38
40
  });
39
41
  return parts.join('&');
40
42
  }
@@ -54,17 +56,15 @@ class BaseClient {
54
56
  }
55
57
  get instance() {
56
58
  var _a;
57
- if ((0, tslib_1.__classPrivateFieldGet)(this, _BaseClient_instance, "f")) {
58
- return (0, tslib_1.__classPrivateFieldGet)(this, _BaseClient_instance, "f");
59
+ if (tslib_1.__classPrivateFieldGet(this, _BaseClient_instance, "f")) {
60
+ return tslib_1.__classPrivateFieldGet(this, _BaseClient_instance, "f");
59
61
  }
60
- (0, tslib_1.__classPrivateFieldSet)(this, _BaseClient_instance, axios_1.default.create(Object.assign(Object.assign({ paramsSerializer: this.paramSerializer.bind(this) }, this.config.baseRequestConfig), { baseURL: `${this.config.host}${this.urlSuffix}`, headers: this.removeUndefinedProperties(Object.assign({ [ATLASSIAN_TOKEN_CHECK_FLAG]: this.config.noCheckAtlassianToken ? ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE : undefined }, (_a = this.config.baseRequestConfig) === null || _a === void 0 ? void 0 : _a.headers)) })), "f");
61
- return (0, tslib_1.__classPrivateFieldGet)(this, _BaseClient_instance, "f");
62
+ tslib_1.__classPrivateFieldSet(this, _BaseClient_instance, axios_1.default.create(Object.assign(Object.assign({ paramsSerializer: this.paramSerializer.bind(this) }, this.config.baseRequestConfig), { baseURL: `${this.config.host}${this.urlSuffix}`, headers: this.removeUndefinedProperties(Object.assign({ [ATLASSIAN_TOKEN_CHECK_FLAG]: this.config.noCheckAtlassianToken ? ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE : undefined }, (_a = this.config.baseRequestConfig) === null || _a === void 0 ? void 0 : _a.headers)) })), "f");
63
+ return tslib_1.__classPrivateFieldGet(this, _BaseClient_instance, "f");
62
64
  }
63
- sendRequest(requestConfig, callback, telemetryData) {
64
- var _a, _b, _c, _d, _e, _f, _g, _h;
65
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
66
- const startDateTime = new Date();
67
- const telemetry = Object.assign({ authentication: this.authenticationType, baseRequestConfigUsed: !!this.config.baseRequestConfig, bodyExists: !!requestConfig.data, callbackUsed: !!callback, headersExists: !!requestConfig.headers, libVersion: '1.2.2', libVersionHash: 'bda9643ac6601722a28f238714274da4', methodName: (telemetryData === null || telemetryData === void 0 ? void 0 : telemetryData.methodName) || 'sendRequest', onErrorMiddlewareUsed: !!((_a = this.config.middlewares) === null || _a === void 0 ? void 0 : _a.onError), onResponseMiddlewareUsed: !!((_b = this.config.middlewares) === null || _b === void 0 ? void 0 : _b.onResponse), queryExists: !!requestConfig.params, requestEndTime: new Date(), requestStartTime: startDateTime, requestStatusCode: 0, noCheckAtlassianToken: !!this.config.noCheckAtlassianToken }, telemetryData);
65
+ sendRequest(requestConfig, callback) {
66
+ var _a, _b, _c, _d;
67
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
68
68
  try {
69
69
  const modifiedRequestConfig = Object.assign(Object.assign({}, requestConfig), { headers: this.removeUndefinedProperties(Object.assign({ Authorization: yield authenticationService_1.AuthenticationService.getAuthenticationToken(this.config.authentication, {
70
70
  baseURL: this.config.host,
@@ -75,8 +75,7 @@ class BaseClient {
75
75
  const callbackResponseHandler = callback && ((data) => callback(null, data));
76
76
  const defaultResponseHandler = (data) => data;
77
77
  const responseHandler = callbackResponseHandler !== null && callbackResponseHandler !== void 0 ? callbackResponseHandler : defaultResponseHandler;
78
- (_d = (_c = this.config.middlewares) === null || _c === void 0 ? void 0 : _c.onResponse) === null || _d === void 0 ? void 0 : _d.call(_c, response.data);
79
- telemetry.requestStatusCode = response.status;
78
+ (_b = (_a = this.config.middlewares) === null || _a === void 0 ? void 0 : _a.onResponse) === null || _b === void 0 ? void 0 : _b.call(_a, response.data);
80
79
  return responseHandler(response.data);
81
80
  }
82
81
  catch (e) {
@@ -85,32 +84,11 @@ class BaseClient {
85
84
  throw error;
86
85
  };
87
86
  const errorHandler = callbackErrorHandler !== null && callbackErrorHandler !== void 0 ? callbackErrorHandler : defaultErrorHandler;
88
- (_f = (_e = this.config.middlewares) === null || _e === void 0 ? void 0 : _e.onError) === null || _f === void 0 ? void 0 : _f.call(_e, e);
89
- telemetry.requestStatusCode = e.isAxiosError ? (_h = (_g = e.response) === null || _g === void 0 ? void 0 : _g.status) !== null && _h !== void 0 ? _h : 0 : 418;
87
+ (_d = (_c = this.config.middlewares) === null || _c === void 0 ? void 0 : _c.onError) === null || _d === void 0 ? void 0 : _d.call(_c, e);
90
88
  return errorHandler(e);
91
89
  }
92
- finally {
93
- telemetry.requestEndTime = new Date();
94
- this.telemetryClient.sendTelemetry(telemetry);
95
- }
96
90
  });
97
91
  }
98
- get authenticationType() {
99
- const { authentication } = this.config;
100
- if (!authentication) {
101
- return telemetry_confluence_js_1.Authentication.None;
102
- }
103
- if (authentication.basic) {
104
- return telemetry_confluence_js_1.Authentication.Basic;
105
- }
106
- if (authentication.oauth2) {
107
- return telemetry_confluence_js_1.Authentication.OAuth2;
108
- }
109
- if (authentication.jwt) {
110
- return telemetry_confluence_js_1.Authentication.JWT;
111
- }
112
- return telemetry_confluence_js_1.Authentication.NA;
113
- }
114
92
  }
115
93
  exports.BaseClient = BaseClient;
116
94
  _BaseClient_instance = new WeakMap();
@@ -1,7 +1,6 @@
1
- import type { Telemetry } from 'telemetry.confluence.js';
2
1
  import type { Callback } from '../callback';
3
2
  import type { RequestConfig } from '../requestConfig';
4
3
  export interface Client {
5
- sendRequest<T>(requestConfig: RequestConfig, callback?: never, telemetryData?: Partial<Telemetry>): Promise<T>;
6
- sendRequest<T>(requestConfig: RequestConfig, callback?: Callback<T>, telemetryData?: Partial<Telemetry>): Promise<void>;
4
+ sendRequest<T>(requestConfig: RequestConfig, callback?: never, telemetryData?: any): Promise<T>;
5
+ sendRequest<T>(requestConfig: RequestConfig, callback?: Callback<T>, telemetryData?: any): Promise<void>;
7
6
  }
@@ -1,12 +1,14 @@
1
1
  import { BaseClient } from './baseClient';
2
- import { Audit, Content, ContentAttachments, ContentBody, ContentChildrenAndDescendants, ContentComments, ContentLabels, ContentMacroBody, ContentPermissions, ContentProperties, ContentRestrictions, ContentVersions, ContentWatches, DynamicModules, Experimental, Group, InlineTasks, LabelInfo, LongRunningTask, Relation, Search, Settings, Space, SpacePermissions, SpaceProperties, SpaceSettings, Template, Themes, Users } from '../api';
2
+ import { Analytics, Audit, Content, ContentAttachments, ContentBody, ContentChildrenAndDescendants, ContentComments, ContentContentState, ContentLabels, ContentMacroBody, ContentPermissions, ContentProperties, ContentRestrictions, ContentVersions, ContentWatches, DynamicModules, Experimental, Group, InlineTasks, LabelInfo, LongRunningTask, Relation, Search, Settings, Space, SpacePermissions, SpaceProperties, SpaceSettings, Template, Themes, Users } from '../api';
3
3
  export declare class ConfluenceClient extends BaseClient {
4
+ analytics: Analytics;
4
5
  audit: Audit;
5
6
  content: Content;
6
7
  contentAttachments: ContentAttachments;
7
8
  contentBody: ContentBody;
8
9
  contentChildrenAndDescendants: ContentChildrenAndDescendants;
9
10
  contentComments: ContentComments;
11
+ contentContentState: ContentContentState;
10
12
  contentLabels: ContentLabels;
11
13
  contentMacroBody: ContentMacroBody;
12
14
  contentPermissions: ContentPermissions;
@@ -6,12 +6,14 @@ const api_1 = require("../api");
6
6
  class ConfluenceClient extends baseClient_1.BaseClient {
7
7
  constructor() {
8
8
  super(...arguments);
9
+ this.analytics = new api_1.Analytics(this);
9
10
  this.audit = new api_1.Audit(this);
10
11
  this.content = new api_1.Content(this);
11
12
  this.contentAttachments = new api_1.ContentAttachments(this);
12
13
  this.contentBody = new api_1.ContentBody(this);
13
14
  this.contentChildrenAndDescendants = new api_1.ContentChildrenAndDescendants(this);
14
15
  this.contentComments = new api_1.ContentComments(this);
16
+ this.contentContentState = new api_1.ContentContentState(this);
15
17
  this.contentLabels = new api_1.ContentLabels(this);
16
18
  this.contentMacroBody = new api_1.ContentMacroBody(this);
17
19
  this.contentPermissions = new api_1.ContentPermissions(this);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./baseClient"), exports);
5
- (0, tslib_1.__exportStar)(require("./client"), exports);
6
- (0, tslib_1.__exportStar)(require("./confluenceClient"), exports);
7
- (0, tslib_1.__exportStar)(require("./serverClient"), exports);
4
+ tslib_1.__exportStar(require("./baseClient"), exports);
5
+ tslib_1.__exportStar(require("./client"), exports);
6
+ tslib_1.__exportStar(require("./confluenceClient"), exports);
7
+ tslib_1.__exportStar(require("./serverClient"), exports);
package/out/config.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { AxiosError } from 'axios';
2
- import type { TelemetryConfig } from 'telemetry.confluence.js';
3
2
  import type { RequestConfig } from './requestConfig';
4
3
  import type { UtilityTypes } from './utilityTypes';
5
4
  export interface Config {
@@ -7,6 +6,7 @@ export interface Config {
7
6
  baseRequestConfig?: Config.BaseRequestConfig;
8
7
  authentication?: Config.Authentication;
9
8
  middlewares?: Config.Middlewares;
9
+ /** @deprecated Disabled. Will be removed in the next major version. */
10
10
  telemetry?: Config.Telemetry;
11
11
  /**
12
12
  * Adds `'X-Atlassian-Token': 'no-check'` to each request header
@@ -16,14 +16,17 @@ export interface Config {
16
16
  export declare namespace Config {
17
17
  type BaseRequestConfig = RequestConfig;
18
18
  type Error = AxiosError;
19
- type Telemetry = boolean | TelemetryConfig;
19
+ /** @deprecated Disabled. Will be removed in the next major version. */
20
+ type Telemetry = boolean | any;
20
21
  type Authentication = UtilityTypes.XOR<{
21
22
  jwt: Authentication.JWT;
23
+ }, UtilityTypes.XOR<{
24
+ personalAccessToken: Authentication.PersonalAccessToken;
22
25
  }, UtilityTypes.XOR<{
23
26
  basic: Authentication.Basic;
24
27
  }, {
25
28
  oauth2: Authentication.OAuth2;
26
- }>>;
29
+ }>>>;
27
30
  interface Middlewares {
28
31
  onError?: Config.Middlewares.OnErrorHandler;
29
32
  onResponse?: Config.Middlewares.OnResponseHandler;
@@ -33,10 +36,11 @@ export declare namespace Config {
33
36
  type OnResponseHandler = (data: any) => void;
34
37
  }
35
38
  namespace Authentication {
39
+ type PersonalAccessToken = string;
36
40
  type JWT = {
37
41
  /** The key from the app descriptor. */
38
42
  issuer: string;
39
- /** The sharedsecret key received during the app installation handshake */
43
+ /** The shared secret key received during the app installation handshake */
40
44
  secret: string;
41
45
  /** Token expiry time (default 3 minutes after issuing) */
42
46
  expiryTimeSeconds?: number;
package/out/index.js CHANGED
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Parameters = exports.Models = exports.Server = exports.Api = void 0;
4
4
  const tslib_1 = require("tslib");
5
- (0, tslib_1.__exportStar)(require("./clients"), exports);
6
- (0, tslib_1.__exportStar)(require("./config"), exports);
7
- (0, tslib_1.__exportStar)(require("./requestConfig"), exports);
8
- (0, tslib_1.__exportStar)(require("./callback"), exports);
5
+ tslib_1.__exportStar(require("./clients"), exports);
6
+ tslib_1.__exportStar(require("./config"), exports);
7
+ tslib_1.__exportStar(require("./requestConfig"), exports);
8
+ tslib_1.__exportStar(require("./callback"), exports);
9
9
  exports.Api = require("./api");
10
10
  exports.Server = require("./server");
11
11
  exports.Models = require("./api/models");
@@ -0,0 +1 @@
1
+ export declare function paramSerializer(key: string, values?: string | string[]): "" | (() => string) | undefined;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.paramSerializer = void 0;
4
+ function paramSerializer(key, values) {
5
+ if (typeof values === 'string') {
6
+ return () => `${key}=${values}`;
7
+ }
8
+ if (!values) {
9
+ return undefined;
10
+ }
11
+ if (!values.length) {
12
+ return '';
13
+ }
14
+ return () => values.map((value) => `${key}=${value}`).join('&');
15
+ }
16
+ exports.paramSerializer = paramSerializer;
@@ -1,7 +1,7 @@
1
1
  import * as Models from './models';
2
2
  import * as Parameters from './parameters';
3
- import { Client } from '../clients';
4
3
  import { Callback } from '../callback';
4
+ import { Client } from '../clients';
5
5
  import { Pagination } from '../pagination';
6
6
  export declare class Audit {
7
7
  private client;
@@ -7,7 +7,7 @@ class Audit {
7
7
  this.client = client;
8
8
  }
9
9
  getAuditRecords(parameters, callback) {
10
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
10
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
11
  const config = {
12
12
  url: '/rest/api/audit',
13
13
  method: 'GET',
@@ -23,7 +23,7 @@ class Audit {
23
23
  });
24
24
  }
25
25
  createAuditRecord(parameters, callback) {
26
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
26
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
27
  const config = {
28
28
  url: '/rest/api/audit',
29
29
  method: 'POST',
@@ -44,7 +44,7 @@ class Audit {
44
44
  });
45
45
  }
46
46
  exportAuditRecords(parameters, callback) {
47
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
47
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
48
48
  const config = {
49
49
  url: '/rest/api/audit/export',
50
50
  method: 'GET',
@@ -59,7 +59,7 @@ class Audit {
59
59
  });
60
60
  }
61
61
  getRetentionPeriod(callback) {
62
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
62
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
63
63
  const config = {
64
64
  url: '/rest/api/audit/retention',
65
65
  method: 'GET',
@@ -68,7 +68,7 @@ class Audit {
68
68
  });
69
69
  }
70
70
  setRetentionPeriod(parameters, callback) {
71
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
71
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
72
72
  const config = {
73
73
  url: '/rest/api/audit/retention',
74
74
  method: 'PUT',
@@ -81,7 +81,7 @@ class Audit {
81
81
  });
82
82
  }
83
83
  getAuditRecordsForTimePeriod(parameters, callback) {
84
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
84
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
85
85
  const config = {
86
86
  url: '/rest/api/audit/since',
87
87
  method: 'GET',
@@ -1,7 +1,7 @@
1
1
  import * as Models from './models';
2
2
  import * as Parameters from './parameters';
3
- import { Client } from '../clients';
4
3
  import { Callback } from '../callback';
4
+ import { Client } from '../clients';
5
5
  import { Pagination } from '../pagination';
6
6
  export declare class Content {
7
7
  private client;