info-library 2.14.13-beta.3 → 2.14.13-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -264,8 +264,6 @@ class InfoPlatformModel {
264
264
  this.ModoPrime = false;
265
265
  this.PaginaLimpa = false;
266
266
  this.Menu = [];
267
- this.AppApi = null;
268
- this.LoggedUserApi = null;
269
267
  this.ShortcutApi = null;
270
268
  }
271
269
  setConfig(config) {
@@ -1102,86 +1100,43 @@ class InfoAuthenticationService {
1102
1100
  }
1103
1101
  login(usuario, senha, reCaptchaToken = null, codigo2FA = null) {
1104
1102
  this.removeSessao();
1105
- return this._dataService.postNoToken(this._plataforma.LoggedUserApi, { Usuario: usuario, Senha: senha, ReCaptchaToken: reCaptchaToken, Codigo2FA: codigo2FA }, 'Autenticar')
1103
+ return this._dataService.postNoToken('CentroControle_Usuario', { Usuario: usuario, Senha: senha, ReCaptchaToken: reCaptchaToken, Codigo2FA: codigo2FA }, 'Autenticar')
1106
1104
  .pipe(map((r) => {
1107
1105
  if (r.success && r.data != null)
1108
1106
  this._utilities.setLocalStorage(this._plataforma.TokenKey, r.data.Token);
1109
1107
  return r;
1110
1108
  }), catchError((e) => this.errorHandling(e)));
1111
- // return this._http
1112
- // .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/autenticar', { Usuario: usuario, Senha: senha, ReCaptchaToken: reCaptchaToken, Codigo2FA: codigo2FA })
1113
- // .pipe(
1114
- // map((r: any) => {
1115
- // if (r.Success && r.Data != null)
1116
- // this._utilities.setLocalStorage(this._plataforma.TokenKey, r.Data.Token);
1117
- // return new InfoLoginModel(r.Success, r.Messages, r.Data);
1118
- // }),
1119
- // catchError((e: HttpErrorResponse) => this.errorHandling(e))
1120
- // );
1121
1109
  }
1122
1110
  trocarEmpresa(usuario, empresaId) {
1123
- return this._dataService.post(this._plataforma.LoggedUserApi, { EmpresaId: empresaId }, 'TrocarEmpresa')
1111
+ return this._dataService.post('CentroControle_Usuario', { EmpresaId: empresaId }, 'TrocarEmpresa')
1124
1112
  .pipe(map((r) => {
1125
1113
  if (r.success && r.data != null)
1126
1114
  this._utilities.setLocalStorage(this._plataforma.TokenKey, r.data);
1127
1115
  return r;
1128
1116
  }), catchError((e) => this.errorHandling(e)));
1129
- // this._http
1130
- // .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/trocarempresa', { EmpresaId: empresaId }, { headers: this._dataService.getHeaderToken() })
1131
- // .pipe(
1132
- // map((r: any) => {
1133
- // if (r.Success && r.Data != null)
1134
- // this._utilities.setLocalStorage(this._plataforma.TokenKey, r.Data);
1135
- // return new InfoLoginModel(r.Success, r.Messages, r.Data);
1136
- // }),
1137
- // catchError((e: HttpErrorResponse) => this.errorHandling(e))
1138
- // );
1139
1117
  }
1140
1118
  trocarUnidade(usuario, empresaId, unidadeId) {
1141
- return this._dataService.post(this._plataforma.LoggedUserApi, { EmpresaId: empresaId, UnidadeId: unidadeId }, 'TrocarUnidade')
1119
+ return this._dataService.post('CentroControle_Usuario', { EmpresaId: empresaId, UnidadeId: unidadeId }, 'TrocarUnidade')
1142
1120
  .pipe(map((r) => {
1143
1121
  if (r.success && r.data != null)
1144
1122
  this._utilities.setLocalStorage(this._plataforma.TokenKey, r.data);
1145
1123
  return r;
1146
1124
  }), catchError((e) => this.errorHandling(e)));
1147
- // return this._http
1148
- // .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/trocarunidade', { EmpresaId: empresaId, UnidadeId: unidadeId }, { headers: this._dataService.getHeaderToken() })
1149
- // .pipe(
1150
- // map((r: any) => {
1151
- // if (r.Success && r.Data != null)
1152
- // this._utilities.setLocalStorage(this._plataforma.TokenKey, r.Data);
1153
- // return new InfoLoginModel(r.Success, r.Messages, r.Data);
1154
- // }),
1155
- // catchError((e: HttpErrorResponse) => this.errorHandling(e))
1156
- // );
1157
1125
  }
1158
1126
  clonar(usuario) {
1159
- return this._dataService.post(this._plataforma.LoggedUserApi, { Usuario: usuario }, 'Clonar')
1127
+ return this._dataService.post('CentroControle_Usuario', { Usuario: usuario }, 'Clonar')
1160
1128
  .pipe(map((r) => {
1161
1129
  if (r.success && r.data != null)
1162
1130
  this._utilities.setLocalStorage(this._plataforma.TokenKey, r.data);
1163
1131
  return r;
1164
1132
  }), catchError((e) => this.errorHandling(e)));
1165
- // return this._http
1166
- // .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/clonar', { Usuario: usuario }, { headers: this._dataService.getHeaderToken() })
1167
- // .pipe(
1168
- // map((r: any) => {
1169
- // if (r.Success && r.Data != null)
1170
- // this._utilities.setLocalStorage(this._plataforma.TokenKey, r.Data);
1171
- // return new InfoLoginModel(r.Success, r.Messages, r.Data);
1172
- // }),
1173
- // catchError((e: HttpErrorResponse) => this.errorHandling(e))
1174
- // );
1175
1133
  }
1176
1134
  logout() {
1177
1135
  if (this.isLogged()) {
1178
- this._dataService.post(this._plataforma.LoggedUserApi, 'Logout').subscribe(r => {
1136
+ this._dataService.post('CentroControle_Usuario', 'Logout').subscribe(r => {
1179
1137
  this.removeSessao();
1180
1138
  this._router.navigateByUrl('login').then(r => { location.reload(); });
1181
1139
  });
1182
- // this._http.post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/Logout', null, { headers: this._dataService.getHeaderToken() })
1183
- // .subscribe(() => {
1184
- // });
1185
1140
  }
1186
1141
  else {
1187
1142
  this.removeSessao();
@@ -1189,55 +1144,24 @@ class InfoAuthenticationService {
1189
1144
  }
1190
1145
  }
1191
1146
  getPermissions(url, logAtividade = false) {
1192
- return this._dataService.get(this._plataforma.LoggedUserApi, 'GetPermissao', `url=${url}&logatividade=${logAtividade.toString()}`)
1147
+ return this._dataService.get('CentroControle_Usuario', 'GetPermissao', `url=${url}&logatividade=${logAtividade.toString()}`)
1193
1148
  .pipe(map((r) => r), catchError((e) => this.errorHandling(e)));
1194
- // return this._http
1195
- // .get(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/getpermissao?url=' + url + '&logatividade=' + logAtividade.toString(), { headers: this._dataService.getHeaderToken() })
1196
- // .pipe(
1197
- // map((r: any) => new InfoLoginModel(r.Success, r.Messages, r.Data)),
1198
- // catchError((e: HttpErrorResponse) => this.errorHandling(e))
1199
- // );
1200
1149
  }
1201
1150
  setTrocaSenha(model) {
1202
- return this._dataService.post(this._plataforma.LoggedUserApi, model, 'TrocarSenha')
1151
+ return this._dataService.post('CentroControle_Usuario', model, 'TrocarSenha')
1203
1152
  .pipe(map((r) => r), catchError((e) => this.errorHandling(e)));
1204
- // return this._http
1205
- // .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/TrocarSenha', model, { headers: this._dataService.getHeaderToken() })
1206
- // .pipe(
1207
- // map((r: any) => new InfoLoginModel(r.Success, r.Messages, r.Data)),
1208
- // catchError((e: HttpErrorResponse) => this.errorHandling(e))
1209
- // );
1210
1153
  }
1211
1154
  setRecuperarSenha(model) {
1212
- return this._dataService.post(this._plataforma.LoggedUserApi, model, 'RecuperarSenha')
1155
+ return this._dataService.post('CentroControle_Usuario', model, 'RecuperarSenha')
1213
1156
  .pipe(map((r) => r), catchError((e) => this.errorHandling(e)));
1214
- // return this._http
1215
- // .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/RecuperarSenha', model, { headers: this._dataService.getHeaderToken() })
1216
- // .pipe(
1217
- // map((r: any) => new InfoLoginModel(r.Success, r.Messages, r.Data)),
1218
- // catchError((e: HttpErrorResponse) => this.errorHandling(e))
1219
- // );
1220
1157
  }
1221
1158
  setResetarSenha(model) {
1222
- return this._dataService.postNoToken(this._plataforma.LoggedUserApi, model, 'ResetarSenha')
1159
+ return this._dataService.postNoToken('CentroControle_Usuario', model, 'ResetarSenha')
1223
1160
  .pipe(map((r) => r), catchError((e) => this.errorHandling(e)));
1224
- // return this._http
1225
- // .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/ResetarSenha', model)
1226
- // .pipe(
1227
- // map((r: any) => new InfoLoginModel(r.Success, r.Messages, r.Data)),
1228
- // catchError((e: HttpErrorResponse) => this.errorHandling(e))
1229
- // );
1230
1161
  }
1231
1162
  getLoginResources() {
1232
- console.log(this._plataforma.AppApi);
1233
- return this._dataService.getNoToken(this._plataforma.AppApi, 'GetLoginResources')
1163
+ return this._dataService.getNoToken('CentroControle_App', 'GetLoginResources')
1234
1164
  .pipe(map((r) => r), catchError((e) => this.errorHandling(e)));
1235
- // return this._http
1236
- // .get(this._plataforma.Config.webapiUrl + this._plataforma.AppApi + '/GetLoginResources')
1237
- // .pipe(
1238
- // map((r: any) => new InfoLoginModel(r.Success, r.Messages, r.Data)),
1239
- // catchError((e: HttpErrorResponse) => this.errorHandling(e))
1240
- // );
1241
1165
  }
1242
1166
  hasPermission(url, keyFunction = 'view') {
1243
1167
  if (url == '/' && keyFunction == 'view')
@@ -1290,14 +1214,8 @@ class InfoAuthenticationService {
1290
1214
  }
1291
1215
  }
1292
1216
  validaSessao(url) {
1293
- return this._dataService.get(this._plataforma.LoggedUserApi, 'ValidaSessao', `url=${url}`)
1217
+ return this._dataService.get('CentroControle_Usuario', 'ValidaSessao', `url=${url}`)
1294
1218
  .pipe(map((r) => new InfoLoginModel(r === true, '', r)), catchError((e) => this.errorHandling(e)));
1295
- // return this._http
1296
- // .get(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/validasessao?url=' + url, { headers: this._dataService.getHeaderToken() })
1297
- // .pipe(
1298
- // map((r: any) => new InfoLoginModel(r === true, '', r)),
1299
- // catchError((e: HttpErrorResponse) => this.errorHandling(e))
1300
- // );
1301
1219
  }
1302
1220
  removeSessao() {
1303
1221
  Object.keys(localStorage).forEach((key) => {
@@ -9027,7 +8945,6 @@ class InfoMainComponent {
9027
8945
  this.menuapi = null;
9028
8946
  this.menumethod = 'GetMenu';
9029
8947
  this.activemenubyurl = false;
9030
- this.appapi = 'CentroControle_App';
9031
8948
  this.loggeduserapi = null;
9032
8949
  this.loggedusermethod = 'GetLoggedUser';
9033
8950
  this.notificationapi = null;
@@ -9056,8 +8973,6 @@ class InfoMainComponent {
9056
8973
  this._renderer.addClass(this._element.nativeElement, 'topmenu');
9057
8974
  this._platform.Themes = this.themes;
9058
8975
  this._platform.ShortcutApi = this.shortcutapi;
9059
- this._platform.LoggedUserApi = this.loggeduserapi;
9060
- this._platform.AppApi = this.appapi;
9061
8976
  if (this._utilities.getLocalStorage(this._platform.TokenKey) == null)
9062
8977
  this._router.navigateByUrl(this.loginurl);
9063
8978
  else
@@ -9140,7 +9055,7 @@ class InfoMainComponent {
9140
9055
  if (rf & 1) {
9141
9056
  i0.ɵɵlistener("click", function InfoMainComponent_click_HostBindingHandler($event) { return ctx.onClick($event.target); }, false, i0.ɵɵresolveDocument);
9142
9057
  }
9143
- }, inputs: { opened: "opened", version: "version", messages: "messages", enabledia: "enabledia", themes: "themes", languages: "languages", profileurl: "profileurl", loginurl: "loginurl", menuapi: "menuapi", menumethod: "menumethod", activemenubyurl: "activemenubyurl", appapi: "appapi", loggeduserapi: "loggeduserapi", loggedusermethod: "loggedusermethod", notificationapi: "notificationapi", notificationgetmethod: "notificationgetmethod", notificationpostmethod: "notificationpostmethod", notificationverifymethod: "notificationverifymethod", notificationverifyenabled: "notificationverifyenabled", fastsearchform: "fastsearchform", fastsearchformwidth: "fastsearchformwidth", fastsearchtitle: "fastsearchtitle", setthemeonchangecompany: "setthemeonchangecompany", shortcutapi: "shortcutapi" }, outputs: { ongetnotification: "ongetnotification", onverifynotification: "onverifynotification" }, ngContentSelectors: _c4, decls: 15, vars: 23, consts: [[1, "site-container", 3, "ngClass"], [3, "themes", "languages", "profileurl", "notificationapi", "notificationgetmethod", "notificationpostmethod", "notificationverifymethod", "notificationverifyenabled", "fastsearchform", "fastsearchformwidth", "fastsearchtitle", "setthemeonchangecompany", "enabledia", "onchangestate", "ongetnotification", "onverifynotification"], ["topbar", ""], [3, "api", "method", "onchangestate", 4, "ngIf"], [3, "api", "method", "activemenubyurl", "onchangestate", 4, "ngIf"], [1, "main-content"], [1, "main-content-wrap"], [1, "footer", "row"], [1, "copyright", "col-9"], ["class", "version col-3", 4, "ngIf"], [3, "messages"], [3, "api", "method", "onchangestate"], [3, "api", "method", "activemenubyurl", "onchangestate"], ["sidebar", ""], [1, "version", "col-3"]], template: function InfoMainComponent_Template(rf, ctx) {
9058
+ }, inputs: { opened: "opened", version: "version", messages: "messages", enabledia: "enabledia", themes: "themes", languages: "languages", profileurl: "profileurl", loginurl: "loginurl", menuapi: "menuapi", menumethod: "menumethod", activemenubyurl: "activemenubyurl", loggeduserapi: "loggeduserapi", loggedusermethod: "loggedusermethod", notificationapi: "notificationapi", notificationgetmethod: "notificationgetmethod", notificationpostmethod: "notificationpostmethod", notificationverifymethod: "notificationverifymethod", notificationverifyenabled: "notificationverifyenabled", fastsearchform: "fastsearchform", fastsearchformwidth: "fastsearchformwidth", fastsearchtitle: "fastsearchtitle", setthemeonchangecompany: "setthemeonchangecompany", shortcutapi: "shortcutapi" }, outputs: { ongetnotification: "ongetnotification", onverifynotification: "onverifynotification" }, ngContentSelectors: _c4, decls: 15, vars: 23, consts: [[1, "site-container", 3, "ngClass"], [3, "themes", "languages", "profileurl", "notificationapi", "notificationgetmethod", "notificationpostmethod", "notificationverifymethod", "notificationverifyenabled", "fastsearchform", "fastsearchformwidth", "fastsearchtitle", "setthemeonchangecompany", "enabledia", "onchangestate", "ongetnotification", "onverifynotification"], ["topbar", ""], [3, "api", "method", "onchangestate", 4, "ngIf"], [3, "api", "method", "activemenubyurl", "onchangestate", 4, "ngIf"], [1, "main-content"], [1, "main-content-wrap"], [1, "footer", "row"], [1, "copyright", "col-9"], ["class", "version col-3", 4, "ngIf"], [3, "messages"], [3, "api", "method", "onchangestate"], [3, "api", "method", "activemenubyurl", "onchangestate"], ["sidebar", ""], [1, "version", "col-3"]], template: function InfoMainComponent_Template(rf, ctx) {
9144
9059
  if (rf & 1) {
9145
9060
  i0.ɵɵprojectionDef(_c2);
9146
9061
  i0.ɵɵelementStart(0, "div", 0)(1, "info-topbar", 1, 2);
@@ -9203,8 +9118,6 @@ class InfoMainComponent {
9203
9118
  type: Input
9204
9119
  }], activemenubyurl: [{
9205
9120
  type: Input
9206
- }], appapi: [{
9207
- type: Input
9208
9121
  }], loggeduserapi: [{
9209
9122
  type: Input
9210
9123
  }], loggedusermethod: [{