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/src/api/users.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type * as Models from './models';
2
2
  import type * as Parameters from './parameters';
3
- import type { Callback } from '../callback';
4
3
  import type { Client } from '../clients';
4
+ import type { Callback } from '../callback';
5
5
  import type { RequestConfig } from '../requestConfig';
6
6
 
7
7
  export class Users {
@@ -153,7 +153,8 @@ export class Users {
153
153
  }
154
154
 
155
155
  /**
156
- * Returns user details for the ids provided in request.
156
+ * Returns user details for the ids provided in the request. Currently this API returns a maximum of 100 results. If
157
+ * more than 100 account ids are passed in, then the first 100 will be returned.
157
158
  *
158
159
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
159
160
  * ('Can use' global permission).
@@ -163,7 +164,8 @@ export class Users {
163
164
  callback: Callback<T>,
164
165
  ): Promise<void>;
165
166
  /**
166
- * Returns user details for the ids provided in request.
167
+ * Returns user details for the ids provided in the request. Currently this API returns a maximum of 100 results. If
168
+ * more than 100 account ids are passed in, then the first 100 will be returned.
167
169
  *
168
170
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
169
171
  * ('Can use' global permission).
@@ -190,8 +192,10 @@ export class Users {
190
192
  }
191
193
 
192
194
  /**
193
- * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these
195
+ * Returns a user's email address regardless of the user’s profile visibility settings. For Connect apps, this API is
196
+ * only available to apps approved by Atlassian, according to these
194
197
  * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603).
198
+ * For Forge apps, this API only supports access via asApp() requests.
195
199
  *
196
200
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
197
201
  * ('Can use' global permission).
@@ -201,8 +205,10 @@ export class Users {
201
205
  callback: Callback<T>,
202
206
  ): Promise<void>;
203
207
  /**
204
- * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these
208
+ * Returns a user's email address regardless of the user’s profile visibility settings. For Connect apps, this API is
209
+ * only available to apps approved by Atlassian, according to these
205
210
  * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603).
211
+ * For Forge apps, this API only supports access via asApp() requests.
206
212
  *
207
213
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
208
214
  * ('Can use' global permission).
@@ -227,9 +233,10 @@ export class Users {
227
233
  }
228
234
 
229
235
  /**
230
- * Returns user email addresses for a set of accountIds. This API is only available to apps approved by Atlassian,
231
- * according to these
236
+ * Returns a user's email address regardless of the user’s profile visibility settings. For Connect apps, this API is
237
+ * only available to apps approved by Atlassian, according to these
232
238
  * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603).
239
+ * For Forge apps, this API only supports access via asApp() requests.
233
240
  *
234
241
  * Any accounts which are not available will not be included in the result.
235
242
  *
@@ -241,9 +248,10 @@ export class Users {
241
248
  callback: Callback<T>,
242
249
  ): Promise<void>;
243
250
  /**
244
- * Returns user email addresses for a set of accountIds. This API is only available to apps approved by Atlassian,
245
- * according to these
251
+ * Returns a user's email address regardless of the user’s profile visibility settings. For Connect apps, this API is
252
+ * only available to apps approved by Atlassian, according to these
246
253
  * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603).
254
+ * For Forge apps, this API only supports access via asApp() requests.
247
255
  *
248
256
  * Any accounts which are not available will not be included in the result.
249
257
  *
@@ -275,6 +283,8 @@ export class Users {
275
283
  *
276
284
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission
277
285
  * if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).
286
+ *
287
+ * @deprecated Will be removed in next major version.
278
288
  */
279
289
  async getBulkUserMigration<T = Models.MigratedUserArray>(
280
290
  parameters: Parameters.GetBulkUserMigration,
@@ -286,6 +296,8 @@ export class Users {
286
296
  *
287
297
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Confluence Administrator' global permission
288
298
  * if specifying a user, otherwise permission to access the Confluence site ('Can use' global permission).
299
+ *
300
+ * @deprecated Will be removed in next major version.
289
301
  */
290
302
  async getBulkUserMigration<T = Models.MigratedUserArray>(
291
303
  parameters: Parameters.GetBulkUserMigration,
@@ -4,16 +4,15 @@ import axios from 'axios';
4
4
  import { getAuthenticationToken } from '~/services';
5
5
  import type { Callback } from '~/callback';
6
6
  import type { Client } from './client';
7
- import {
8
- ConfigSchema,
9
- type Config,
10
- type Error as ConfluenceError,
11
- } from '~/config';
7
+ import { ConfigSchema, type Config, type Error as ConfluenceError } from '~/config';
12
8
  import type { RequestConfig } from '~/requestConfig';
13
- import { ZodError } from 'zod';
9
+ import { ZodError, z } from 'zod';
14
10
 
15
11
  const ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token';
16
12
  const ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE = 'no-check';
13
+ const NON_EMAIL_BASIC_AUTH_WARNING =
14
+ '[confluence.js] authentication.basic.email is not a valid email address; treating it as login workaround.';
15
+ const EMAIL_SCHEMA = z.email();
17
16
 
18
17
  export class BaseClient implements Client {
19
18
  #instance: AxiosInstance | undefined;
@@ -23,15 +22,32 @@ export class BaseClient implements Client {
23
22
 
24
23
  try {
25
24
  this.config = ConfigSchema.parse(this.config);
25
+ this.warnIfNonEmailBasicAuthLogin();
26
26
  } catch (e) {
27
- if (e instanceof ZodError && e.errors[0].code === 'invalid_string') {
28
- throw new Error(e.errors[0].message);
27
+ if (e instanceof ZodError && e.issues[0]?.message) {
28
+ throw new Error(e.issues[0].message, e);
29
29
  }
30
30
 
31
31
  throw e;
32
32
  }
33
33
  }
34
34
 
35
+ private warnIfNonEmailBasicAuthLogin() {
36
+ if (this.config.suppressWarnings) {
37
+ return;
38
+ }
39
+
40
+ const authentication = this.config.authentication;
41
+
42
+ if (!authentication || !('basic' in authentication)) {
43
+ return;
44
+ }
45
+
46
+ if (!EMAIL_SCHEMA.safeParse(authentication.basic.email).success) {
47
+ console.warn(NON_EMAIL_BASIC_AUTH_WARNING);
48
+ }
49
+ }
50
+
35
51
  protected paramSerializer(parameters: Record<string, any>): string {
36
52
  const parts: string[] = [];
37
53
 
@@ -32,6 +32,7 @@ import {
32
32
  Template,
33
33
  Themes,
34
34
  Users,
35
+ UserProperties,
35
36
  } from '../api';
36
37
 
37
38
  export class ConfluenceClient extends BaseClient {
@@ -48,10 +49,12 @@ export class ConfluenceClient extends BaseClient {
48
49
  contentAttachments = new ContentAttachments(this);
49
50
  contentBody = new ContentBody(this);
50
51
  contentChildrenAndDescendants = new ContentChildrenAndDescendants(this);
52
+ /** @deprecated Will be removed in next major version. */
51
53
  contentComments = new ContentComments(this);
52
54
  contentLabels = new ContentLabels(this);
53
55
  contentMacroBody = new ContentMacroBody(this);
54
56
  contentPermissions = new ContentPermissions(this);
57
+ /** @deprecated Will be removed in next major version. */
55
58
  contentProperties = new ContentProperties(this);
56
59
  contentRestrictions = new ContentRestrictions(this);
57
60
  contentStates = new ContentStates(this);
@@ -60,6 +63,7 @@ export class ConfluenceClient extends BaseClient {
60
63
  dynamicModules = new DynamicModules(this);
61
64
  experimental = new Experimental(this);
62
65
  group = new Group(this);
66
+ /** @deprecated Will be removed in next major version. */
63
67
  inlineTasks = new InlineTasks(this);
64
68
  labelInfo = new LabelInfo(this);
65
69
  longRunningTask = new LongRunningTask(this);
@@ -68,9 +72,11 @@ export class ConfluenceClient extends BaseClient {
68
72
  settings = new Settings(this);
69
73
  space = new Space(this);
70
74
  spacePermissions = new SpacePermissions(this);
75
+ /** @deprecated Will be removed in next major version. */
71
76
  spaceProperties = new SpaceProperties(this);
72
77
  spaceSettings = new SpaceSettings(this);
73
78
  template = new Template(this);
74
79
  themes = new Themes(this);
75
80
  users = new Users(this);
81
+ userProperties = new UserProperties(this);
76
82
  }
package/src/config.ts CHANGED
@@ -9,7 +9,7 @@ import type { AxiosError } from 'axios';
9
9
  export const BasicSchema = z.strictObject({
10
10
  basic: z.strictObject({
11
11
  /** User's email associated with Atlassian account */
12
- email: z.string().email(),
12
+ email: z.string(),
13
13
  /**
14
14
  * API token generated from Atlassian account settings
15
15
  *
@@ -48,18 +48,22 @@ export const RequestConfigSchema = z.any();
48
48
  /** Middleware configuration schema */
49
49
  export const MiddlewaresSchema = z.object({
50
50
  /** Error handler middleware */
51
- onError: z.optional(z.function().args(z.any()).returns(z.void())),
51
+ onError: z.optional(z.custom<(input: unknown) => void>((value) => typeof value === 'function')),
52
52
  /** Response handler middleware */
53
- onResponse: z.optional(z.function().args(z.any()).returns(z.void())),
53
+ onResponse: z.optional(z.custom<(input: unknown) => void>((value) => typeof value === 'function')),
54
54
  });
55
55
 
56
56
  export const ConfigSchema = z.object({
57
- host: z.string().url({ message: 'Couldn\'t parse the host URL. Perhaps you forgot to add \'http://\' or \'https://\' at the beginning of the URL?' }),
57
+ host: z.url({
58
+ error:
59
+ 'Couldn\'t parse the host URL. Perhaps you forgot to add \'http://\' or \'https://\' at the beginning of the URL?',
60
+ }),
58
61
  baseRequestConfig: z.optional(RequestConfigSchema),
59
62
  authentication: z.optional(AuthenticationSchema),
60
63
  middlewares: z.optional(MiddlewaresSchema),
61
64
  /** Adds `'X-Atlassian-Token': 'no-check'` to each request header */
62
65
  noCheckAtlassianToken: z.optional(z.boolean()),
66
+ suppressWarnings: z.boolean().optional().default(false),
63
67
  /** Prefix for all API routes. */
64
68
  apiPrefix: z.optional(z.string()),
65
69
  });
@@ -1,4 +1,4 @@
1
- import * as jwt from 'atlassian-jwt';
1
+ import * as jwt from '@atlassian/atlassian-jwt';
2
2
  import type { JWT } from '~';
3
3
 
4
4
  export function createJWTAuthentication(
package/favicon.svg DELETED
@@ -1,7 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 72">
2
- <g style="" transform="matrix(1, 0, 0, 1, -214, -214.000031)">
3
- <path class="st0"
4
- d="M 231.14 281.76 C 226.01 279.28 222.08 275.78 219.33 271.27 C 216.59 266.76 215.21 261.57 215.21 255.69 C 215.21 247.92 216.99 240.91 220.55 234.67 C 224.11 228.43 229.13 223.52 235.59 219.92 C 242.06 216.33 249.47 214.53 257.84 214.53 C 263.98 214.53 269.4 215.58 274.11 217.67 C 278.81 219.76 282.37 222.77 284.79 226.69 L 273.32 236.1 C 269.66 230.74 264.14 228.06 256.76 228.06 C 251.73 228.06 247.29 229.24 243.43 231.59 C 239.57 233.94 236.59 237.14 234.46 241.19 C 232.34 245.24 231.27 249.75 231.27 254.71 C 231.27 260 232.95 264.2 236.32 267.3 C 239.68 270.4 244.4 271.95 250.48 271.95 C 257.73 271.95 263.81 269.3 268.71 264.01 L 278.12 273.61 C 271.32 281.52 261.66 285.47 249.11 285.47 C 242.26 285.48 236.27 284.24 231.14 281.76 Z"
5
- style="fill: rgb(42, 86, 163); stroke-width: 1;"></path>
6
- </g>
7
- </svg>