Built files from Bizgaze WebServer
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

integrationmanager.js 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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 Integrations;
  15. (function (Integrations) {
  16. let Managers;
  17. (function (Managers) {
  18. class IntegrationManager extends Platform.Core.BaseManager {
  19. getserviceintegrators() {
  20. return __awaiter(this, void 0, void 0, function* () {
  21. const url = 'apis/v4/unibase/integrations/integrator/getserviceintegratorslist';
  22. return yield this.dataHelper().getAsync(url).then(function (response) {
  23. if (response.result != null) {
  24. response.result = JSON.parse(response.result);
  25. }
  26. return response;
  27. });
  28. });
  29. }
  30. getIntegrator(integratorId) {
  31. return __awaiter(this, void 0, void 0, function* () {
  32. const url = 'apis/v4/unibase/integrations/integrator/getintegratorbyid/integratorid/' + integratorId;
  33. return yield this.dataHelper().getAsync(url).then(function (response) {
  34. if (response.result != null) {
  35. response.result = JSON.parse(response.result);
  36. }
  37. return response;
  38. });
  39. });
  40. }
  41. saveIntegrator(obj) {
  42. return __awaiter(this, void 0, void 0, function* () {
  43. const url = 'apis/v4/unibase/integrations/integrator/saveintegrator';
  44. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  45. if (response.result != null) {
  46. response.result = JSON.parse(response.result);
  47. }
  48. return response;
  49. });
  50. });
  51. }
  52. getProvider(providerId) {
  53. return __awaiter(this, void 0, void 0, function* () {
  54. const url = 'apis/v4/unibase/integrations/providers/getprovider/providerid/' + providerId;
  55. return yield this.dataHelper().getAsync(url).then(function (response) {
  56. if (response.result != null) {
  57. response.result = JSON.parse(response.result);
  58. }
  59. return response;
  60. });
  61. });
  62. }
  63. getProviders() {
  64. return __awaiter(this, void 0, void 0, function* () {
  65. const url = 'apis/v4/unibase/integrations/providers/getproviders';
  66. return yield this.dataHelper().getAsync(url).then(function (response) {
  67. if (response.result != null) {
  68. response.result = JSON.parse(response.result);
  69. }
  70. return response;
  71. });
  72. });
  73. }
  74. getProvidersByIds(ids) {
  75. return __awaiter(this, void 0, void 0, function* () {
  76. const url = 'apis/v4/unibase/integrations/provider/getprovidersbyids/providerids/' + ids;
  77. return yield this.dataHelper().getAsync(url).then(function (response) {
  78. if (response.result != null) {
  79. response.result = JSON.parse(response.result);
  80. }
  81. return response;
  82. });
  83. });
  84. }
  85. getServicesByProviderId(providerId) {
  86. return __awaiter(this, void 0, void 0, function* () {
  87. const url = 'apis/v4/unibase/integrations/providers/getservicesbyproviderid/providerid/' + providerId;
  88. return yield this.dataHelper().getAsync(url).then(function (response) {
  89. if (response.result != null) {
  90. response.result = JSON.parse(response.result);
  91. }
  92. return response;
  93. });
  94. });
  95. }
  96. getServices() {
  97. return __awaiter(this, void 0, void 0, function* () {
  98. const url = 'apis/v4/unibase/integrations/providers/getservices';
  99. return yield this.dataHelper().getAsync(url).then(function (response) {
  100. if (response.result != null) {
  101. response.result = JSON.parse(response.result);
  102. }
  103. return response;
  104. });
  105. });
  106. }
  107. getServicesByIds(ids) {
  108. return __awaiter(this, void 0, void 0, function* () {
  109. const url = 'apis/v4/unibase/integrations/providers/getservicesbyids/serviceids/' + ids;
  110. return yield this.dataHelper().getAsync(url).then(function (response) {
  111. if (response.result != null) {
  112. response.result = JSON.parse(response.result);
  113. }
  114. return response;
  115. });
  116. });
  117. }
  118. getService(serviceId) {
  119. return __awaiter(this, void 0, void 0, function* () {
  120. const url = 'apis/v4/unibase/integrations/providers/getservice/serviceid/' + serviceId;
  121. return yield this.dataHelper().getAsync(url).then(function (response) {
  122. if (response.result != null) {
  123. response.result = JSON.parse(response.result);
  124. }
  125. return response;
  126. });
  127. });
  128. }
  129. saveService(obj) {
  130. return __awaiter(this, void 0, void 0, function* () {
  131. const url = 'apis/v4/unibase/integrations/providers/saveservice';
  132. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  133. if (response.result != null) {
  134. response.result = JSON.parse(response.result);
  135. }
  136. return response;
  137. });
  138. });
  139. }
  140. getintegratorsettings(serviceintegratorid) {
  141. return __awaiter(this, void 0, void 0, function* () {
  142. const url = 'apis/v4/unibase/integrations/integrator/getsettings/serviceintegratorid/' + serviceintegratorid;
  143. return yield this.dataHelper().getAsync(url).then(function (response) {
  144. if (response.result != null) {
  145. response.result = JSON.parse(response.result);
  146. }
  147. return response;
  148. });
  149. });
  150. }
  151. getinputsettings(serviceIntegratorId, isInput) {
  152. return __awaiter(this, void 0, void 0, function* () {
  153. const url = 'apis/v4/unibase/integrations/integrator/inputsettings/serviceintegratorid/' + serviceIntegratorId + '/isinput/' + isInput;
  154. return yield this.dataHelper().getAsync(url).then(function (response) {
  155. if (response.result != null) {
  156. response.result = JSON.parse(response.result);
  157. }
  158. return response;
  159. });
  160. });
  161. }
  162. deleteServiceIntegrator(serviceIntegratorId) {
  163. return __awaiter(this, void 0, void 0, function* () {
  164. const url = 'apis/v4/unibase/integrations/providers/deleteserviceintegrator/serviceintegratorid/' + serviceIntegratorId;
  165. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  166. if (response.result != null) {
  167. response.result = JSON.parse(response.result);
  168. }
  169. return response;
  170. });
  171. });
  172. }
  173. changeServiceIntegratorStatus(serviceIntegratorId, isUpdate) {
  174. return __awaiter(this, void 0, void 0, function* () {
  175. const url = 'apis/v4/unibase/integrations/integrator/changeserviceintegratorstatus/serviceintegratorid/' + serviceIntegratorId + '/isupdate/' + isUpdate;
  176. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  177. if (response.result != null) {
  178. response.result = JSON.parse(response.result);
  179. }
  180. return response;
  181. });
  182. });
  183. }
  184. UpdateServiceIntegrator(obj) {
  185. return __awaiter(this, void 0, void 0, function* () {
  186. const url = 'apis/v4/unibase/integrations/integrator/updateserviceintegrator';
  187. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  188. if (response.result != null) {
  189. response.result = JSON.parse(response.result);
  190. }
  191. return response;
  192. });
  193. });
  194. }
  195. saveSetting(obj) {
  196. return __awaiter(this, void 0, void 0, function* () {
  197. const url = 'apis/v4/unibase/integrations/integrator/savesetting/List';
  198. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  199. if (response.result != null) {
  200. response.result = JSON.parse(response.result);
  201. }
  202. return response;
  203. });
  204. });
  205. }
  206. getServiceIntegratorsByIntegratorId(integratorid) {
  207. return __awaiter(this, void 0, void 0, function* () {
  208. const url = 'apis/v4/unibase/integrations/integrator/getserviceintegratorsbyintegratorid/integratorid/' + integratorid;
  209. return yield this.dataHelper().getAsync(url).then(function (response) {
  210. if (response.result != null) {
  211. response.result = JSON.parse(response.result);
  212. }
  213. return response;
  214. });
  215. });
  216. }
  217. getServiceIntegrators(plantCode, fromDate, toDate) {
  218. return __awaiter(this, void 0, void 0, function* () {
  219. const url = 'apis/v4/unibase/integrations/integrator/getserviceintegrators/plantcode/' + plantCode + '/fromdate/' + fromDate + '/todate/' + toDate;
  220. return yield this.dataHelper().getAsync(url).then(function (response) {
  221. if (response.result != null) {
  222. response.result = JSON.parse(response.result);
  223. }
  224. return response;
  225. });
  226. });
  227. }
  228. getservicesbyIntegrator(integratorid) {
  229. return __awaiter(this, void 0, void 0, function* () {
  230. const url = 'apis/v4/unibase/integrations/providers/getservicesbyintegrator/integratorid/' + integratorid;
  231. return yield this.dataHelper().getAsync(url).then(function (response) {
  232. if (response.result != null) {
  233. response.result = JSON.parse(response.result);
  234. }
  235. return response;
  236. });
  237. });
  238. }
  239. saveServiceIntegrator(obj) {
  240. return __awaiter(this, void 0, void 0, function* () {
  241. const url = 'apis/v4/unibase/integrations/integrator/saveserviceintegrator';
  242. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  243. if (response.result != null) {
  244. response.result = JSON.parse(response.result);
  245. }
  246. return response;
  247. });
  248. });
  249. }
  250. saveProvider(obj) {
  251. return __awaiter(this, void 0, void 0, function* () {
  252. const url = 'apis/v4/unibase/integrations/providers/saveprovider';
  253. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  254. if (response.result != null) {
  255. response.result = JSON.parse(response.result);
  256. }
  257. return response;
  258. });
  259. });
  260. }
  261. getsyncsbyserviceintegrator(serviceintegratorid) {
  262. return __awaiter(this, void 0, void 0, function* () {
  263. const url = 'apis/v4/unibase/integrations/integrator/getsyncsbyserviceintegrator/serviceintegratorid/' + serviceintegratorid;
  264. return yield this.dataHelper().getAsync(url).then(function (response) {
  265. if (response.result != null) {
  266. response.result = JSON.parse(response.result);
  267. }
  268. return response;
  269. });
  270. });
  271. }
  272. getsynclogsbysyncid(syncid) {
  273. return __awaiter(this, void 0, void 0, function* () {
  274. const url = 'apis/v4/unibase/integrations/integrator/getsynclogsbysyncid/syncid/' + syncid;
  275. return yield this.dataHelper().getAsync(url).then(function (response) {
  276. if (response.result != null) {
  277. response.result = JSON.parse(response.result);
  278. }
  279. return response;
  280. });
  281. });
  282. }
  283. executeServiceRequest(executeService) {
  284. return __awaiter(this, void 0, void 0, function* () {
  285. const url = 'apis/v4/unibase/integrations/integrator/executeservicerequest';
  286. return yield this.dataHelper().postAsync(url, executeService).then(function (response) {
  287. if (response.result != null) {
  288. response.result = JSON.parse(response.result);
  289. }
  290. return response;
  291. });
  292. });
  293. }
  294. importProvider(importReq) {
  295. return __awaiter(this, void 0, void 0, function* () {
  296. const url = '/apis/v4/unibase/integrations/providers/importprovider';
  297. return yield this.dataHelper().postAsync(url, importReq).then(function (response) {
  298. if (response.result != null) {
  299. response.result = JSON.parse(response.result);
  300. }
  301. return response;
  302. });
  303. });
  304. }
  305. exportProvider(providerId) {
  306. return __awaiter(this, void 0, void 0, function* () {
  307. const url = 'apis/v4/unibase/integrations/provider/export/' + providerId;
  308. return yield this.dataHelper().getAsync(url).then(function (response) {
  309. if (response.result != null) {
  310. response.result = response.result;
  311. }
  312. return response;
  313. });
  314. });
  315. }
  316. duplicateProvider(providerId) {
  317. return __awaiter(this, void 0, void 0, function* () {
  318. const url = 'apis/v4/unibase/integrations/providers/duplicate/providerid/' + providerId;
  319. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  320. if (response.result != null) {
  321. response.result = JSON.parse(response.result);
  322. }
  323. return response;
  324. });
  325. });
  326. }
  327. updateProviderStatus(providerid, statusId) {
  328. return __awaiter(this, void 0, void 0, function* () {
  329. const url = 'apis/v4/unibase/integrations/providers/updatestatus/providerid/' + providerid + '/installedstatusid/' + statusId;
  330. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  331. if (response.result != null) {
  332. response.result = JSON.parse(response.result);
  333. }
  334. return response;
  335. });
  336. });
  337. }
  338. updateServiceStatus(serviceId, statusId) {
  339. return __awaiter(this, void 0, void 0, function* () {
  340. const url = 'apis/v4/unibase/integrations/providers/updateservicestatus/serviceid/' + serviceId + '/statusid/' + statusId;
  341. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  342. if (response.result != null) {
  343. response.result = JSON.parse(response.result);
  344. }
  345. return response;
  346. });
  347. });
  348. }
  349. updateServiceIntegratorStatus(serviceintegratorid, statusId) {
  350. return __awaiter(this, void 0, void 0, function* () {
  351. const url = 'apis/v4/unibase/integrations/integrator/updateserviceintegratorstatus/serviceintegratorid/' + serviceintegratorid + '/statusid/' + statusId;
  352. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  353. if (response.result != null) {
  354. response.result = JSON.parse(response.result);
  355. }
  356. return response;
  357. });
  358. });
  359. }
  360. deleteProvider(serviceId) {
  361. return __awaiter(this, void 0, void 0, function* () {
  362. const url = 'apis/v4/unibase/integrations/providers/deleteservice/serviceid/' + serviceId;
  363. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  364. if (response.result != null) {
  365. response.result = JSON.parse(response.result);
  366. }
  367. return response;
  368. });
  369. });
  370. }
  371. regenerateSession(integratorId) {
  372. return __awaiter(this, void 0, void 0, function* () {
  373. const url = 'apis/v4/unibase/integrations/integrator/updatesession/id/' + integratorId;
  374. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  375. if (response.result != null) {
  376. response.result = JSON.parse(response.result);
  377. }
  378. return response;
  379. });
  380. });
  381. }
  382. resetSettings(serviceintegratorid) {
  383. return __awaiter(this, void 0, void 0, function* () {
  384. const url = 'apis/v4/unibase/integrations/integrator/resetsettings/serviceintegratorid/' + serviceintegratorid;
  385. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  386. return response;
  387. });
  388. });
  389. }
  390. refreshIntegrationProviders() {
  391. return __awaiter(this, void 0, void 0, function* () {
  392. const url = 'apis/v4/unibase/integrations/providers/refreshintegrationproviders/np';
  393. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  394. MessageHelper.Instance().showSuccess(response.Message, "Unibase_ValidationSummary");
  395. return response;
  396. });
  397. });
  398. }
  399. getIntegrationProviders() {
  400. return __awaiter(this, void 0, void 0, function* () {
  401. const url = 'apis/v4/unibase/integrations/provider/integrationproviders';
  402. return yield this.dataHelper().getAsync(url).then(function (response) {
  403. if (response.result != null) {
  404. response.result = JSON.parse(response.result);
  405. }
  406. return response;
  407. });
  408. });
  409. }
  410. getServiceIntegratorById(serviceintegratorid) {
  411. return __awaiter(this, void 0, void 0, function* () {
  412. const url = 'apis/v4/unibase/integrations/integrator/getServiceIntegratorbyid/serviceintegratorid/' + serviceintegratorid;
  413. return yield this.dataHelper().getAsync(url).then(function (response) {
  414. if (response.result != null) {
  415. response.result = JSON.parse(response.result);
  416. }
  417. return response;
  418. });
  419. });
  420. }
  421. static Instance() {
  422. if (this._instance === undefined)
  423. this._instance = new IntegrationManager();
  424. return this._instance;
  425. }
  426. }
  427. Managers.IntegrationManager = IntegrationManager;
  428. })(Managers = Integrations.Managers || (Integrations.Managers = {}));
  429. })(Integrations = Platform.Integrations || (Platform.Integrations = {}));
  430. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  431. })(Unibase || (Unibase = {}));