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 Platform; (function (Platform) { let Files; (function (Files) { let Managers; (function (Managers) { class FileManager extends Platform.Core.BaseManager { validateDocument(Id, InstalledAppId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/files/validatedocument/pkid/' + Id + '/installedappid/' + InstalledAppId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } validateDocumentByGroup(Id, InstalledAppId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/files/validatedocumentbygroup/pkid/' + Id + '/installedappid/' + InstalledAppId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getDocumentTypes() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/files/documenttypes'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getDocumentFile(Id) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/files/getdocumentfile/fileid/' + Id; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getDocumentBase64File(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; }); }); } getDocumentByRefId(refid, formpropertyid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/files/getdocumentbyrefid/refid/' + refid + '/formpropertyid/' + formpropertyid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result !== "") response.result = JSON.parse(response.result); return response; }); }); } deleteDocumentFile(DocumentFileId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/files/deletedocumentfile/documentfileid/' + DocumentFileId; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } updateFileProvider(fileproviderid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/files/updatefileprovider/fileproviderid/' + fileproviderid; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } getfileprovider() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/files/gettenant'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } _tempFileSave(postData) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/forms/uploadfile'; return yield this.dataHelper().postAsync(url, postData).then(function (response) { return response; }); }); } getDocumentByRefIdApi(RefId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/files/getdocumentbyrefidapi/refid/' + RefId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result !== "") response.result = JSON.parse(response.result); return response; }); }); } static Instance() { if (this.instance === undefined) { this.instance = new FileManager(); } return this.instance; } } Managers.FileManager = FileManager; })(Managers = Files.Managers || (Files.Managers = {})); })(Files = Platform.Files || (Platform.Files = {})); })(Platform = Unibase.Platform || (Unibase.Platform = {})); })(Unibase || (Unibase = {}));