confluence.js 1.1.3 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -0
  3. package/out/api/content.d.ts +24 -52
  4. package/out/api/content.js +14 -0
  5. package/out/api/contentAttachments.d.ts +10 -6
  6. package/out/api/contentAttachments.js +12 -0
  7. package/out/api/contentChildrenAndDescendants.d.ts +6 -24
  8. package/out/api/contentChildrenAndDescendants.js +6 -0
  9. package/out/api/contentPermissions.d.ts +6 -2
  10. package/out/api/contentPermissions.js +6 -1
  11. package/out/api/contentProperties.js +1 -0
  12. package/out/api/contentWatches.d.ts +2 -2
  13. package/out/api/experimental.d.ts +16 -0
  14. package/out/api/experimental.js +34 -0
  15. package/out/api/group.d.ts +30 -10
  16. package/out/api/group.js +31 -2
  17. package/out/api/index.d.ts +1 -0
  18. package/out/api/index.js +1 -0
  19. package/out/api/inlineTasks.d.ts +28 -0
  20. package/out/api/inlineTasks.js +21 -0
  21. package/out/api/models/getViewers.d.ts +6 -0
  22. package/out/api/models/getViewers.js +2 -0
  23. package/out/api/models/getViews.d.ts +6 -0
  24. package/out/api/models/getViews.js +2 -0
  25. package/out/api/models/groupCreate.d.ts +4 -0
  26. package/out/api/models/groupCreate.js +2 -0
  27. package/out/api/models/horizontalHeaderLookAndFeel.d.ts +11 -0
  28. package/out/api/models/horizontalHeaderLookAndFeel.js +2 -0
  29. package/out/api/models/index.d.ts +13 -4
  30. package/out/api/models/index.js +13 -4
  31. package/out/api/models/lookAndFeel.d.ts +3 -0
  32. package/out/api/models/spacePermissionCreate.d.ts +33 -0
  33. package/out/api/models/spacePermissionCreate.js +2 -0
  34. package/out/api/models/spacePermissionCustomContent.d.ts +16 -0
  35. package/out/api/models/spacePermissionCustomContent.js +2 -0
  36. package/out/api/models/spacePermissionRequest.d.ts +41 -0
  37. package/out/api/models/spacePermissionRequest.js +2 -0
  38. package/out/api/models/spacePrivateCreate.d.ts +9 -0
  39. package/out/api/models/spacePropertyCreate.d.ts +4 -0
  40. package/out/api/models/spaceUpdate.d.ts +4 -0
  41. package/out/api/models/taskStatusUpdate.d.ts +3 -0
  42. package/out/api/models/taskStatusUpdate.js +2 -0
  43. package/out/api/models/topNavigationLookAndFeel.d.ts +8 -0
  44. package/out/api/models/topNavigationLookAndFeel.js +2 -0
  45. package/out/api/parameters/addCustomContentPermissions.d.ts +5 -0
  46. package/out/api/parameters/addCustomContentPermissions.js +2 -0
  47. package/out/api/parameters/addPermissionToSpace.d.ts +5 -0
  48. package/out/api/parameters/addPermissionToSpace.js +2 -0
  49. package/out/api/parameters/addUserToGroup.d.ts +2 -1
  50. package/out/api/parameters/addUserToGroupByGroupId.d.ts +2 -1
  51. package/out/api/parameters/archivePages.d.ts +6 -0
  52. package/out/api/parameters/archivePages.js +2 -0
  53. package/out/api/parameters/checkContentPermission.d.ts +5 -0
  54. package/out/api/parameters/checkContentPermission.js +2 -0
  55. package/out/api/parameters/deleteRelationship.d.ts +38 -0
  56. package/out/api/parameters/deleteRelationship.js +2 -0
  57. package/out/api/parameters/downloadAttachment.d.ts +11 -0
  58. package/out/api/parameters/downloadAttachment.js +2 -0
  59. package/out/api/parameters/getContentProperties.d.ts +2 -0
  60. package/out/api/parameters/getDescendantsOfType.d.ts +101 -0
  61. package/out/api/parameters/getDescendantsOfType.js +89 -0
  62. package/out/api/parameters/getGroupByName.d.ts +4 -0
  63. package/out/api/parameters/getGroupByName.js +2 -0
  64. package/out/api/parameters/getGroups.d.ts +2 -0
  65. package/out/api/parameters/getTaskById.d.ts +4 -0
  66. package/out/api/parameters/getTaskById.js +2 -0
  67. package/out/api/parameters/getViewers.d.ts +6 -0
  68. package/out/api/parameters/getViewers.js +2 -0
  69. package/out/api/parameters/getViews.d.ts +6 -0
  70. package/out/api/parameters/getViews.js +2 -0
  71. package/out/api/parameters/index.d.ts +131 -116
  72. package/out/api/parameters/index.js +131 -116
  73. package/out/api/parameters/publishLegacyDraft.d.ts +3 -1
  74. package/out/api/parameters/publishSharedDraft.d.ts +3 -1
  75. package/out/api/parameters/searchByCQL.d.ts +34 -0
  76. package/out/api/parameters/searchByCQL.js +2 -0
  77. package/out/api/parameters/searchGroups.d.ts +8 -0
  78. package/out/api/parameters/searchGroups.js +2 -0
  79. package/out/api/parameters/searchUser.d.ts +20 -0
  80. package/out/api/parameters/searchUser.js +2 -0
  81. package/out/api/parameters/updateTaskById.d.ts +5 -0
  82. package/out/api/parameters/updateTaskById.js +2 -0
  83. package/out/api/relation.d.ts +12 -4
  84. package/out/api/relation.js +12 -2
  85. package/out/api/search.d.ts +12 -64
  86. package/out/api/search.js +19 -2
  87. package/out/api/settings.d.ts +2 -2
  88. package/out/api/settings.js +3 -0
  89. package/out/api/space.js +3 -0
  90. package/out/api/spacePermissions.d.ts +26 -2
  91. package/out/api/spacePermissions.js +20 -3
  92. package/out/api/spaceProperties.d.ts +4 -4
  93. package/out/api/spaceProperties.js +1 -0
  94. package/out/clients/baseClient.js +1 -1
  95. package/out/clients/confluenceClient.d.ts +2 -1
  96. package/out/clients/confluenceClient.js +1 -0
  97. package/package.json +6 -6
  98. package/src/api/content.ts +57 -52
  99. package/src/api/contentAttachments.ts +28 -6
  100. package/src/api/contentChildrenAndDescendants.ts +24 -28
  101. package/src/api/contentPermissions.ts +24 -7
  102. package/src/api/contentProperties.ts +1 -0
  103. package/src/api/contentWatches.ts +3 -3
  104. package/src/api/experimental.ts +44 -0
  105. package/src/api/group.ts +71 -19
  106. package/src/api/index.ts +1 -0
  107. package/src/api/inlineTasks.ts +52 -0
  108. package/src/api/models/getViewers.ts +6 -0
  109. package/src/api/models/getViews.ts +6 -0
  110. package/src/api/models/groupCreate.ts +4 -0
  111. package/src/api/models/horizontalHeaderLookAndFeel.ts +12 -0
  112. package/src/api/models/index.ts +13 -4
  113. package/src/api/models/lookAndFeel.ts +3 -0
  114. package/src/api/models/spacePermissionCreate.ts +34 -0
  115. package/src/api/models/spacePermissionCustomContent.ts +17 -0
  116. package/src/api/models/spacePermissionRequest.ts +42 -0
  117. package/src/api/models/spacePrivateCreate.ts +9 -0
  118. package/src/api/models/spacePropertyCreate.ts +4 -0
  119. package/src/api/models/spaceUpdate.ts +4 -0
  120. package/src/api/models/taskStatusUpdate.ts +3 -0
  121. package/src/api/models/topNavigationLookAndFeel.ts +8 -0
  122. package/src/api/parameters/addCustomContentPermissions.ts +6 -0
  123. package/src/api/parameters/addPermissionToSpace.ts +6 -0
  124. package/src/api/parameters/addUserToGroup.ts +3 -1
  125. package/src/api/parameters/addUserToGroupByGroupId.ts +3 -1
  126. package/src/api/parameters/archivePages.ts +6 -0
  127. package/src/api/parameters/checkContentPermission.ts +6 -0
  128. package/src/api/parameters/deleteRelationship.ts +38 -0
  129. package/src/api/parameters/downloadAttachment.ts +11 -0
  130. package/src/api/parameters/getContentProperties.ts +2 -0
  131. package/src/api/parameters/getDescendantsOfType.ts +102 -0
  132. package/src/api/parameters/getGroupByName.ts +4 -0
  133. package/src/api/parameters/getGroups.ts +2 -0
  134. package/src/api/parameters/getTaskById.ts +4 -0
  135. package/src/api/parameters/getViewers.ts +6 -0
  136. package/src/api/parameters/getViews.ts +6 -0
  137. package/src/api/parameters/index.ts +131 -116
  138. package/src/api/parameters/publishLegacyDraft.ts +4 -1
  139. package/src/api/parameters/publishSharedDraft.ts +4 -1
  140. package/src/api/parameters/searchByCQL.ts +34 -0
  141. package/src/api/parameters/searchGroups.ts +8 -0
  142. package/src/api/parameters/searchUser.ts +20 -0
  143. package/src/api/parameters/updateTaskById.ts +6 -0
  144. package/src/api/relation.ts +33 -8
  145. package/src/api/search.ts +53 -73
  146. package/src/api/settings.ts +6 -3
  147. package/src/api/space.ts +3 -0
  148. package/src/api/spacePermissions.ts +66 -8
  149. package/src/api/spaceProperties.ts +5 -4
  150. package/src/clients/baseClient.ts +2 -2
  151. package/src/clients/confluenceClient.ts +2 -0
@@ -7,6 +7,23 @@ import { RequestConfig } from '../requestConfig';
7
7
  export class ContentPermissions {
8
8
  constructor(private client: Client) {}
9
9
 
10
+ /** @deprecated Will be removed in the next major version. Use `checkContentPermission` method instead. */
11
+ async permissionCheck<T = Models.PermissionCheckResponse>(
12
+ parameters: Parameters.PermissionCheck,
13
+ callback: Callback<T>
14
+ ): Promise<void>;
15
+ /** @deprecated Will be removed in the next major version. Use `checkContentPermission` method instead. */
16
+ async permissionCheck<T = Models.PermissionCheckResponse>(
17
+ parameters: Parameters.PermissionCheck,
18
+ callback?: never
19
+ ): Promise<T>;
20
+ async permissionCheck<T = Models.PermissionCheckResponse>(
21
+ parameters: Parameters.PermissionCheck,
22
+ callback?: Callback<T>,
23
+ ): Promise<void | T> {
24
+ return this.checkContentPermission(parameters, callback!);
25
+ }
26
+
10
27
  /**
11
28
  * Check if a user or a group can perform an operation to the specified content. The `operation` to check must be
12
29
  * provided. The user’s account ID or the ID of the group can be provided in the `subject` to check permissions
@@ -21,8 +38,8 @@ export class ContentPermissions {
21
38
  * ('Can use' global permission) if checking permission for self, otherwise 'Confluence Administrator' global
22
39
  * permission is required.
23
40
  */
24
- async permissionCheck<T = Models.PermissionCheckResponse>(
25
- parameters: Parameters.PermissionCheck,
41
+ async checkContentPermission<T = Models.PermissionCheckResponse>(
42
+ parameters: Parameters.CheckContentPermission,
26
43
  callback: Callback<T>
27
44
  ): Promise<void>;
28
45
  /**
@@ -39,12 +56,12 @@ export class ContentPermissions {
39
56
  * ('Can use' global permission) if checking permission for self, otherwise 'Confluence Administrator' global
40
57
  * permission is required.
41
58
  */
42
- async permissionCheck<T = Models.PermissionCheckResponse>(
43
- parameters: Parameters.PermissionCheck,
59
+ async checkContentPermission<T = Models.PermissionCheckResponse>(
60
+ parameters: Parameters.CheckContentPermission,
44
61
  callback?: never
45
62
  ): Promise<T>;
46
- async permissionCheck<T = Models.PermissionCheckResponse>(
47
- parameters: Parameters.PermissionCheck,
63
+ async checkContentPermission<T = Models.PermissionCheckResponse>(
64
+ parameters: Parameters.CheckContentPermission,
48
65
  callback?: Callback<T>,
49
66
  ): Promise<void | T> {
50
67
  const config: RequestConfig = {
@@ -56,6 +73,6 @@ export class ContentPermissions {
56
73
  },
57
74
  };
58
75
 
59
- return this.client.sendRequest(config, callback, { methodName: 'permissionCheck' });
76
+ return this.client.sendRequest(config, callback, { methodName: 'checkContentPermission' });
60
77
  }
61
78
  }
@@ -37,6 +37,7 @@ export class ContentProperties {
37
37
  url: `/api/content/${parameters.id}/property`,
38
38
  method: 'GET',
39
39
  params: {
40
+ key: parameters.key,
40
41
  expand: parameters.expand,
41
42
  start: parameters.start,
42
43
  limit: parameters.limit,
@@ -68,7 +68,7 @@ export class ContentWatches {
68
68
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
69
69
  * ('Can use' global permission).
70
70
  */
71
- async getWatchesForSpace<T = Models.WatchArray>(
71
+ async getWatchesForSpace<T = Models.SpaceWatchArray>(
72
72
  parameters: Parameters.GetWatchesForSpace,
73
73
  callback: Callback<T>
74
74
  ): Promise<void>;
@@ -85,11 +85,11 @@ export class ContentWatches {
85
85
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
86
86
  * ('Can use' global permission).
87
87
  */
88
- async getWatchesForSpace<T = Models.WatchArray>(
88
+ async getWatchesForSpace<T = Models.SpaceWatchArray>(
89
89
  parameters: Parameters.GetWatchesForSpace,
90
90
  callback?: never
91
91
  ): Promise<T>;
92
- async getWatchesForSpace<T = Models.WatchArray>(
92
+ async getWatchesForSpace<T = Models.SpaceWatchArray>(
93
93
  parameters: Parameters.GetWatchesForSpace,
94
94
  callback?: Callback<T>,
95
95
  ): Promise<void | T> {
@@ -0,0 +1,44 @@
1
+ import * as Models from './models';
2
+ import * as Parameters from './parameters';
3
+ import { Client } from '../clients';
4
+ import { Callback } from '../callback';
5
+ import { RequestConfig } from '../requestConfig';
6
+
7
+ export class Experimental {
8
+ constructor(private client: Client) {}
9
+
10
+ /** Get the total number of views a piece of content has. */
11
+ async getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback: Callback<T>): Promise<void>;
12
+ /** Get the total number of views a piece of content has. */
13
+ async getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback?: never): Promise<T>;
14
+ async getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback?: Callback<T>): Promise<void | T> {
15
+ const config: RequestConfig = {
16
+ url: `/api/analytics/content/${parameters.contentId}/views`,
17
+ method: 'GET',
18
+ params: {
19
+ fromDate: parameters.fromDate,
20
+ },
21
+ };
22
+
23
+ return this.client.sendRequest(config, callback, { methodName: 'getViews' });
24
+ }
25
+
26
+ /** Get the total number of distinct viewers a piece of content has. */
27
+ async getViewers<T = Models.GetViewers>(parameters: Parameters.GetViewers, callback: Callback<T>): Promise<void>;
28
+ /** Get the total number of distinct viewers a piece of content has. */
29
+ async getViewers<T = Models.GetViewers>(parameters: Parameters.GetViewers, callback?: never): Promise<T>;
30
+ async getViewers<T = Models.GetViewers>(
31
+ parameters: Parameters.GetViewers,
32
+ callback?: Callback<T>,
33
+ ): Promise<void | T> {
34
+ const config: RequestConfig = {
35
+ url: `/api/analytics/content/${parameters.contentId}/viewers`,
36
+ method: 'GET',
37
+ params: {
38
+ fromDate: parameters.fromDate,
39
+ },
40
+ };
41
+
42
+ return this.client.sendRequest(config, callback, { methodName: 'getViewers' });
43
+ }
44
+ }
package/src/api/group.ts CHANGED
@@ -34,6 +34,7 @@ export class Group {
34
34
  params: {
35
35
  start: parameters?.start,
36
36
  limit: parameters?.limit,
37
+ accessType: parameters?.accessType,
37
38
  },
38
39
  };
39
40
 
@@ -158,6 +159,37 @@ export class Group {
158
159
  return this.client.sendRequest(config, callback, { methodName: 'getGroupByGroupId' });
159
160
  }
160
161
 
162
+ /**
163
+ * Delete user group.
164
+ *
165
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: User must be a site admin.
166
+ */
167
+ async removeGroupById<T = void>(parameters: Parameters.RemoveGroupById, callback: Callback<T>): Promise<void>;
168
+ /**
169
+ * Delete user group.
170
+ *
171
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: User must be a site admin.
172
+ */
173
+ async removeGroupById<T = void>(parameters: Parameters.RemoveGroupById, callback?: never): Promise<T>;
174
+ async removeGroupById<T = void>(parameters: Parameters.RemoveGroupById, callback?: Callback<T>): Promise<void | T> {
175
+ const config: RequestConfig = {
176
+ url: '/api/group/by-id',
177
+ method: 'DELETE',
178
+ params: {
179
+ id: parameters.id,
180
+ },
181
+ };
182
+
183
+ return this.client.sendRequest(config, callback, { methodName: 'removeGroupById' });
184
+ }
185
+
186
+ /** @deprecated Will be removed in the next major version. Use `getGroupByName` instead. */
187
+ async getGroup<T = Models.Group>(parameters: Parameters.GetGroup, callback: Callback<T>): Promise<void>;
188
+ /** @deprecated Will be removed in the next major version. Use `getGroupByName` instead. */
189
+ async getGroup<T = Models.Group>(parameters: Parameters.GetGroup, callback?: never): Promise<T>;
190
+ async getGroup<T = Models.Group>(parameters: Parameters.GetGroup, callback?: Callback<T>): Promise<void | T> {
191
+ return this.getGroupByName(parameters, callback!);
192
+ }
161
193
  /**
162
194
  * Returns a user group for a given group name.
163
195
  *
@@ -166,7 +198,7 @@ export class Group {
166
198
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
167
199
  * ('Can use' global permission).
168
200
  */
169
- async getGroup<T = Models.Group>(parameters: Parameters.GetGroup, callback: Callback<T>): Promise<void>;
201
+ async getGroupByName<T = Models.Group>(parameters: Parameters.GetGroupByName, callback: Callback<T>): Promise<void>;
170
202
  /**
171
203
  * Returns a user group for a given group name.
172
204
  *
@@ -175,14 +207,17 @@ export class Group {
175
207
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
176
208
  * ('Can use' global permission).
177
209
  */
178
- async getGroup<T = Models.Group>(parameters: Parameters.GetGroup, callback?: never): Promise<T>;
179
- async getGroup<T = Models.Group>(parameters: Parameters.GetGroup, callback?: Callback<T>): Promise<void | T> {
210
+ async getGroupByName<T = Models.Group>(parameters: Parameters.GetGroupByName, callback?: never): Promise<T>;
211
+ async getGroupByName<T = Models.Group>(
212
+ parameters: Parameters.GetGroupByName,
213
+ callback?: Callback<T>,
214
+ ): Promise<void | T> {
180
215
  const config: RequestConfig = {
181
216
  url: `/api/group/${parameters.groupName}`,
182
217
  method: 'GET',
183
218
  };
184
219
 
185
- return this.client.sendRequest(config, callback, { methodName: 'getGroup' });
220
+ return this.client.sendRequest(config, callback, { methodName: 'getGroupByName' });
186
221
  }
187
222
 
188
223
  /**
@@ -191,7 +226,7 @@ export class Group {
191
226
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
192
227
  * ('Can use' global permission).
193
228
  */
194
- async getMembersByQueryParam<T = Models.UserArrayWithLinks>(
229
+ async getMembersByQueryParam<T = Models.UserArray>(
195
230
  parameters: Parameters.GetMembersByQueryParam,
196
231
  callback: Callback<T>
197
232
  ): Promise<void>;
@@ -201,11 +236,11 @@ export class Group {
201
236
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
202
237
  * ('Can use' global permission).
203
238
  */
204
- async getMembersByQueryParam<T = Models.UserArrayWithLinks>(
239
+ async getMembersByQueryParam<T = Models.UserArray>(
205
240
  parameters: Parameters.GetMembersByQueryParam,
206
241
  callback?: never
207
242
  ): Promise<T>;
208
- async getMembersByQueryParam<T = Models.UserArrayWithLinks>(
243
+ async getMembersByQueryParam<T = Models.UserArray>(
209
244
  parameters: Parameters.GetMembersByQueryParam,
210
245
  callback?: Callback<T>,
211
246
  ): Promise<void | T> {
@@ -230,7 +265,7 @@ export class Group {
230
265
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
231
266
  * ('Can use' global permission).
232
267
  */
233
- async getGroupMembers<T = Models.UserArrayWithLinks>(
268
+ async getGroupMembers<T = Models.UserArray>(
234
269
  parameters: Parameters.GetGroupMembers,
235
270
  callback: Callback<T>
236
271
  ): Promise<void>;
@@ -242,11 +277,8 @@ export class Group {
242
277
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
243
278
  * ('Can use' global permission).
244
279
  */
245
- async getGroupMembers<T = Models.UserArrayWithLinks>(
246
- parameters: Parameters.GetGroupMembers,
247
- callback?: never
248
- ): Promise<T>;
249
- async getGroupMembers<T = Models.UserArrayWithLinks>(
280
+ async getGroupMembers<T = Models.UserArray>(parameters: Parameters.GetGroupMembers, callback?: never): Promise<T>;
281
+ async getGroupMembers<T = Models.UserArray>(
250
282
  parameters: Parameters.GetGroupMembers,
251
283
  callback?: Callback<T>,
252
284
  ): Promise<void | T> {
@@ -262,12 +294,12 @@ export class Group {
262
294
  return this.client.sendRequest(config, callback, { methodName: 'getGroupMembers' });
263
295
  }
264
296
 
265
- /** Get search results of groups by partial query provided. */
297
+ /** @deprecated Will be removed in the next major version. Use `searchGroups` instead. */
266
298
  async getGroupsSearch<T = Models.GroupArrayWithLinks>(
267
299
  parameters: Parameters.GetGroupsSearch,
268
300
  callback: Callback<T>
269
301
  ): Promise<void>;
270
- /** Get search results of groups by partial query provided. */
302
+ /** @deprecated Will be removed in the next major version. Use `searchGroups` instead. */
271
303
  async getGroupsSearch<T = Models.GroupArrayWithLinks>(
272
304
  parameters: Parameters.GetGroupsSearch,
273
305
  callback?: never
@@ -275,6 +307,20 @@ export class Group {
275
307
  async getGroupsSearch<T = Models.GroupArrayWithLinks>(
276
308
  parameters: Parameters.GetGroupsSearch,
277
309
  callback?: Callback<T>,
310
+ ): Promise<void | T> {
311
+ return this.searchGroups(parameters, callback!);
312
+ }
313
+
314
+ /** Get search results of groups by partial query provided. */
315
+ async searchGroups<T = Models.GroupArrayWithLinks>(
316
+ parameters: Parameters.SearchGroups,
317
+ callback: Callback<T>
318
+ ): Promise<void>;
319
+ /** Get search results of groups by partial query provided. */
320
+ async searchGroups<T = Models.GroupArrayWithLinks>(parameters: Parameters.SearchGroups, callback?: never): Promise<T>;
321
+ async searchGroups<T = Models.GroupArrayWithLinks>(
322
+ parameters: Parameters.SearchGroups,
323
+ callback?: Callback<T>,
278
324
  ): Promise<void | T> {
279
325
  const config: RequestConfig = {
280
326
  url: '/api/group/picker',
@@ -286,7 +332,7 @@ export class Group {
286
332
  },
287
333
  };
288
334
 
289
- return this.client.sendRequest(config, callback, { methodName: 'getGroupsSearch' });
335
+ return this.client.sendRequest(config, callback, { methodName: 'searchGroups' });
290
336
  }
291
337
 
292
338
  /**
@@ -317,6 +363,9 @@ export class Group {
317
363
  params: {
318
364
  groupId: parameters.groupId,
319
365
  },
366
+ data: {
367
+ accountId: parameters.accountId,
368
+ },
320
369
  };
321
370
 
322
371
  return this.client.sendRequest(config, callback, { methodName: 'addUserToGroupByGroupId' });
@@ -364,7 +413,7 @@ export class Group {
364
413
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
365
414
  * ('Can use' global permission).
366
415
  */
367
- async getGroupMembersByGroupId<T = Models.UserArrayWithLinks>(
416
+ async getGroupMembersByGroupId<T = Models.UserArray>(
368
417
  parameters: Parameters.GetGroupMembersByGroupId,
369
418
  callback: Callback<T>
370
419
  ): Promise<void>;
@@ -376,11 +425,11 @@ export class Group {
376
425
  * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
377
426
  * ('Can use' global permission).
378
427
  */
379
- async getGroupMembersByGroupId<T = Models.UserArrayWithLinks>(
428
+ async getGroupMembersByGroupId<T = Models.UserArray>(
380
429
  parameters: Parameters.GetGroupMembersByGroupId,
381
430
  callback?: never
382
431
  ): Promise<T>;
383
- async getGroupMembersByGroupId<T = Models.UserArrayWithLinks>(
432
+ async getGroupMembersByGroupId<T = Models.UserArray>(
384
433
  parameters: Parameters.GetGroupMembersByGroupId,
385
434
  callback?: Callback<T>,
386
435
  ): Promise<void | T> {
@@ -415,6 +464,9 @@ export class Group {
415
464
  params: {
416
465
  name: parameters.name,
417
466
  },
467
+ data: {
468
+ accountId: parameters.accountId,
469
+ },
418
470
  };
419
471
 
420
472
  return this.client.sendRequest(config, callback, { methodName: 'addUserToGroup' });
package/src/api/index.ts CHANGED
@@ -12,6 +12,7 @@ export * from './contentRestrictions';
12
12
  export * from './contentVersions';
13
13
  export * from './contentWatches';
14
14
  export * from './dynamicModules';
15
+ export * from './experimental';
15
16
  export * from './group';
16
17
  export * from './inlineTasks';
17
18
  export * from './labelInfo';
@@ -51,4 +51,56 @@ export class InlineTasks {
51
51
 
52
52
  return this.client.sendRequest(config, callback, { methodName: 'searchTasks' });
53
53
  }
54
+
55
+ /**
56
+ * Returns inline task based on the global ID.
57
+ *
58
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content associated
59
+ * with the task.
60
+ */
61
+ async getTaskById<T = Models.Task>(parameters: Parameters.GetTaskById, callback: Callback<T>): Promise<void>;
62
+ /**
63
+ * Returns inline task based on the global ID.
64
+ *
65
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content associated
66
+ * with the task.
67
+ */
68
+ async getTaskById<T = Models.Task>(parameters: Parameters.GetTaskById, callback?: never): Promise<T>;
69
+ async getTaskById<T = Models.Task>(parameters: Parameters.GetTaskById, callback?: Callback<T>): Promise<void | T> {
70
+ const config: RequestConfig = {
71
+ url: `/api/inlinetasks/${parameters.inlineTaskId}`,
72
+ method: 'GET',
73
+ };
74
+
75
+ return this.client.sendRequest(config, callback, { methodName: 'getTaskById' });
76
+ }
77
+
78
+ /**
79
+ * Updates an inline tasks status given its global ID
80
+ *
81
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content associated
82
+ * with the task.
83
+ */
84
+ async updateTaskById<T = Models.Task>(parameters: Parameters.UpdateTaskById, callback: Callback<T>): Promise<void>;
85
+ /**
86
+ * Updates an inline tasks status given its global ID
87
+ *
88
+ * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content associated
89
+ * with the task.
90
+ */
91
+ async updateTaskById<T = Models.Task>(parameters: Parameters.UpdateTaskById, callback?: never): Promise<T>;
92
+ async updateTaskById<T = Models.Task>(
93
+ parameters: Parameters.UpdateTaskById,
94
+ callback?: Callback<T>,
95
+ ): Promise<void | T> {
96
+ const config: RequestConfig = {
97
+ url: `/api/inlinetasks/${parameters.inlineTaskId}`,
98
+ method: 'PUT',
99
+ data: {
100
+ status: parameters.status,
101
+ },
102
+ };
103
+
104
+ return this.client.sendRequest(config, callback, { methodName: 'updateTaskById' });
105
+ }
54
106
  }
@@ -0,0 +1,6 @@
1
+ export interface GetViewers {
2
+ /** The content ID. */
3
+ id?: number;
4
+ /** The total number of distinct viewers for the content. */
5
+ count?: number;
6
+ }
@@ -0,0 +1,6 @@
1
+ export interface GetViews {
2
+ /** The content ID. */
3
+ id?: number;
4
+ /** The total number of views for the content. */
5
+ count?: number;
6
+ }
@@ -0,0 +1,4 @@
1
+ export interface GroupCreate {
2
+ type: string;
3
+ name: string;
4
+ }
@@ -0,0 +1,12 @@
1
+ import { ButtonLookAndFeel } from './buttonLookAndFeel';
2
+ import { TopNavigationLookAndFeel } from './topNavigationLookAndFeel';
3
+ import { NavigationLookAndFeel } from './navigationLookAndFeel';
4
+ import { SearchFieldLookAndFeel } from './searchFieldLookAndFeel';
5
+
6
+ export interface HorizontalHeaderLookAndFeel {
7
+ backgroundColor: string;
8
+ button?: ButtonLookAndFeel;
9
+ primaryNavigation: TopNavigationLookAndFeel;
10
+ secondaryNavigation?: NavigationLookAndFeel;
11
+ search?: SearchFieldLookAndFeel;
12
+ }
@@ -14,8 +14,6 @@ export * from './breadcrumb';
14
14
  export * from './bulkUserLookup';
15
15
  export * from './bulkUserLookupArray';
16
16
  export * from './buttonLookAndFeel';
17
- export * from './cQLPersonalDataConvertedQueries';
18
- export * from './cQLPersonalDataMigrationRequest';
19
17
  export * from './changedValue';
20
18
  export * from './connectModule';
21
19
  export * from './connectModules';
@@ -30,8 +28,8 @@ export * from './contentBlueprintDraft';
30
28
  export * from './contentBody';
31
29
  export * from './contentBodyCreate';
32
30
  export * from './contentBodyCreateStorage';
33
- export * from './contentChildType';
34
31
  export * from './contentChildren';
32
+ export * from './contentChildType';
35
33
  export * from './contentComment';
36
34
  export * from './contentCreate';
37
35
  export * from './contentHistory';
@@ -59,17 +57,23 @@ export * from './copyPageHierarchyRequest';
59
57
  export * from './copyPageHierarchyTitleOptions';
60
58
  export * from './copyPageRequest';
61
59
  export * from './copyPageRequestDestination';
60
+ export * from './cQLPersonalDataConvertedQueries';
61
+ export * from './cQLPersonalDataMigrationRequest';
62
62
  export * from './deletedSpace';
63
63
  export * from './dynamicModulesErrorMessage';
64
64
  export * from './embeddable';
65
65
  export * from './embeddedContent';
66
66
  export * from './genericLinks';
67
67
  export * from './getRestrictionsByOperation';
68
+ export * from './getViewers';
69
+ export * from './getViews';
68
70
  export * from './group';
69
71
  export * from './groupArray';
70
72
  export * from './groupArrayWithLinks';
73
+ export * from './groupCreate';
71
74
  export * from './groupName';
72
75
  export * from './headerLookAndFeel';
76
+ export * from './horizontalHeaderLookAndFeel';
73
77
  export * from './icon';
74
78
  export * from './label';
75
79
  export * from './labelArray';
@@ -112,6 +116,9 @@ export * from './spaceCreate';
112
116
  export * from './spaceDescription';
113
117
  export * from './spaceDescriptionCreate';
114
118
  export * from './spacePermission';
119
+ export * from './spacePermissionCreate';
120
+ export * from './spacePermissionCustomContent';
121
+ export * from './spacePermissionRequest';
115
122
  export * from './spacePermissionV2';
116
123
  export * from './spacePrivateCreate';
117
124
  export * from './spaceProperty';
@@ -129,17 +136,19 @@ export * from './superBatchWebResources';
129
136
  export * from './systemInfoEntity';
130
137
  export * from './task';
131
138
  export * from './taskPageResponse';
139
+ export * from './taskStatusUpdate';
132
140
  export * from './theme';
133
141
  export * from './themeArray';
134
142
  export * from './themeNoLinks';
135
143
  export * from './themeUpdate';
144
+ export * from './topNavigationLookAndFeel';
136
145
  export * from './user';
137
146
  export * from './userAnonymous';
138
147
  export * from './userArray';
139
148
  export * from './userArrayWithLinks';
140
149
  export * from './userDetails';
141
- export * from './userWatch';
142
150
  export * from './usersUserKeys';
151
+ export * from './userWatch';
143
152
  export * from './version';
144
153
  export * from './versionArray';
145
154
  export * from './versionRestore';
@@ -1,6 +1,7 @@
1
1
  import { MenusLookAndFeel } from './menusLookAndFeel';
2
2
  import { HeaderLookAndFeel } from './headerLookAndFeel';
3
3
  import { ContentLookAndFeel } from './contentLookAndFeel';
4
+ import { HorizontalHeaderLookAndFeel } from './horizontalHeaderLookAndFeel';
4
5
 
5
6
  export interface LookAndFeel {
6
7
  headings: {
@@ -15,4 +16,6 @@ export interface LookAndFeel {
15
16
  bordersAndDividers: {
16
17
  color: string;
17
18
  };
19
+ horizontalHeader?: HorizontalHeaderLookAndFeel;
20
+ spaceReference?: unknown;
18
21
  }
@@ -0,0 +1,34 @@
1
+ import { User } from './user';
2
+ import { GroupCreate } from './groupCreate';
3
+ import { OperationCheckResult } from './operationCheckResult';
4
+
5
+ /**
6
+ * This object represents a permission for given space. Permissions consist of* at least one operation object with an
7
+ * accompanying subjects object.
8
+ *
9
+ * The following combinations of `operation` and `targetType` values are valid for the `operation` object:
10
+ *
11
+ * - 'create': 'page', 'blogpost', 'comment', 'attachment'
12
+ * - 'read': 'space'
13
+ * - 'delete': 'page', 'blogpost', 'comment', 'attachment'
14
+ * - 'export': 'space'
15
+ * - 'administer': 'space'
16
+ */
17
+ export interface SpacePermissionCreate {
18
+ /** The users and/or groups that the permission applies to. */
19
+ subjects: {
20
+ user?: {
21
+ results: User[];
22
+ size: number;
23
+ };
24
+ group?: {
25
+ results: GroupCreate[];
26
+ size: number;
27
+ };
28
+ };
29
+ operation: OperationCheckResult;
30
+ /** Grant anonymous users permission to use the operation. */
31
+ anonymousAccess: boolean;
32
+ /** Grants access to unlicensed users from JIRA Service Desk when used with the 'read space' operation. */
33
+ unlicensedAccess: boolean;
34
+ }
@@ -0,0 +1,17 @@
1
+ import { PermissionSubject } from './permissionSubject';
2
+
3
+ /**
4
+ * This object represents a list of space permissions for custom content type for an individual user. Permissions
5
+ * consist of* a subjects object and a list with at least one operation object.
6
+ */
7
+ export interface SpacePermissionCustomContent {
8
+ subject: PermissionSubject;
9
+ operations: {
10
+ /** The operation type */
11
+ key: string;
12
+ /** The custom content type */
13
+ target: string;
14
+ /** Grant or restrict access */
15
+ access: boolean;
16
+ }[];
17
+ }
@@ -0,0 +1,42 @@
1
+ import { PermissionSubject } from './permissionSubject';
2
+ import { GenericLinks } from './genericLinks';
3
+
4
+ /**
5
+ * This object represents the request for the single space permission. Permissions consist of* at least one operation
6
+ * object with an accompanying subjects object.
7
+ *
8
+ * The following combinations of `operation.key` and `operation.target` values are valid for the `operation` object:
9
+ *
10
+ * ```bash
11
+ * 'create': 'page', 'blogpost', 'comment', 'attachment'
12
+ * 'read': 'space'
13
+ * 'delete': 'page', 'blogpost', 'comment', 'attachment', 'space'
14
+ * 'export': 'space'
15
+ * 'administer': 'space'
16
+ * 'archive': 'page'
17
+ * 'restrict_content': 'space'
18
+ * ```
19
+ *
20
+ * For example, to enable Delete Own permission, set the `operation` object to the following:
21
+ *
22
+ * "operation": {
23
+ * "key": "delete",
24
+ * "target": "space"
25
+ * }
26
+ *
27
+ * To enable Add/Delete Restrictions permissions, set the `operation` object to the following:
28
+ *
29
+ * "operation": {
30
+ * "key": "restrict_content",
31
+ * "target": "space"
32
+ * }
33
+ */
34
+ export interface SpacePermissionRequest {
35
+ subject: PermissionSubject;
36
+ operation: {
37
+ key: string;
38
+ /** The space or content type that the operation applies to. */
39
+ target: string;
40
+ };
41
+ links?: GenericLinks;
42
+ }
@@ -1,4 +1,5 @@
1
1
  import { SpaceDescriptionCreate } from './spaceDescriptionCreate';
2
+ import { SpacePermissionCreate } from './spacePermissionCreate';
2
3
 
3
4
  /** This is the request object used when creating a new private space. */
4
5
  export interface SpacePrivateCreate {
@@ -7,4 +8,12 @@ export interface SpacePrivateCreate {
7
8
  /** The name of the new space. */
8
9
  name: string;
9
10
  description?: SpaceDescriptionCreate;
11
+ /**
12
+ * The permissions for the new space. If no permissions are provided, the [Confluence default space
13
+ * permissions](https://confluence.atlassian.com/x/UAgzKw#CreateaSpace-Spacepermissions) are applied. Note that if
14
+ * permissions are provided, the space is created with only the provided set of permissions, not including the default
15
+ * space permissions. Space permissions can be modified after creation using the space permissions endpoints, and a
16
+ * private space can be created using the create private space endpoint.
17
+ */
18
+ permissions?: SpacePermissionCreate[];
10
19
  }
@@ -4,4 +4,8 @@ export interface SpacePropertyCreate {
4
4
  /** The key of the new property. */
5
5
  key: string;
6
6
  value: PropertyValue;
7
+ space?: {
8
+ /** The key of the space */
9
+ key?: string;
10
+ };
7
11
  }