Skip to content

Commit e1d382e

Browse files
committed
20220822 update : support rotate row and column.
1 parent 9305d21 commit e1d382e

File tree

5 files changed

+140
-6
lines changed

5 files changed

+140
-6
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![npm](https://img.shields.io/npm/v/asposecellscloud) ![node-current](https://img.shields.io/node/v/asposecellscloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-node)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-node/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-node/22.7)
1+
![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![npm](https://img.shields.io/npm/v/asposecellscloud) ![node-current](https://img.shields.io/node/v/asposecellscloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-node)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-node/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-node/22.8)
22

33
# Process Excel® Files in the Cloud with Node.js
44

@@ -20,11 +20,9 @@
2020
- Fetch the required shape from worksheet.
2121
- Leverage the power of named ranges.
2222

23-
## Feature & Enhancements in Version 22.7
24-
25-
- Add 4 kinds of Save Option.
26-
- Add the checkExcelRestriction parameter for multiple APIs.
23+
## Feature & Enhancements in Version 22.8
2724

25+
- Support transposing Excel Rows to Columns.
2826

2927
## Read & Write Spreadsheet Formats
3028

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "asposecellscloud",
3-
"version": "22.7.0",
3+
"version": "22.8.0",
44
"description": "Aspose.Cells Cloud SDK for Node.js",
55
"keywords": [
66
"Aspose",

src/api.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12708,6 +12708,55 @@ export class CellsApi {
1270812708
json: true,
1270912709
};
1271012710

12711+
(requestOptions as any).formData = formParams;
12712+
const response = await invokeApiMethod(requestOptions, this.configuration);
12713+
const result = ObjectSerializer.deserialize(response.body, "FilesResult");
12714+
return Promise.resolve({body: result, response});
12715+
}
12716+
/**
12717+
*
12718+
* @param requestObj contains request parameters
12719+
*/
12720+
public async postRotate(requestObj: model.PostRotateRequest): Promise<{response: http.ClientResponse, body: model.FilesResult}> {
12721+
if (requestObj === null || requestObj === undefined) {
12722+
throw new Error('Required parameter "requestObj" was null or undefined when calling PostReverse.');
12723+
}
12724+
12725+
let localVarPath = this.configuration.getApiBaseUrl() + "/cells/rotate";
12726+
const queryParameters: any = {};
12727+
const formParams: any = {};
12728+
12729+
// verify required parameter 'requestObj.file' is not null or undefined
12730+
if (requestObj.file === null || requestObj.file === undefined) {
12731+
throw new Error('Required parameter "requestObj.file" was null or undefined when calling postRotate.');
12732+
}
12733+
12734+
// verify required parameter 'requestObj.rotateType' is not null or undefined
12735+
if (requestObj.rotateType === null || requestObj.rotateType === undefined) {
12736+
throw new Error('Required parameter "requestObj.rotateType" was null or undefined when calling postRotate.');
12737+
}
12738+
12739+
// verify required parameter 'requestObj.format' is not null or undefined
12740+
if (requestObj.format === null || requestObj.format === undefined) {
12741+
throw new Error('Required parameter "requestObj.format" was null or undefined when calling postRotate.');
12742+
}
12743+
12744+
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "rotateType", requestObj.rotateType);
12745+
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "format", requestObj.format);
12746+
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "checkExcelRestriction", requestObj.checkExcelRestriction);
12747+
if (requestObj.file !== undefined) {
12748+
for (var key in requestObj.file){
12749+
formParams[key] = requestObj.file[key];
12750+
}
12751+
}
12752+
12753+
const requestOptions: request.Options = {
12754+
method: "POST",
12755+
qs: queryParameters,
12756+
uri: localVarPath,
12757+
json: true,
12758+
};
12759+
1271112760
(requestOptions as any).formData = formParams;
1271212761
const response = await invokeApiMethod(requestOptions, this.configuration);
1271312762
const result = ObjectSerializer.deserialize(response.body, "FilesResult");

src/model/model.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26858,6 +26858,36 @@ export class PostReverseRequest {
2685826858
}
2685926859
}
2686026860

26861+
26862+
/**
26863+
* Request model for PostRotateRequest operation.
26864+
*/
26865+
export class PostRotateRequest {
26866+
/**
26867+
* File to upload
26868+
*/
26869+
public file: Buffer;
26870+
26871+
/**
26872+
* Gets or sets rotateType
26873+
*/
26874+
public rotateType: string;
26875+
26876+
/**
26877+
* Gets or sets format
26878+
*/
26879+
public format: string;
26880+
26881+
/**
26882+
* Gets or sets checkExcelRestriction
26883+
*/
26884+
public checkExcelRestriction: boolean;
26885+
26886+
public constructor(init?: Partial<PostRotateRequest>) {
26887+
Object.assign(this, init);
26888+
}
26889+
}
26890+
2686126891
/**
2686226892
* Request model for PostSearch operation.
2686326893
*/

test/CellsRotateApi.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* MIT License
3+
4+
* Copyright (c) 2021 Aspose Pty Ltd
5+
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
import { expect } from "chai";
26+
import "mocha";
27+
28+
import * as model from "../src/model/model";
29+
import * as BaseTest from "./baseTest";
30+
31+
const localPath = "TestData/";
32+
var fs = require('fs');
33+
var path = require('path');
34+
var assert = require('assert');
35+
describe('CellsRotateApi', function() {
36+
this.timeout(200000);
37+
describe('PostRotate', function() {
38+
it('should call PostRotate successfully', function() {
39+
const cellsApi = BaseTest.initializeLightCellsApi();
40+
var req = new model.PostRotateRequest();
41+
req.rotateType ="270";
42+
req.format = "pdf";
43+
const AssemblyTestXlsx = "assemblytest.xlsx";
44+
var dataAssemblyTestXlsx =fs.createReadStream(localPath + AssemblyTestXlsx);
45+
const DataSourceXlsx = "datasource.xlsx";
46+
var dataDataSourceXlsx =fs.createReadStream(localPath + DataSourceXlsx);
47+
req.file = { AssemblyTestXlsx :dataAssemblyTestXlsx ,DataSourceXlsx:dataDataSourceXlsx };
48+
49+
return cellsApi.postRotate(req)
50+
.then((result) => {
51+
expect(result.response.statusCode).to.equal(200);
52+
});
53+
});
54+
});
55+
56+
57+
});

0 commit comments

Comments
 (0)