123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- 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 Templates;
- (function (Templates) {
- let Managers;
- (function (Managers) {
- class TemplateManager extends Unibase.Platform.Core.BaseManager {
- deleteCopy(copyItemId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/deletecopyitem/copyitemid/' + copyItemId;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- deleteTemplate(TemplateId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/deletetemplate/templateid/' + TemplateId;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- deleteTemplateProvider(TemplateProviderId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/deletetemplateprovider/templateproviderid/' + TemplateProviderId;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getTemplatePdf(templateid, id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/generatepdf/templateid/' + templateid + '/id/' + id;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- return response;
- return null;
- });
- });
- }
- getTemplates(appproviderid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/gettemplatesbyapp/installedappid/' + appproviderid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getTemplateText(templateid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/gettemplate/templateid/' + templateid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- updateTemplate(TemplateId, appproviderid, id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/updatetemplate/templateid/' + TemplateId + '/installedappid/' + appproviderid + '/id/' + id;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- refreshPrintProviders() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/refreshprintproviders/np';
- return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getTemplatePdfFile(PrintProviderUniqueKey, PkId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/generatetemplatepdf/printprovideruniquekey/' + PrintProviderUniqueKey + '/pkid/' + PkId;
- return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getTemplatePdfFile_new(PrintProviderId, PkId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/generatetemplatepdf/printproviderid/' + PrintProviderId + '/pkid/' + PkId;
- return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getPrintProvider(printProviderId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/getprintproviderbyid/printProviderId/' + printProviderId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- refreshTemplateProviders() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/refreshtemplateproviders/np';
- return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
- MessageHelper.Instance().showSuccess(response.message, "Unibase_ValidationSummary");
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getTemplateHtml(templateid, isexcise, id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/gettemplatehtml/templateid/' + templateid + '/isexcise/' + isexcise + '/id/' + id;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getTemplate(appproviderid, id) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/templates/gettemplatedata/installedappid/' + appproviderid + '/id/' + id;
- 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 TemplateManager();
- }
- return this.instance;
- }
- }
- Managers.TemplateManager = TemplateManager;
- })(Managers = Templates.Managers || (Templates.Managers = {}));
- })(Templates = Platform.Templates || (Platform.Templates = {}));
- })(Platform = Unibase.Platform || (Unibase.Platform = {}));
- })(Unibase || (Unibase = {}));
|