This commit is contained in:
2023-03-11 17:30:20 +00:00
commit b6c4e025bc
5124 changed files with 1153349 additions and 0 deletions
@@ -0,0 +1,173 @@
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 DataSources;
(function (DataSources) {
let Managers;
(function (Managers) {
class DataListManager extends Platform.Core.BaseManager {
getDataSourceProviders() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/datasources/getdatasourceproviders';
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDataSources(dataSourceProviderId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/datasources/get/providerid/' + dataSourceProviderId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDataSource(datasourceId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/datasources/get/' + datasourceId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
saveDataSource(obj) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/datasources/save';
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDataList(datalistId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/datalists/get/' + datalistId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
saveDataList(obj) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/datalists/savedatalist';
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
buildQuery(obj) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/datalist/buildquery';
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
var message = response;
return message;
}).fail(function () {
MessageHelper.Instance();
});
});
}
saveDataSourceSetting(obj) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/DataList/DataSourceSetting/Save';
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
return response;
}).fail(function () {
});
});
}
refreshDataLists() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/datasources/refreshdatalists/np';
return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
return response.message;
});
});
}
getTable(querystring, iscommon, datasourceid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/datalist/getdata/querystring/' + querystring + '/iscommon/' + iscommon + '/datasourceid/' + datasourceid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
}).fail(function () {
MessageHelper.Instance();
});
});
}
getdatafromapi(datalistid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/datalist/GetDataFromApi/datalistid/' + datalistid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result == '') {
response.result = null;
}
else if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
}).fail(function () {
MessageHelper.Instance();
});
});
}
getprimarykey(datalistid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/datalists/Getprimarykeycolumn/' + datalistid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result == "") {
response.result = null;
}
else {
response.result = JSON.parse(response.result);
}
return response;
});
});
}
getdatalistcolumns(datalistid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/datalist/getdatalistcolumns/datalistid/' + datalistid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result == '') {
response.result = null;
}
else if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
}).fail(function () {
MessageHelper.Instance();
});
});
}
static Instance() {
if (this._instance === undefined)
this._instance = new DataListManager();
return this._instance;
}
}
Managers.DataListManager = DataListManager;
})(Managers = DataSources.Managers || (DataSources.Managers = {}));
})(DataSources = Platform.DataSources || (Platform.DataSources = {}));
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
+1
View File
@@ -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(n){let t;(function(t){let i;(function(t){class i extends n.Core.BaseManager{getDataSourceProviders(){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().getAsync("apis/v4/unibase/platform/datasources/getdatasourceproviders").then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getDataSources(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/datasources/get/providerid/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getDataSource(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/datasources/get/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}saveDataSource(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/unibase/platform/datasources/save",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}getDataList(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/datalists/get/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}saveDataList(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/unibase/platform/datalists/savedatalist",n).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n})})}buildQuery(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/unibase/platform/datalist/buildquery",n).then(function(n){return n}).fail(function(){MessageHelper.Instance()})})}saveDataSourceSetting(n){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/DataList/DataSourceSetting/Save",n).then(function(n){return n}).fail(function(){})})}refreshDataLists(){return __awaiter(this,void 0,void 0,function*(){return yield this.dataHelper().postAsync("apis/v4/unibase/platform/datasources/refreshdatalists/np","{}").then(function(n){return n.message})})}getTable(n,t,i){return __awaiter(this,void 0,void 0,function*(){const r="apis/v4/unibase/platform/datalist/getdata/querystring/"+n+"/iscommon/"+t+"/datasourceid/"+i;return yield this.dataHelper().getAsync(r).then(function(n){return n.result!==null&&(n.result=JSON.parse(n.result)),n}).fail(function(){MessageHelper.Instance()})})}getdatafromapi(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/datalist/GetDataFromApi/datalistid/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result==""?n.result=null:n.result!==null&&(n.result=JSON.parse(n.result)),n}).fail(function(){MessageHelper.Instance()})})}getprimarykey(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/datalists/Getprimarykeycolumn/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result=n.result==""?null:JSON.parse(n.result),n})})}getdatalistcolumns(n){return __awaiter(this,void 0,void 0,function*(){const t="apis/v4/unibase/platform/datalist/getdatalistcolumns/datalistid/"+n;return yield this.dataHelper().getAsync(t).then(function(n){return n.result==""?n.result=null:n.result!==null&&(n.result=JSON.parse(n.result)),n}).fail(function(){MessageHelper.Instance()})})}static Instance(){return this._instance===undefined&&(this._instance=new i),this._instance}}t.DataListManager=i})(i=t.Managers||(t.Managers={}))})(t=n.DataSources||(n.DataSources={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
@@ -0,0 +1,380 @@
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 DataSources;
(function (DataSources) {
let Managers;
(function (Managers) {
class DocTypeManager extends Platform.Core.BaseManager {
getDataTypes() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/forms/datatypes';
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDataTypesByControlId(controlId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/forms/datatypecontrols/controlid/' + controlId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getUnassignedProperties(InstalledAppId, FormId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/forms/unassignedproperties/installedappid/' + InstalledAppId + '/formid/' + FormId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDocPropertiesByAppId(InstalledAppId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/forms/docproperties/installedappid/' + InstalledAppId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
saveDocProperty(obj) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/createtable';
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
if (response.result !== null)
response.result = response.result;
return response;
});
});
}
getDocProperties(doctypeId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/getdocproperties/doctypeid/' + doctypeId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getPropertiesByDocTypeId(Id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/getdocproperties/doctypeid/' + Id;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDocProperty(DocPropertyId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/forms/docproperties/' + DocPropertyId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
deleteDocProperty(FormId, DocPropertyId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/forms/formid/' + FormId + '/docpropertyid/' + DocPropertyId + '/deleteproperty';
var result = "";
return yield this.dataHelper().postAsync(url, null).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
deleteDocProperties(DocPropertyId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/deleteproperties/docpropertyid/' + DocPropertyId;
var result = "";
return yield this.dataHelper().deleteAsync(url, DocPropertyId).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
executeTable(TableName) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/ExecuteTableData/tablename/' + TableName;
var result = "";
return yield this.dataHelper().postAsync(url, TableName).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDocTypesByAppId(InstalledAppId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/forms/doctypes/installedappid/' + InstalledAppId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDoctypes() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/getdoctypes';
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
;
getDoctypesAutocomplete(term, authtoken) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/doctypesautocomplete/term/' + term + '/authtoken/' + authtoken;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDoctype(doctypeid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/getdoctypes/doctypeid/' + doctypeid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDoctypeByName(doctypename) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/getdoctypes/doctypename/' + doctypename;
var Doctypes;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
deletetDoctype(doctypeid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/deletedoctype/doctypeid/' + doctypeid;
var Doctypes;
return yield this.dataHelper().deleteAsync(url, doctypeid).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
saveDoctype(obj) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/savedoctype';
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
if (response.result !== null)
response.result = response.result;
return response;
});
;
});
}
addAppDoctype(obj) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/saveappdoctype';
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
if (response.result !== null)
response.result = response.result;
return response;
});
});
}
saveAppDefaultDoctype(isdefault, doctypeid, installedappid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/saveappdefaultdoctype/isdefault/' + isdefault + '/doctypeid/' + doctypeid + '/installedappid/' + installedappid;
return yield this.dataHelper().postAsync(url, null).then(function (response) {
if (response.result !== null)
response.result = response.result;
return response;
});
});
}
updateAppDpctype(obj) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/updateappdoctype';
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDefaultDoctype(installedappid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/getappdefaultdoctype/installedappid/' + installedappid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null && response.result !== "")
response.result = JSON.parse(response.result);
return response;
});
});
}
addAppDoctypes(obj) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/saveappdoctypelist/list';
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
if (response.result !== null)
response.result = response.result;
return response;
});
});
}
getAppDoctypes(InstalledAppId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/getappdoctypebyinstalledappid/installedappid/' + InstalledAppId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getAppDoctype(AppDoctypeId) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/getappdoctype/appdoctypeid/' + AppDoctypeId;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
GetRelationType() {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/RelationTypes';
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDoctypeRelation(doctypeid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/getdoctyperelationbydoctypebyId/docTypeid/' + doctypeid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
getDocPropertyRelation(doctypeid, installedappid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/getdocpropertyrelationbydoctypeidandinstalledappid/DocTypeid/' + doctypeid + '/InstalledAppId/' + installedappid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
save(obj) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/savedocpropertyactionprovider';
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
if (response.result !== null)
response.result = response.result;
return response;
});
});
}
getDocPropertyActionProviders(installedappid) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/getdocpropertyactionproviders/installedappid/' + installedappid;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result !== null)
response.result = JSON.parse(response.result);
return response;
});
});
}
updateIndexes(obj) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/updateindexes/ids/' + obj;
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
if (response.result != null) {
response.result = JSON.parse(response.result);
}
return response;
});
});
}
deleteDoctype(id) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/delete/id/' + id;
return yield this.dataHelper().postAsync(url, id).then(function (response) {
if (response.result != null) {
response.result = JSON.parse(response.result);
}
return response;
});
});
}
exportDocType(DocTypeId, installedAppId, isAppDocType) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/exportdoctype/doctypeid/' + DocTypeId + '/installedappid/' + installedAppId + '/isappdoctype/' + isAppDocType;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result != null) {
response.result = response.result;
}
return response;
});
});
}
exportAllDocType(installedAppId, isAppDoctype) {
return __awaiter(this, void 0, void 0, function* () {
const url = 'apis/v4/unibase/platform/doctypes/exportalldoctype/installedappid/' + installedAppId + '/isappdoctype/' + isAppDoctype;
return yield this.dataHelper().getAsync(url).then(function (response) {
if (response.result != null) {
response.result = response.result;
}
return response;
});
});
}
static Instance() {
if (this._instance === undefined)
this._instance = new DocTypeManager();
return this._instance;
}
}
Managers.DocTypeManager = DocTypeManager;
})(Managers = DataSources.Managers || (DataSources.Managers = {}));
})(DataSources = Platform.DataSources || (Platform.DataSources = {}));
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
})(Unibase || (Unibase = {}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"version":3,"file":"idatalistmanager.js","sourceRoot":"","sources":["idatalistmanager.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
{"version":3,"file":"idoctypemanager.js","sourceRoot":"","sources":["idoctypemanager.ts"],"names":[],"mappings":""}