123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- };
- var Unibase;
- (function (Unibase) {
- let Apps;
- (function (Apps) {
- let Collaboration;
- (function (Collaboration) {
- class DocumentManager extends Unibase.Platform.Core.BaseManager {
- getDocumentFileInfo(Id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/getdocumentfile/id/' + Id;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getJsonData(Id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/getjsondata/id/' + Id;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- toJsonData(Id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/tojsondata/id/' + Id;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- spreadSheetDownload(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/downloadspreadsheet';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- saveWord(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = '/apis/v4/collaboration/unicloud/files/saveword';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- saveSpreadSheet(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = '/apis/v4/collaboration/unicloud/files/savespreadsheet';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- ConvertDocstoPdfDownload(id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/downloadpdffromword/id/' + id;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getDocumentBase64FileDownload(Id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/files/getebase64documentfile/id/' + Id;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- importCreateSpreadSheet(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/createnewspreadsheet';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- importReplaceSpreadSheet(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/replacespreadsheet';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- insertNewSpreadsheet(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/insertnewspreadsheet';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- copyOfCurrentDocument(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/copyspreadsheet';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- renameFileTitle(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/replacefiletitle';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- spellCheck(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'https://plugins.spellcheck.bizgaze.com/api/documenteditor/SpellCheck';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response !== null)
- response = JSON.parse(response);
- return response;
- });
- });
- }
- ssAutoSave(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = '/apis/v4/collaboration/unicloud/files/spreadsheetautosave';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- CopySheetInToExistingWorkbook(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = '/apis/v4/collaboration/unicloud/files/copysheetintoexistingworkbook/';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- CopySheetToNewSpreadsheet(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/copysheettonewspreadsheet';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- lastEdit(Id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/getversiondetails/id/' + Id;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- rollBackFileData(Id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/restorejsondatatofiledata/id/' + Id;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- ConvertSpreadsheettoOdsDownload(id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/downloadodsfromExcel/id/' + id;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getPermissionLevel(fileId, uid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/getpermissionlevel/id/' + fileId + "/uid/" + uid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getCustomJsonData(Id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/getcustomjsondata/id/' + Id;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- saveSheetColor(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/savesheetcolor';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(JSON.parse(response.result));
- return response;
- });
- });
- }
- updateSheetColorIndex(data) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/updatesheetindex';
- return yield this.dataHelper().postAsync(url, data).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(JSON.parse(response.result));
- return response;
- });
- });
- }
- getRecentViews(Id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = '/apis/v4/collaboration/unicloud/files/getrecentviews/id/' + Id;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getLinkInfo(fileid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/collaboration/unicloud/files/linkinfo/id/' + fileid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- static Instance() {
- if (this.instance === undefined) {
- this.instance = new DocumentManager();
- }
- return this.instance;
- }
- }
- Collaboration.DocumentManager = DocumentManager;
- })(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
- })(Apps = Unibase.Apps || (Unibase.Apps = {}));
- })(Unibase || (Unibase = {}));
|