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