123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- 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 = {}));
|