Skip to content

Commit 2a415ff

Browse files
committed
Updated sources
1 parent b8be71f commit 2a415ff

8 files changed

Lines changed: 506 additions & 88 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ var GroupDocs = require('groupdocs-conversion-cloud');
2121
var appSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
2222
var appKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
2323

24-
// construct ConversionApi
25-
var conversionApi = GroupDocs.ConversionApi.fromKeys(appSid, appKey);
24+
// construct Api
25+
var api = GroupDocs.InfoApi.fromKeys(appSid, appKey);
2626
var request = new GroupDocs.GetSupportedConversionTypesRequest();
2727
// retrieve supported conversion types
28-
conversionApi.getSupportedConversionTypes(request)
28+
api.getSupportedConversionTypes(request)
2929
.then(function (response) {
3030
console.log("Supported file-formats:")
3131
response.forEach(function (format) {
@@ -41,19 +41,19 @@ Or compile and run same written in TypeScript:
4141

4242
```ts
4343
// load the module
44-
import { ConversionApi, GetSupportedConversionTypesRequest } from "groupdocs-conversion-cloud";
44+
import { INfoApi, GetSupportedConversionTypesRequest } from "groupdocs-conversion-cloud";
4545

4646
// get your appSid and appKey at https://dashboard.groupdocs.cloud (free registration is required).
4747
const appSid: string = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
4848
const appKey: string = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
4949

50-
// construct ConversionApi
51-
const conversionApi: ConversionApi = ConversionApi.fromKeys(appSid, appKey);
50+
// construct Api
51+
const api: InfoApi = InfoApi.fromKeys(appSid, appKey);
5252

5353
const request: GetSupportedConversionTypesRequest = new GetSupportedConversionTypesRequest();
5454

5555
// retrieve supported file-formats
56-
conversionApi.getSupportedConversionTypes(request)
56+
api.getSupportedConversionTypes(request)
5757
.then((result) => {
5858
console.log("Supported file-formats:");
5959
result.forEach((format) => {

package.json

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

src/conversion_api.ts

Lines changed: 96 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,24 @@ export * from "./configuration";
3535
/**
3636
* GroupDocs.Conversion Cloud API
3737
*/
38-
export class ConversionApi {
38+
export class ConvertApi {
3939

4040
/**
41-
* Creates new instance of ConversionApi
41+
* Creates new instance of ConvertApi
4242
* @param appSid Application identifier (App SID).
4343
* @param appKey Application private key (App Key).
4444
*/
4545
public static fromKeys(appSid: string, appKey: string) {
4646
const config = new Configuration(appSid, appKey);
47-
return new ConversionApi(config);
47+
return new ConvertApi(config);
4848
}
4949

5050
/**
51-
* Creates new instance of ConversionApi
51+
* Creates new instance of ConvertApi
5252
* @param config API configuration.
5353
*/
5454
public static fromConfig(config: Configuration) {
55-
return new ConversionApi(config);
55+
return new ConvertApi(config);
5656
}
5757

5858
/**
@@ -126,33 +126,6 @@ export class ConversionApi {
126126
return Promise.resolve(result);
127127
}
128128

129-
/**
130-
* Returns all supported conversion types
131-
* @param requestObj contains request parameters
132-
*/
133-
public async getSupportedConversionTypes(requestObj: model.GetSupportedConversionTypesRequest): Promise<Array<model.SupportedFormat>> {
134-
if (requestObj === null || requestObj === undefined) {
135-
throw new Error('Required parameter "requestObj" was null or undefined when calling getSupportedConversionTypes.');
136-
}
137-
138-
let localVarPath = this.configuration.getServerUrl() + "/conversion/formats";
139-
const queryParameters: any = {};
140-
141-
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "filePath", requestObj.filePath);
142-
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
143-
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "format", requestObj.format);
144-
const requestOptions: request.Options = {
145-
method: "GET",
146-
qs: queryParameters,
147-
uri: localVarPath,
148-
json: true,
149-
};
150-
151-
const response = await invokeApiMethod(requestOptions, this.configuration);
152-
const result = Serializer.deserialize(response.body, "Array<SupportedFormat>");
153-
return Promise.resolve(result);
154-
}
155-
156129
}
157130
/**
158131
* GroupDocs.Conversion Cloud API
@@ -363,7 +336,7 @@ export class FileApi {
363336
}
364337

365338
const requestOptions: request.Options = {
366-
method: "POST",
339+
method: "PUT",
367340
qs: queryParameters,
368341
uri: localVarPath,
369342
json: true,
@@ -468,7 +441,7 @@ export class FolderApi {
468441

469442
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
470443
const requestOptions: request.Options = {
471-
method: "POST",
444+
method: "PUT",
472445
qs: queryParameters,
473446
uri: localVarPath,
474447
json: true,
@@ -577,6 +550,95 @@ export class FolderApi {
577550
return Promise.resolve(response);
578551
}
579552

553+
}
554+
/**
555+
* GroupDocs.Conversion Cloud API
556+
*/
557+
export class InfoApi {
558+
559+
/**
560+
* Creates new instance of InfoApi
561+
* @param appSid Application identifier (App SID).
562+
* @param appKey Application private key (App Key).
563+
*/
564+
public static fromKeys(appSid: string, appKey: string) {
565+
const config = new Configuration(appSid, appKey);
566+
return new InfoApi(config);
567+
}
568+
569+
/**
570+
* Creates new instance of InfoApi
571+
* @param config API configuration.
572+
*/
573+
public static fromConfig(config: Configuration) {
574+
return new InfoApi(config);
575+
}
576+
577+
/**
578+
* Configuration
579+
*/
580+
private configuration: Configuration;
581+
582+
/**
583+
* @param config Configuration.
584+
*/
585+
private constructor(config: Configuration) {
586+
this.configuration = config;
587+
}
588+
589+
/**
590+
* Returns metadata for provided document
591+
* @param requestObj contains request parameters
592+
*/
593+
public async getDocumentMetadata(requestObj: model.GetDocumentMetadataRequest): Promise<model.DocumentMetadata> {
594+
if (requestObj === null || requestObj === undefined) {
595+
throw new Error('Required parameter "requestObj" was null or undefined when calling getDocumentMetadata.');
596+
}
597+
598+
let localVarPath = this.configuration.getServerUrl() + "/conversion/info";
599+
const queryParameters: any = {};
600+
601+
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "filePath", requestObj.filePath);
602+
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
603+
const requestOptions: request.Options = {
604+
method: "GET",
605+
qs: queryParameters,
606+
uri: localVarPath,
607+
json: true,
608+
};
609+
610+
const response = await invokeApiMethod(requestOptions, this.configuration);
611+
const result = Serializer.deserialize(response.body, "DocumentMetadata");
612+
return Promise.resolve(result);
613+
}
614+
615+
/**
616+
* Returns all supported conversion types
617+
* @param requestObj contains request parameters
618+
*/
619+
public async getSupportedConversionTypes(requestObj: model.GetSupportedConversionTypesRequest): Promise<Array<model.SupportedFormat>> {
620+
if (requestObj === null || requestObj === undefined) {
621+
throw new Error('Required parameter "requestObj" was null or undefined when calling getSupportedConversionTypes.');
622+
}
623+
624+
let localVarPath = this.configuration.getServerUrl() + "/conversion/formats";
625+
const queryParameters: any = {};
626+
627+
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "filePath", requestObj.filePath);
628+
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
629+
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "format", requestObj.format);
630+
const requestOptions: request.Options = {
631+
method: "GET",
632+
qs: queryParameters,
633+
uri: localVarPath,
634+
json: true,
635+
};
636+
637+
const response = await invokeApiMethod(requestOptions, this.configuration);
638+
const result = Serializer.deserialize(response.body, "Array<SupportedFormat>");
639+
return Promise.resolve(result);
640+
}
641+
580642
}
581643
/**
582644
* GroupDocs.Conversion Cloud API

0 commit comments

Comments
 (0)