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 Automation; (function (Automation) { let Managers; (function (Managers) { class RuleManager extends Platform.Core.BaseManager { static Instance() { if (this._instance === undefined) this._instance = new RuleManager(); return this._instance; } saveRule(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/saverule'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } DeleteTemplateKeys(Templatekeyid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/DeleteEventTemplateKey/templatekeyid/' + Templatekeyid; return yield this.dataHelper().postAsync(url, null).then(function (response) { return response; }); }); } getNotificationRules(installedappid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getnotificationrules/installedappid/' + installedappid; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } getRule(ruleid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getrule/RuleId/' + ruleid + ''; let ruleinfo; return yield this.dataHelper().getAsync(url).then(function (response) { ruleinfo = JSON.parse(response.result); return ruleinfo; }); }); } getRuleEvents(ruleid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getruleevents/RuleId/' + ruleid + ''; let ruleeventinfo; return yield this.dataHelper().getAsync(url).then(function (response) { ruleeventinfo = JSON.parse(response.result); return ruleeventinfo; }); }); } getRuleEventsByEventGroupId(eventgroupid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getruleeventsbyeventgroupid/EventGroupId/' + eventgroupid + ''; let ruleeventinfo; return yield this.dataHelper().getAsync(url).then(function (response) { ruleeventinfo = JSON.parse(response.result); return ruleeventinfo; }); }); } saveRuleFlow(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/updateruleflow'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } saveRuleAction(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/saveruleaction'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } getRuleAction(ruleactionid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getruleaction/RuleActionId/' + ruleactionid; let ruleactioninfo; return yield this.dataHelper().getAsync(url).then(function (response) { ruleactioninfo = JSON.parse(response.result); return ruleactioninfo; }); }); } getAllRuleActions() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/_GetRuleActions'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response = JSON.parse(response.result); } return response; }); }); } getRuleActionsByInstalledApp(installedappid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/GetAllRuleActionsByInstalledAppId/installedappid/' + installedappid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response = JSON.parse(response.result); } return response; }); }); } getRuleActions(ruleid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getruleactions/RuleId/' + ruleid; let ruleactioninfo; return yield this.dataHelper().getAsync(url).then(function (response) { ruleactioninfo = JSON.parse(response.result); return ruleactioninfo; }); }); } getRuleActionByEventGroupId(eventgroupid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getruleactionbyeventgroupid/EventGroupId/' + eventgroupid; let ruleactioninfo; return yield this.dataHelper().getAsync(url).then(function (response) { ruleactioninfo = JSON.parse(response.result); return ruleactioninfo; }); }); } saveRuleEvent(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/saveruleevent'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } saveAdvRuleEvent(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/SaveAdvRuleEvent'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } getRuleConditions(ruleid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getruleconditions/RuleId/' + ruleid; let ruleconditioninfo; return yield this.dataHelper().getAsync(url).then(function (response) { ruleconditioninfo = JSON.parse(response.result); return ruleconditioninfo; }); }); } getRuleActionConditions(ruleid, ruleactionid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getruleactionconditions/RuleId/' + ruleid + '/RuleActionId/' + ruleactionid; let ruleconditioninfo; return yield this.dataHelper().getAsync(url).then(function (response) { ruleconditioninfo = JSON.parse(response.result); return ruleconditioninfo; }); }); } saveEventTemplate(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/savetemplate'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } saveEventTemplates(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/savetemplates/List'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } getEventTemplateKeys(templateid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/geteventtemplatekeys/TemplateId/' + templateid + ''; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } getInstalledApps() { return __awaiter(this, void 0, void 0, function* () { var installedapps; const url = 'apis/v4/unibase/platform/apps/getinstalledapps'; return yield this.dataHelper().getAsync(url).then(function (response) { installedapps = JSON.parse(response.result); return installedapps; }); }); } saveRuleProvider(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/saveruleprovider'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } loadRuleProviders(InstalledAppId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getruleprovidersbyappid/InstalledAppId/' + InstalledAppId; let ruleproviderinfo; return yield this.dataHelper().getAsync(url).then(function (response) { ruleproviderinfo = JSON.parse(response.result); return ruleproviderinfo; }); }); } getRuleProvider(ruleproviderid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getruleprovider/RuleProviderId/' + ruleproviderid; let ruleproviderinfo; return yield this.dataHelper().getAsync(url).then(function (response) { ruleproviderinfo = JSON.parse(response.result); return ruleproviderinfo; }); }); } getTokens(ruleproviderid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getTokenss/RuleProviderId/' + ruleproviderid; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } getContactColumns(ruleproviderid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getContactColumns/RuleProviderId/' + ruleproviderid; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } getResultActions(ruleactionid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getResultActions/RuleActionId/' + ruleactionid; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } getEventGroups(ruleid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/geteventgroups/RuleId/' + ruleid + ''; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } getActions() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getactions'; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } getEventTemplateNotesByLanguageId(doctypeid, languageid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/geteventtemplatenotesbylanguageid/DoctypeId/' + doctypeid + '/LanguageId/' + languageid; let eventtemplatenoteinfo; return yield this.dataHelper().getAsync(url).then(function (response) { eventtemplatenoteinfo = JSON.parse(response.result); return eventtemplatenoteinfo; }); }); } refreshNotes(doctypeid, isrefresh) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/refreshnotes/DoctypeId/' + doctypeid + '/Isrefresh/' + isrefresh; return yield this.dataHelper().postAsync(url, "{}").then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } alert(response.message); return response; }); }); } getRecipientProviders() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getrecipientproviders'; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } getActionRecipient(ruleactionid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getactionrecipient/RuleActionId/' + ruleactionid; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } getAction(actionid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getaction/ActionId/' + actionid; return yield this.dataHelper().getAsync(url).then(function (response) { return JSON.parse(response.result); }); }); } exportRuleProiders() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/exportruleproviders/'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response.result = response.result; } return response; }); }); } exportSingleRuleProiders(ruleproviderid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/ExportSingleProvider/ruleproviderid/' + ruleproviderid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response.result = response.result; } return response; }); }); } exportSingleRule(ruleid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/ExportSingleRule/RuleId/' + ruleid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response.result = response.result; } return response; }); }); } exportRules() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/exportrules/'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response.result = response.result; } return response; }); }); } getTimeLineLogs(refid, installedappid, ispriority) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/gettimelinelogs/refid/' + refid + '/installedappid/' + installedappid + '/ispriority/' + ispriority; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } deleteEventGroup(EventGroupId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/deleteeventgroup/EventGroupId/' + EventGroupId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result != null) { response.result = response.result; } return response; }); }); } ExecutedActions() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/executedactions'; return yield this.dataHelper().getAsync(url).then(function (response) { response.result = JSON.parse(response.result); return response; }); }); } ExecutedActionsList(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/executedactionslist'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { response.result = JSON.parse(response.result); return response; }); }); } UpdateRuleActionStatus(RuleActionId, Status) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/changeruleactionstatus/RuleActionId/' + RuleActionId + '/Status/' + Status; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } getActiveRules(ruleid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getactiverules/RuleId/' + ruleid; let activeruleinfo; return yield this.dataHelper().getAsync(url).then(function (response) { activeruleinfo = JSON.parse(response.result); return activeruleinfo; }); }); } UpdateActiveRuleStatus(ActiveRuleId, Status) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/changeactiverulestatus/ActiveRuleId/' + ActiveRuleId + '/Status/' + Status; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } UpdateRuleScheduler(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/updatescheduledrule'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } getSelectedRecipientsData(RecipientProviderId, SelectedIds, IdColumn) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getselectedrecipientsdata/recipientproviderid/' + RecipientProviderId + '/selectedids/' + SelectedIds + '/idcolumn/' + IdColumn; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } getCreateFormsByInstalledAppId(Installedappid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/getCreateFormsByInstalledAppId/installedappid/' + Installedappid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getExternalContactsFromReport(reportid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/analytics/getiscontactreportcolumns/reportid/' + reportid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } exporteventtemplates() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/ExportAllTemplates'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response = response.result; } return response; }); }); } exportsingletemplate(doctypeid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/ExportSingleDoctemplate/doctypeid/' + doctypeid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response = response.result; } return response; }); }); } GetFollwersByPkid(pkid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/GetFollowersByPkId/PrimaryKeyId/' + pkid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } GetFollwersByVersionGuid(versionGuid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/GetFollowersByVersionGuid/versionguid/' + versionGuid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } refreshNotificationProviders() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/RefreshNotificationProviders/np'; return yield this.dataHelper().postAsync(url, "{}").then(function (response) { MessageHelper.Instance().showSuccess(response.message, "Unibase_ValidationSummary"); return response; }); }); } getImportLogs(logtype) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/notificationrule/platform/GetImportLogs/logType/' + logtype; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } } Managers.RuleManager = RuleManager; })(Managers = Automation.Managers || (Automation.Managers = {})); })(Automation = Platform.Automation || (Platform.Automation = {})); })(Platform = Unibase.Platform || (Unibase.Platform = {})); })(Unibase || (Unibase = {}));