Skip to content

Commit dfd1078

Browse files
committed
Release Aspose.Cells Cloud SDK 21.10
1 parent 11c7bda commit dfd1078

File tree

7 files changed

+338
-29
lines changed

7 files changed

+338
-29
lines changed

README.md

Lines changed: 5 additions & 22 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/21.9)
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/21.10)
22

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

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

23-
## Feature & Enhancements in Version 21.9
24-
25-
- Correct the return type of the following REST APIs.
26-
27-
Delete WorksheetDeleteChart
28-
Post WorksheetChartLegend
29-
Post WorksheetChartTitle
30-
Put WorksheetAddChart
31-
Put WorksheetChartTitle
32-
Post WorksheetHyperlink
33-
Put WorksheetHyperlink
34-
Put WorksheetListObject
35-
Put WorksheetOleObject
36-
Post WorksheetPicture
37-
Put WorksheetAddPicture
38-
Put WorksheetPivotTable
39-
Delete DocumentProperties
40-
Delete DocumentProperty
41-
Put DocumentProperty
42-
Put WorksheetShape
43-
Delete WorksheetValidation
23+
## Feature & Enhancements in Version 21.10
24+
25+
- Add new API for support delete multiple worksheets in a single call.
26+
- Add new API for supports batch convert excel files.
4427

4528

4629
## Read & Write Spreadsheet Formats

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": "21.9.0",
3+
"version": "21.10.0",
44
"description": "Aspose.Cells Cloud SDK for Node.js",
55
"keywords": [
66
"Aspose",

src/api.ts

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11514,6 +11514,75 @@ export class CellsApi {
1151411514
const result = ObjectSerializer.deserialize(response.body, "FilesUploadResult");
1151511515
return Promise.resolve({body: result, response});
1151611516
}
11517+
/**
11518+
* Read worksheets info.
11519+
* @param requestObj contains request parameters
11520+
*/
11521+
public async cellsWorksheetsDeleteWorksheets(requestObj: model.CellsWorksheets_DeleteWorksheetsRequest): Promise<{response: http.ClientResponse, body: model.CellsCloudResponse}> {
11522+
if (requestObj === null || requestObj === undefined) {
11523+
throw new Error('Required parameter "requestObj" was null or undefined when calling cellsWorksheetsDeleteWorksheets.');
11524+
}
11525+
11526+
let localVarPath = this.configuration.getApiBaseUrl() + "/cells/{name}/worksheets"
11527+
.replace("{" + "name" + "}", String(requestObj.name));
11528+
const queryParameters: any = {};
11529+
11530+
// verify required parameter 'requestObj.name' is not null or undefined
11531+
if (requestObj.name === null || requestObj.name === undefined) {
11532+
throw new Error('Required parameter "requestObj.name" was null or undefined when calling cellsWorksheetsDeleteWorksheets.');
11533+
}
11534+
11535+
// verify required parameter 'requestObj.matchCondition' is not null or undefined
11536+
if (requestObj.matchCondition === null || requestObj.matchCondition === undefined) {
11537+
throw new Error('Required parameter "requestObj.matchCondition" was null or undefined when calling cellsWorksheetsDeleteWorksheets.');
11538+
}
11539+
11540+
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "folder", requestObj.folder);
11541+
localVarPath = addQueryParameterToUrl(localVarPath, queryParameters, "storageName", requestObj.storageName);
11542+
const requestOptions: request.Options = {
11543+
method: "DELETE",
11544+
qs: queryParameters,
11545+
uri: localVarPath,
11546+
json: true,
11547+
body: (requestObj.matchCondition == null) ? "" : ObjectSerializer.serialize(requestObj.matchCondition, requestObj.matchCondition.constructor.name === "Object" ? "MatchConditionRequest" : requestObj.matchCondition.constructor.name),
11548+
};
11549+
11550+
const response = await invokeApiMethod(requestOptions, this.configuration);
11551+
const result = ObjectSerializer.deserialize(response.body, "CellsCloudResponse");
11552+
return Promise.resolve({body: result, response});
11553+
}
11554+
11555+
11556+
/**
11557+
*
11558+
* @param requestObj contains request parameters
11559+
*/
11560+
public async postBatchConvert(requestObj: model.PostBatchConvertRequest): Promise<{response: http.ClientResponse, body: model.Buffer}> {
11561+
if (requestObj === null || requestObj === undefined) {
11562+
throw new Error('Required parameter "requestObj" was null or undefined when calling postBatchConvert.');
11563+
}
11564+
11565+
const localVarPath = this.configuration.getApiBaseUrl() + "/cells/batch/convert";
11566+
const queryParameters: any = {};
11567+
11568+
// verify required parameter 'requestObj.batchConvertRequest' is not null or undefined
11569+
if (requestObj.batchConvertRequest === null || requestObj.batchConvertRequest === undefined) {
11570+
throw new Error('Required parameter "requestObj.batchConvertRequest" was null or undefined when calling postBatchConvert.');
11571+
}
11572+
11573+
const requestOptions: request.Options = {
11574+
method: "POST",
11575+
qs: queryParameters,
11576+
uri: localVarPath,
11577+
json: true,
11578+
body: (requestObj.batchConvertRequest == null) ? "" : ObjectSerializer.serialize(requestObj.batchConvertRequest, requestObj.batchConvertRequest.constructor.name === "Object" ? "BatchConvertRequest" : requestObj.batchConvertRequest.constructor.name),
11579+
};
11580+
11581+
const response = await invokeApiMethod(requestOptions, this.configuration);
11582+
const result = ObjectSerializer.deserialize(response.body, "Buffer");
11583+
return Promise.resolve({body: result, response});
11584+
}
11585+
1151711586

1151811587
}
1151911588
/**
@@ -12107,5 +12176,4 @@ export class CellsApi {
1210712176
const result = ObjectSerializer.deserialize(response.body, "FilesResult");
1210812177
return Promise.resolve({body: result, response});
1210912178
}
12110-
1211112179
}

src/model/model.ts

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25621,6 +25621,19 @@ export class PostClearObjectsRequest {
2562125621
Object.assign(this, init);
2562225622
}
2562325623
}
25624+
/**
25625+
* Request model for PostBatchConvert operation.
25626+
*/
25627+
export class PostBatchConvertRequest {
25628+
/**
25629+
* Gets or sets batchConvertRequest
25630+
*/
25631+
public batchConvertRequest: BatchConvertRequest;
25632+
25633+
public constructor(init?: Partial<PostBatchConvertRequest>) {
25634+
Object.assign(this, init);
25635+
}
25636+
}
2562425637

2562525638
/**
2562625639
* Request model for PostExport operation.
@@ -25832,3 +25845,125 @@ export class PostWatermarkRequest {
2583225845
Object.assign(this, init);
2583325846
}
2583425847
}
25848+
25849+
25850+
/**
25851+
* Request model for CellsWorksheets_DeleteWorksheets operation.
25852+
*/
25853+
export class CellsWorksheets_DeleteWorksheetsRequest {
25854+
/**
25855+
* Gets or sets name
25856+
*/
25857+
public name: string;
25858+
25859+
/**
25860+
* Gets or sets matchCondition
25861+
*/
25862+
public matchCondition: MatchConditionRequest;
25863+
25864+
/**
25865+
* Gets or sets folder
25866+
*/
25867+
public folder: string;
25868+
25869+
/**
25870+
* Gets or sets storageName
25871+
*/
25872+
public storageName: string;
25873+
25874+
public constructor(init?: Partial<CellsWorksheets_DeleteWorksheetsRequest>) {
25875+
Object.assign(this, init);
25876+
}
25877+
}
25878+
25879+
25880+
25881+
export class BatchConvertRequest {
25882+
25883+
/**
25884+
* Attribute type map
25885+
*/
25886+
public static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
25887+
{
25888+
name: "sourceFolder",
25889+
baseName: "SourceFolder",
25890+
type: "string",
25891+
},
25892+
{
25893+
name: "matchCondition",
25894+
baseName: "MatchCondition",
25895+
type: "MatchConditionRequest",
25896+
},
25897+
{
25898+
name: "format",
25899+
baseName: "Format",
25900+
type: "string",
25901+
},
25902+
{
25903+
name: "outFolder",
25904+
baseName: "OutFolder",
25905+
type: "string",
25906+
},
25907+
{
25908+
name: "saveOptions",
25909+
baseName: "SaveOptions",
25910+
type: "SaveOptions",
25911+
} ];
25912+
25913+
/**
25914+
* Returns attribute type map
25915+
*/
25916+
public static getAttributeTypeMap() {
25917+
return BatchConvertRequest.attributeTypeMap;
25918+
}
25919+
25920+
public sourceFolder: string;
25921+
25922+
public matchCondition: MatchConditionRequest;
25923+
25924+
public format: string;
25925+
25926+
public outFolder: string;
25927+
25928+
public saveOptions: SaveOptions;
25929+
25930+
public constructor(init?: Partial<BatchConvertRequest>) {
25931+
25932+
Object.assign(this, init);
25933+
}
25934+
}
25935+
25936+
25937+
export class MatchConditionRequest {
25938+
25939+
/**
25940+
* Attribute type map
25941+
*/
25942+
public static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
25943+
{
25944+
name: "regexPattern",
25945+
baseName: "RegexPattern",
25946+
type: "string",
25947+
},
25948+
{
25949+
name: "fullMatchConditions",
25950+
baseName: "FullMatchConditions",
25951+
type: "Array<string>",
25952+
} ];
25953+
25954+
/**
25955+
* Returns attribute type map
25956+
*/
25957+
public static getAttributeTypeMap() {
25958+
return MatchConditionRequest.attributeTypeMap;
25959+
}
25960+
25961+
public regexPattern: string;
25962+
25963+
public fullMatchConditions: Array<string>;
25964+
25965+
public constructor(init?: Partial<MatchConditionRequest>) {
25966+
25967+
Object.assign(this, init);
25968+
}
25969+
}

test/CellsBatchApi.ts

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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+
var fs = require('fs');
31+
var path = require('path');
32+
var assert = require('assert');
33+
var filename = "Book1.xlsx";
34+
const localPath = "TestData/";
35+
36+
describe('Cells sdk for NodeJS test ok.', function() {
37+
it('should call postBatchConvert successfully', function() {
38+
const cellsApi = BaseTest.initializeCellsApi();
39+
filename = "Book1.xlsx";
40+
var data =fs.createReadStream(localPath + filename);
41+
var req = new model.UploadFileRequest();
42+
req.path = "Temp/" + filename;
43+
req.file = data;
44+
45+
return cellsApi.uploadFile(req)
46+
.then((result) => {
47+
expect(result.body.uploaded.length).greaterThan(0);
48+
filename = "myDocument.xlsx";
49+
var data =fs.createReadStream(localPath + filename);
50+
var req = new model.UploadFileRequest();
51+
req.path = "Temp/" + filename;
52+
req.file = data;
53+
54+
return cellsApi.uploadFile(req)
55+
.then((result) => {
56+
expect(result.body.toString().length).to.greaterThan(0);
57+
filename = "datasource.xlsx";
58+
var data =fs.createReadStream(localPath + filename);
59+
var req = new model.UploadFileRequest();
60+
req.path = "Temp/" + filename;
61+
req.file = data;
62+
63+
return cellsApi.uploadFile(req)
64+
.then((result) => {
65+
expect(result.body.toString().length).to.greaterThan(0);
66+
filename = "assemblytest.xlsx";
67+
var data =fs.createReadStream(localPath + filename);
68+
var req = new model.UploadFileRequest();
69+
req.path = "Temp/" + filename;
70+
req.file = data;
71+
72+
return cellsApi.uploadFile(req)
73+
.then((result) => {
74+
expect(result.body.toString().length).to.greaterThan(0);
75+
var req = new model.PostBatchConvertRequest();
76+
req.batchConvertRequest = new model.BatchConvertRequest();
77+
req.batchConvertRequest.format = "pdf";
78+
req.batchConvertRequest.sourceFolder = "Temp";
79+
req.batchConvertRequest.matchCondition = new model.MatchConditionRequest();
80+
req.batchConvertRequest.matchCondition.fullMatchConditions = new Array<string>();
81+
req.batchConvertRequest.matchCondition.fullMatchConditions.push( "assemblytest.xlsx");
82+
return cellsApi.postBatchConvert(req)
83+
.then((result) => {
84+
expect(result.body.toString().length).to.greaterThan(0);
85+
86+
});
87+
});
88+
});
89+
});
90+
});
91+
});
92+
93+
});

test/CellsOneApi.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var assert = require('assert');
3333
const localPath = "../TestData/";
3434

3535
describe('Cells sdk for NodeJS test ok.', function() {
36-
it('should call cellsWorkbookPostWorkbookGetSmartMarkerResult successfully', function() {
36+
it('should call cellsWorksheetsDeleteWorksheets successfully', function() {
3737
const cellsApi = BaseTest.initializeCellsApi();
3838
const filename = "Book1.xlsx";
3939
var data =fs.createReadStream(localPath + filename);
@@ -44,13 +44,15 @@ describe('Cells sdk for NodeJS test ok.', function() {
4444
return cellsApi.uploadFile(req)
4545
.then((result) => {
4646
expect(result.body.uploaded.length).greaterThan(0);
47-
var req = new model.CellsWorkbook_PostWorkbookGetSmartMarkerResultRequest();
47+
var req = new model.CellsWorksheets_DeleteWorksheetsRequest();
4848
req.name = filename;
49-
req.xmlFile = "ReportData.xml";
50-
// req.outPath = null;
49+
req.matchCondition = new model.MatchConditionRequest();
50+
req.matchCondition.fullMatchConditions =new Array<string>() ;
51+
req.matchCondition.fullMatchConditions.push("Sheet1");
52+
req.matchCondition.fullMatchConditions.push("Sheet2");
5153
req.folder = "Temp";
5254

53-
return cellsApi.cellsWorkbookPostWorkbookGetSmartMarkerResult(req)
55+
return cellsApi.cellsWorksheetsDeleteWorksheets(req)
5456
.then((result) => {
5557
// expect(result.response.statusCode).to.equal(200);
5658
expect(result.body.toString().length).to.greaterThan(0);

0 commit comments

Comments
 (0)