import { CellsApi,DeleteWorksheetFreezePanesRequest,UploadFileRequest } from "asposecellscloud";
var fs = require('fs');
var path = require('path');
var process = require('process');
const _ = require('asposecellscloud');

const cellsApi = new CellsApi(process.env.CellsCloudClientId, process.env.CellsCloudClientSecret);

var remoteFolder = "TestData/In"
var localPath = "TestData/CellsCloud/"
var localName = "Book1.xlsx"
var remoteName = "Book1.xlsx"


describe('example', function(){
  it("should call successfully" , function(){
      var localNameRequest = new UploadFileRequest();
      localNameRequest.uploadFiles ={localName:fs.createReadStream(localPath  + localName)};
      localNameRequest.path = remoteFolder + "/" + remoteName ;
      localNameRequest.storageName ="";
      cellsApi.uploadFile(localNameRequest );

var request = new DeleteWorksheetFreezePanesRequest();
request.name =  remoteName;
request.sheetName =  "Sheet1";
request.row =  1;
request.column =  1;
request.freezedRows =  4;
request.freezedColumns =  5;
request.folder =  remoteFolder;
request.storageName =  "";
return cellsApi.deleteWorksheetFreezePanes(request)
  });
});