Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dataapimanager.js 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3. return new (P || (P = Promise))(function (resolve, reject) {
  4. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8. });
  9. };
  10. var Unibase;
  11. (function (Unibase) {
  12. let Platform;
  13. (function (Platform) {
  14. let DataApis;
  15. (function (DataApis) {
  16. let Manangers;
  17. (function (Manangers) {
  18. class DataApiManager extends Platform.Core.BaseManager {
  19. saveDataApi(obj) {
  20. return __awaiter(this, void 0, void 0, function* () {
  21. const url = 'apis/v4/unibase/platform/dataapis/savedataapi';
  22. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  23. if (response.result != null) {
  24. response.result = JSON.parse(response.result);
  25. }
  26. return response;
  27. });
  28. });
  29. }
  30. getManagers() {
  31. return __awaiter(this, void 0, void 0, function* () {
  32. const url = 'apis/v4/unibase/platform/dataapis/getmanagers';
  33. var mangerinfo;
  34. return yield this.dataHelper().getAsync(url).then(function (response) {
  35. if (response.result != null) {
  36. response.result = JSON.parse(response.result);
  37. }
  38. return response;
  39. });
  40. });
  41. }
  42. getMethodProviderData(systemname) {
  43. return __awaiter(this, void 0, void 0, function* () {
  44. const url = 'apis/v4/unibase/platform/dataapis/getmethodproviders/systemname/' + systemname;
  45. return yield this.dataHelper().getAsync(url).then(function (response) {
  46. if (response.result != null) {
  47. response.result = JSON.parse(response.result);
  48. }
  49. return response;
  50. });
  51. });
  52. }
  53. getMethodProviderDataByRequestType(systemname, requesttypeid) {
  54. return __awaiter(this, void 0, void 0, function* () {
  55. const url = 'apis/v4/unibase/platform/dataapis/getmethodproviders/systemname/' + systemname + '/requesttypeid/' + requesttypeid;
  56. return yield this.dataHelper().getAsync(url).then(function (response) {
  57. if (response.result != null) {
  58. response.result = JSON.parse(response.result);
  59. }
  60. return response;
  61. });
  62. });
  63. }
  64. getdataApiLog(dataapilogid) {
  65. return __awaiter(this, void 0, void 0, function* () {
  66. const url = 'apis/v4/unibase/platform/dataapis/getdataapilog/' + dataapilogid;
  67. return yield this.dataHelper().getAsync(url).then(function (response) {
  68. if (response.result != null && response.result != "") {
  69. response.result = JSON.parse(response.result);
  70. }
  71. return response;
  72. });
  73. });
  74. }
  75. getProperties(paramType) {
  76. return __awaiter(this, void 0, void 0, function* () {
  77. const url = 'apis/v4/unibase/platform/dataapis/getproperties/paramtype/' + paramType;
  78. return yield this.dataHelper().getAsync(url).then(function (response) {
  79. if (response.result != null) {
  80. response.result = JSON.parse(response.result);
  81. }
  82. return response;
  83. });
  84. });
  85. }
  86. getMethodProvider(id) {
  87. return __awaiter(this, void 0, void 0, function* () {
  88. const url = 'apis/v4/unibase/platform/dataapis/getmethodprovider/methodproviderid/' + id;
  89. return yield this.dataHelper().getAsync(url).then(function (response) {
  90. if (response.result != null) {
  91. response.result = JSON.parse(response.result);
  92. }
  93. return response;
  94. });
  95. });
  96. }
  97. refreshDataApis() {
  98. return __awaiter(this, void 0, void 0, function* () {
  99. const url = 'dataapi/refreshdataapis';
  100. return yield this.dataHelper().post(url, null, function (response) {
  101. MessageHelper.Instance().showSuccess("Data Apis refreshed successfully", "Unibase_ValidationSummary");
  102. return response;
  103. }, function (response) {
  104. });
  105. });
  106. }
  107. executefailedapisbyfilter(obj) {
  108. return __awaiter(this, void 0, void 0, function* () {
  109. const url = 'apis/v4/unibase/platform/dataapis/executefailedapisbyfilter';
  110. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  111. if (response.result != null && response.result != "") {
  112. response.result = JSON.parse(response.result);
  113. }
  114. return response;
  115. });
  116. });
  117. }
  118. getDataApiLogfilter(obj) {
  119. return __awaiter(this, void 0, void 0, function* () {
  120. const url = 'apis/v4/unibase/platform/dataapis/getdataapilogitemsforfilter';
  121. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  122. if (response.result != null && response.result != "") {
  123. response.result = JSON.parse(response.result);
  124. }
  125. return response;
  126. });
  127. });
  128. }
  129. getapilogitembydataapilogid(dataapilogid) {
  130. return __awaiter(this, void 0, void 0, function* () {
  131. const url = 'apis/v4/unibase/platform/dataapis/getapilogitembydataapilogid/' + dataapilogid;
  132. return yield this.dataHelper().getAsync(url).then(function (response) {
  133. if (response.result != null && response.result != "") {
  134. response.result = JSON.parse(response.result);
  135. }
  136. return response;
  137. });
  138. });
  139. }
  140. getDataApi(id) {
  141. return __awaiter(this, void 0, void 0, function* () {
  142. const url = 'apis/v4/unibase/platform/dataapis/get/' + id;
  143. return yield this.dataHelper().getAsync(url).then(function (response) {
  144. if (response.result != null && response.result != "") {
  145. response.result = JSON.parse(response.result);
  146. }
  147. return response;
  148. });
  149. });
  150. }
  151. getDataApiExecutionData(id) {
  152. return __awaiter(this, void 0, void 0, function* () {
  153. const url = 'apis/v4/unibase/platform/dataapis/getdataapiexecutiondata/' + id;
  154. return yield this.dataHelper().getAsync(url).then(function (response) {
  155. if (response.result != null && response.result != "") {
  156. response.result = JSON.parse(response.result);
  157. }
  158. return response;
  159. });
  160. });
  161. }
  162. exportDataApis(installedappid) {
  163. return __awaiter(this, void 0, void 0, function* () {
  164. const url = 'apis/v4/unibase/platform/dataapis/export/' + installedappid;
  165. return yield this.dataHelper().getAsync(url).then(function (response) {
  166. if (response.result != null) {
  167. response.result = response.result;
  168. }
  169. return response;
  170. });
  171. });
  172. }
  173. getApiLogItemsfilter(obj) {
  174. return __awaiter(this, void 0, void 0, function* () {
  175. const url = 'apis/v4/unibase/platform/dataapis/getapilogitemsforfilter';
  176. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  177. if (response.result != null && response.result != "") {
  178. response.result = JSON.parse(response.result);
  179. }
  180. return response;
  181. });
  182. });
  183. }
  184. getApiLogItems(refid, page, rows) {
  185. return __awaiter(this, void 0, void 0, function* () {
  186. const url = 'apis/v4/unibase/platform/dataapis/getapilogitems/refid/' + refid + '/page/' + page + '/rows/' + rows;
  187. return yield this.dataHelper().getAsync(url).then(function (response) {
  188. if (response.result != null && response.result != "") {
  189. response.result = JSON.parse(response.result);
  190. }
  191. return response;
  192. });
  193. });
  194. }
  195. getApiLogItem(apilogitemid) {
  196. return __awaiter(this, void 0, void 0, function* () {
  197. const url = 'apis/v4/unibase/platform/dataapis/getapilogitem/' + apilogitemid;
  198. return yield this.dataHelper().getAsync(url).then(function (response) {
  199. if (response.result != null && response.result != "") {
  200. response.result = JSON.parse(response.result);
  201. }
  202. return response;
  203. });
  204. });
  205. }
  206. refreshDataApisByManager(manager) {
  207. return __awaiter(this, void 0, void 0, function* () {
  208. const url = 'dataapi/refreshdataapis/' + manager;
  209. return yield this.dataHelper().post(url, null, function (response) {
  210. MessageHelper.Instance().showSuccess("Data Apis refreshed successfully", "Unibase_ValidationSummary");
  211. return response;
  212. }, function (response) {
  213. });
  214. });
  215. }
  216. executeFailedApiLog(dataApiLogId) {
  217. return __awaiter(this, void 0, void 0, function* () {
  218. const url = 'apis/v4/unibase/platform/dataapis/executefailedapi/id/' + dataApiLogId;
  219. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  220. if (response.result != null) {
  221. response.result = JSON.parse(response.result);
  222. }
  223. return response;
  224. });
  225. });
  226. }
  227. executeFailedApiQueue(apiQueueId) {
  228. return __awaiter(this, void 0, void 0, function* () {
  229. const url = 'apis/v4/unibase/platform/dataapis/executefailedapiqueue/id/' + apiQueueId;
  230. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  231. if (response.result != null) {
  232. response.result = JSON.parse(response.result);
  233. }
  234. return response;
  235. });
  236. });
  237. }
  238. reInitiateApi() {
  239. return __awaiter(this, void 0, void 0, function* () {
  240. const url = 'apis/v4/unibase/platform/dataapis/reintiateapiqueue/np';
  241. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  242. if (response.result != null) {
  243. response.result = JSON.parse(response.result);
  244. }
  245. return response;
  246. });
  247. });
  248. }
  249. changeQueueStatus() {
  250. return __awaiter(this, void 0, void 0, function* () {
  251. const url = 'apis/v4/unibase/platform/dataapis/changeapiqueuestatus/np';
  252. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  253. if (response.result != null) {
  254. response.result = JSON.parse(response.result);
  255. }
  256. return response;
  257. });
  258. });
  259. }
  260. static Instance() {
  261. if (this._instance === undefined)
  262. this._instance = new DataApiManager();
  263. return this._instance;
  264. }
  265. }
  266. Manangers.DataApiManager = DataApiManager;
  267. })(Manangers = DataApis.Manangers || (DataApis.Manangers = {}));
  268. })(DataApis = Platform.DataApis || (Platform.DataApis = {}));
  269. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  270. })(Unibase || (Unibase = {}));