Skip to content

Commit 68817e6

Browse files
committed
1.1.2
1 parent 75cd1d2 commit 68817e6

File tree

9 files changed

+246
-52
lines changed

9 files changed

+246
-52
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ jobs:
2626
echo EMAIL=${{ secrets.EMAIL }} >> .env
2727
echo API_TOKEN=${{ secrets.API_TOKEN }} >> .env
2828
- run: npm run build
29-
- run: npm test
29+
- run: npm run test:unit
30+
- run: npm run test:e2e
3031
- run: npm run lint
3132
env:
3233
CI: true

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Changelog
22

3+
### 1.1.2
4+
5+
- `expand` property added to `Content.getContent` request.
6+
- `expand` property added to `Content.createContent` request.
7+
- `Content.updateContent` request body fixed. ([#6](https://github.com/MrRefactoring/confluence.js/issues/6) Thanks [eddiegroves](https://github.com/eddiegroves) for catching)
8+
39
### 1.1.1
410

5-
- `expand` property added to `ContentAttachments.getAttachments`.
11+
- `expand` property added to `ContentAttachments.getAttachments`. ([#4](https://github.com/MrRefactoring/confluence.js/issues/4) Thanks [eddiegroves](https://github.com/eddiegroves) for catching)
612

713
### 1.1.0
814

package-lock.json

Lines changed: 41 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "confluence.js",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "confluence.js is a powerful Node.JS/Browser module that allows you to interact with the Confluence API very easily",
55
"main": "out/index.js",
66
"types": "out/index.d.ts",
@@ -37,8 +37,8 @@
3737
"@types/jest": "^26.0.24",
3838
"@types/oauth": "^0.9.1",
3939
"@types/sinon": "^10.0.2",
40-
"@typescript-eslint/eslint-plugin": "^4.29.0",
41-
"@typescript-eslint/parser": "^4.29.0",
40+
"@typescript-eslint/eslint-plugin": "^4.29.1",
41+
"@typescript-eslint/parser": "^4.29.1",
4242
"dotenv": "^10.0.0",
4343
"eslint": "^7.32.0",
4444
"eslint-config-airbnb-typescript": "^12.3.1",
@@ -57,6 +57,6 @@
5757
"axios": "^0.21.1",
5858
"oauth": "^0.9.15",
5959
"telemetry.confluence.js": "<2",
60-
"tslib": "^2.3.0"
60+
"tslib": "^2.3.1"
6161
}
6262
}

src/api/content.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export class Content {
4545
orderby: parameters?.orderby,
4646
start: parameters?.start,
4747
limit: parameters?.limit,
48+
expand: parameters?.expand,
4849
},
4950
};
5051

@@ -89,6 +90,7 @@ export class Content {
8990
method: 'POST',
9091
params: {
9192
status: parameters?.status,
93+
expand: parameters?.expand,
9294
},
9395
data: {
9496
...parameters,
@@ -346,7 +348,14 @@ export class Content {
346348
status: parameters.status,
347349
conflictPolicy: parameters.conflictPolicy,
348350
},
349-
data: parameters.body,
351+
data: {
352+
version: parameters.version,
353+
title: parameters.title,
354+
type: parameters.type,
355+
status: parameters.statusBody,
356+
ancestors: parameters.ancestors,
357+
body: parameters.body,
358+
},
350359
};
351360

352361
return this.client.sendRequest(config, callback, { methodName: 'updateContent' });

src/api/models/contentUpdate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface ContentUpdate {
2020
* The updated status of the content. Note, if you change the status of a page from 'current' to 'draft' and it has an
2121
* existing draft, the existing draft will be deleted in favor of the updated page.
2222
*/
23-
status?: string;
23+
status?: 'current' | 'trashed' | 'historical' | 'draft' | string;
2424
/** The new parent for the content. Only one parent content 'id' can be specified. */
2525
ancestors?: {
2626
/** The `id` of the parent content. */

src/api/parameters/createContent.ts

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,90 @@ export interface CreateContent extends ContentCreate {
44
/** Filter the returned content by status. */
55
status?: string;
66
/** A multi-value parameter indicating which properties of the content to expand. */
7-
expand?: string[];
7+
expand?: string | string[] | CreateContent.Expand | CreateContent.Expand[];
8+
}
9+
10+
export namespace CreateContent {
11+
export enum Expand {
12+
/**
13+
* Returns whether the content has attachments, comments, or child pages. Use this if you only need to check whether
14+
* the content has children of a particular type.
15+
*/
16+
AllChildTypes = 'childTypes.all',
17+
/** Returns whether the content has attachments. */
18+
AttachmentChildType = 'childTypes.attachment',
19+
/** Returns whether the content has comments. */
20+
CommentChildType = 'childTypes.comment',
21+
/** Returns whether the content has child pages. */
22+
PageChildType = 'childTypes.page',
23+
/**
24+
* Returns the space that the content is in. This is the same as the information returned by [Get
25+
* space](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/).
26+
*/
27+
Container = 'container',
28+
/**
29+
* Returns information about the current user in relation to the content, including when they last viewed it,
30+
* modified it, contributed to it, or added it as a favorite.
31+
*/
32+
CurrentUserMetadata = 'metadata.currentuser',
33+
/** Returns content properties that have been set via the Confluence REST API. */
34+
PropertiesMetadata = 'metadata.properties',
35+
/** Returns the labels that have been added to the content. */
36+
LabelsMetadata = 'metadata.labels',
37+
/** This property is only used by Atlassian. */
38+
FrontendMetadata = 'metadata.frontend',
39+
/** Returns the operations for the content, which are used when setting permissions. */
40+
Operations = 'operations',
41+
/** Returns pages that are descendants at the level immediately below the content. */
42+
PageChildren = 'children.page',
43+
/** Returns all attachments for the content. */
44+
AttachmentChildren = 'children.attachment',
45+
/** Returns all comments on the content. */
46+
CommentChildren = 'children.comment',
47+
/** Returns the users that have permission to read the content. */
48+
ReadUserRestriction = 'restrictions.read.restrictions.user',
49+
/**
50+
* Returns the groups that have permission to read the content. Note that this may return deleted groups, because
51+
* deleting a group doesn't remove associated restrictions.
52+
*/
53+
ReadGroupRestriction = 'restrictions.read.restrictions.group',
54+
/** Returns the users that have permission to update the content. */
55+
UpdateUserRestriction = 'restrictions.update.restrictions.user',
56+
/**
57+
* Returns the groups that have permission to update the content. Note that this may return deleted groups because
58+
* deleting a group doesn't remove associated restrictions.
59+
*/
60+
UpdateGroupRestriction = 'restrictions.update.restrictions.group',
61+
/** Returns the history of the content, including the date it was created. */
62+
History = 'history',
63+
/** Returns information about the most recent update of the content, including who updated it and when it was updated. */
64+
LastUpdated = 'history.lastUpdated',
65+
/** Returns information about the update prior to the current content update. */
66+
PreviousVersion = 'history.previousVersion',
67+
/** Returns all of the users who have contributed to the content. */
68+
Contributors = 'history.contributors',
69+
/** Returns information about the update after to the current content update. */
70+
NextVersion = 'history.nextVersion',
71+
/** Returns the parent page, if the content is a page. */
72+
Ancestors = 'ancestors',
73+
/** Returns the body of the content in different formats, including the editor format, view format, and export format. */
74+
Body = 'body',
75+
/** Returns information about the most recent update of the content, including who updated it and when it was updated. */
76+
Version = 'version',
77+
/** Returns pages that are descendants at any level below the content. */
78+
PageDescendant = 'descendants.page',
79+
/** Returns all attachments for the content, same as `children.attachment`. */
80+
AttachmentDescendant = 'descendants.attachment',
81+
/** Returns all comments on the content, same as `children.comment`. */
82+
CommentDescendant = 'descendants.comment',
83+
/**
84+
* Returns the space that the content is in. This is the same as the information returned by [Get
85+
* space](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/).
86+
*/
87+
Space = 'space',
88+
/** Returns inline comment-specific properties. */
89+
InlineProperties = 'extensions.inlineProperties',
90+
/** Returns the resolution status of each comment. */
91+
Resolution = 'extensions.resolution',
92+
}
893
}

0 commit comments

Comments
 (0)