123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431 |
- 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 Integrations;
- (function (Integrations) {
- let Managers;
- (function (Managers) {
- class IntegrationManager extends Platform.Core.BaseManager {
- getserviceintegrators() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/getserviceintegratorslist';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getIntegrator(integratorId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/getintegratorbyid/integratorid/' + integratorId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- saveIntegrator(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/saveintegrator';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getProvider(providerId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/getprovider/providerid/' + providerId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getProviders() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/getproviders';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getProvidersByIds(ids) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/provider/getprovidersbyids/providerids/' + ids;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getServicesByProviderId(providerId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/getservicesbyproviderid/providerid/' + providerId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getServices() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/getservices';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getServicesByIds(ids) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/getservicesbyids/serviceids/' + ids;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getService(serviceId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/getservice/serviceid/' + serviceId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- saveService(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/saveservice';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getintegratorsettings(serviceintegratorid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/getsettings/serviceintegratorid/' + serviceintegratorid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getinputsettings(serviceIntegratorId, isInput) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/inputsettings/serviceintegratorid/' + serviceIntegratorId + '/isinput/' + isInput;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- deleteServiceIntegrator(serviceIntegratorId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/deleteserviceintegrator/serviceintegratorid/' + serviceIntegratorId;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- changeServiceIntegratorStatus(serviceIntegratorId, isUpdate) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/changeserviceintegratorstatus/serviceintegratorid/' + serviceIntegratorId + '/isupdate/' + isUpdate;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- UpdateServiceIntegrator(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/updateserviceintegrator';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- saveSetting(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/savesetting/List';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getServiceIntegratorsByIntegratorId(integratorid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/getserviceintegratorsbyintegratorid/integratorid/' + integratorid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getServiceIntegrators(plantCode, fromDate, toDate) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/getserviceintegrators/plantcode/' + plantCode + '/fromdate/' + fromDate + '/todate/' + toDate;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getservicesbyIntegrator(integratorid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/getservicesbyintegrator/integratorid/' + integratorid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- saveServiceIntegrator(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/saveserviceintegrator';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- saveProvider(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/saveprovider';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getsyncsbyserviceintegrator(serviceintegratorid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/getsyncsbyserviceintegrator/serviceintegratorid/' + serviceintegratorid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getsynclogsbysyncid(syncid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/getsynclogsbysyncid/syncid/' + syncid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- executeServiceRequest(executeService) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/executeservicerequest';
- return yield this.dataHelper().postAsync(url, executeService).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- importProvider(importReq) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = '/apis/v4/unibase/integrations/providers/importprovider';
- return yield this.dataHelper().postAsync(url, importReq).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- exportProvider(providerId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/provider/export/' + providerId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = response.result;
- }
- return response;
- });
- });
- }
- duplicateProvider(providerId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/duplicate/providerid/' + providerId;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- updateProviderStatus(providerid, statusId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/updatestatus/providerid/' + providerid + '/installedstatusid/' + statusId;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- updateServiceStatus(serviceId, statusId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/updateservicestatus/serviceid/' + serviceId + '/statusid/' + statusId;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- updateServiceIntegratorStatus(serviceintegratorid, statusId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/updateserviceintegratorstatus/serviceintegratorid/' + serviceintegratorid + '/statusid/' + statusId;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- deleteProvider(serviceId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/deleteservice/serviceid/' + serviceId;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- regenerateSession(integratorId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/updatesession/id/' + integratorId;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- resetSettings(serviceintegratorid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/resetsettings/serviceintegratorid/' + serviceintegratorid;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- return response;
- });
- });
- }
- refreshIntegrationProviders() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/providers/refreshintegrationproviders/np';
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- MessageHelper.Instance().showSuccess(response.Message, "Unibase_ValidationSummary");
- return response;
- });
- });
- }
- getIntegrationProviders() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/provider/integrationproviders';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- getServiceIntegratorById(serviceintegratorid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/integrations/integrator/getServiceIntegratorbyid/serviceintegratorid/' + serviceintegratorid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- static Instance() {
- if (this._instance === undefined)
- this._instance = new IntegrationManager();
- return this._instance;
- }
- }
- Managers.IntegrationManager = IntegrationManager;
- })(Managers = Integrations.Managers || (Integrations.Managers = {}));
- })(Integrations = Platform.Integrations || (Platform.Integrations = {}));
- })(Platform = Unibase.Platform || (Unibase.Platform = {}));
- })(Unibase || (Unibase = {}));
|