Iniit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"itemplatemanager.js","sourceRoot":"","sources":["itemplatemanager.ts"],"names":[],"mappings":""}
|
||||
@@ -0,0 +1,180 @@
|
||||
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 = {}));
|
||||
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseManager{deleteCopy(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/templates/deletecopyitem/copyitemid/"+n;return yield this.dataHelper().postAsync(t,null).then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}deleteTemplate(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/templates/deletetemplate/templateid/"+n;return yield this.dataHelper().postAsync(t,null).then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}deleteTemplateProvider(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/templates/deletetemplateprovider/templateproviderid/"+n;return yield this.dataHelper().postAsync(t,null).then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}getTemplatePdf(n,t){return __awaiter(this,void 0,void 0,function*(){const i="apis/v4/unibase/platform/templates/generatepdf/templateid/"+n+"/id/"+t;return yield this.dataHelper().getAsync(i).then(function(n){return n.result!==null?n:null})})}getTemplates(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/templates/gettemplatesbyapp/installedappid/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getTemplateText(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/templates/gettemplate/templateid/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}updateTemplate(n,t,i){return __awaiter(this,void 0,void 0,function*(){const r="apis/v4/unibase/platform/templates/updatetemplate/templateid/"+n+"/installedappid/"+t+"/id/"+i;return yield this.dataHelper().postAsync(r,null).then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}refreshPrintProviders(){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/unibase/platform/templates/refreshprintproviders/np","{}").then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}getTemplatePdfFile(n,t){return __awaiter(this,void 0,void 0,function*(){const i="apis/v4/unibase/platform/templates/generatetemplatepdf/printprovideruniquekey/"+n+"/pkid/"+t;return yield this.dataHelper().postAsync(i,"{}").then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}getTemplatePdfFile_new(n,t){return __awaiter(this,void 0,void 0,function*(){const i="apis/v4/unibase/platform/templates/generatetemplatepdf/printproviderid/"+n+"/pkid/"+t;return yield this.dataHelper().postAsync(i,"{}").then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}getPrintProvider(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/templates/getprintproviderbyid/printProviderId/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}refreshTemplateProviders(){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/unibase/platform/templates/refreshtemplateproviders/np","{}").then(function(n){return MessageHelper.Instance().showSuccess(n.message,"Unibase_ValidationSummary"),n.result!=null&&(n.result=JSON.parse(n.result)),n})})}getTemplateHtml(n,t,i){return __awaiter(this,void 0,void 0,function*(){const r="apis/v4/unibase/platform/templates/gettemplatehtml/templateid/"+n+"/isexcise/"+t+"/id/"+i;return yield this.dataHelper().getAsync(r).then(function(n){return n.result!=null&&(n.result=JSON.parse(n.result)),n})})}getTemplate(n,t){return __awaiter(this,void 0,void 0,function*(){const i="apis/v4/unibase/platform/templates/gettemplatedata/installedappid/"+n+"/id/"+t;return yield this.dataHelper().getAsync(i).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.TemplateManager=i})(i=t.Managers||(t.Managers={}))})(i=t.Templates||(t.Templates={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|
||||
Reference in New Issue
Block a user