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