confluence.js 1.1.3 → 1.3.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.
- package/CHANGELOG.md +49 -0
- package/README.md +1 -57
- package/out/api/content.d.ts +24 -52
- package/out/api/content.js +15 -0
- package/out/api/contentAttachments.d.ts +10 -6
- package/out/api/contentAttachments.js +13 -0
- package/out/api/contentChildrenAndDescendants.d.ts +6 -24
- package/out/api/contentChildrenAndDescendants.js +6 -0
- package/out/api/contentPermissions.d.ts +6 -2
- package/out/api/contentPermissions.js +6 -1
- package/out/api/contentProperties.js +2 -0
- package/out/api/contentWatches.d.ts +2 -2
- package/out/api/experimental.d.ts +52 -0
- package/out/api/experimental.js +70 -0
- package/out/api/group.d.ts +30 -10
- package/out/api/group.js +31 -2
- package/out/api/index.d.ts +1 -0
- package/out/api/index.js +1 -0
- package/out/api/inlineTasks.d.ts +28 -0
- package/out/api/inlineTasks.js +21 -0
- package/out/api/models/getViewers.d.ts +6 -0
- package/out/api/models/getViewers.js +2 -0
- package/out/api/models/getViews.d.ts +6 -0
- package/out/api/models/getViews.js +2 -0
- package/out/api/models/groupCreate.d.ts +4 -0
- package/out/api/models/groupCreate.js +2 -0
- package/out/api/models/horizontalHeaderLookAndFeel.d.ts +11 -0
- package/out/api/models/horizontalHeaderLookAndFeel.js +2 -0
- package/out/api/models/index.d.ts +13 -4
- package/out/api/models/index.js +13 -4
- package/out/api/models/lookAndFeel.d.ts +3 -0
- package/out/api/models/spacePermissionCreate.d.ts +33 -0
- package/out/api/models/spacePermissionCreate.js +2 -0
- package/out/api/models/spacePermissionCustomContent.d.ts +16 -0
- package/out/api/models/spacePermissionCustomContent.js +2 -0
- package/out/api/models/spacePermissionRequest.d.ts +41 -0
- package/out/api/models/spacePermissionRequest.js +2 -0
- package/out/api/models/spacePrivateCreate.d.ts +9 -0
- package/out/api/models/spacePropertyCreate.d.ts +4 -0
- package/out/api/models/spaceUpdate.d.ts +4 -0
- package/out/api/models/taskStatusUpdate.d.ts +3 -0
- package/out/api/models/taskStatusUpdate.js +2 -0
- package/out/api/models/topNavigationLookAndFeel.d.ts +8 -0
- package/out/api/models/topNavigationLookAndFeel.js +2 -0
- package/out/api/parameters/addCustomContentPermissions.d.ts +5 -0
- package/out/api/parameters/addCustomContentPermissions.js +2 -0
- package/out/api/parameters/addLabelsToSpace.d.ts +4 -0
- package/out/api/parameters/addLabelsToSpace.js +2 -0
- package/out/api/parameters/addPermissionToSpace.d.ts +5 -0
- package/out/api/parameters/addPermissionToSpace.js +2 -0
- package/out/api/parameters/addUserToGroup.d.ts +2 -1
- package/out/api/parameters/addUserToGroupByGroupId.d.ts +2 -1
- package/out/api/parameters/archivePages.d.ts +6 -0
- package/out/api/parameters/archivePages.js +2 -0
- package/out/api/parameters/checkContentPermission.d.ts +5 -0
- package/out/api/parameters/checkContentPermission.js +2 -0
- package/out/api/parameters/deleteLabelFromSpace.d.ts +8 -0
- package/out/api/parameters/deleteLabelFromSpace.js +2 -0
- package/out/api/parameters/deleteRelationship.d.ts +38 -0
- package/out/api/parameters/deleteRelationship.js +2 -0
- package/out/api/parameters/downloadAttachment.d.ts +11 -0
- package/out/api/parameters/downloadAttachment.js +2 -0
- package/out/api/parameters/getBulkUserLookup.d.ts +0 -6
- package/out/api/parameters/getContentById.d.ts +85 -1
- package/out/api/parameters/getContentById.js +87 -0
- package/out/api/parameters/getContentChildren.d.ts +1 -0
- package/out/api/parameters/getContentProperties.d.ts +2 -0
- package/out/api/parameters/getContentProperty.d.ts +12 -0
- package/out/api/parameters/getContentVersions.d.ts +1 -1
- package/out/api/parameters/getCurrentUser.d.ts +1 -6
- package/out/api/parameters/getDescendantsOfType.d.ts +101 -0
- package/out/api/parameters/getDescendantsOfType.js +89 -0
- package/out/api/parameters/getGroupByName.d.ts +4 -0
- package/out/api/parameters/getGroupByName.js +2 -0
- package/out/api/parameters/getGroups.d.ts +2 -0
- package/out/api/parameters/getHistoryForContent.d.ts +1 -1
- package/out/api/parameters/getLabelsForSpace.d.ts +18 -0
- package/out/api/parameters/getLabelsForSpace.js +2 -0
- package/out/api/parameters/getTaskById.d.ts +4 -0
- package/out/api/parameters/getTaskById.js +2 -0
- package/out/api/parameters/getViewers.d.ts +6 -0
- package/out/api/parameters/getViewers.js +2 -0
- package/out/api/parameters/getViews.d.ts +6 -0
- package/out/api/parameters/getViews.js +2 -0
- package/out/api/parameters/index.d.ts +134 -116
- package/out/api/parameters/index.js +134 -116
- package/out/api/parameters/publishLegacyDraft.d.ts +3 -1
- package/out/api/parameters/publishSharedDraft.d.ts +3 -1
- package/out/api/parameters/restoreContentVersion.d.ts +1 -1
- package/out/api/parameters/searchByCQL.d.ts +34 -0
- package/out/api/parameters/searchByCQL.js +2 -0
- package/out/api/parameters/searchGroups.d.ts +8 -0
- package/out/api/parameters/searchGroups.js +2 -0
- package/out/api/parameters/searchUser.d.ts +27 -0
- package/out/api/parameters/searchUser.js +2 -0
- package/out/api/parameters/updateTaskById.d.ts +5 -0
- package/out/api/parameters/updateTaskById.js +2 -0
- package/out/api/relation.d.ts +12 -4
- package/out/api/relation.js +12 -2
- package/out/api/search.d.ts +12 -64
- package/out/api/search.js +19 -2
- package/out/api/settings.d.ts +2 -2
- package/out/api/settings.js +3 -0
- package/out/api/space.js +5 -1
- package/out/api/spacePermissions.d.ts +26 -2
- package/out/api/spacePermissions.js +20 -3
- package/out/api/spaceProperties.d.ts +4 -4
- package/out/api/spaceProperties.js +1 -0
- package/out/api/template.d.ts +24 -16
- package/out/clients/baseClient.d.ts +2 -5
- package/out/clients/baseClient.js +4 -30
- package/out/clients/client.d.ts +2 -3
- package/out/clients/confluenceClient.d.ts +2 -1
- package/out/clients/confluenceClient.js +1 -0
- package/out/config.d.ts +3 -2
- package/out/index.d.ts +1 -0
- package/out/index.js +2 -1
- package/package.json +24 -24
- package/src/api/content.ts +58 -52
- package/src/api/contentAttachments.ts +29 -6
- package/src/api/contentChildrenAndDescendants.ts +24 -28
- package/src/api/contentPermissions.ts +24 -7
- package/src/api/contentProperties.ts +2 -0
- package/src/api/contentWatches.ts +3 -3
- package/src/api/experimental.ts +137 -0
- package/src/api/group.ts +71 -19
- package/src/api/index.ts +1 -0
- package/src/api/inlineTasks.ts +52 -0
- package/src/api/models/getViewers.ts +6 -0
- package/src/api/models/getViews.ts +6 -0
- package/src/api/models/groupCreate.ts +4 -0
- package/src/api/models/horizontalHeaderLookAndFeel.ts +12 -0
- package/src/api/models/index.ts +13 -4
- package/src/api/models/lookAndFeel.ts +3 -0
- package/src/api/models/spacePermissionCreate.ts +34 -0
- package/src/api/models/spacePermissionCustomContent.ts +17 -0
- package/src/api/models/spacePermissionRequest.ts +42 -0
- package/src/api/models/spacePrivateCreate.ts +9 -0
- package/src/api/models/spacePropertyCreate.ts +4 -0
- package/src/api/models/spaceUpdate.ts +4 -0
- package/src/api/models/taskStatusUpdate.ts +3 -0
- package/src/api/models/topNavigationLookAndFeel.ts +8 -0
- package/src/api/parameters/addCustomContentPermissions.ts +6 -0
- package/src/api/parameters/addLabelsToSpace.ts +4 -0
- package/src/api/parameters/addPermissionToSpace.ts +6 -0
- package/src/api/parameters/addUserToGroup.ts +3 -1
- package/src/api/parameters/addUserToGroupByGroupId.ts +3 -1
- package/src/api/parameters/archivePages.ts +6 -0
- package/src/api/parameters/checkContentPermission.ts +6 -0
- package/src/api/parameters/deleteLabelFromSpace.ts +8 -0
- package/src/api/parameters/deleteRelationship.ts +38 -0
- package/src/api/parameters/downloadAttachment.ts +11 -0
- package/src/api/parameters/getBulkUserLookup.ts +0 -6
- package/src/api/parameters/getContentById.ts +86 -1
- package/src/api/parameters/getContentChildren.ts +1 -0
- package/src/api/parameters/getContentProperties.ts +2 -0
- package/src/api/parameters/getContentProperty.ts +12 -0
- package/src/api/parameters/getContentVersions.ts +1 -1
- package/src/api/parameters/getCurrentUser.ts +1 -6
- package/src/api/parameters/getDescendantsOfType.ts +102 -0
- package/src/api/parameters/getGroupByName.ts +4 -0
- package/src/api/parameters/getGroups.ts +2 -0
- package/src/api/parameters/getHistoryForContent.ts +1 -1
- package/src/api/parameters/getLabelsForSpace.ts +18 -0
- package/src/api/parameters/getTaskById.ts +4 -0
- package/src/api/parameters/getViewers.ts +6 -0
- package/src/api/parameters/getViews.ts +6 -0
- package/src/api/parameters/index.ts +134 -116
- package/src/api/parameters/publishLegacyDraft.ts +4 -1
- package/src/api/parameters/publishSharedDraft.ts +4 -1
- package/src/api/parameters/restoreContentVersion.ts +1 -1
- package/src/api/parameters/searchByCQL.ts +34 -0
- package/src/api/parameters/searchGroups.ts +8 -0
- package/src/api/parameters/searchUser.ts +27 -0
- package/src/api/parameters/updateTaskById.ts +6 -0
- package/src/api/relation.ts +33 -8
- package/src/api/search.ts +53 -73
- package/src/api/settings.ts +6 -3
- package/src/api/space.ts +4 -1
- package/src/api/spacePermissions.ts +66 -8
- package/src/api/spaceProperties.ts +5 -4
- package/src/api/template.ts +24 -16
- package/src/clients/baseClient.ts +4 -60
- package/src/clients/client.ts +2 -3
- package/src/clients/confluenceClient.ts +2 -0
- package/src/config.ts +3 -2
- package/src/index.ts +1 -0
- package/tsconfig.json +2 -1
|
@@ -218,6 +218,23 @@ export class ContentChildrenAndDescendants {
|
|
|
218
218
|
return this.client.sendRequest(config, callback, { methodName: 'getContentDescendants' });
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
+
/** @deprecated This API will be removed in the next major version. Use `getDescendantsOfType` method instead. */
|
|
222
|
+
async descendantsOfType<T = Models.ContentArray>(
|
|
223
|
+
parameters: Parameters.DescendantsOfType,
|
|
224
|
+
callback: Callback<T>
|
|
225
|
+
): Promise<void>;
|
|
226
|
+
/** @deprecated This API will be removed in the next major version. Use `getDescendantsOfType` method instead. */
|
|
227
|
+
async descendantsOfType<T = Models.ContentArray>(
|
|
228
|
+
parameters: Parameters.DescendantsOfType,
|
|
229
|
+
callback?: never
|
|
230
|
+
): Promise<T>;
|
|
231
|
+
async descendantsOfType<T = Models.ContentArray>(
|
|
232
|
+
parameters: Parameters.DescendantsOfType,
|
|
233
|
+
callback?: Callback<T>,
|
|
234
|
+
): Promise<void | T> {
|
|
235
|
+
return this.getDescendantsOfType(parameters, callback!);
|
|
236
|
+
}
|
|
237
|
+
|
|
221
238
|
/**
|
|
222
239
|
* Returns all descendants of a given type, for a piece of content. This is similar to [Get content children by
|
|
223
240
|
* type](#api-content-id-child-type-get), except that this method returns child pages at all levels, rather than just
|
|
@@ -235,8 +252,8 @@ export class ContentChildrenAndDescendants {
|
|
|
235
252
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and
|
|
236
253
|
* permission to view the content if it is a page.
|
|
237
254
|
*/
|
|
238
|
-
async
|
|
239
|
-
parameters: Parameters.
|
|
255
|
+
async getDescendantsOfType<T = Models.ContentArray>(
|
|
256
|
+
parameters: Parameters.GetDescendantsOfType,
|
|
240
257
|
callback: Callback<T>
|
|
241
258
|
): Promise<void>;
|
|
242
259
|
/**
|
|
@@ -256,12 +273,12 @@ export class ContentChildrenAndDescendants {
|
|
|
256
273
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and
|
|
257
274
|
* permission to view the content if it is a page.
|
|
258
275
|
*/
|
|
259
|
-
async
|
|
260
|
-
parameters: Parameters.
|
|
276
|
+
async getDescendantsOfType<T = Models.ContentArray>(
|
|
277
|
+
parameters: Parameters.GetDescendantsOfType,
|
|
261
278
|
callback?: never
|
|
262
279
|
): Promise<T>;
|
|
263
|
-
async
|
|
264
|
-
parameters: Parameters.
|
|
280
|
+
async getDescendantsOfType<T = Models.ContentArray>(
|
|
281
|
+
parameters: Parameters.GetDescendantsOfType,
|
|
265
282
|
callback?: Callback<T>,
|
|
266
283
|
): Promise<void | T> {
|
|
267
284
|
const config: RequestConfig = {
|
|
@@ -271,6 +288,7 @@ export class ContentChildrenAndDescendants {
|
|
|
271
288
|
depth: parameters.depth,
|
|
272
289
|
start: parameters.start,
|
|
273
290
|
limit: parameters.limit,
|
|
291
|
+
expand: parameters.expand,
|
|
274
292
|
},
|
|
275
293
|
};
|
|
276
294
|
|
|
@@ -283,17 +301,6 @@ export class ContentChildrenAndDescendants {
|
|
|
283
301
|
* copied page is defined using the destinationPageId in the request body. The titleOptions object defines the rules
|
|
284
302
|
* of renaming page titles during the copy; for example, search and replace can be used in conjunction to rewrite the
|
|
285
303
|
* copied page titles.
|
|
286
|
-
*
|
|
287
|
-
* Response example:
|
|
288
|
-
* <pre>
|
|
289
|
-
* {
|
|
290
|
-
* "id" : "1180606",
|
|
291
|
-
* "links" : {
|
|
292
|
-
* "status" : "/rest/api/longtask/1180606"
|
|
293
|
-
* }
|
|
294
|
-
* }
|
|
295
|
-
* </pre>
|
|
296
|
-
* Use the /longtask/<taskId> REST API to get the copy task status.
|
|
297
304
|
*/
|
|
298
305
|
async copyPageHierarchy<T = unknown>(parameters: Parameters.CopyPageHierarchy, callback: Callback<T>): Promise<void>;
|
|
299
306
|
/**
|
|
@@ -302,17 +309,6 @@ export class ContentChildrenAndDescendants {
|
|
|
302
309
|
* copied page is defined using the destinationPageId in the request body. The titleOptions object defines the rules
|
|
303
310
|
* of renaming page titles during the copy; for example, search and replace can be used in conjunction to rewrite the
|
|
304
311
|
* copied page titles.
|
|
305
|
-
*
|
|
306
|
-
* Response example:
|
|
307
|
-
* <pre>
|
|
308
|
-
* {
|
|
309
|
-
* "id" : "1180606",
|
|
310
|
-
* "links" : {
|
|
311
|
-
* "status" : "/rest/api/longtask/1180606"
|
|
312
|
-
* }
|
|
313
|
-
* }
|
|
314
|
-
* </pre>
|
|
315
|
-
* Use the /longtask/<taskId> REST API to get the copy task status.
|
|
316
312
|
*/
|
|
317
313
|
async copyPageHierarchy<T = unknown>(parameters: Parameters.CopyPageHierarchy, callback?: never): Promise<T>;
|
|
318
314
|
async copyPageHierarchy<T = unknown>(
|
|
@@ -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
|
|
25
|
-
parameters: Parameters.
|
|
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
|
|
43
|
-
parameters: Parameters.
|
|
59
|
+
async checkContentPermission<T = Models.PermissionCheckResponse>(
|
|
60
|
+
parameters: Parameters.CheckContentPermission,
|
|
44
61
|
callback?: never
|
|
45
62
|
): Promise<T>;
|
|
46
|
-
async
|
|
47
|
-
parameters: Parameters.
|
|
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: '
|
|
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,
|
|
@@ -125,6 +126,7 @@ export class ContentProperties {
|
|
|
125
126
|
method: 'GET',
|
|
126
127
|
params: {
|
|
127
128
|
expand: parameters.expand,
|
|
129
|
+
status: parameters.status,
|
|
128
130
|
},
|
|
129
131
|
};
|
|
130
132
|
|
|
@@ -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.
|
|
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.
|
|
88
|
+
async getWatchesForSpace<T = Models.SpaceWatchArray>(
|
|
89
89
|
parameters: Parameters.GetWatchesForSpace,
|
|
90
90
|
callback?: never
|
|
91
91
|
): Promise<T>;
|
|
92
|
-
async getWatchesForSpace<T = Models.
|
|
92
|
+
async getWatchesForSpace<T = Models.SpaceWatchArray>(
|
|
93
93
|
parameters: Parameters.GetWatchesForSpace,
|
|
94
94
|
callback?: Callback<T>,
|
|
95
95
|
): Promise<void | T> {
|
|
@@ -0,0 +1,137 @@
|
|
|
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
|
+
/**
|
|
11
|
+
* Returns a list of labels associated with a space. Can provide a prefix as well as other filters to select different
|
|
12
|
+
* types of labels.
|
|
13
|
+
*/
|
|
14
|
+
async getLabelsForSpace<T = Models.LabelArray>(
|
|
15
|
+
parameters: Parameters.GetLabelsForSpace,
|
|
16
|
+
callback: Callback<T>
|
|
17
|
+
): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Returns a list of labels associated with a space. Can provide a prefix as well as other filters to select different
|
|
20
|
+
* types of labels.
|
|
21
|
+
*/
|
|
22
|
+
async getLabelsForSpace<T = Models.LabelArray>(
|
|
23
|
+
parameters: Parameters.GetLabelsForSpace,
|
|
24
|
+
callback?: never
|
|
25
|
+
): Promise<T>;
|
|
26
|
+
async getLabelsForSpace<T = Models.LabelArray>(
|
|
27
|
+
parameters: Parameters.GetLabelsForSpace,
|
|
28
|
+
callback?: Callback<T>,
|
|
29
|
+
): Promise<void | T> {
|
|
30
|
+
const config: RequestConfig = {
|
|
31
|
+
url: `/api/space/${parameters.spaceKey}/label`,
|
|
32
|
+
method: 'GET',
|
|
33
|
+
params: {
|
|
34
|
+
prefix: parameters.prefix,
|
|
35
|
+
start: parameters.start,
|
|
36
|
+
limit: parameters.limit,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return this.client.sendRequest(config, callback, { methodName: 'getLabelsForSpace' });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Adds labels to a piece of content. Does not modify the existing labels.
|
|
45
|
+
*
|
|
46
|
+
* Notes:
|
|
47
|
+
*
|
|
48
|
+
* - Labels can also be added when creating content ([Create content](#api-content-post)).
|
|
49
|
+
* - Labels can be updated when updating content ([Update content](#api-content-id-put)). This will delete the existing
|
|
50
|
+
* labels and replace them with the labels in the request.
|
|
51
|
+
*
|
|
52
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.
|
|
53
|
+
*/
|
|
54
|
+
async addLabelsToSpace<T = Models.LabelArray>(
|
|
55
|
+
parameters: Parameters.AddLabelsToSpace,
|
|
56
|
+
callback: Callback<T>
|
|
57
|
+
): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Adds labels to a piece of content. Does not modify the existing labels.
|
|
60
|
+
*
|
|
61
|
+
* Notes:
|
|
62
|
+
*
|
|
63
|
+
* - Labels can also be added when creating content ([Create content](#api-content-post)).
|
|
64
|
+
* - Labels can be updated when updating content ([Update content](#api-content-id-put)). This will delete the existing
|
|
65
|
+
* labels and replace them with the labels in the request.
|
|
66
|
+
*
|
|
67
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.
|
|
68
|
+
*/
|
|
69
|
+
async addLabelsToSpace<T = Models.LabelArray>(parameters: Parameters.AddLabelsToSpace, callback?: never): Promise<T>;
|
|
70
|
+
async addLabelsToSpace<T = Models.LabelArray>(
|
|
71
|
+
parameters: Parameters.AddLabelsToSpace,
|
|
72
|
+
callback?: Callback<T>,
|
|
73
|
+
): Promise<void | T> {
|
|
74
|
+
const config: RequestConfig = {
|
|
75
|
+
url: `/api/space/${parameters.spaceKey}/label`,
|
|
76
|
+
method: 'POST',
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return this.client.sendRequest(config, callback, { methodName: 'addLabelsToSpace' });
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async deleteLabelFromSpace<T = void>(
|
|
83
|
+
parameters: Parameters.DeleteLabelFromSpace,
|
|
84
|
+
callback: Callback<T>
|
|
85
|
+
): Promise<void>;
|
|
86
|
+
async deleteLabelFromSpace<T = void>(parameters: Parameters.DeleteLabelFromSpace, callback?: never): Promise<T>;
|
|
87
|
+
async deleteLabelFromSpace<T = void>(
|
|
88
|
+
parameters: Parameters.DeleteLabelFromSpace,
|
|
89
|
+
callback?: Callback<T>,
|
|
90
|
+
): Promise<void | T> {
|
|
91
|
+
const config: RequestConfig = {
|
|
92
|
+
url: `/api/space/${parameters.spaceKey}/label`,
|
|
93
|
+
method: 'DELETE',
|
|
94
|
+
params: {
|
|
95
|
+
name: parameters.name,
|
|
96
|
+
prefix: parameters.prefix,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return this.client.sendRequest(config, callback, { methodName: 'deleteLabelFromSpace' });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Get the total number of views a piece of content has. */
|
|
104
|
+
async getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback: Callback<T>): Promise<void>;
|
|
105
|
+
/** Get the total number of views a piece of content has. */
|
|
106
|
+
async getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback?: never): Promise<T>;
|
|
107
|
+
async getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback?: Callback<T>): Promise<void | T> {
|
|
108
|
+
const config: RequestConfig = {
|
|
109
|
+
url: `/api/analytics/content/${parameters.contentId}/views`,
|
|
110
|
+
method: 'GET',
|
|
111
|
+
params: {
|
|
112
|
+
fromDate: parameters.fromDate,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return this.client.sendRequest(config, callback, { methodName: 'getViews' });
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Get the total number of distinct viewers a piece of content has. */
|
|
120
|
+
async getViewers<T = Models.GetViewers>(parameters: Parameters.GetViewers, callback: Callback<T>): Promise<void>;
|
|
121
|
+
/** Get the total number of distinct viewers a piece of content has. */
|
|
122
|
+
async getViewers<T = Models.GetViewers>(parameters: Parameters.GetViewers, callback?: never): Promise<T>;
|
|
123
|
+
async getViewers<T = Models.GetViewers>(
|
|
124
|
+
parameters: Parameters.GetViewers,
|
|
125
|
+
callback?: Callback<T>,
|
|
126
|
+
): Promise<void | T> {
|
|
127
|
+
const config: RequestConfig = {
|
|
128
|
+
url: `/api/analytics/content/${parameters.contentId}/viewers`,
|
|
129
|
+
method: 'GET',
|
|
130
|
+
params: {
|
|
131
|
+
fromDate: parameters.fromDate,
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
return this.client.sendRequest(config, callback, { methodName: 'getViewers' });
|
|
136
|
+
}
|
|
137
|
+
}
|
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
|
|
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
|
|
179
|
-
async
|
|
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: '
|
|
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.
|
|
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.
|
|
239
|
+
async getMembersByQueryParam<T = Models.UserArray>(
|
|
205
240
|
parameters: Parameters.GetMembersByQueryParam,
|
|
206
241
|
callback?: never
|
|
207
242
|
): Promise<T>;
|
|
208
|
-
async getMembersByQueryParam<T = Models.
|
|
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.
|
|
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.
|
|
246
|
-
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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: '
|
|
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.
|
|
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.
|
|
428
|
+
async getGroupMembersByGroupId<T = Models.UserArray>(
|
|
380
429
|
parameters: Parameters.GetGroupMembersByGroupId,
|
|
381
430
|
callback?: never
|
|
382
431
|
): Promise<T>;
|
|
383
|
-
async getGroupMembersByGroupId<T = Models.
|
|
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';
|
package/src/api/inlineTasks.ts
CHANGED
|
@@ -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,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
|
+
}
|