Skip to content

Commit cc57f09

Browse files
committed
Updated sources
1 parent 8f41904 commit cc57f09

5 files changed

Lines changed: 122 additions & 21 deletions

File tree

package-lock.json

Lines changed: 19 additions & 19 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-viewer-cloud",
3-
"version": "21.10.0",
3+
"version": "21.12.0",
44
"description": "GroupDocs.Viewer Cloud SDK for Node.js",
55
"homepage": "https://products.groupdocs.cloud/viewer",
66
"author": {

src/model.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,49 @@ export class CadViewInfo {
277277
}
278278
}
279279

280+
/**
281+
* Metered license consumption information
282+
*/
283+
export class ConsumptionResult {
284+
285+
/**
286+
* Attribute type map
287+
*/
288+
public static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
289+
{
290+
name: "credit",
291+
baseName: "credit",
292+
type: "number",
293+
},
294+
{
295+
name: "quantity",
296+
baseName: "quantity",
297+
type: "number",
298+
} ];
299+
300+
/**
301+
* Returns attribute type map
302+
*/
303+
public static getAttributeTypeMap() {
304+
return ConsumptionResult.attributeTypeMap;
305+
}
306+
307+
/**
308+
* Amount of used credits
309+
*/
310+
public credit: number;
311+
312+
/**
313+
* Amount of MBs processed
314+
*/
315+
public quantity: number;
316+
317+
public constructor(init?: Partial<ConsumptionResult>) {
318+
319+
Object.assign(this, init);
320+
}
321+
}
322+
280323
/**
281324
* Delete view options
282325
*/
@@ -3241,6 +3284,7 @@ const typeMap = {
32413284
AttachmentInfo,
32423285
CadOptions,
32433286
CadViewInfo,
3287+
ConsumptionResult,
32443288
DeleteViewOptions,
32453289
DiscUsage,
32463290
EmailOptions,

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

src/viewer_api.ts

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

546+
}
547+
/**
548+
* GroupDocs.Viewer Cloud API
549+
*/
550+
export class LicenseApi {
551+
552+
/**
553+
* Creates new instance of LicenseApi
554+
* @param appSid Application identifier (App SID).
555+
* @param appKey Application private key (App Key).
556+
*/
557+
public static fromKeys(appSid: string, appKey: string) {
558+
const config = new Configuration(appSid, appKey);
559+
return new LicenseApi(config);
560+
}
561+
562+
/**
563+
* Creates new instance of LicenseApi
564+
* @param config API configuration.
565+
*/
566+
public static fromConfig(config: Configuration) {
567+
return new LicenseApi(config);
568+
}
569+
570+
/**
571+
* Configuration
572+
*/
573+
private configuration: Configuration;
574+
575+
/**
576+
* @param config Configuration.
577+
*/
578+
private constructor(config: Configuration) {
579+
this.configuration = config;
580+
}
581+
582+
/**
583+
* Get license consumption
584+
* @param requestObj contains request parameters
585+
*/
586+
public async getConsumptionCredit(): Promise<model.ConsumptionResult> {
587+
588+
const localVarPath = this.configuration.getServerUrl() + "/viewer/consumption";
589+
const queryParameters: any = {};
590+
591+
const requestOptions: request.Options = {
592+
method: "GET",
593+
qs: queryParameters,
594+
uri: localVarPath,
595+
json: true,
596+
};
597+
598+
const response = await invokeApiMethod(requestOptions, this.configuration);
599+
const result = Serializer.deserialize(response.body, "ConsumptionResult");
600+
return Promise.resolve(result);
601+
}
602+
546603
}
547604
/**
548605
* GroupDocs.Viewer Cloud API

0 commit comments

Comments
 (0)