123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482 |
- 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 Membership;
- (function (Membership) {
- let Managers;
- (function (Managers) {
- class AccountManager extends Platform.Core.BaseManager {
- validateLogin(request) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = _appsettings.authentication_url() + 'account/login';
- return yield this.dataHelper().postAsync(url, request).then(function (response) {
- var actionResponse = response;
- return actionResponse;
- });
- });
- }
- changePassword(request) {
- var identity = Membership.Infos.Identity.getCurrentUser();
- identity.userId;
- }
- getIdentity(session) {
- Membership.Infos.Identity.setCurrentUser(null);
- }
- getIndustries() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/getindustries';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- var selectResponse = response;
- return selectResponse;
- }).fail(function () {
- });
- });
- }
- anonymousLogin() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/anonymouslogin';
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- var actionResponse = response;
- return actionResponse;
- });
- });
- }
- parentanonymouslogin() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/parentanonymouslogin';
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- var actionResponse = response;
- return actionResponse;
- });
- });
- }
- getUser(phone, email) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/getuserbyphoneormail/' + phone + '/' + email;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- var selectResponse = response;
- return selectResponse;
- }).fail(function () {
- });
- });
- }
- sendOtp(request) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/sendotp';
- return yield this.dataHelper().postAsync(url, request).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- verifyOtp(request) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/verifyotp';
- return yield this.dataHelper().postAsync(url, request).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- signUp_Old(request) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/registertenant';
- return yield this.dataHelper().postAsync(url, request).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- signUp(request) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/AllocateEmptyTenantAsync';
- return yield this.dataHelper().postAsync(url, request).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- getTenants() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/gettenants';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- var selectResponse = response;
- return selectResponse;
- }).fail(function () {
- });
- });
- }
- getUserTenants(phoneOrEmail) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/gettenants/' + phoneOrEmail;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- var selectResponse = response;
- return selectResponse;
- }).fail(function () {
- });
- });
- }
- registerUser(request) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/registeruser';
- return yield this.dataHelper().postAsync(url, request).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- getContact(phoneOrEmail, tenantId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/getcontactbyphoneormail/' + phoneOrEmail + '/' + tenantId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- updatePassword(request) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/updatepassword';
- return yield this.dataHelper().postAsync(url, request).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- getfollowerbyfollowid(userid, followid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/followers/getfollowerbyfollowid/userid/' + userid + '/followid/' + followid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null && response.result !== "")
- response.result = JSON.parse(response.result);
- return response;
- }).fail(function () {
- });
- });
- }
- getfollowermanagers(userId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/followers/getmanagerfollowersbyuserid/userid/' + userId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- }).fail(function () {
- });
- });
- }
- deleteManagerFollower(managerFollowerId, contactId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/followers/deletemanagerfollower/managerfollowerid/' + managerFollowerId + '/contactid/' + contactId;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- savemanager(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/followers/savemanager';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- deleteFollower(followerId, contactId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/followers/deletefollower/followerid/' + followerId + '/contactid/' + contactId;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- savefollower(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/followers/savefollower';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- lobs(tenantid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/getlobs/' + tenantid + '';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- var selectResponse = response;
- return selectResponse;
- }).fail(function () {
- });
- });
- }
- getchildtags(tenantid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/getchildtags/' + tenantid + '';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- var selectResponse = response;
- return selectResponse;
- }).fail(function () {
- });
- });
- }
- registercontact(contactname, phonenumber, emailaddress, tagid, tenantid, password, firmname) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/registercontact/' + contactname + '/' + phonenumber + '/' + emailaddress + '/' + tagid + '/' + tenantid + '/' + password + '/' + firmname + '';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- var selectResponse = response;
- return selectResponse;
- }).fail(function () {
- });
- });
- }
- childlobs(LobId, tenantid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/getchildlobs/' + LobId + '/' + tenantid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- var selectResponse = response;
- return selectResponse;
- }).fail(function () {
- });
- });
- }
- registercmnUser(request) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/register';
- return yield this.dataHelper().postAsync(url, request).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- register(request) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/contactregister';
- return yield this.dataHelper().postAsync(url, request).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- userLogin(unibaseid) {
- return __awaiter(this, void 0, void 0, function* () {
- const serverurl = 'Account/UserLogin/UserName/' + unibaseid;
- return yield this.dataHelper().postAsync(serverurl, null).then(function (response) {
- return response;
- });
- });
- }
- userLogoff(sessionid) {
- return __awaiter(this, void 0, void 0, function* () {
- const serverurl = 'Account/UserLogOff/Session/' + sessionid;
- return yield this.dataHelper().postAsync(serverurl, null).then(function (response) {
- return response;
- });
- });
- }
- deleteUserDevices(unibaseid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/common/deleteuserdevices/unibaseid/' + unibaseid;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- updateUserDeviceStatus(deviceuniqueid, status) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/common/updateuserdevicestatus/deviceuniqueid/' + deviceuniqueid + '/status/' + status;
- return yield this.dataHelper().postAsync(url, null).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- generatesession(token) {
- return __awaiter(this, void 0, void 0, function* () {
- const serverurl = 'Account/GenerateSession/Token/' + token;
- return yield this.dataHelper().postAsync(serverurl, null).then(function (response) {
- return response;
- });
- });
- }
- generatesessionbytenantid(token, tid) {
- return __awaiter(this, void 0, void 0, function* () {
- const serverurl = 'Account/GenerateSession/Token/' + token + '/tid/' + tid;
- return yield this.dataHelper().getAsync(serverurl).then(function (response) {
- return response;
- });
- });
- }
- setTenantAsDefault(tenantid, username) {
- return __awaiter(this, void 0, void 0, function* () {
- const serverurl = 'Account/SetTenantAsDefault/TenantId/' + tenantid + '/UserName/' + username;
- return yield this.dataHelper().postAsync(serverurl, null).then(function (response) {
- return response;
- });
- });
- }
- savesupportusers(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'Account/SaveSupportUser';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- }).fail(function () {
- });
- });
- }
- GetSupportUserSession(SessionId) {
- return __awaiter(this, void 0, void 0, function* () {
- const serverurl = 'Account/GetSupportUserSession/SessionId/' + SessionId;
- return yield this.dataHelper().getAsync(serverurl).then(function (response) {
- return response;
- });
- });
- }
- getuserbyuserid(userid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'Account/GetUser/' + userid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- getdomainloadjs() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = _appsettings.authentication_url() + 'Account/Domain';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- getSharedTenants() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'Account/Tenants/GetSharedTenants';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- switchtosecondary(EnableSecData) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'Account/SwitchtoSecondary/Enable/' + EnableSecData;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null) {
- Unibase.Platform.Membership.Infos.Identity.setCurrentUser(response.result);
- window.location.reload();
- }
- }).fail(function () {
- });
- });
- }
- switchtotenant(tenantid) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'Account/SwitchtoTenant/' + tenantid;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null) {
- Unibase.Platform.Membership.Infos.Identity.setCurrentUser(response.result);
- window.location.reload();
- }
- }).fail(function () {
- });
- });
- }
- getconnectedtenant(parenttenantid, childtenant) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'account/gettenant/' + parenttenantid + '/' + childtenant;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- var selectResponse = response;
- return selectResponse;
- }).fail(function () {
- });
- });
- }
- IsValidSession() {
- return __awaiter(this, void 0, void 0, function* () {
- const url = _appsettings.authentication_url() + 'account/session/validate';
- return yield this.dataHelper().getAsync(url).then(function (response) {
- return response;
- }).fail(function () {
- });
- });
- }
- MapUser(orgContactId, assaignedTenantId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/bizgaze/crm/organization/usermaping/orgcontactid/' + orgContactId + '/assaignedtenantid/' + assaignedTenantId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- updateUserDetails(obj) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/membership/updateuserdetails';
- return yield this.dataHelper().postAsync(url, obj).then(function (response) {
- if (response.result != null) {
- response.result = JSON.parse(response.result);
- }
- return response;
- });
- });
- }
- ChangeUsersLockStatus(status, tenantid) {
- return __awaiter(this, void 0, void 0, function* () {
- const serverurl = 'account/Status/' + status + '/TenantId/' + tenantid + '/ChangeUsersLockStatus';
- return yield this.dataHelper().postAsync(serverurl, null).then(function (response) {
- return response;
- });
- });
- }
- ValidateUsersLockStatus(tenantid) {
- return __awaiter(this, void 0, void 0, function* () {
- const serverurl = 'account/ValidateUsersLockStatus/TenantId/' + tenantid;
- return yield this.dataHelper().postAsync(serverurl, null).then(function (response) {
- return response;
- });
- });
- }
- getTenantUserByUserId(userId) {
- return __awaiter(this, void 0, void 0, function* () {
- const url = 'apis/v4/unibase/platform/users/getuserbyuserid/' + userId;
- return yield this.dataHelper().getAsync(url).then(function (response) {
- if (response.result !== null)
- response.result = JSON.parse(response.result);
- return response;
- });
- });
- }
- static Instance() {
- return new AccountManager();
- }
- }
- Managers.AccountManager = AccountManager;
- })(Managers = Membership.Managers || (Membership.Managers = {}));
- })(Membership = Platform.Membership || (Platform.Membership = {}));
- })(Platform = Unibase.Platform || (Unibase.Platform = {}));
- })(Unibase || (Unibase = {}));
|