Skip to content

Commit db0d680

Browse files
#23 ContentAttachments fixes (#24)
* ContentAttachments fixes * pipeline fixes
1 parent 738dc56 commit db0d680

25 files changed

+734
-461
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"jest": true
1818
},
1919
"rules": {
20+
"arrow-parens": ["error", "as-needed"],
2021
"@typescript-eslint/lines-between-class-members": "off",
2122
"max-len": "off",
2223
"class-methods-use-this": "off",

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### 1.5.0
4+
5+
`ContentAttachments` fixes for all attachments. ([#23](https://github.com/MrRefactoring/confluence.js/issues/23) Thanks [Anton](https://github.com/tester22) for catching)
6+
37
### 1.4.1
48

59
- Dependencies updated.

package-lock.json

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

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "confluence.js",
3-
"version": "1.4.1",
3+
"version": "1.5.0",
44
"description": "confluence.js is a powerful Node.JS/Browser module that allows you to interact with the Confluence API very easily",
55
"author": "Vladislav Tupikin <[email protected]>",
66
"license": "MIT",
@@ -14,7 +14,7 @@
1414
"test": "npm run test:unit && npm run test:e2e",
1515
"prettier": "prettier --write src/**/*.ts",
1616
"doc": "typedoc --name \"Confluence.js - Cloud and Server API library\" --out docs ./src/index.ts --plugin typedoc-plugin-extras --footerDate --footerTime --footerTypedocVersion --favicon https://svgshare.com/i/bVi.svg",
17-
"lint": "eslint src --ext .ts",
17+
"lint": "eslint src tests --ext .ts",
1818
"lint:fix": "npm run lint -- --fix",
1919
"test:unit": "ava tests/unit",
2020
"test:e2e": "ava --timeout=2m --fail-fast --no-worker-threads -c 1 -s tests/e2e/**/*.test.ts"
@@ -36,34 +36,36 @@
3636
"api",
3737
"wrapper",
3838
"client",
39+
"cloud",
3940
"rest",
4041
"wiki",
4142
"atlassian"
4243
],
4344
"devDependencies": {
44-
"@swc-node/register": "^1.4.2",
45+
"@swc-node/register": "^1.5.1",
4546
"@types/express": "^4.17.13",
4647
"@types/oauth": "^0.9.1",
4748
"@types/sinon": "^10.0.11",
48-
"@typescript-eslint/eslint-plugin": "^5.21.0",
49-
"@typescript-eslint/parser": "^5.21.0",
49+
"@typescript-eslint/eslint-plugin": "^5.25.0",
50+
"@typescript-eslint/parser": "^5.25.0",
5051
"ava": "^4.2.0",
51-
"dotenv": "^16.0.0",
52-
"eslint": "^8.14.0",
52+
"dotenv": "^16.0.1",
53+
"eslint": "^8.16.0",
5354
"eslint-config-airbnb": "^19.0.4",
5455
"eslint-config-airbnb-typescript": "^17.0.0",
5556
"eslint-import-resolver-typescript": "^2.7.1",
5657
"eslint-plugin-import": "^2.26.0",
5758
"prettier": "^2.6.2",
5859
"prettier-plugin-jsdoc": "^0.3.38",
59-
"sinon": "^13.0.2",
60+
"sinon": "^14.0.0",
6061
"typedoc": "^0.22.15",
6162
"typedoc-plugin-extras": "^2.2.3",
62-
"typescript": "^4.6.3"
63+
"typescript": "^4.6.4"
6364
},
6465
"dependencies": {
6566
"atlassian-jwt": "^2.0.2",
66-
"axios": "^0.27.0",
67+
"axios": "^0.27.2",
68+
"form-data": "^4.0.0",
6769
"oauth": "^0.9.15",
6870
"tslib": "^2.4.0"
6971
}

src/api/contentAttachments.ts

Lines changed: 85 additions & 197 deletions
Large diffs are not rendered by default.

src/api/models/attachment.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { AttachmentMetadata } from './attachmentMetadata';
2+
import { GenericLinks } from './genericLinks';
3+
4+
export interface Attachment {
5+
id: string;
6+
type: 'attachment' | string;
7+
status: 'current' | string;
8+
title: string;
9+
macroRenderedOutput: any;
10+
metadata: AttachmentMetadata;
11+
extensions: {
12+
mediaType: string;
13+
fileSize: number;
14+
comment: string;
15+
mediaTypeDescription: string;
16+
fileId: string;
17+
};
18+
_expandable: {
19+
childTypes: string;
20+
operations: string;
21+
schedulePublishDate: string;
22+
children: string;
23+
restrictions: string;
24+
history: string;
25+
ancestors: string;
26+
body: string;
27+
descendants: string;
28+
space: string;
29+
};
30+
_links: GenericLinks;
31+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { GenericLinks } from './genericLinks';
2+
3+
export interface AttachmentContainer {
4+
id: string;
5+
type: 'page' | 'string';
6+
status: 'current' | string;
7+
title: string;
8+
macroRenderedOutput: any;
9+
extensions: {
10+
position: number;
11+
};
12+
_expandable: {
13+
container: string;
14+
metadata: string;
15+
restrictions: string;
16+
history:string;
17+
body: string;
18+
version: string;
19+
descendants: string;
20+
space: string;
21+
childTypes: string;
22+
operations: string;
23+
schedulePublishDate: string;
24+
children: string;
25+
ancestors: string;
26+
};
27+
_links: GenericLinks;
28+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { GenericLinks } from './genericLinks';
2+
3+
export interface AttachmentMetadata {
4+
comment: string;
5+
mediaType: string;
6+
labels: {
7+
results: string[];
8+
start: number;
9+
limit: number;
10+
size: number;
11+
_links: GenericLinks;
12+
};
13+
_expandable: {
14+
currentuser: string;
15+
comments: string;
16+
simple: string;
17+
properties: string;
18+
frontend: string;
19+
likes: string;
20+
};
21+
}

src/api/models/attachmentUpdate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @deprecated will be removed in second major version */
12
export interface AttachmentUpdate {
23
/**
34
* The attachment version. Set this to the current version number of the attachment. Note, the version number only

src/api/models/contentArray.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Content } from './content';
22
import { GenericLinks } from './genericLinks';
33

4-
export interface ContentArray {
5-
results: Content[];
6-
start: number;
7-
limit: number;
4+
export interface ContentArray<T = Content> {
5+
results: T[];
6+
start?: number;
7+
limit?: number;
88
size: number;
99
_links: GenericLinks;
1010
}

0 commit comments

Comments
 (0)