Skip to content

Commit

Permalink
Updated sources
Browse files Browse the repository at this point in the history
  • Loading branch information
product-team committed May 30, 2019
1 parent b8be71f commit 2a415ff
Show file tree
Hide file tree
Showing 8 changed files with 506 additions and 88 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ var GroupDocs = require('groupdocs-conversion-cloud');
var appSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
var appKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

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

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

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

// construct ConversionApi
const conversionApi: ConversionApi = ConversionApi.fromKeys(appSid, appKey);
// construct Api
const api: InfoApi = InfoApi.fromKeys(appSid, appKey);

const request: GetSupportedConversionTypesRequest = new GetSupportedConversionTypesRequest();

// retrieve supported file-formats
conversionApi.getSupportedConversionTypes(request)
api.getSupportedConversionTypes(request)
.then((result) => {
console.log("Supported file-formats:");
result.forEach((format) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "groupdocs-conversion-cloud",
"version": "19.4.0",
"version": "19.5.0",
"description": "GroupDocs.Conversion Cloud SDK for Node.js",
"homepage": "https://products.groupdocs.cloud/conversion",
"author": {
Expand Down
130 changes: 96 additions & 34 deletions src/conversion_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ export * from "./configuration";
/**
* GroupDocs.Conversion Cloud API
*/
export class ConversionApi {
export class ConvertApi {

/**
* Creates new instance of ConversionApi
* Creates new instance of ConvertApi
* @param appSid Application identifier (App SID).
* @param appKey Application private key (App Key).
*/
public static fromKeys(appSid: string, appKey: string) {
const config = new Configuration(appSid, appKey);
return new ConversionApi(config);
return new ConvertApi(config);
}

/**
* Creates new instance of ConversionApi
* Creates new instance of ConvertApi
* @param config API configuration.
*/
public static fromConfig(config: Configuration) {
return new ConversionApi(config);
return new ConvertApi(config);
}

/**
Expand Down Expand Up @@ -126,33 +126,6 @@ export class ConversionApi {
return Promise.resolve(result);
}

/**
* Returns all supported conversion types
* @param requestObj contains request parameters
*/
public async getSupportedConversionTypes(requestObj: model.GetSupportedConversionTypesRequest): Promise<Array<model.SupportedFormat>> {
if (requestObj === null || requestObj === undefined) {
throw new Error('Required parameter "requestObj" was null or undefined when calling getSupportedConversionTypes.');
}

let localVarPath = this.configuration.getServerUrl() + "/conversion/formats";
const queryParameters: any = {};

localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "filePath", requestObj.filePath);
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "format", requestObj.format);
const requestOptions: request.Options = {
method: "GET",
qs: queryParameters,
uri: localVarPath,
json: true,
};

const response = await invokeApiMethod(requestOptions, this.configuration);
const result = Serializer.deserialize(response.body, "Array<SupportedFormat>");
return Promise.resolve(result);
}

}
/**
* GroupDocs.Conversion Cloud API
Expand Down Expand Up @@ -363,7 +336,7 @@ export class FileApi {
}

const requestOptions: request.Options = {
method: "POST",
method: "PUT",
qs: queryParameters,
uri: localVarPath,
json: true,
Expand Down Expand Up @@ -468,7 +441,7 @@ export class FolderApi {

localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
const requestOptions: request.Options = {
method: "POST",
method: "PUT",
qs: queryParameters,
uri: localVarPath,
json: true,
Expand Down Expand Up @@ -577,6 +550,95 @@ export class FolderApi {
return Promise.resolve(response);
}

}
/**
* GroupDocs.Conversion Cloud API
*/
export class InfoApi {

/**
* Creates new instance of InfoApi
* @param appSid Application identifier (App SID).
* @param appKey Application private key (App Key).
*/
public static fromKeys(appSid: string, appKey: string) {
const config = new Configuration(appSid, appKey);
return new InfoApi(config);
}

/**
* Creates new instance of InfoApi
* @param config API configuration.
*/
public static fromConfig(config: Configuration) {
return new InfoApi(config);
}

/**
* Configuration
*/
private configuration: Configuration;

/**
* @param config Configuration.
*/
private constructor(config: Configuration) {
this.configuration = config;
}

/**
* Returns metadata for provided document
* @param requestObj contains request parameters
*/
public async getDocumentMetadata(requestObj: model.GetDocumentMetadataRequest): Promise<model.DocumentMetadata> {
if (requestObj === null || requestObj === undefined) {
throw new Error('Required parameter "requestObj" was null or undefined when calling getDocumentMetadata.');
}

let localVarPath = this.configuration.getServerUrl() + "/conversion/info";
const queryParameters: any = {};

localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "filePath", requestObj.filePath);
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
const requestOptions: request.Options = {
method: "GET",
qs: queryParameters,
uri: localVarPath,
json: true,
};

const response = await invokeApiMethod(requestOptions, this.configuration);
const result = Serializer.deserialize(response.body, "DocumentMetadata");
return Promise.resolve(result);
}

/**
* Returns all supported conversion types
* @param requestObj contains request parameters
*/
public async getSupportedConversionTypes(requestObj: model.GetSupportedConversionTypesRequest): Promise<Array<model.SupportedFormat>> {
if (requestObj === null || requestObj === undefined) {
throw new Error('Required parameter "requestObj" was null or undefined when calling getSupportedConversionTypes.');
}

let localVarPath = this.configuration.getServerUrl() + "/conversion/formats";
const queryParameters: any = {};

localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "filePath", requestObj.filePath);
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "format", requestObj.format);
const requestOptions: request.Options = {
method: "GET",
qs: queryParameters,
uri: localVarPath,
json: true,
};

const response = await invokeApiMethod(requestOptions, this.configuration);
const result = Serializer.deserialize(response.body, "Array<SupportedFormat>");
return Promise.resolve(result);
}

}
/**
* GroupDocs.Conversion Cloud API
Expand Down
Loading

0 comments on commit 2a415ff

Please sign in to comment.