Skip to content

Commit 70ffa79

Browse files
committed
Updated sources
1 parent c5fd227 commit 70ffa79

7 files changed

Lines changed: 81 additions & 14 deletions

File tree

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "groupdocs-annotation-cloud",
3-
"version": "21.2.0",
3+
"version": "21.6.0",
44
"description": "GroupDocs.Annotation Cloud SDK for Node.js",
55
"homepage": "https://products.groupdocs.cloud/annotation",
66
"author": {

src/api_client.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,17 @@ async function invokeApiMethodInternal(requestOptions: request.Options, config:
9999
bodyContent = JSON.parse(bodyContent.toString("utf8"));
100100
}
101101
if (bodyContent.error) {
102-
reject({ message: bodyContent.error, code: response.statusCode });
103-
} else if (bodyContent.Error) {
104-
reject({ message: bodyContent.Error.Message, code: response.statusCode });
102+
if (bodyContent.error.message) {
103+
reject({ message: bodyContent.error.message, code: bodyContent.error.code });
104+
} else {
105+
reject({ message: bodyContent.error, code: response.statusCode });
106+
}
107+
} else {
108+
if (bodyContent.message) {
109+
reject({ message: bodyContent.message, code: bodyContent.code });
110+
} else {
111+
reject({ message: bodyContent, code: response.statusCode });
112+
}
105113
}
106114
} catch (error) {
107115
reject({ message: "Error while parse server error: " + error });

src/model.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ export class AnnotateOptions {
6060
name: "outputPath",
6161
baseName: "outputPath",
6262
type: "string",
63+
},
64+
{
65+
name: "fontsPath",
66+
baseName: "fontsPath",
67+
type: "string",
6368
} ];
6469

6570
/**
@@ -99,6 +104,11 @@ export class AnnotateOptions {
99104
*/
100105
public outputPath: string;
101106

107+
/**
108+
* The path to directory containing custom fonts in storage
109+
*/
110+
public fontsPath: string;
111+
102112
public constructor(init?: Partial<AnnotateOptions>) {
103113

104114
Object.assign(this, init);
@@ -239,6 +249,11 @@ export class AnnotationInfo {
239249
baseName: "angle",
240250
type: "number",
241251
},
252+
{
253+
name: "zIndex",
254+
baseName: "zIndex",
255+
type: "number",
256+
},
242257
{
243258
name: "url",
244259
baseName: "url",
@@ -382,6 +397,11 @@ export class AnnotationInfo {
382397
*/
383398
public angle: number;
384399

400+
/**
401+
* Gets or sets z-index. Default value is 0 The z-index property specifies the stack order of an element.
402+
*/
403+
public zIndex: number;
404+
385405
/**
386406
* Gets or sets annotation link url
387407
*/
@@ -1337,10 +1357,25 @@ export class PreviewOptions {
13371357
baseName: "height",
13381358
type: "number",
13391359
},
1360+
{
1361+
name: "resolution",
1362+
baseName: "resolution",
1363+
type: "number",
1364+
},
13401365
{
13411366
name: "renderComments",
13421367
baseName: "renderComments",
13431368
type: "boolean",
1369+
},
1370+
{
1371+
name: "renderAnnotations",
1372+
baseName: "renderAnnotations",
1373+
type: "boolean",
1374+
},
1375+
{
1376+
name: "fontsPath",
1377+
baseName: "fontsPath",
1378+
type: "string",
13441379
} ];
13451380

13461381
/**
@@ -1375,11 +1410,26 @@ export class PreviewOptions {
13751410
*/
13761411
public height: number;
13771412

1413+
/**
1414+
* Gets or sets the resolution for generated images, in dots per inch. The default value is 96.
1415+
*/
1416+
public resolution: number;
1417+
13781418
/**
13791419
* Render document comments. Default value is 'false'.
13801420
*/
13811421
public renderComments: boolean;
13821422

1423+
/**
1424+
* The property that controls whether annotations will be generated on the preview. Default State - true.
1425+
*/
1426+
public renderAnnotations: boolean;
1427+
1428+
/**
1429+
* The path to directory containing custom fonts in storage
1430+
*/
1431+
public fontsPath: string;
1432+
13831433
public constructor(init?: Partial<PreviewOptions>) {
13841434

13851435
Object.assign(this, init);

src/package_version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
/**
2626
* Package version
2727
*/
28-
export const PackageVersion: string = "21.2.0";
28+
export const PackageVersion: string = "21.6.0";

src/serializer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class Serializer {
132132
}
133133

134134
private static findCorrectType(data: any, expectedType: string) {
135-
if (data === undefined) {
135+
if (data === undefined || data === null) {
136136
return expectedType;
137137
} else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
138138
return expectedType;

test/api/test_info_api.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,13 @@ describe("info_api", () => {
6565
expect(response.path).equal(file.GetPath());
6666
}
6767
});
68+
69+
it("test_get_info_file_not_found", () => {
70+
let fileInfo = new Model.FileInfo();
71+
fileInfo.filePath = "some-folder\\NotExist.docx";
72+
const request = new GetInfoRequest(fileInfo);
73+
return TestContext.getInfoApi().getInfo(request).catch((error) => {
74+
expect(error.message).equal("Specified file not found");
75+
});
76+
});
6877
});

0 commit comments

Comments
 (0)