Skip to content

Commit 9c11555

Browse files
committed
Updated sources
1 parent 70ffa79 commit 9c11555

13 files changed

Lines changed: 948 additions & 999 deletions

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "groupdocs-annotation-cloud",
3-
"version": "21.6.0",
3+
"version": "22.2.0",
44
"description": "GroupDocs.Annotation Cloud SDK for Node.js",
55
"homepage": "https://products.groupdocs.cloud/annotation",
66
"author": {
@@ -40,9 +40,9 @@
4040
"@types/mocha": "^5.2.7",
4141
"@types/node": "^12.19.15",
4242
"chai": "^4.2.0",
43-
"mocha": "^7.0.1",
43+
"mocha": "^9.1.2",
4444
"ts-node": "^8.6.2",
45-
"tslint": "^5.17.0",
45+
"tslint": "^6.1.0",
4646
"typescript": "^3.7.5"
4747
}
4848
}

src/annotation_api.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,63 @@ export class InfoApi {
699699
return Promise.resolve(result);
700700
}
701701

702+
}
703+
/**
704+
* GroupDocs.Annotation Cloud API
705+
*/
706+
export class LicenseApi {
707+
708+
/**
709+
* Creates new instance of LicenseApi
710+
* @param appSid Application identifier (App SID).
711+
* @param appKey Application private key (App Key).
712+
*/
713+
public static fromKeys(appSid: string, appKey: string) {
714+
const config = new Configuration(appSid, appKey);
715+
return new LicenseApi(config);
716+
}
717+
718+
/**
719+
* Creates new instance of LicenseApi
720+
* @param config API configuration.
721+
*/
722+
public static fromConfig(config: Configuration) {
723+
return new LicenseApi(config);
724+
}
725+
726+
/**
727+
* Configuration
728+
*/
729+
private configuration: Configuration;
730+
731+
/**
732+
* @param config Configuration.
733+
*/
734+
private constructor(config: Configuration) {
735+
this.configuration = config;
736+
}
737+
738+
/**
739+
* Get license consumption
740+
* @param requestObj contains request parameters
741+
*/
742+
public async getConsumptionCredit(): Promise<model.ConsumptionResult> {
743+
744+
const localVarPath = this.configuration.getServerUrl() + "/annotation/consumption";
745+
const queryParameters: any = {};
746+
747+
const requestOptions: request.Options = {
748+
method: "GET",
749+
qs: queryParameters,
750+
uri: localVarPath,
751+
json: true,
752+
};
753+
754+
const response = await invokeApiMethod(requestOptions, this.configuration);
755+
const result = Serializer.deserialize(response.body, "ConsumptionResult");
756+
return Promise.resolve(result);
757+
}
758+
702759
}
703760
/**
704761
* GroupDocs.Annotation Cloud API

src/model.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ export class AnnotationInfo {
229229
baseName: "backgroundColor",
230230
type: "number",
231231
},
232+
{
233+
name: "squigglyColor",
234+
baseName: "squigglyColor",
235+
type: "number",
236+
},
232237
{
233238
name: "fontFamily",
234239
baseName: "fontFamily",
@@ -263,6 +268,11 @@ export class AnnotationInfo {
263268
name: "imagePath",
264269
baseName: "imagePath",
265270
type: "string",
271+
},
272+
{
273+
name: "autoScale",
274+
baseName: "autoScale",
275+
type: "boolean",
266276
} ];
267277

268278
/**
@@ -377,6 +387,11 @@ export class AnnotationInfo {
377387
*/
378388
public backgroundColor: number;
379389

390+
/**
391+
* Gets or sets annotation color
392+
*/
393+
public squigglyColor: number;
394+
380395
/**
381396
* Gets or sets the annotation's font family
382397
*/
@@ -412,6 +427,11 @@ export class AnnotationInfo {
412427
*/
413428
public imagePath: string;
414429

430+
/**
431+
* Sets auto scale for watermark annotation
432+
*/
433+
public autoScale: boolean;
434+
415435
public constructor(init?: Partial<AnnotationInfo>) {
416436

417437
Object.assign(this, init);
@@ -451,6 +471,7 @@ export namespace AnnotationInfo {
451471
TextUnderline = 'TextUnderline' as any,
452472
Watermark = 'Watermark' as any,
453473
Image = 'Image' as any,
474+
TextSquiggly = 'TextSquiggly' as any,
454475
}
455476
export enum PenStyleEnum {
456477
Solid = 'Solid' as any,
@@ -555,6 +576,49 @@ export class AnnotationReplyInfo {
555576
}
556577
}
557578

579+
/**
580+
* Metered license consumption information
581+
*/
582+
export class ConsumptionResult {
583+
584+
/**
585+
* Attribute type map
586+
*/
587+
public static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
588+
{
589+
name: "credit",
590+
baseName: "credit",
591+
type: "number",
592+
},
593+
{
594+
name: "quantity",
595+
baseName: "quantity",
596+
type: "number",
597+
} ];
598+
599+
/**
600+
* Returns attribute type map
601+
*/
602+
public static getAttributeTypeMap() {
603+
return ConsumptionResult.attributeTypeMap;
604+
}
605+
606+
/**
607+
* Amount of used credits
608+
*/
609+
public credit: number;
610+
611+
/**
612+
* Amount of MBs processed
613+
*/
614+
public quantity: number;
615+
616+
public constructor(init?: Partial<ConsumptionResult>) {
617+
618+
Object.assign(this, init);
619+
}
620+
}
621+
558622
/**
559623
* Class for disc space information.
560624
*/
@@ -1780,6 +1844,7 @@ const typeMap = {
17801844
AnnotateOptions,
17811845
AnnotationInfo,
17821846
AnnotationReplyInfo,
1847+
ConsumptionResult,
17831848
DiscUsage,
17841849
DocumentInfo,
17851850
ErrorDetails,

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.6.0";
28+
export const PackageVersion: string = "22.2.0";

test/api/test_annotate_api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import { ExtractRequest, AnnotateRequest, RemoveAnnotationsRequest } from "../..
3232
describe("annotate_api", () => {
3333

3434
before(async () => {
35-
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = "0"
3635
await TestContext.uploadTestFiles();
3736
});
3837

test/api/test_annotate_api_many_pages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { AnnotateRequest } from "../../src/annotation_api";
3232
describe("annotate_api_many_pages", () => {
3333

3434
before(async () => {
35-
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = "0"
35+
//process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = "0"
3636
await TestContext.uploadTestFiles();
3737
});
3838

test/api/test_file_api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import { TestFile } from "../test_file";
3838
describe("file_api", () => {
3939

4040
before(async () => {
41-
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = "0"
4241
await TestContext.uploadTestFiles();
4342
});
4443

test/api/test_folder_api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import * as TestContext from "../test_context";
3636
describe("folder_api", () => {
3737

3838
before(async () => {
39-
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = "0"
4039
await TestContext.uploadTestFiles();
4140
});
4241

test/api/test_info_api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import { GetInfoRequest } from "../../src/annotation_api";
3232
describe("info_api", () => {
3333

3434
before(async () => {
35-
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = "0"
3635
await TestContext.uploadTestFiles();
3736
});
3837

0 commit comments

Comments
 (0)