123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359 |
- 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 Dashboards;
- (function (Dashboards) {
- let Managers;
- (function (Managers) {
- class DashboardManager extends Platform.Core.BaseManager {
- getDashboardGroups() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/groups';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getDashboardGroup(DashboardGroupId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/get/' + DashboardGroupId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getDashboardGroupbyName(DashboardGroupName) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/groups/name/' + DashboardGroupName;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null && response.result != "") {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- saveDashboardGroup(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/savedashboardgroup';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- updateDashboardGroup(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/changegroup';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- deleteDashboardGroup(DashboardGroupId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/deletegroup/groupid/' + DashboardGroupId;
- return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- unGroupAllandDelete(ItemsArray, ToDeleteGroupId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/deletedashboardgroup/groupid/' + ToDeleteGroupId + '/groupitems/' + ItemsArray;
- return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- renameGroup(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/renamedashboardgroup';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- setDashboardGroupAsViewable(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- var ViewAll = obj.IsExclude;
- var DashboardGroupId = Number(obj.DashboardGroupId);
- const url = 'apis/v4/unibase/platform/dashboards/setgroupasviewable/dashboardgroupid/' + DashboardGroupId + '/viewall/' + ViewAll;
- return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getDashboards() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/get';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getUserDashboards() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/bizgaze/platform/dashboards/userdashboards';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getUnGroupedDashboards() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/ungrouped';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- saveDashboard(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/save';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- deleteDashboard(DashboardId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/delete/dashboardid/' + DashboardId;
- return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- getDashboardsByInstalledApp(installedAppId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/getdashboards/installedappid/' + installedAppId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getDashboard(DashboardId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/getdashboard/dashboardid/' + DashboardId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getDashboardsByGroup(groupId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/getdashboardsbygroup/groupid/' + groupId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- trackDashboard(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/track';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getDashboardRolesByGroup(DashboardGroupId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/getdashboardgroupprole/dashboardgroupid/' + DashboardGroupId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getRolesList() {
- return __awaiter(this, void 0, void 0, function* () {
- let term;
- if (term == "") {
- term = undefined;
- }
- const url = 'apis/v4/unibase/platform/roles/get/term/' + term;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- saveDashboardGroupRole(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/savedashboardgrouprole';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- removeDashboardGroupRole(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/deletedashboardgrouprole/dashboardgroupid/' + obj.DashboardGroupId + '/roleid/' + obj.RoleId;
- return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getDashboardRoles(DashboardId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/dashboardroles/dashboardid/' + DashboardId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- addViewRole(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/savedashboardrole';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- removeViewRole(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- let DashboardId = obj.DashboardId;
- let roleId = obj.RoleId;
- const url = 'apis/v4/unibase/platform/dashboards/deletedashboardrole/dashboardid/' + DashboardId + '/roleid/' + roleId;
- return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- exportDashboard() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/apps/exportdashboardportlets';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- }
- return response;
- });
- });
- }
- setDashboardAsViewable(DashboardId, viewable) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/setdashboardasviewable/dashboardid/' + DashboardId + '/viewall/' + viewable;
- return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- saveAllDashboardSetting(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/dashboards/savedashboardsettings/List';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result !== null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- exportDashboardByDashboardId(dashboardid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/apps/exportdashboardportlet/dashboardgroupid/' + dashboardid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- }
- return response;
- });
- });
- }
- exportPortlet(portletId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/portlets/exportportlet/PortletId/' + portletId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- }
- return response;
- });
- });
- }
- static Instance() {
- if (this._instance === undefined)
- this._instance = new DashboardManager();
- return this._instance;
- }
- }
- Managers.DashboardManager = DashboardManager;
- })(Managers = Dashboards.Managers || (Dashboards.Managers = {}));
- })(Dashboards = Platform.Dashboards || (Platform.Dashboards = {}));
- })(Platform = Unibase.Platform || (Unibase.Platform = {}));
- })(Unibase || (Unibase = {}));
|