confluence.js 1.5.3 → 1.6.1
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 +15 -0
- package/README.md +1 -0
- package/out/api/contentBody.d.ts +52 -0
- package/out/api/contentBody.js +26 -0
- package/out/api/contentBody.js.map +1 -1
- package/out/api/contentChildrenAndDescendants.js +2 -1
- package/out/api/contentChildrenAndDescendants.js.map +1 -1
- package/out/api/contentContentState.d.ts +30 -28
- package/out/api/contentContentState.js +2 -0
- package/out/api/contentContentState.js.map +1 -1
- package/out/api/contentMacroBody.d.ts +68 -0
- package/out/api/contentMacroBody.js +29 -0
- package/out/api/contentMacroBody.js.map +1 -1
- package/out/api/contentStates.d.ts +120 -0
- package/out/api/contentStates.js +88 -0
- package/out/api/contentStates.js.map +1 -0
- package/out/api/dynamicModules.js +1 -0
- package/out/api/dynamicModules.js.map +1 -1
- package/out/api/experimental.d.ts +2 -2
- package/out/api/index.d.ts +1 -0
- package/out/api/index.js +1 -0
- package/out/api/index.js.map +1 -1
- package/out/api/models/asyncContentBody.d.ts +30 -0
- package/out/api/models/asyncContentBody.js +3 -0
- package/out/api/models/asyncContentBody.js.map +1 -0
- package/out/api/models/asyncId.d.ts +3 -0
- package/out/api/models/asyncId.js +3 -0
- package/out/api/models/asyncId.js.map +1 -0
- package/out/api/models/contentBodyCreate.d.ts +1 -0
- package/out/api/models/contentStateResponse.d.ts +7 -0
- package/out/api/models/contentStateResponse.js +3 -0
- package/out/api/models/contentStateResponse.js.map +1 -0
- package/out/api/models/contentStateRestInput.d.ts +11 -0
- package/out/api/models/contentStateRestInput.js +3 -0
- package/out/api/models/contentStateRestInput.js.map +1 -0
- package/out/api/models/index.d.ts +16 -12
- package/out/api/models/index.js +16 -12
- package/out/api/models/index.js.map +1 -1
- package/out/api/parameters/asyncConvertContentBodyRequest.d.ts +38 -0
- package/out/api/parameters/asyncConvertContentBodyRequest.js +3 -0
- package/out/api/parameters/asyncConvertContentBodyRequest.js.map +1 -0
- package/out/api/parameters/asyncConvertContentBodyResponse.d.ts +4 -0
- package/out/api/parameters/asyncConvertContentBodyResponse.js +3 -0
- package/out/api/parameters/asyncConvertContentBodyResponse.js.map +1 -0
- package/out/api/parameters/getAndAsyncConvertMacroBodyByMacroId.d.ts +46 -0
- package/out/api/parameters/getAndAsyncConvertMacroBodyByMacroId.js +3 -0
- package/out/api/parameters/getAndAsyncConvertMacroBodyByMacroId.js.map +1 -0
- package/out/api/parameters/getAndConvertMacroBodyByMacroId.d.ts +34 -0
- package/out/api/parameters/getAndConvertMacroBodyByMacroId.js +3 -0
- package/out/api/parameters/getAndConvertMacroBodyByMacroId.js.map +1 -0
- package/out/api/parameters/getAvailableContentStates.d.ts +4 -2
- package/out/api/parameters/getContentState.d.ts +8 -4
- package/out/api/parameters/getSpaceContentStates.d.ts +4 -0
- package/out/api/parameters/getSpaceContentStates.js +3 -0
- package/out/api/parameters/getSpaceContentStates.js.map +1 -0
- package/out/api/parameters/getUser.d.ts +6 -4
- package/out/api/parameters/index.d.ts +5 -0
- package/out/api/parameters/index.js +5 -0
- package/out/api/parameters/index.js.map +1 -1
- package/out/api/parameters/movePage.d.ts +9 -5
- package/out/api/parameters/removeContentState.d.ts +5 -1
- package/out/api/parameters/setContentState.d.ts +11 -5
- package/out/api/settings.d.ts +2 -2
- package/out/api/space.d.ts +2 -2
- package/out/api/spaceProperties.d.ts +4 -4
- package/out/clients/confluenceClient.d.ts +2 -1
- package/out/clients/confluenceClient.js +1 -0
- package/out/clients/confluenceClient.js.map +1 -1
- package/out/index.d.ts +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/package.json +12 -12
- package/src/api/contentBody.ts +100 -0
- package/src/api/contentChildrenAndDescendants.ts +3 -1
- package/src/api/contentContentState.ts +30 -28
- package/src/api/contentMacroBody.ts +115 -0
- package/src/api/contentStates.ts +252 -0
- package/src/api/dynamicModules.ts +1 -0
- package/src/api/experimental.ts +2 -2
- package/src/api/index.ts +1 -0
- package/src/api/models/asyncContentBody.ts +31 -0
- package/src/api/models/asyncId.ts +3 -0
- package/src/api/models/contentBodyCreate.ts +1 -0
- package/src/api/models/contentStateResponse.ts +8 -0
- package/src/api/models/contentStateRestInput.ts +11 -0
- package/src/api/models/index.ts +16 -12
- package/src/api/parameters/asyncConvertContentBodyRequest.ts +81 -0
- package/src/api/parameters/asyncConvertContentBodyResponse.ts +4 -0
- package/src/api/parameters/getAndAsyncConvertMacroBodyByMacroId.ts +88 -0
- package/src/api/parameters/getAndConvertMacroBodyByMacroId.ts +104 -0
- package/src/api/parameters/getAvailableContentStates.ts +5 -2
- package/src/api/parameters/getContentState.ts +9 -4
- package/src/api/parameters/getSpaceContentStates.ts +4 -0
- package/src/api/parameters/getUser.ts +14 -4
- package/src/api/parameters/index.ts +5 -0
- package/src/api/parameters/movePage.ts +9 -5
- package/src/api/parameters/removeContentState.ts +6 -1
- package/src/api/parameters/setContentState.ts +13 -5
- package/src/api/settings.ts +2 -2
- package/src/api/space.ts +3 -3
- package/src/api/spaceProperties.ts +4 -4
- package/src/clients/confluenceClient.ts +2 -0
- package/src/index.ts +1 -0
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export interface RemoveContentState {
|
|
2
2
|
/** The Id of the content whose content state is to be set. */
|
|
3
|
-
|
|
3
|
+
id?: string;
|
|
4
|
+
/** Status of content state from which to delete state. Can be draft or archived */
|
|
5
|
+
status?: string;
|
|
6
|
+
/** @deprecated The Id of the content whose content state is to be set. */
|
|
7
|
+
contentId?: string;
|
|
4
8
|
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { ContentStateRestInput } from '../models';
|
|
2
|
+
export interface SetContentState extends ContentStateRestInput {
|
|
2
3
|
/** The Id of the content whose content state is to be set. */
|
|
3
|
-
|
|
4
|
-
/**
|
|
4
|
+
id?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Status of content onto which state will be placed. If draft, then draft state will change. If current, state will
|
|
7
|
+
* be placed onto a new version of the content with same body as previous version.
|
|
8
|
+
*/
|
|
9
|
+
status?: 'current' | 'draft' | string;
|
|
10
|
+
/** @deprecated The Id of the content whose content state is to be set. */
|
|
11
|
+
contentId?: string;
|
|
12
|
+
/** @deprecated The Id of the content */
|
|
5
13
|
contentStateId?: number;
|
|
6
|
-
name?: string;
|
|
7
|
-
color?: string;
|
|
8
14
|
}
|
package/out/api/settings.d.ts
CHANGED
|
@@ -105,8 +105,8 @@ export declare class Settings {
|
|
|
105
105
|
* ('Can use' global permission).
|
|
106
106
|
*/
|
|
107
107
|
getSystemInfo<T = Models.SystemInfoEntity>(callback?: never): Promise<T>;
|
|
108
|
-
/** Gets Content State settings for a space */
|
|
108
|
+
/** @deprecated Gets Content State settings for a space */
|
|
109
109
|
getContentStateSettings<T = Models.ContentStateSettings>(parameters: Parameters.GetContentStateSettings, callback: Callback<T>): Promise<void>;
|
|
110
|
-
/** Gets Content State settings for a space */
|
|
110
|
+
/** @deprecated Gets Content State settings for a space */
|
|
111
111
|
getContentStateSettings<T = Models.ContentStateSettings>(parameters: Parameters.GetContentStateSettings, callback?: never): Promise<T>;
|
|
112
112
|
}
|
package/out/api/space.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ export declare class Space {
|
|
|
88
88
|
*
|
|
89
89
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
|
|
90
90
|
*/
|
|
91
|
-
deleteSpace<T = Models.
|
|
91
|
+
deleteSpace<T = Models.LongTask>(parameters: Parameters.DeleteSpace, callback: Callback<T>): Promise<void>;
|
|
92
92
|
/**
|
|
93
93
|
* Deletes a space. Note, the space will be deleted in a long running task. Therefore, the space may not be deleted
|
|
94
94
|
* yet when this method has returned. Clients should poll the status link that is returned in the response until the
|
|
@@ -96,7 +96,7 @@ export declare class Space {
|
|
|
96
96
|
*
|
|
97
97
|
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space.
|
|
98
98
|
*/
|
|
99
|
-
deleteSpace<T = Models.
|
|
99
|
+
deleteSpace<T = Models.LongTask>(parameters: Parameters.DeleteSpace, callback?: never): Promise<T>;
|
|
100
100
|
/**
|
|
101
101
|
* Returns all content in a space. The returned content is grouped by type (pages then blogposts), then ordered by
|
|
102
102
|
* content ID in ascending order.
|
|
@@ -42,15 +42,15 @@ export declare class SpaceProperties {
|
|
|
42
42
|
*/
|
|
43
43
|
getSpaceProperty<T = Models.SpaceProperty>(parameters: Parameters.GetSpaceProperty, callback?: never): Promise<T>;
|
|
44
44
|
/**
|
|
45
|
-
* Creates a new space property. This is the same as `POST /
|
|
46
|
-
*
|
|
45
|
+
* Creates a new space property. This is the same as `POST /api/space/{spaceKey}/property` but the key for the
|
|
46
|
+
* property is passed as a path parameter, rather than in the request body.
|
|
47
47
|
*
|
|
48
48
|
* **[Permissions required](https://confluence.atlassian.com/x/_AozKw)**: ‘Admin’ permission for the space.
|
|
49
49
|
*/
|
|
50
50
|
createSpacePropertyForKey<T = Models.SpaceProperty>(parameters: Parameters.CreateSpacePropertyForKey, callback: Callback<T>): Promise<void>;
|
|
51
51
|
/**
|
|
52
|
-
* Creates a new space property. This is the same as `POST /
|
|
53
|
-
*
|
|
52
|
+
* Creates a new space property. This is the same as `POST /api/space/{spaceKey}/property` but the key for the
|
|
53
|
+
* property is passed as a path parameter, rather than in the request body.
|
|
54
54
|
*
|
|
55
55
|
* **[Permissions required](https://confluence.atlassian.com/x/_AozKw)**: ‘Admin’ permission for the space.
|
|
56
56
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient } from './baseClient';
|
|
2
|
-
import { Analytics, Audit, Content, ContentAttachments, ContentBody, ContentChildrenAndDescendants, ContentComments, ContentContentState, ContentLabels, ContentMacroBody, ContentPermissions, ContentProperties, ContentRestrictions, ContentVersions, ContentWatches, DynamicModules, Experimental, Group, InlineTasks, LabelInfo, LongRunningTask, Relation, Search, Settings, Space, SpacePermissions, SpaceProperties, SpaceSettings, Template, Themes, Users } from '../api';
|
|
2
|
+
import { Analytics, Audit, Content, ContentAttachments, ContentBody, ContentChildrenAndDescendants, ContentComments, ContentContentState, ContentLabels, ContentMacroBody, ContentPermissions, ContentProperties, ContentRestrictions, ContentStates, ContentVersions, ContentWatches, DynamicModules, Experimental, Group, InlineTasks, LabelInfo, LongRunningTask, Relation, Search, Settings, Space, SpacePermissions, SpaceProperties, SpaceSettings, Template, Themes, Users } from '../api';
|
|
3
3
|
export declare class ConfluenceClient extends BaseClient {
|
|
4
4
|
analytics: Analytics;
|
|
5
5
|
audit: Audit;
|
|
@@ -14,6 +14,7 @@ export declare class ConfluenceClient extends BaseClient {
|
|
|
14
14
|
contentPermissions: ContentPermissions;
|
|
15
15
|
contentProperties: ContentProperties;
|
|
16
16
|
contentRestrictions: ContentRestrictions;
|
|
17
|
+
contentStates: ContentStates;
|
|
17
18
|
contentVersions: ContentVersions;
|
|
18
19
|
contentWatches: ContentWatches;
|
|
19
20
|
dynamicModules: DynamicModules;
|
|
@@ -19,6 +19,7 @@ class ConfluenceClient extends baseClient_1.BaseClient {
|
|
|
19
19
|
this.contentPermissions = new api_1.ContentPermissions(this);
|
|
20
20
|
this.contentProperties = new api_1.ContentProperties(this);
|
|
21
21
|
this.contentRestrictions = new api_1.ContentRestrictions(this);
|
|
22
|
+
this.contentStates = new api_1.ContentStates(this);
|
|
22
23
|
this.contentVersions = new api_1.ContentVersions(this);
|
|
23
24
|
this.contentWatches = new api_1.ContentWatches(this);
|
|
24
25
|
this.dynamicModules = new api_1.DynamicModules(this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confluenceClient.js","sourceRoot":"","sources":["../../src/clients/confluenceClient.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"confluenceClient.js","sourceRoot":"","sources":["../../src/clients/confluenceClient.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,gCAiCgB;AAEhB,MAAa,gBAAiB,SAAQ,uBAAU;IAAhD;;QACE,cAAS,GAAG,IAAI,eAAS,CAAC,IAAI,CAAC,CAAC;QAChC,UAAK,GAAG,IAAI,WAAK,CAAC,IAAI,CAAC,CAAC;QACxB,YAAO,GAAG,IAAI,aAAO,CAAC,IAAI,CAAC,CAAC;QAC5B,uBAAkB,GAAG,IAAI,wBAAkB,CAAC,IAAI,CAAC,CAAC;QAClD,gBAAW,GAAG,IAAI,iBAAW,CAAC,IAAI,CAAC,CAAC;QACpC,kCAA6B,GAAG,IAAI,mCAA6B,CAAC,IAAI,CAAC,CAAC;QACxE,oBAAe,GAAG,IAAI,qBAAe,CAAC,IAAI,CAAC,CAAC;QAC5C,wBAAmB,GAAG,IAAI,yBAAmB,CAAC,IAAI,CAAC,CAAC;QACpD,kBAAa,GAAG,IAAI,mBAAa,CAAC,IAAI,CAAC,CAAC;QACxC,qBAAgB,GAAG,IAAI,sBAAgB,CAAC,IAAI,CAAC,CAAC;QAC9C,uBAAkB,GAAG,IAAI,wBAAkB,CAAC,IAAI,CAAC,CAAC;QAClD,sBAAiB,GAAG,IAAI,uBAAiB,CAAC,IAAI,CAAC,CAAC;QAChD,wBAAmB,GAAG,IAAI,yBAAmB,CAAC,IAAI,CAAC,CAAC;QACpD,kBAAa,GAAG,IAAI,mBAAa,CAAC,IAAI,CAAC,CAAC;QACxC,oBAAe,GAAG,IAAI,qBAAe,CAAC,IAAI,CAAC,CAAC;QAC5C,mBAAc,GAAG,IAAI,oBAAc,CAAC,IAAI,CAAC,CAAC;QAC1C,mBAAc,GAAG,IAAI,oBAAc,CAAC,IAAI,CAAC,CAAC;QAC1C,iBAAY,GAAG,IAAI,kBAAY,CAAC,IAAI,CAAC,CAAC;QACtC,UAAK,GAAG,IAAI,WAAK,CAAC,IAAI,CAAC,CAAC;QACxB,gBAAW,GAAG,IAAI,iBAAW,CAAC,IAAI,CAAC,CAAC;QACpC,cAAS,GAAG,IAAI,eAAS,CAAC,IAAI,CAAC,CAAC;QAChC,oBAAe,GAAG,IAAI,qBAAe,CAAC,IAAI,CAAC,CAAC;QAC5C,aAAQ,GAAG,IAAI,cAAQ,CAAC,IAAI,CAAC,CAAC;QAC9B,WAAM,GAAG,IAAI,YAAM,CAAC,IAAI,CAAC,CAAC;QAC1B,aAAQ,GAAG,IAAI,cAAQ,CAAC,IAAI,CAAC,CAAC;QAC9B,UAAK,GAAG,IAAI,WAAK,CAAC,IAAI,CAAC,CAAC;QACxB,qBAAgB,GAAG,IAAI,sBAAgB,CAAC,IAAI,CAAC,CAAC;QAC9C,oBAAe,GAAG,IAAI,qBAAe,CAAC,IAAI,CAAC,CAAC;QAC5C,kBAAa,GAAG,IAAI,mBAAa,CAAC,IAAI,CAAC,CAAC;QACxC,aAAQ,GAAG,IAAI,cAAQ,CAAC,IAAI,CAAC,CAAC;QAC9B,WAAM,GAAG,IAAI,YAAM,CAAC,IAAI,CAAC,CAAC;QAC1B,UAAK,GAAG,IAAI,WAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAjCD,4CAiCC"}
|
package/out/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './requestConfig';
|
|
|
4
4
|
export * from './callback';
|
|
5
5
|
export * from './pagination';
|
|
6
6
|
export * from './utilityTypes';
|
|
7
|
+
export * from './services/authenticationService';
|
|
7
8
|
export * as Api from './api';
|
|
8
9
|
export * as Server from './server';
|
|
9
10
|
export * as Models from './api/models';
|
package/out/index.js
CHANGED
|
@@ -8,6 +8,7 @@ tslib_1.__exportStar(require("./requestConfig"), exports);
|
|
|
8
8
|
tslib_1.__exportStar(require("./callback"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./pagination"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./utilityTypes"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./services/authenticationService"), exports);
|
|
11
12
|
exports.Api = require("./api");
|
|
12
13
|
exports.Server = require("./server");
|
|
13
14
|
exports.Models = require("./api/models");
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,oDAA0B;AAC1B,mDAAyB;AACzB,0DAAgC;AAChC,qDAA2B;AAC3B,uDAA6B;AAC7B,yDAA+B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,oDAA0B;AAC1B,mDAAyB;AACzB,0DAAgC;AAChC,qDAA2B;AAC3B,uDAA6B;AAC7B,yDAA+B;AAC/B,2EAAiD;AAEjD,+BAA6B;AAC7B,qCAAmC;AACnC,yCAAuC;AACvC,iDAA+C;AAC/C,kDAAgD;AAChD,0DAAwD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "confluence.js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "confluence.js is a powerful Node.JS/Browser module that allows you to interact with the Confluence API very easily",
|
|
5
5
|
"author": "Vladislav Tupikin <mrrefactoring@yandex.ru>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,25 +42,25 @@
|
|
|
42
42
|
"atlassian"
|
|
43
43
|
],
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@swc-node/register": "^1.5.
|
|
46
|
-
"@types/express": "^4.17.
|
|
45
|
+
"@swc-node/register": "^1.5.4",
|
|
46
|
+
"@types/express": "^4.17.14",
|
|
47
47
|
"@types/oauth": "^0.9.1",
|
|
48
48
|
"@types/sinon": "^10.0.13",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
50
|
-
"@typescript-eslint/parser": "^5.
|
|
51
|
-
"ava": "^
|
|
52
|
-
"dotenv": "^16.0.
|
|
53
|
-
"eslint": "^8.
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^5.41.0",
|
|
50
|
+
"@typescript-eslint/parser": "^5.41.0",
|
|
51
|
+
"ava": "^5.0.1",
|
|
52
|
+
"dotenv": "^16.0.3",
|
|
53
|
+
"eslint": "^8.26.0",
|
|
54
54
|
"eslint-config-airbnb": "^19.0.4",
|
|
55
55
|
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
56
|
-
"eslint-import-resolver-typescript": "^3.5.
|
|
56
|
+
"eslint-import-resolver-typescript": "^3.5.2",
|
|
57
57
|
"eslint-plugin-import": "^2.26.0",
|
|
58
58
|
"prettier": "^2.7.1",
|
|
59
59
|
"prettier-plugin-jsdoc": "^0.4.2",
|
|
60
|
-
"sinon": "^14.0.
|
|
61
|
-
"typedoc": "^0.23.
|
|
60
|
+
"sinon": "^14.0.1",
|
|
61
|
+
"typedoc": "^0.23.19",
|
|
62
62
|
"typedoc-plugin-extras": "^2.3.0",
|
|
63
|
-
"typescript": "^4.8.
|
|
63
|
+
"typescript": "^4.8.4"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"atlassian-jwt": "^2.0.2",
|
package/src/api/contentBody.ts
CHANGED
|
@@ -65,4 +65,104 @@ export class ContentBody {
|
|
|
65
65
|
|
|
66
66
|
return this.client.sendRequest(config, callback);
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Converts a content body from one format to another format asynchronously. Returns the asyncId for the asynchronous
|
|
71
|
+
* task.
|
|
72
|
+
*
|
|
73
|
+
* Supported conversions:
|
|
74
|
+
*
|
|
75
|
+
* - Storage: export_view
|
|
76
|
+
*
|
|
77
|
+
* No other conversions are supported at the moment. Once a conversion is completed, it will be available for 5
|
|
78
|
+
* minutes at the result endpoint.
|
|
79
|
+
*
|
|
80
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',
|
|
81
|
+
* 'View' permission for the space, and permission to view the content.
|
|
82
|
+
*/
|
|
83
|
+
async asyncConvertContentBodyRequest<T = Models.AsyncId>(
|
|
84
|
+
parameters: Parameters.AsyncConvertContentBodyRequest,
|
|
85
|
+
callback: Callback<T>
|
|
86
|
+
): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Converts a content body from one format to another format asynchronously. Returns the asyncId for the asynchronous
|
|
89
|
+
* task.
|
|
90
|
+
*
|
|
91
|
+
* Supported conversions:
|
|
92
|
+
*
|
|
93
|
+
* - Storage: export_view
|
|
94
|
+
*
|
|
95
|
+
* No other conversions are supported at the moment. Once a conversion is completed, it will be available for 5
|
|
96
|
+
* minutes at the result endpoint.
|
|
97
|
+
*
|
|
98
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',
|
|
99
|
+
* 'View' permission for the space, and permission to view the content.
|
|
100
|
+
*/
|
|
101
|
+
async asyncConvertContentBodyRequest<T = Models.AsyncId>(
|
|
102
|
+
parameters: Parameters.AsyncConvertContentBodyRequest,
|
|
103
|
+
callback?: never
|
|
104
|
+
): Promise<T>;
|
|
105
|
+
async asyncConvertContentBodyRequest<T = Models.AsyncId>(
|
|
106
|
+
parameters: Parameters.AsyncConvertContentBodyRequest,
|
|
107
|
+
callback?: Callback<T>,
|
|
108
|
+
): Promise<void | T> {
|
|
109
|
+
const config: RequestConfig = {
|
|
110
|
+
url: `/api/contentbody/convert/async/${parameters.to}`,
|
|
111
|
+
method: 'POST',
|
|
112
|
+
params: {
|
|
113
|
+
spaceKeyContext: parameters.spaceKeyContext,
|
|
114
|
+
contentIdContext: parameters.contentIdContext,
|
|
115
|
+
allowCache: parameters.allowCache,
|
|
116
|
+
embeddedContentRender: parameters.embeddedContentRender,
|
|
117
|
+
expand: parameters.expand,
|
|
118
|
+
},
|
|
119
|
+
data: {
|
|
120
|
+
value: parameters.value,
|
|
121
|
+
representation: parameters.representation,
|
|
122
|
+
...parameters.additionalProperties,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
return this.client.sendRequest(config, callback);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Returns the Asynchronous Content Body for the corresponding asyncId if the task is complete or returns the status
|
|
131
|
+
* of the task.
|
|
132
|
+
*
|
|
133
|
+
* After the task is completed, the result can be obtained for 5 minutes, or until an identical conversion request is
|
|
134
|
+
* made again, with allowCache query param set to false.
|
|
135
|
+
*
|
|
136
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',
|
|
137
|
+
* 'View' permission for the space, and permission to view the content.
|
|
138
|
+
*/
|
|
139
|
+
async asyncConvertContentBodyResponse<T = Models.AsyncContentBody>(
|
|
140
|
+
parameters: Parameters.AsyncConvertContentBodyResponse,
|
|
141
|
+
callback: Callback<T>
|
|
142
|
+
): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Returns the Asynchronous Content Body for the corresponding asyncId if the task is complete or returns the status
|
|
145
|
+
* of the task.
|
|
146
|
+
*
|
|
147
|
+
* After the task is completed, the result can be obtained for 5 minutes, or until an identical conversion request is
|
|
148
|
+
* made again, with allowCache query param set to false.
|
|
149
|
+
*
|
|
150
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: If request specifies 'contentIdContext',
|
|
151
|
+
* 'View' permission for the space, and permission to view the content.
|
|
152
|
+
*/
|
|
153
|
+
async asyncConvertContentBodyResponse<T = Models.AsyncContentBody>(
|
|
154
|
+
parameters: Parameters.AsyncConvertContentBodyResponse,
|
|
155
|
+
callback?: never
|
|
156
|
+
): Promise<T>;
|
|
157
|
+
async asyncConvertContentBodyResponse<T = Models.AsyncContentBody>(
|
|
158
|
+
parameters: Parameters.AsyncConvertContentBodyResponse,
|
|
159
|
+
callback?: Callback<T>,
|
|
160
|
+
): Promise<void | T> {
|
|
161
|
+
const config: RequestConfig = {
|
|
162
|
+
url: `/api/contentbody/convert/async/${parameters.id}`,
|
|
163
|
+
method: 'GET',
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
return this.client.sendRequest(config, callback);
|
|
167
|
+
}
|
|
68
168
|
}
|
|
@@ -92,8 +92,10 @@ export class ContentChildrenAndDescendants {
|
|
|
92
92
|
*/
|
|
93
93
|
async movePage<T = Models.MovePage>(parameters: Parameters.MovePage, callback?: never): Promise<T>;
|
|
94
94
|
async movePage<T = Models.MovePage>(parameters: Parameters.MovePage, callback?: Callback<T>): Promise<void | T> {
|
|
95
|
+
const pageId = parameters.pageId || parameters.id;
|
|
96
|
+
|
|
95
97
|
const config: RequestConfig = {
|
|
96
|
-
url: `/api/content/${
|
|
98
|
+
url: `/api/content/${pageId}/move/${parameters.position}/${parameters.targetId}`,
|
|
97
99
|
method: 'PUT',
|
|
98
100
|
};
|
|
99
101
|
|
|
@@ -4,20 +4,22 @@ import { Callback } from '../callback';
|
|
|
4
4
|
import { Client } from '../clients';
|
|
5
5
|
import { RequestConfig } from '../requestConfig';
|
|
6
6
|
|
|
7
|
+
/** @deprecated Use {@link ContentStates} instead. */
|
|
7
8
|
export class ContentContentState {
|
|
9
|
+
/** @deprecated */
|
|
8
10
|
constructor(private client: Client) {}
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
|
-
* Gets the current page status of the draft or published version of content. To specify the draft
|
|
12
|
-
* parameter status to PUBLISHED, otherwise DRAFT.
|
|
13
|
+
* @deprecated Gets the current page status of the draft or published version of content. To specify the draft
|
|
14
|
+
* version, set the parameter status to PUBLISHED, otherwise DRAFT.
|
|
13
15
|
*/
|
|
14
16
|
async getContentState<T = Models.ContentStateContainer>(
|
|
15
17
|
parameters: Parameters.GetContentState,
|
|
16
18
|
callback: Callback<T>
|
|
17
19
|
): Promise<void>;
|
|
18
20
|
/**
|
|
19
|
-
* Gets the current page status of the draft or published version of content. To specify the draft
|
|
20
|
-
* parameter status to PUBLISHED, otherwise DRAFT.
|
|
21
|
+
* @deprecated Gets the current page status of the draft or published version of content. To specify the draft
|
|
22
|
+
* version, set the parameter status to PUBLISHED, otherwise DRAFT.
|
|
21
23
|
*/
|
|
22
24
|
async getContentState<T = Models.ContentStateContainer>(
|
|
23
25
|
parameters: Parameters.GetContentState,
|
|
@@ -39,28 +41,28 @@ export class ContentContentState {
|
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
/**
|
|
42
|
-
* Sets the content state of the content specified and creates a new version (publishes the content
|
|
43
|
-
* the body) of the content with the new status. The desired type of status must be allowed. There
|
|
44
|
-
* statuses and custom statuses. To specify the desired new status, one can use the id of the
|
|
45
|
-
* color of the status. If contentStateId is defined, then name and color are ignored. If
|
|
46
|
-
* defined, name and color will be used if provided. Firstly, we will determine if a status of
|
|
47
|
-
* exists, and if it does, that this status is used. If it does not exist, and custom statuses
|
|
48
|
-
* status with this name and color will be created. Color can be specified in traditional
|
|
49
|
-
* magenta, lavender, etc.) or as a hex string ex: #0ff0Fd.
|
|
44
|
+
* @deprecated Sets the content state of the content specified and creates a new version (publishes the content
|
|
45
|
+
* without changing the body) of the content with the new status. The desired type of status must be allowed. There
|
|
46
|
+
* are space suggested statuses and custom statuses. To specify the desired new status, one can use the id of the
|
|
47
|
+
* status or the name and color of the status. If contentStateId is defined, then name and color are ignored. If
|
|
48
|
+
* contentStateId is not defined, name and color will be used if provided. Firstly, we will determine if a status of
|
|
49
|
+
* this name and color exists, and if it does, that this status is used. If it does not exist, and custom statuses
|
|
50
|
+
* are allowed, a custom status with this name and color will be created. Color can be specified in traditional
|
|
51
|
+
* english colors (teal, magenta, lavender, etc.) or as a hex string ex: #0ff0Fd.
|
|
50
52
|
*/
|
|
51
53
|
async setContentState<T = Models.ContentStateContainer>(
|
|
52
54
|
parameters: Parameters.SetContentState,
|
|
53
55
|
callback: Callback<T>
|
|
54
56
|
): Promise<void>;
|
|
55
57
|
/**
|
|
56
|
-
* Sets the content state of the content specified and creates a new version (publishes the content
|
|
57
|
-
* the body) of the content with the new status. The desired type of status must be allowed. There
|
|
58
|
-
* statuses and custom statuses. To specify the desired new status, one can use the id of the
|
|
59
|
-
* color of the status. If contentStateId is defined, then name and color are ignored. If
|
|
60
|
-
* defined, name and color will be used if provided. Firstly, we will determine if a status of
|
|
61
|
-
* exists, and if it does, that this status is used. If it does not exist, and custom statuses
|
|
62
|
-
* status with this name and color will be created. Color can be specified in traditional
|
|
63
|
-
* magenta, lavender, etc.) or as a hex string ex: #0ff0Fd.
|
|
58
|
+
* @deprecated Sets the content state of the content specified and creates a new version (publishes the content
|
|
59
|
+
* without changing the body) of the content with the new status. The desired type of status must be allowed. There
|
|
60
|
+
* are space suggested statuses and custom statuses. To specify the desired new status, one can use the id of the
|
|
61
|
+
* status or the name and color of the status. If contentStateId is defined, then name and color are ignored. If
|
|
62
|
+
* contentStateId is not defined, name and color will be used if provided. Firstly, we will determine if a status of
|
|
63
|
+
* this name and color exists, and if it does, that this status is used. If it does not exist, and custom statuses
|
|
64
|
+
* are allowed, a custom status with this name and color will be created. Color can be specified in traditional
|
|
65
|
+
* english colors (teal, magenta, lavender, etc.) or as a hex string ex: #0ff0Fd.
|
|
64
66
|
*/
|
|
65
67
|
async setContentState<T = Models.ContentStateContainer>(
|
|
66
68
|
parameters: Parameters.SetContentState,
|
|
@@ -84,16 +86,16 @@ export class ContentContentState {
|
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
/**
|
|
87
|
-
* Removes the content state of the content specified and creates a new version (publishes the content
|
|
88
|
-
* changing the body) of the content with the new status.
|
|
89
|
+
* @deprecated Removes the content state of the content specified and creates a new version (publishes the content
|
|
90
|
+
* without changing the body) of the content with the new status.
|
|
89
91
|
*/
|
|
90
92
|
async removeContentState<T = Models.ContentStateContainer>(
|
|
91
93
|
parameters: Parameters.RemoveContentState,
|
|
92
94
|
callback: Callback<T>
|
|
93
95
|
): Promise<void>;
|
|
94
96
|
/**
|
|
95
|
-
* Removes the content state of the content specified and creates a new version (publishes the content
|
|
96
|
-
* changing the body) of the content with the new status.
|
|
97
|
+
* @deprecated Removes the content state of the content specified and creates a new version (publishes the content
|
|
98
|
+
* without changing the body) of the content with the new status.
|
|
97
99
|
*/
|
|
98
100
|
async removeContentState<T = Models.ContentStateContainer>(
|
|
99
101
|
parameters: Parameters.RemoveContentState,
|
|
@@ -111,12 +113,12 @@ export class ContentContentState {
|
|
|
111
113
|
return this.client.sendRequest(config, callback);
|
|
112
114
|
}
|
|
113
115
|
|
|
114
|
-
/** Gets a Global Timestamp of the last time the content state was updated */
|
|
116
|
+
/** @deprecated Gets a Global Timestamp of the last time the content state was updated */
|
|
115
117
|
async getContentStateLastUpdated<T = unknown>(
|
|
116
118
|
parameters: Parameters.GetContentStateLastUpdated,
|
|
117
119
|
callback: Callback<T>
|
|
118
120
|
): Promise<void>;
|
|
119
|
-
/** Gets a Global Timestamp of the last time the content state was updated */
|
|
121
|
+
/** @deprecated Gets a Global Timestamp of the last time the content state was updated */
|
|
120
122
|
async getContentStateLastUpdated<T = unknown>(
|
|
121
123
|
parameters: Parameters.GetContentStateLastUpdated,
|
|
122
124
|
callback?: never
|
|
@@ -133,12 +135,12 @@ export class ContentContentState {
|
|
|
133
135
|
return this.client.sendRequest(config, callback);
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
/** Gets content states that are available for the content to be set as. */
|
|
138
|
+
/** @deprecated Gets content states that are available for the content to be set as. */
|
|
137
139
|
async getAvailableContentStates<T = Models.AvailableContentStates>(
|
|
138
140
|
parameters: Parameters.GetAvailableContentStates,
|
|
139
141
|
callback: Callback<T>
|
|
140
142
|
): Promise<void>;
|
|
141
|
-
/** Gets content states that are available for the content to be set as. */
|
|
143
|
+
/** @deprecated Gets content states that are available for the content to be set as. */
|
|
142
144
|
async getAvailableContentStates<T = Models.AvailableContentStates>(
|
|
143
145
|
parameters: Parameters.GetAvailableContentStates,
|
|
144
146
|
callback?: never
|
|
@@ -58,4 +58,119 @@ export class ContentMacroBody {
|
|
|
58
58
|
|
|
59
59
|
return this.client.sendRequest(config, callback);
|
|
60
60
|
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Returns the body of a macro in format specified in path, for the given macro ID. This includes information like the
|
|
64
|
+
* name of the macro, the body of the macro, and any macro parameters.
|
|
65
|
+
*
|
|
66
|
+
* About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for
|
|
67
|
+
* it, unless an ID is specified (by an app). The macro ID will look similar to this:
|
|
68
|
+
* '50884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is
|
|
69
|
+
* only modified by Confluence if there are conflicting IDs.
|
|
70
|
+
*
|
|
71
|
+
* Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a
|
|
72
|
+
* macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and
|
|
73
|
+
* transparently propagate out to all instances.
|
|
74
|
+
*
|
|
75
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the
|
|
76
|
+
* macro is in.
|
|
77
|
+
*/
|
|
78
|
+
async getAndConvertMacroBodyByMacroId<T = Models.ContentBody>(
|
|
79
|
+
parameters: Parameters.GetAndConvertMacroBodyByMacroId,
|
|
80
|
+
callback: Callback<T>
|
|
81
|
+
): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Returns the body of a macro in format specified in path, for the given macro ID. This includes information like the
|
|
84
|
+
* name of the macro, the body of the macro, and any macro parameters.
|
|
85
|
+
*
|
|
86
|
+
* About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for
|
|
87
|
+
* it, unless an ID is specified (by an app). The macro ID will look similar to this:
|
|
88
|
+
* '50884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is
|
|
89
|
+
* only modified by Confluence if there are conflicting IDs.
|
|
90
|
+
*
|
|
91
|
+
* Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a
|
|
92
|
+
* macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and
|
|
93
|
+
* transparently propagate out to all instances.
|
|
94
|
+
*
|
|
95
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the
|
|
96
|
+
* macro is in.
|
|
97
|
+
*/
|
|
98
|
+
async getAndConvertMacroBodyByMacroId<T = Models.ContentBody>(
|
|
99
|
+
parameters: Parameters.GetAndConvertMacroBodyByMacroId,
|
|
100
|
+
callback?: never
|
|
101
|
+
): Promise<T>;
|
|
102
|
+
async getAndConvertMacroBodyByMacroId<T = Models.ContentBody>(
|
|
103
|
+
parameters: Parameters.GetAndConvertMacroBodyByMacroId,
|
|
104
|
+
callback?: Callback<T>,
|
|
105
|
+
): Promise<void | T> {
|
|
106
|
+
const config: RequestConfig = {
|
|
107
|
+
url: `/api/content/${parameters.id}/history/${parameters.version}/macro/id/${parameters.macroId}/convert/${parameters.to}`,
|
|
108
|
+
method: 'GET',
|
|
109
|
+
params: {
|
|
110
|
+
spaceKeyContext: parameters.spaceKeyContext,
|
|
111
|
+
embeddedContentRender: parameters.embeddedContentRender,
|
|
112
|
+
expand: parameters.expand,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return this.client.sendRequest(config, callback);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Returns Async Id of the conversion task which will convert the macro into a content body of the desired format. The
|
|
121
|
+
* result will be available for 5 minutes after completion of the conversion.
|
|
122
|
+
*
|
|
123
|
+
* About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for
|
|
124
|
+
* it, unless an ID is specified (by an app). The macro ID will look similar to this:
|
|
125
|
+
* '884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is only
|
|
126
|
+
* modified by Confluence if there are conflicting IDs.
|
|
127
|
+
*
|
|
128
|
+
* Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a
|
|
129
|
+
* macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and
|
|
130
|
+
* transparently propagate out to all instances.
|
|
131
|
+
*
|
|
132
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the
|
|
133
|
+
* macro is in.
|
|
134
|
+
*/
|
|
135
|
+
async getAndAsyncConvertMacroBodyByMacroId<T = Models.AsyncId>(
|
|
136
|
+
parameters: Parameters.GetAndAsyncConvertMacroBodyByMacroId,
|
|
137
|
+
callback: Callback<T>
|
|
138
|
+
): Promise<void>;
|
|
139
|
+
/**
|
|
140
|
+
* Returns Async Id of the conversion task which will convert the macro into a content body of the desired format. The
|
|
141
|
+
* result will be available for 5 minutes after completion of the conversion.
|
|
142
|
+
*
|
|
143
|
+
* About the macro ID: When a macro is created in a new version of content, Confluence will generate a random ID for
|
|
144
|
+
* it, unless an ID is specified (by an app). The macro ID will look similar to this:
|
|
145
|
+
* '884bd9-0cb8-41d5-98be-f80943c14f96'. The ID is then persisted as new versions of content are created, and is only
|
|
146
|
+
* modified by Confluence if there are conflicting IDs.
|
|
147
|
+
*
|
|
148
|
+
* Note, to preserve backwards compatibility this resource will also match on the hash of the macro body, even if a
|
|
149
|
+
* macro ID is found. This check will eventually become redundant, as macro IDs are generated for pages and
|
|
150
|
+
* transparently propagate out to all instances.
|
|
151
|
+
*
|
|
152
|
+
* **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to view the content that the
|
|
153
|
+
* macro is in.
|
|
154
|
+
*/
|
|
155
|
+
async getAndAsyncConvertMacroBodyByMacroId<T = Models.AsyncId>(
|
|
156
|
+
parameters: Parameters.GetAndAsyncConvertMacroBodyByMacroId,
|
|
157
|
+
callback?: never
|
|
158
|
+
): Promise<T>;
|
|
159
|
+
async getAndAsyncConvertMacroBodyByMacroId<T = Models.AsyncId>(
|
|
160
|
+
parameters: Parameters.GetAndAsyncConvertMacroBodyByMacroId,
|
|
161
|
+
callback?: Callback<T>,
|
|
162
|
+
): Promise<void | T> {
|
|
163
|
+
const config: RequestConfig = {
|
|
164
|
+
url: `/api/content/${parameters.id}/history/${parameters.version}/macro/id/${parameters.macroId}/convert/async/${parameters.to}`,
|
|
165
|
+
method: 'GET',
|
|
166
|
+
params: {
|
|
167
|
+
allowCache: parameters.allowCache,
|
|
168
|
+
spaceKeyContext: parameters.spaceKeyContext,
|
|
169
|
+
embeddedContentRender: parameters.embeddedContentRender,
|
|
170
|
+
expand: parameters.expand,
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
return this.client.sendRequest(config, callback);
|
|
175
|
+
}
|
|
61
176
|
}
|