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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
### 1.3.0
|
|
4
|
+
|
|
5
|
+
- Telemetry removed (deprecated)
|
|
6
|
+
- Fixed bug with spaceKeys in `client.space.getSpaces` ([#14](https://github.com/MrRefactoring/confluence.js/issues/14) Thanks [David Sanchez](https://github.com/emulienfou) for catching)
|
|
7
|
+
- Fixed bug with attachment download ([#15](https://github.com/MrRefactoring/confluence.js/issues/15) Thanks [Martin Reinhardt](https://github.com/hypery2k) for catching)
|
|
8
|
+
|
|
9
|
+
### 1.2.2
|
|
10
|
+
|
|
11
|
+
- JSDOC improvements
|
|
12
|
+
- New experimental endpoints
|
|
13
|
+
- Small improvements
|
|
14
|
+
|
|
15
|
+
### 1.2.1
|
|
16
|
+
|
|
17
|
+
- Vulnerabilities fixes.
|
|
18
|
+
- Dependencies updated.
|
|
19
|
+
- Docs updated
|
|
20
|
+
- `expand` property added to `getContentById` method.
|
|
21
|
+
|
|
22
|
+
### 1.2.0
|
|
23
|
+
|
|
24
|
+
- Cloud API
|
|
25
|
+
- `archivePages` method added to `Content`.
|
|
26
|
+
- `publishLegacyDraft` request fixed in `Content` class.
|
|
27
|
+
- `publishSharedDraft` request fixed in `Content` class.
|
|
28
|
+
- `downloadAttachment` method added to `ContentAttachments`.
|
|
29
|
+
- `descendantsOfType` renamed to `getDescendantsOfType` in `ContentChildrenAndDescendants`.
|
|
30
|
+
- `permissionCheck` renamed to `checkContentPermission` in `ContentPermissions`.
|
|
31
|
+
- `key` property added to `getContentProperties` request in `ContentProperties`.
|
|
32
|
+
- Added `Experemental` API.
|
|
33
|
+
- `accessType` property added to `getGroups` request in `Group`.
|
|
34
|
+
- `removeGroupById` method added to `Group`.
|
|
35
|
+
- `getGroup` renamed to `getGroupByName` in `Group`.
|
|
36
|
+
- `getGroupsSearch` renamed to `searchGroups` in `Group`.
|
|
37
|
+
- `accountId` property added to `addUserToGroupByGroupId` in `Group`.
|
|
38
|
+
- `accountId` property added to `addUserToGroup` in `Group`.
|
|
39
|
+
- `getTaskById` method added to `InlineTasks`.
|
|
40
|
+
- `updateTaskById` method added to `InlineTasks`.
|
|
41
|
+
- `GetRelationship` renamed to `getRelationship` in `Relation`.
|
|
42
|
+
- `delete` renamed to `deleteRelationship` in `Relation`.
|
|
43
|
+
- `search` renamed to `searchByCQL` in `Search`.
|
|
44
|
+
- `userSearch` renamed to `searchUser` in `Search`.
|
|
45
|
+
- `horizontalHeader`, `spaceReference`, `links` properties added to `updateLookAndFeelSettings` in `Settings`.
|
|
46
|
+
- `permissions` property added to `createPrivateSpace` in `Space`.
|
|
47
|
+
- `type` and `status` properties added to `updateSpace` in `Space`.
|
|
48
|
+
- `addPermission` renamed to `addPermissionToSpace` in `SpacePermissions`.
|
|
49
|
+
- `addCustomContentPermissions` method added to `SpacePermissions`.
|
|
50
|
+
- `space` property added to `createSpaceProperty` in `SpaceProperties`.
|
|
51
|
+
|
|
3
52
|
### 1.1.3
|
|
4
53
|
|
|
5
54
|
- Vulnerabilities fixed
|
package/README.md
CHANGED
|
@@ -18,9 +18,6 @@ Usability, consistency, and performance are key focuses of confluence.js, and it
|
|
|
18
18
|
## Table of contents
|
|
19
19
|
|
|
20
20
|
- [Installation](#installation)
|
|
21
|
-
- [Telemetry information collection agreement](#telemetry-information-collection-agreement)
|
|
22
|
-
- [Customizing telemetry collection data example](#customizing-telemetry-collection-data-example)
|
|
23
|
-
- [Disabling telemetry collection example](#disabling-telemetry-collection-example)
|
|
24
21
|
- [Usage](#usage)
|
|
25
22
|
- [Authentication](#authentication)
|
|
26
23
|
- [Basic](#basic-authenticationhttpsdeveloperatlassiancomcloudconfluencebasic-auth-for-rest-apis)
|
|
@@ -47,60 +44,6 @@ Install with the yarn:
|
|
|
47
44
|
yarn add confluence.js
|
|
48
45
|
```
|
|
49
46
|
|
|
50
|
-
## Telemetry information collecting agreement
|
|
51
|
-
|
|
52
|
-
The use of this library may collect, record and transmit data
|
|
53
|
-
about the operation of the library and related data, as well
|
|
54
|
-
as potentially personal data, including ip address from which
|
|
55
|
-
the request is made, user agent from the device from which the
|
|
56
|
-
request is made, version of the library used, version of the
|
|
57
|
-
telemetry sending library, name of the invoked method, authorization
|
|
58
|
-
type information (can be configured), base configuration request
|
|
59
|
-
usage information, callback information, onResponse middleware usage
|
|
60
|
-
information, onError middleware usage information, queries usage
|
|
61
|
-
information, body usage information in request, headers usage
|
|
62
|
-
information in request, HTTP response code (can be configured),
|
|
63
|
-
request start date and time and response receipt date and time
|
|
64
|
-
(can be configured), No check atlassian token flag enabling information.
|
|
65
|
-
|
|
66
|
-
The type and amount of data may vary with the version of the libraries and can be changed at any time without notice.
|
|
67
|
-
|
|
68
|
-
Telemetry data collection is enabled by default.
|
|
69
|
-
|
|
70
|
-
The following tracking parameters can be configured:
|
|
71
|
-
|
|
72
|
-
- Authentication type
|
|
73
|
-
- Request status code
|
|
74
|
-
- Request timings
|
|
75
|
-
|
|
76
|
-
#### Customizing telemetry collecting data example
|
|
77
|
-
|
|
78
|
-
```typescript
|
|
79
|
-
import { Config } from 'confluence.js';
|
|
80
|
-
|
|
81
|
-
const config: Config = {
|
|
82
|
-
host: 'https://your-domain.atlassian.net',
|
|
83
|
-
telemetry: {
|
|
84
|
-
allowedToPassAuthenticationType: false, // true by default
|
|
85
|
-
allowedToPassRequestStatusCode: true, // true by default
|
|
86
|
-
allowedToPassRequestTimings: false, // true by default
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
If you want to disable telemetry, set the `telemetry` field to `false`.
|
|
92
|
-
|
|
93
|
-
#### Disabling telemetry collection example
|
|
94
|
-
|
|
95
|
-
```typescript
|
|
96
|
-
import { Config } from 'confluence.js';
|
|
97
|
-
|
|
98
|
-
const config: Config = {
|
|
99
|
-
host: 'https://your-domain.atlassian.net',
|
|
100
|
-
telemetry: false, // Telemetry will not be collected
|
|
101
|
-
};
|
|
102
|
-
```
|
|
103
|
-
|
|
104
47
|
## Usage
|
|
105
48
|
|
|
106
49
|
#### Authentication
|
|
@@ -292,6 +235,7 @@ Available groups:
|
|
|
292
235
|
- [contentVersions](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-versions/#api-group-content-versions)
|
|
293
236
|
- [contentWatches](https://developer.atlassian.com/cloud/confluence/rest/api-group-content-watches/#api-group-content-watches)
|
|
294
237
|
- [dynamicModules](https://developer.atlassian.com/cloud/confluence/rest/api-group-dynamic-modules/#api-group-dynamic-modules)
|
|
238
|
+
- [experimental](https://developer.atlassian.com/cloud/confluence/rest/api-group-experimental/#api-group-experimental)
|
|
295
239
|
- [group](https://developer.atlassian.com/cloud/confluence/rest/api-group-group/#api-group-group)
|
|
296
240
|
- [inlineTasks](https://developer.atlassian.com/cloud/confluence/rest/api-group-inline-tasks/#api-group-inline-tasks)
|
|
297
241
|
- [labelInfo](https://developer.atlassian.com/cloud/confluence/rest/api-group-label-info/#api-group-label-info)
|
package/out/api/content.d.ts
CHANGED
|
@@ -49,6 +49,30 @@ export declare class Content {
|
|
|
49
49
|
* content will be created in, and permission to view the draft if publishing a draft.
|
|
50
50
|
*/
|
|
51
51
|
createContent<T = Models.Content>(parameters?: Parameters.CreateContent, callback?: never): Promise<T>;
|
|
52
|
+
/**
|
|
53
|
+
* Archives a list of pages. The pages to be archived are specified as a list of content IDs. This API accepts the
|
|
54
|
+
* archival request and returns a task ID. The archival process happens asynchronously. Use the /longtask/<taskId>
|
|
55
|
+
* REST API to get the copy task status.
|
|
56
|
+
*
|
|
57
|
+
* Each content ID needs to resolve to page objects that are not already in an archived state. The content IDs need
|
|
58
|
+
* not belong to the same space.
|
|
59
|
+
*
|
|
60
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Archive' permission for each of the pages
|
|
61
|
+
* in the corresponding space it belongs to.
|
|
62
|
+
*/
|
|
63
|
+
archivePages<T = unknown>(parameters: Parameters.ArchivePages, callback: Callback<T>): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Archives a list of pages. The pages to be archived are specified as a list of content IDs. This API accepts the
|
|
66
|
+
* archival request and returns a task ID. The archival process happens asynchronously. Use the /longtask/<taskId>
|
|
67
|
+
* REST API to get the copy task status.
|
|
68
|
+
*
|
|
69
|
+
* Each content ID needs to resolve to page objects that are not already in an archived state. The content IDs need
|
|
70
|
+
* not belong to the same space.
|
|
71
|
+
*
|
|
72
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Archive' permission for each of the pages
|
|
73
|
+
* in the corresponding space it belongs to.
|
|
74
|
+
*/
|
|
75
|
+
archivePages<T = unknown>(parameters: Parameters.ArchivePages, callback?: never): Promise<T>;
|
|
52
76
|
/**
|
|
53
77
|
* Publishes a legacy draft of a page created from a blueprint. Legacy drafts will eventually be removed in favor of
|
|
54
78
|
* shared drafts. For now, this method works the same as [Publish shared draft](#api-content-blueprint-instance-draftId-put).
|
|
@@ -91,32 +115,6 @@ export declare class Content {
|
|
|
91
115
|
* Returns the list of content that matches a Confluence Query Language (CQL) query. For information on CQL, see:
|
|
92
116
|
* [Advanced searching using CQL](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/).
|
|
93
117
|
*
|
|
94
|
-
* Example initial call:
|
|
95
|
-
* ```
|
|
96
|
-
* https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25
|
|
97
|
-
* ```
|
|
98
|
-
*
|
|
99
|
-
* Example response:
|
|
100
|
-
* ```
|
|
101
|
-
* {
|
|
102
|
-
* "results": [
|
|
103
|
-
* { ... },
|
|
104
|
-
* { ... },
|
|
105
|
-
* ...
|
|
106
|
-
* { ... }
|
|
107
|
-
* ],
|
|
108
|
-
* "limit": 25,
|
|
109
|
-
* "size": 25,
|
|
110
|
-
* ...
|
|
111
|
-
* "_links": {
|
|
112
|
-
* "base": "<url>",
|
|
113
|
-
* "context": "<url>",
|
|
114
|
-
* "next": "/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg",
|
|
115
|
-
* "self": "<url>"
|
|
116
|
-
* }
|
|
117
|
-
* }
|
|
118
|
-
* ```
|
|
119
|
-
*
|
|
120
118
|
* When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The
|
|
121
119
|
* URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of
|
|
122
120
|
* results returned in each call. Example subsequent call (taken from example response):
|
|
@@ -133,32 +131,6 @@ export declare class Content {
|
|
|
133
131
|
* Returns the list of content that matches a Confluence Query Language (CQL) query. For information on CQL, see:
|
|
134
132
|
* [Advanced searching using CQL](https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/).
|
|
135
133
|
*
|
|
136
|
-
* Example initial call:
|
|
137
|
-
* ```
|
|
138
|
-
* https://your-domain.atlassian.net/wiki/rest/api/content/search?cql=type=page&limit=25
|
|
139
|
-
* ```
|
|
140
|
-
*
|
|
141
|
-
* Example response:
|
|
142
|
-
* ```
|
|
143
|
-
* {
|
|
144
|
-
* "results": [
|
|
145
|
-
* { ... },
|
|
146
|
-
* { ... },
|
|
147
|
-
* ...
|
|
148
|
-
* { ... }
|
|
149
|
-
* ],
|
|
150
|
-
* "limit": 25,
|
|
151
|
-
* "size": 25,
|
|
152
|
-
* ...
|
|
153
|
-
* "_links": {
|
|
154
|
-
* "base": "<url>",
|
|
155
|
-
* "context": "<url>",
|
|
156
|
-
* "next": "/rest/api/content/search?cql=type=page&limit=25&cursor=raNDoMsTRiNg",
|
|
157
|
-
* "self": "<url>"
|
|
158
|
-
* }
|
|
159
|
-
* }
|
|
160
|
-
* ```
|
|
161
|
-
*
|
|
162
134
|
* When additional results are available, returns `next` and `prev` URLs to retrieve them in subsequent calls. The
|
|
163
135
|
* URLs each contain a cursor that points to the appropriate set of results. Use `limit` to specify the number of
|
|
164
136
|
* results returned in each call. Example subsequent call (taken from example response):
|
package/out/api/content.js
CHANGED
|
@@ -41,6 +41,18 @@ class Content {
|
|
|
41
41
|
return this.client.sendRequest(config, callback, { methodName: 'createContent' });
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
+
archivePages(parameters, callback) {
|
|
45
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
46
|
+
const config = {
|
|
47
|
+
url: '/api/content/archive',
|
|
48
|
+
method: 'POST',
|
|
49
|
+
data: {
|
|
50
|
+
pages: parameters.pages,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
return this.client.sendRequest(config, callback, { methodName: 'archivePages' });
|
|
54
|
+
});
|
|
55
|
+
}
|
|
44
56
|
publishLegacyDraft(parameters, callback) {
|
|
45
57
|
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
46
58
|
const config = {
|
|
@@ -49,6 +61,7 @@ class Content {
|
|
|
49
61
|
params: {
|
|
50
62
|
status: parameters.status,
|
|
51
63
|
},
|
|
64
|
+
data: Object.assign(Object.assign({}, parameters), { version: parameters.version, title: parameters.title, type: parameters.type, status: parameters.bodyStatus, space: parameters.space, ancestors: parameters.ancestors }),
|
|
52
65
|
};
|
|
53
66
|
return this.client.sendRequest(config, callback, { methodName: 'publishLegacyDraft' });
|
|
54
67
|
});
|
|
@@ -61,6 +74,7 @@ class Content {
|
|
|
61
74
|
params: {
|
|
62
75
|
status: parameters.status,
|
|
63
76
|
},
|
|
77
|
+
data: Object.assign(Object.assign({}, parameters), { version: parameters.version, title: parameters.title, type: parameters.type, status: parameters.bodyStatus, space: parameters.space, ancestors: parameters.ancestors }),
|
|
64
78
|
};
|
|
65
79
|
return this.client.sendRequest(config, callback, { methodName: 'publishSharedDraft' });
|
|
66
80
|
});
|
|
@@ -90,6 +104,7 @@ class Content {
|
|
|
90
104
|
version: parameters.version,
|
|
91
105
|
embeddedContentRender: parameters.embeddedContentRender,
|
|
92
106
|
trigger: parameters.trigger,
|
|
107
|
+
expand: parameters.expand,
|
|
93
108
|
},
|
|
94
109
|
};
|
|
95
110
|
return this.client.sendRequest(config, callback, { methodName: 'getContentById' });
|
|
@@ -32,7 +32,7 @@ export declare class ContentAttachments {
|
|
|
32
32
|
*
|
|
33
33
|
* The media type 'multipart/form-data' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt). Most client
|
|
34
34
|
* libraries have classes that make it easier to implement multipart posts, like the
|
|
35
|
-
* [MultipartEntityBuilder](
|
|
35
|
+
* [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/) Java class
|
|
36
36
|
* provided by Apache HTTP Components.
|
|
37
37
|
*
|
|
38
38
|
* Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5), in the case where the form data is
|
|
@@ -65,7 +65,7 @@ export declare class ContentAttachments {
|
|
|
65
65
|
*
|
|
66
66
|
* The media type 'multipart/form-data' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt). Most client
|
|
67
67
|
* libraries have classes that make it easier to implement multipart posts, like the
|
|
68
|
-
* [MultipartEntityBuilder](
|
|
68
|
+
* [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/) Java class
|
|
69
69
|
* provided by Apache HTTP Components.
|
|
70
70
|
*
|
|
71
71
|
* Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5), in the case where the form data is
|
|
@@ -98,7 +98,7 @@ export declare class ContentAttachments {
|
|
|
98
98
|
*
|
|
99
99
|
* The media type 'multipart/form-data' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt). Most client
|
|
100
100
|
* libraries have classes that make it easier to implement multipart posts, like the
|
|
101
|
-
* [MultipartEntityBuilder](
|
|
101
|
+
* [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/) Java class
|
|
102
102
|
* provided by Apache HTTP Components.
|
|
103
103
|
*
|
|
104
104
|
* Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5), in the case where the form data is
|
|
@@ -132,7 +132,7 @@ export declare class ContentAttachments {
|
|
|
132
132
|
*
|
|
133
133
|
* The media type 'multipart/form-data' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt). Most client
|
|
134
134
|
* libraries have classes that make it easier to implement multipart posts, like the
|
|
135
|
-
* [MultipartEntityBuilder](
|
|
135
|
+
* [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/) Java class
|
|
136
136
|
* provided by Apache HTTP Components.
|
|
137
137
|
*
|
|
138
138
|
* Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5), in the case where the form data is
|
|
@@ -182,7 +182,7 @@ export declare class ContentAttachments {
|
|
|
182
182
|
*
|
|
183
183
|
* The media type 'multipart/form-data' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt). Most client
|
|
184
184
|
* libraries have classes that make it easier to implement multipart posts, like the
|
|
185
|
-
* [MultipartEntityBuilder](
|
|
185
|
+
* [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/) Java class
|
|
186
186
|
* provided by Apache HTTP Components.
|
|
187
187
|
*
|
|
188
188
|
* Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5), in the case where the form data is
|
|
@@ -218,7 +218,7 @@ export declare class ContentAttachments {
|
|
|
218
218
|
*
|
|
219
219
|
* The media type 'multipart/form-data' is defined in [RFC 7578](https://www.ietf.org/rfc/rfc7578.txt). Most client
|
|
220
220
|
* libraries have classes that make it easier to implement multipart posts, like the
|
|
221
|
-
* [MultipartEntityBuilder](
|
|
221
|
+
* [MultipartEntityBuilder](https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/) Java class
|
|
222
222
|
* provided by Apache HTTP Components.
|
|
223
223
|
*
|
|
224
224
|
* Note, according to [RFC 7578](https://tools.ietf.org/html/rfc7578#section-4.5), in the case where the form data is
|
|
@@ -243,4 +243,8 @@ export declare class ContentAttachments {
|
|
|
243
243
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.
|
|
244
244
|
*/
|
|
245
245
|
updateAttachmentData<T = Models.Content>(parameters: Parameters.UpdateAttachmentData, callback?: never): Promise<T>;
|
|
246
|
+
/** Redirects the client to a URL that serves an attachment's binary data. */
|
|
247
|
+
downloadAttachment<T = ArrayBuffer>(parameters: Parameters.DownloadAttachment, callback: Callback<T>): Promise<void>;
|
|
248
|
+
/** Redirects the client to a URL that serves an attachment's binary data. */
|
|
249
|
+
downloadAttachment<T = ArrayBuffer>(parameters: Parameters.DownloadAttachment, callback?: never): Promise<T>;
|
|
246
250
|
}
|
|
@@ -68,5 +68,18 @@ class ContentAttachments {
|
|
|
68
68
|
return this.client.sendRequest(config, callback, { methodName: 'updateAttachmentData' });
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
+
downloadAttachment(parameters, callback) {
|
|
72
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
73
|
+
const config = {
|
|
74
|
+
url: `/api/content/${parameters.id}/child/attachment/${parameters.attachmentId}/download`,
|
|
75
|
+
method: 'GET',
|
|
76
|
+
responseType: 'arraybuffer',
|
|
77
|
+
params: {
|
|
78
|
+
version: parameters.version,
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
return this.client.sendRequest(config, callback, { methodName: 'downloadAttachment' });
|
|
82
|
+
});
|
|
83
|
+
}
|
|
71
84
|
}
|
|
72
85
|
exports.ContentAttachments = ContentAttachments;
|
|
@@ -141,6 +141,10 @@ export declare class ContentChildrenAndDescendants {
|
|
|
141
141
|
* permission to view the content if it is a page.
|
|
142
142
|
*/
|
|
143
143
|
getContentDescendants<T = Models.ContentChildren>(parameters: Parameters.GetContentDescendants, callback?: never): Promise<T>;
|
|
144
|
+
/** @deprecated This API will be removed in the next major version. Use `getDescendantsOfType` method instead. */
|
|
145
|
+
descendantsOfType<T = Models.ContentArray>(parameters: Parameters.DescendantsOfType, callback: Callback<T>): Promise<void>;
|
|
146
|
+
/** @deprecated This API will be removed in the next major version. Use `getDescendantsOfType` method instead. */
|
|
147
|
+
descendantsOfType<T = Models.ContentArray>(parameters: Parameters.DescendantsOfType, callback?: never): Promise<T>;
|
|
144
148
|
/**
|
|
145
149
|
* Returns all descendants of a given type, for a piece of content. This is similar to [Get content children by
|
|
146
150
|
* type](#api-content-id-child-type-get), except that this method returns child pages at all levels, rather than just
|
|
@@ -158,7 +162,7 @@ export declare class ContentChildrenAndDescendants {
|
|
|
158
162
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and
|
|
159
163
|
* permission to view the content if it is a page.
|
|
160
164
|
*/
|
|
161
|
-
|
|
165
|
+
getDescendantsOfType<T = Models.ContentArray>(parameters: Parameters.GetDescendantsOfType, callback: Callback<T>): Promise<void>;
|
|
162
166
|
/**
|
|
163
167
|
* Returns all descendants of a given type, for a piece of content. This is similar to [Get content children by
|
|
164
168
|
* type](#api-content-id-child-type-get), except that this method returns child pages at all levels, rather than just
|
|
@@ -176,24 +180,13 @@ export declare class ContentChildrenAndDescendants {
|
|
|
176
180
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space, and
|
|
177
181
|
* permission to view the content if it is a page.
|
|
178
182
|
*/
|
|
179
|
-
|
|
183
|
+
getDescendantsOfType<T = Models.ContentArray>(parameters: Parameters.GetDescendantsOfType, callback?: never): Promise<T>;
|
|
180
184
|
/**
|
|
181
185
|
* Copy page hierarchy allows the copying of an entire hierarchy of pages and their associated properties, permissions
|
|
182
186
|
* and attachments. The id path parameter refers to the content id of the page to copy, and the new parent of this
|
|
183
187
|
* copied page is defined using the destinationPageId in the request body. The titleOptions object defines the rules
|
|
184
188
|
* of renaming page titles during the copy; for example, search and replace can be used in conjunction to rewrite the
|
|
185
189
|
* copied page titles.
|
|
186
|
-
*
|
|
187
|
-
* Response example:
|
|
188
|
-
* <pre>
|
|
189
|
-
* {
|
|
190
|
-
* "id" : "1180606",
|
|
191
|
-
* "links" : {
|
|
192
|
-
* "status" : "/rest/api/longtask/1180606"
|
|
193
|
-
* }
|
|
194
|
-
* }
|
|
195
|
-
* </pre>
|
|
196
|
-
* Use the /longtask/<taskId> REST API to get the copy task status.
|
|
197
190
|
*/
|
|
198
191
|
copyPageHierarchy<T = unknown>(parameters: Parameters.CopyPageHierarchy, callback: Callback<T>): Promise<void>;
|
|
199
192
|
/**
|
|
@@ -202,17 +195,6 @@ export declare class ContentChildrenAndDescendants {
|
|
|
202
195
|
* copied page is defined using the destinationPageId in the request body. The titleOptions object defines the rules
|
|
203
196
|
* of renaming page titles during the copy; for example, search and replace can be used in conjunction to rewrite the
|
|
204
197
|
* copied page titles.
|
|
205
|
-
*
|
|
206
|
-
* Response example:
|
|
207
|
-
* <pre>
|
|
208
|
-
* {
|
|
209
|
-
* "id" : "1180606",
|
|
210
|
-
* "links" : {
|
|
211
|
-
* "status" : "/rest/api/longtask/1180606"
|
|
212
|
-
* }
|
|
213
|
-
* }
|
|
214
|
-
* </pre>
|
|
215
|
-
* Use the /longtask/<taskId> REST API to get the copy task status.
|
|
216
198
|
*/
|
|
217
199
|
copyPageHierarchy<T = unknown>(parameters: Parameters.CopyPageHierarchy, callback?: never): Promise<T>;
|
|
218
200
|
/**
|
|
@@ -55,6 +55,11 @@ class ContentChildrenAndDescendants {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
descendantsOfType(parameters, callback) {
|
|
58
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
59
|
+
return this.getDescendantsOfType(parameters, callback);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
getDescendantsOfType(parameters, callback) {
|
|
58
63
|
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
59
64
|
const config = {
|
|
60
65
|
url: `/api/content/${parameters.id}/descendant/${parameters.type}`,
|
|
@@ -63,6 +68,7 @@ class ContentChildrenAndDescendants {
|
|
|
63
68
|
depth: parameters.depth,
|
|
64
69
|
start: parameters.start,
|
|
65
70
|
limit: parameters.limit,
|
|
71
|
+
expand: parameters.expand,
|
|
66
72
|
},
|
|
67
73
|
};
|
|
68
74
|
return this.client.sendRequest(config, callback, { methodName: 'descendantsOfType' });
|
|
@@ -5,6 +5,10 @@ import { Callback } from '../callback';
|
|
|
5
5
|
export declare class ContentPermissions {
|
|
6
6
|
private client;
|
|
7
7
|
constructor(client: Client);
|
|
8
|
+
/** @deprecated Will be removed in the next major version. Use `checkContentPermission` method instead. */
|
|
9
|
+
permissionCheck<T = Models.PermissionCheckResponse>(parameters: Parameters.PermissionCheck, callback: Callback<T>): Promise<void>;
|
|
10
|
+
/** @deprecated Will be removed in the next major version. Use `checkContentPermission` method instead. */
|
|
11
|
+
permissionCheck<T = Models.PermissionCheckResponse>(parameters: Parameters.PermissionCheck, callback?: never): Promise<T>;
|
|
8
12
|
/**
|
|
9
13
|
* Check if a user or a group can perform an operation to the specified content. The `operation` to check must be
|
|
10
14
|
* provided. The user’s account ID or the ID of the group can be provided in the `subject` to check permissions
|
|
@@ -19,7 +23,7 @@ export declare class ContentPermissions {
|
|
|
19
23
|
* ('Can use' global permission) if checking permission for self, otherwise 'Confluence Administrator' global
|
|
20
24
|
* permission is required.
|
|
21
25
|
*/
|
|
22
|
-
|
|
26
|
+
checkContentPermission<T = Models.PermissionCheckResponse>(parameters: Parameters.CheckContentPermission, callback: Callback<T>): Promise<void>;
|
|
23
27
|
/**
|
|
24
28
|
* Check if a user or a group can perform an operation to the specified content. The `operation` to check must be
|
|
25
29
|
* provided. The user’s account ID or the ID of the group can be provided in the `subject` to check permissions
|
|
@@ -34,5 +38,5 @@ export declare class ContentPermissions {
|
|
|
34
38
|
* ('Can use' global permission) if checking permission for self, otherwise 'Confluence Administrator' global
|
|
35
39
|
* permission is required.
|
|
36
40
|
*/
|
|
37
|
-
|
|
41
|
+
checkContentPermission<T = Models.PermissionCheckResponse>(parameters: Parameters.CheckContentPermission, callback?: never): Promise<T>;
|
|
38
42
|
}
|
|
@@ -7,6 +7,11 @@ class ContentPermissions {
|
|
|
7
7
|
this.client = client;
|
|
8
8
|
}
|
|
9
9
|
permissionCheck(parameters, callback) {
|
|
10
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
11
|
+
return this.checkContentPermission(parameters, callback);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
checkContentPermission(parameters, callback) {
|
|
10
15
|
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
11
16
|
const config = {
|
|
12
17
|
url: `/api/content/${parameters.id}/permission/check`,
|
|
@@ -16,7 +21,7 @@ class ContentPermissions {
|
|
|
16
21
|
operation: parameters.operation,
|
|
17
22
|
},
|
|
18
23
|
};
|
|
19
|
-
return this.client.sendRequest(config, callback, { methodName: '
|
|
24
|
+
return this.client.sendRequest(config, callback, { methodName: 'checkContentPermission' });
|
|
20
25
|
});
|
|
21
26
|
}
|
|
22
27
|
}
|
|
@@ -12,6 +12,7 @@ class ContentProperties {
|
|
|
12
12
|
url: `/api/content/${parameters.id}/property`,
|
|
13
13
|
method: 'GET',
|
|
14
14
|
params: {
|
|
15
|
+
key: parameters.key,
|
|
15
16
|
expand: parameters.expand,
|
|
16
17
|
start: parameters.start,
|
|
17
18
|
limit: parameters.limit,
|
|
@@ -40,6 +41,7 @@ class ContentProperties {
|
|
|
40
41
|
method: 'GET',
|
|
41
42
|
params: {
|
|
42
43
|
expand: parameters.expand,
|
|
44
|
+
status: parameters.status,
|
|
43
45
|
},
|
|
44
46
|
};
|
|
45
47
|
return this.client.sendRequest(config, callback, { methodName: 'getContentProperty' });
|
|
@@ -44,7 +44,7 @@ export declare class ContentWatches {
|
|
|
44
44
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
|
|
45
45
|
* ('Can use' global permission).
|
|
46
46
|
*/
|
|
47
|
-
getWatchesForSpace<T = Models.
|
|
47
|
+
getWatchesForSpace<T = Models.SpaceWatchArray>(parameters: Parameters.GetWatchesForSpace, callback: Callback<T>): Promise<void>;
|
|
48
48
|
/**
|
|
49
49
|
* Returns all space watches for the space that the content is in. A user that watches a space will receive receive
|
|
50
50
|
* notifications when any content in the space is updated.
|
|
@@ -58,7 +58,7 @@ export declare class ContentWatches {
|
|
|
58
58
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site
|
|
59
59
|
* ('Can use' global permission).
|
|
60
60
|
*/
|
|
61
|
-
getWatchesForSpace<T = Models.
|
|
61
|
+
getWatchesForSpace<T = Models.SpaceWatchArray>(parameters: Parameters.GetWatchesForSpace, callback?: never): Promise<T>;
|
|
62
62
|
/** Returns a list of watchers of a space */
|
|
63
63
|
getWatchersForSpace<T = Models.SpaceWatchArray>(parameters: Parameters.GetWatchersForSpace, callback: Callback<T>): Promise<void>;
|
|
64
64
|
/** Returns a list of watchers of a space */
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as Models from './models';
|
|
2
|
+
import * as Parameters from './parameters';
|
|
3
|
+
import { Client } from '../clients';
|
|
4
|
+
import { Callback } from '../callback';
|
|
5
|
+
export declare class Experimental {
|
|
6
|
+
private client;
|
|
7
|
+
constructor(client: Client);
|
|
8
|
+
/**
|
|
9
|
+
* Returns a list of labels associated with a space. Can provide a prefix as well as other filters to select different
|
|
10
|
+
* types of labels.
|
|
11
|
+
*/
|
|
12
|
+
getLabelsForSpace<T = Models.LabelArray>(parameters: Parameters.GetLabelsForSpace, callback: Callback<T>): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns a list of labels associated with a space. Can provide a prefix as well as other filters to select different
|
|
15
|
+
* types of labels.
|
|
16
|
+
*/
|
|
17
|
+
getLabelsForSpace<T = Models.LabelArray>(parameters: Parameters.GetLabelsForSpace, callback?: never): Promise<T>;
|
|
18
|
+
/**
|
|
19
|
+
* Adds labels to a piece of content. Does not modify the existing labels.
|
|
20
|
+
*
|
|
21
|
+
* Notes:
|
|
22
|
+
*
|
|
23
|
+
* - Labels can also be added when creating content ([Create content](#api-content-post)).
|
|
24
|
+
* - Labels can be updated when updating content ([Update content](#api-content-id-put)). This will delete the existing
|
|
25
|
+
* labels and replace them with the labels in the request.
|
|
26
|
+
*
|
|
27
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.
|
|
28
|
+
*/
|
|
29
|
+
addLabelsToSpace<T = Models.LabelArray>(parameters: Parameters.AddLabelsToSpace, callback: Callback<T>): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Adds labels to a piece of content. Does not modify the existing labels.
|
|
32
|
+
*
|
|
33
|
+
* Notes:
|
|
34
|
+
*
|
|
35
|
+
* - Labels can also be added when creating content ([Create content](#api-content-post)).
|
|
36
|
+
* - Labels can be updated when updating content ([Update content](#api-content-id-put)). This will delete the existing
|
|
37
|
+
* labels and replace them with the labels in the request.
|
|
38
|
+
*
|
|
39
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content.
|
|
40
|
+
*/
|
|
41
|
+
addLabelsToSpace<T = Models.LabelArray>(parameters: Parameters.AddLabelsToSpace, callback?: never): Promise<T>;
|
|
42
|
+
deleteLabelFromSpace<T = void>(parameters: Parameters.DeleteLabelFromSpace, callback: Callback<T>): Promise<void>;
|
|
43
|
+
deleteLabelFromSpace<T = void>(parameters: Parameters.DeleteLabelFromSpace, callback?: never): Promise<T>;
|
|
44
|
+
/** Get the total number of views a piece of content has. */
|
|
45
|
+
getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback: Callback<T>): Promise<void>;
|
|
46
|
+
/** Get the total number of views a piece of content has. */
|
|
47
|
+
getViews<T = Models.GetViews>(parameters: Parameters.GetViews, callback?: never): Promise<T>;
|
|
48
|
+
/** Get the total number of distinct viewers a piece of content has. */
|
|
49
|
+
getViewers<T = Models.GetViewers>(parameters: Parameters.GetViewers, callback: Callback<T>): Promise<void>;
|
|
50
|
+
/** Get the total number of distinct viewers a piece of content has. */
|
|
51
|
+
getViewers<T = Models.GetViewers>(parameters: Parameters.GetViewers, callback?: never): Promise<T>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Experimental = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
class Experimental {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
getLabelsForSpace(parameters, callback) {
|
|
10
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
11
|
+
const config = {
|
|
12
|
+
url: `/api/space/${parameters.spaceKey}/label`,
|
|
13
|
+
method: 'GET',
|
|
14
|
+
params: {
|
|
15
|
+
prefix: parameters.prefix,
|
|
16
|
+
start: parameters.start,
|
|
17
|
+
limit: parameters.limit,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
return this.client.sendRequest(config, callback, { methodName: 'getLabelsForSpace' });
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
addLabelsToSpace(parameters, callback) {
|
|
24
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
25
|
+
const config = {
|
|
26
|
+
url: `/api/space/${parameters.spaceKey}/label`,
|
|
27
|
+
method: 'POST',
|
|
28
|
+
};
|
|
29
|
+
return this.client.sendRequest(config, callback, { methodName: 'addLabelsToSpace' });
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
deleteLabelFromSpace(parameters, callback) {
|
|
33
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
34
|
+
const config = {
|
|
35
|
+
url: `/api/space/${parameters.spaceKey}/label`,
|
|
36
|
+
method: 'DELETE',
|
|
37
|
+
params: {
|
|
38
|
+
name: parameters.name,
|
|
39
|
+
prefix: parameters.prefix,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
return this.client.sendRequest(config, callback, { methodName: 'deleteLabelFromSpace' });
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
getViews(parameters, callback) {
|
|
46
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
47
|
+
const config = {
|
|
48
|
+
url: `/api/analytics/content/${parameters.contentId}/views`,
|
|
49
|
+
method: 'GET',
|
|
50
|
+
params: {
|
|
51
|
+
fromDate: parameters.fromDate,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
return this.client.sendRequest(config, callback, { methodName: 'getViews' });
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
getViewers(parameters, callback) {
|
|
58
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
59
|
+
const config = {
|
|
60
|
+
url: `/api/analytics/content/${parameters.contentId}/viewers`,
|
|
61
|
+
method: 'GET',
|
|
62
|
+
params: {
|
|
63
|
+
fromDate: parameters.fromDate,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
return this.client.sendRequest(config, callback, { methodName: 'getViewers' });
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.Experimental = Experimental;
|