vue-intergrall-plugins 1.0.22 → 1.0.24

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.
@@ -4841,63 +4841,65 @@ var dev = window.location.hostname == 'localhost' ? '&teste=levchat2' : '';var s
4841
4841
  getStandardMessages: function getStandardMessages(type, token) {
4842
4842
  var _this = this;
4843
4843
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
4844
- var url, response, value, data, tipo, nivel, conteudo, msg_ret, st_ret;
4844
+ var url, response, data, tipo, nivel, conteudo, msg_ret, st_ret;
4845
4845
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4846
4846
  while (1) switch (_context.prev = _context.next) {
4847
4847
  case 0:
4848
4848
  url = "".concat(baseURL, "/messages/").concat(type, "?token_cliente=").concat(token).concat(dev);
4849
- _context.prev = 1;
4850
- _context.next = 4;
4851
- return fetch(url, {
4852
- method: 'GET'
4853
- // headers: {
4854
- // Authorization: "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdGQiOiJNS1VUUnd3aW00bDV3d0piTHczb2xPYWtTbWxab283Q1F2MDY3V3pWR2E3VkhDQ2FMUEdsS2VQIiwibWFuYWdlciI6Ik1LVXFCcGtGUjNCTkhrbTZ5Znd3aW00bDV3d0l2Tlk0MDZrMzQ3SVdkRnNnRUY4Y3RIaDlQdngiLCJoYXNfaW5mb3MiOnRydWUsIm5yb3MiOltdLCJhdXRoIjoiTUtVdXdGZjdjMXd3eGI0NGF3d1F4eGlia3N2NW5YR2FxOWZVNkxMYnAzQ0tkS1NHa0RvbWV4ZiIsImlhdCI6MTY0ODgxMjYzOSwiZXhwIjoxNjQ4ODk5MDM5fQ.IMpYYLoxiX566-Y2fqNlJu0qBkEyOOTWZ25UqeOyPUs"
4855
- // }
4856
- });
4857
- case 4:
4858
- response = _context.sent;
4859
- if (response.ok) {
4860
- _context.next = 8;
4849
+ if (_this.$root.$httpRequest) {
4850
+ _context.next = 3;
4861
4851
  break;
4862
4852
  }
4863
- console.error('Erro na requisicao para o servidor (1)', response.statusText);
4864
4853
  return _context.abrupt("return", false);
4865
- case 8:
4866
- _context.next = 10;
4867
- return response.json();
4868
- case 10:
4869
- value = _context.sent;
4870
- data = value.data;
4854
+ case 3:
4855
+ _context.prev = 3;
4856
+ _context.next = 6;
4857
+ return _this.$root.$httpRequest.get(url);
4858
+ case 6:
4859
+ response = _context.sent;
4860
+ if (!(_typeof(response) != "object" || _typeof(response.data) != "object")) {
4861
+ _context.next = 9;
4862
+ break;
4863
+ }
4864
+ return _context.abrupt("return", {
4865
+ msg_ret: 'Retorno incorreto das mensagens formatadas'
4866
+ });
4867
+ case 9:
4868
+ data = response.data;
4871
4869
  tipo = data.tipo, nivel = data.nivel, conteudo = data.conteudo, msg_ret = data.msg_ret, st_ret = data.st_ret;
4872
4870
  if (tipo) _this.$emit('set-message-type', tipo);
4873
4871
  if (!(st_ret === 'OK')) {
4874
- _context.next = 18;
4872
+ _context.next = 16;
4875
4873
  break;
4876
4874
  }
4877
4875
  return _context.abrupt("return", conteudo ? conteudo : nivel);
4878
- case 18:
4876
+ case 16:
4879
4877
  if (!(st_ret === 'AVISO')) {
4880
- _context.next = 22;
4878
+ _context.next = 20;
4881
4879
  break;
4882
4880
  }
4883
4881
  return _context.abrupt("return", {
4884
4882
  msg_ret: msg_ret
4885
4883
  });
4886
- case 22:
4887
- return _context.abrupt("return", false);
4888
- case 23:
4889
- _context.next = 29;
4884
+ case 20:
4885
+ return _context.abrupt("return", msg_ret ? {
4886
+ msg_ret: msg_ret
4887
+ } : false);
4888
+ case 21:
4889
+ _context.next = 27;
4890
4890
  break;
4891
- case 25:
4892
- _context.prev = 25;
4893
- _context.t0 = _context["catch"](1);
4891
+ case 23:
4892
+ _context.prev = 23;
4893
+ _context.t0 = _context["catch"](3);
4894
4894
  console.error("Erro na requisicao para o servidor (2)", _context.t0);
4895
- return _context.abrupt("return", false);
4896
- case 29:
4895
+ return _context.abrupt("return", {
4896
+ msg_ret: _context.t0.message ? _context.t0.message : _context.t0
4897
+ });
4898
+ case 27:
4897
4899
  case "end":
4898
4900
  return _context.stop();
4899
4901
  }
4900
- }, _callee, null, [[1, 25]]);
4902
+ }, _callee, null, [[3, 23]]);
4901
4903
  }))();
4902
4904
  }
4903
4905
  }
@@ -8488,36 +8490,37 @@ var InteratividadeBotoes = __vue_component__$b;var script$6 = {
8488
8490
  }
8489
8491
  return _context.abrupt("return");
8490
8492
  case 4:
8493
+ if (_this2.$root.$httpRequest) {
8494
+ _context.next = 6;
8495
+ break;
8496
+ }
8497
+ return _context.abrupt("return");
8498
+ case 6:
8491
8499
  encodedURL = Buffer(url).toString("base64");
8492
- _context.next = 7;
8493
- return fetch("".concat(baseURL, "/preview?url=").concat(encodedURL).concat(dev), {
8494
- method: "get"
8495
- // headers: {
8496
- // Authorization: "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdGQiOiJNS1VGWnBQeEV1UHc5UXdvN21HU2tWNEl4VHN0blM3MHNyZUJTTWt3d3hiNDRhd3dDcWwxd09jIiwibWFuYWdlciI6Ik1LVXRhd3dpbTRsNXd3WW1LMWFJYXd3aW00bDV3d3d3eGI0NGF3d0s0a2pveHBPMnl6TFZ3dXBud3d4YjQ0YXd3cmxNNHRqZ3FKTExsTjMiLCJoYXNfaW5mb3MiOnRydWUsIm5yb3MiOlsiMjczIl0sImF1dGgiOiJNS1VncmxDdkdRbElGbXZVTERCSGplV0wyOXFVUHdyOVlSMVMyeXdJanlLOUNteCIsImlhdCI6MTY0ODQ3MzYxNSwiZXhwIjoxNjQ4NTYwMDE1fQ.KSG_6_9NfQhk5br7hnXzeLyVZuT69XLaEYF9XkdgmmQ"
8497
- // }
8498
- });
8499
- case 7:
8500
+ _context.next = 9;
8501
+ return _this2.$root.$httpRequest.get("".concat(baseURL, "/preview?url=").concat(encodedURL).concat(dev));
8502
+ case 9:
8500
8503
  response = _context.sent;
8501
8504
  if (!(_typeof(response) != "object" || _typeof(response.data) != "object")) {
8502
- _context.next = 10;
8505
+ _context.next = 12;
8503
8506
  break;
8504
8507
  }
8505
8508
  throw "Retorno incorreto";
8506
- case 10:
8509
+ case 12:
8507
8510
  data = response.data;
8508
8511
  st_ret = data.st_ret, msg_ret = data.msg_ret, raspagem = data.raspagem;
8509
8512
  if (!(st_ret != "OK")) {
8510
- _context.next = 14;
8513
+ _context.next = 16;
8511
8514
  break;
8512
8515
  }
8513
8516
  throw "".concat(st_ret, " - ").concat(msg_ret);
8514
- case 14:
8517
+ case 16:
8515
8518
  if (raspagem) {
8516
- _context.next = 16;
8519
+ _context.next = 18;
8517
8520
  break;
8518
8521
  }
8519
8522
  throw "".concat(st_ret, " - ").concat(msg_ret, " | (Raspagem nao encontrada no retorno)");
8520
- case 16:
8523
+ case 18:
8521
8524
  description = raspagem.description, og = raspagem.og, theme_color = raspagem.theme_color;
8522
8525
  if (description) _this2.linkPreview.description = description;
8523
8526
  if (raspagem.author) _this2.linkPreview.author = raspagem.author;
@@ -8529,17 +8532,17 @@ var InteratividadeBotoes = __vue_component__$b;var script$6 = {
8529
8532
  }
8530
8533
  if (theme_color) _this2.linkPreview.colorTheme = theme_color;
8531
8534
  if (_this2.linkPreview.description || _this2.linkPreview.imageSource) _this2.linkPreview.isValid = true;
8532
- _context.next = 27;
8535
+ _context.next = 29;
8533
8536
  break;
8534
- case 24:
8535
- _context.prev = 24;
8537
+ case 26:
8538
+ _context.prev = 26;
8536
8539
  _context.t0 = _context["catch"](0);
8537
8540
  console.error("Erro ao gerar o preview do link: ", _context.t0);
8538
- case 27:
8541
+ case 29:
8539
8542
  case "end":
8540
8543
  return _context.stop();
8541
8544
  }
8542
- }, _callee, null, [[0, 24]]);
8545
+ }, _callee, null, [[0, 26]]);
8543
8546
  }))();
8544
8547
  },
8545
8548
  openUrl: function openUrl() {
@@ -8575,7 +8578,7 @@ var __vue_staticRenderFns__$6 = [];
8575
8578
  /* style */
8576
8579
  var __vue_inject_styles__$6 = function __vue_inject_styles__(inject) {
8577
8580
  if (!inject) return;
8578
- inject("data-v-2e1c7e66_0", {
8581
+ inject("data-v-d1f3ac6c_0", {
8579
8582
  source: ".link-preview{display:flex;flex-direction:column;background-color:#eee;color:#333;cursor:pointer;margin:5px 0;border-radius:5px;opacity:.95;transition:opacity .3s ease-in-out;font-size:13.6px}.link-preview-image{display:flex;justify-content:center;align-items:center;padding:1px;border-top-left-radius:5px;border-top-right-radius:5px}.link-preview-author{margin:5px;font-size:.615em;font-weight:700}.link-preview-author.mb-0{margin-bottom:0}.link-preview-author h1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.link-preview-image img{min-width:100px;max-width:200px;border-top-left-radius:5px;border-top-right-radius:5px}.link-preview-infos{background-color:#2626261a;padding:5px;margin:5px;font-size:.83em;border-radius:5px}.link-preview:hover{opacity:1}.link-preview:hover .link-preview-infos p{text-decoration:underline}",
8580
8583
  map: undefined,
8581
8584
  media: undefined
@@ -8584,7 +8587,7 @@ var __vue_inject_styles__$6 = function __vue_inject_styles__(inject) {
8584
8587
  /* scoped */
8585
8588
  var __vue_scope_id__$6 = undefined;
8586
8589
  /* module identifier */
8587
- var __vue_module_identifier__$6 = "data-v-2e1c7e66";
8590
+ var __vue_module_identifier__$6 = "data-v-d1f3ac6c";
8588
8591
  /* functional template */
8589
8592
  var __vue_is_functional_template__$6 = false;
8590
8593
  /* style inject shadow dom */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -64,13 +64,9 @@ export default {
64
64
  try {
65
65
  const url = this.returnURL();
66
66
  if (!url) return;
67
+ if (!this.$root.$httpRequest) return
67
68
  const encodedURL = Buffer(url).toString("base64");
68
- const response = await fetch(`${baseURL}/preview?url=${encodedURL}${dev}`, {
69
- method: "get",
70
- // headers: {
71
- // Authorization: "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdGQiOiJNS1VGWnBQeEV1UHc5UXdvN21HU2tWNEl4VHN0blM3MHNyZUJTTWt3d3hiNDRhd3dDcWwxd09jIiwibWFuYWdlciI6Ik1LVXRhd3dpbTRsNXd3WW1LMWFJYXd3aW00bDV3d3d3eGI0NGF3d0s0a2pveHBPMnl6TFZ3dXBud3d4YjQ0YXd3cmxNNHRqZ3FKTExsTjMiLCJoYXNfaW5mb3MiOnRydWUsIm5yb3MiOlsiMjczIl0sImF1dGgiOiJNS1VncmxDdkdRbElGbXZVTERCSGplV0wyOXFVUHdyOVlSMVMyeXdJanlLOUNteCIsImlhdCI6MTY0ODQ3MzYxNSwiZXhwIjoxNjQ4NTYwMDE1fQ.KSG_6_9NfQhk5br7hnXzeLyVZuT69XLaEYF9XkdgmmQ"
72
- // }
73
- });
69
+ const response = await this.$root.$httpRequest.get(`${baseURL}/preview?url=${encodedURL}${dev}`);
74
70
  if (typeof response != "object" || typeof response.data != "object")
75
71
  throw "Retorno incorreto";
76
72
  const { data } = response;