@credithub/harlan-components 1.36.2 → 1.37.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credithub/harlan-components",
3
- "version": "1.36.2",
3
+ "version": "1.37.2",
4
4
  "description": "Provide a set of web components to be used in Harlan and other projects",
5
5
  "keywords": [
6
6
  "harlan",
@@ -25,7 +25,6 @@
25
25
  "build:esm": "tsc && tsc-alias",
26
26
  "clean": "rimraf lib dist",
27
27
  "dev": "vite",
28
- "prepare": "husky install",
29
28
  "serve:dev": "vite preview",
30
29
  "test:ci": "npm run build"
31
30
  },
@@ -35,7 +34,7 @@
35
34
  "@itseasy21/react-elastic-carousel": "^0.12.3",
36
35
  "@react-google-maps/api": "^2.19.2",
37
36
  "@rollup/plugin-babel": "^6.0.4",
38
- "@rollup/plugin-commonjs": "^25.0.7",
37
+ "@rollup/plugin-commonjs": "^28.0.0",
39
38
  "@rollup/plugin-node-resolve": "^15.2.3",
40
39
  "@swc/core": "^1.7.6",
41
40
  "@types/express": "^4.17.21",
@@ -46,7 +45,7 @@
46
45
  "chartjs-plugin-datalabels": "^2.2.0",
47
46
  "classnames": "^2.5.1",
48
47
  "date-fns": "^3.3.1",
49
- "express": "^4.19.2",
48
+ "express": "^2.5.11",
50
49
  "lodash": "^4.17.21",
51
50
  "plotly.js": "^2.27.1",
52
51
  "react-chartjs-2": "^5.2.0",
@@ -77,7 +76,7 @@
77
76
  "@types/supercluster": "^7.1.3",
78
77
  "@types/underscore": "^1.11.15",
79
78
  "@typescript-eslint/eslint-plugin": "^6.9.1",
80
- "@typescript-eslint/parser": "^6.9.1",
79
+ "@typescript-eslint/parser": "^8.7.0",
81
80
  "@vitejs/plugin-react": "^4.3.1",
82
81
  "babel-plugin-module-resolver": "^5.0.0",
83
82
  "eslint": "^8.52.0",
@@ -93,7 +92,7 @@
93
92
  "fs-extra": "^11.2.0",
94
93
  "git-commit-msg-linter": "^5.0.4",
95
94
  "http-server": "^14.1.1",
96
- "husky": "^8.0.3",
95
+ "husky": "^9.1.6",
97
96
  "identity-obj-proxy": "^3.0.0",
98
97
  "lint-staged": "^15.0.2",
99
98
  "ncp": "^2.0.0",
@@ -1,122 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import ProtestosIcon from '../../assets/icones/protestos';
3
- import { useGlobalData } from '../../contexts/globalDataContext';
4
- import React, { useEffect, useMemo, useState } from 'react';
5
- import StatusMessage from '../interface/statusMessage';
6
- import { Section } from '../section';
7
- import { RequestStatus, useQuery } from '../webservice';
8
- function safeStringify(obj) {
9
- var seen = new WeakSet();
10
- return JSON.stringify(obj, function (_, value) {
11
- if (typeof value === 'object' && value !== null) {
12
- if (seen.has(value)) {
13
- return;
14
- }
15
- seen.add(value);
16
- }
17
- return value;
18
- });
19
- }
20
- var selectRelevantData = function (data, documento) {
21
- var protestos = data.protestos, ultimoRegistroCCF = data.ultimoRegistroCCF, ccf = data.ccf, dividasPublicas = data.dividasPublicas, processosJuridicos = data.processosJuridicos, addresses = data.addresses, bankAccounts = data.bankAccounts, ccfData = data.ccfData, contact = data.contact, divida = data.divida, dossie = data.dossie, imoveis = data.imoveis, liminar = data.liminar, partners = data.partners, pepData = data.pepData, processosJuridicosData = data.processosJuridicosData, protestosData = data.protestosData, reclameAqui = data.reclameAqui, refinBoaVista = data.refinBoaVista, refinSerasa = data.refinSerasa, scoreData = data.scoreData, scr = data.scr, veiculos = data.veiculos;
22
- return {
23
- documento: documento,
24
- protestos: protestos,
25
- ultimoRegistroCCF: ultimoRegistroCCF,
26
- ccf: ccf,
27
- dividasPublicas: dividasPublicas,
28
- processosJuridicos: processosJuridicos,
29
- addresses: addresses,
30
- bankAccounts: bankAccounts,
31
- ccfData: ccfData,
32
- contact: contact,
33
- divida: divida,
34
- dossie: dossie,
35
- imoveis: imoveis,
36
- liminar: liminar,
37
- partners: partners,
38
- pepData: pepData,
39
- processosJuridicosData: processosJuridicosData,
40
- protestosData: protestosData,
41
- reclameAqui: reclameAqui,
42
- refinBoaVista: refinBoaVista,
43
- refinSerasa: refinSerasa,
44
- scoreData: scoreData,
45
- scr: scr,
46
- veiculos: veiculos
47
- };
48
- };
49
- var Llama = function (_a) {
50
- var documento = _a.documento;
51
- var globalData = useGlobalData().data;
52
- var _b = useState('{}'), serializedData = _b[0], setSerializedData = _b[1];
53
- var _c = useState(false), queryEnabled = _c[0], setQueryEnabled = _c[1];
54
- useEffect(function () {
55
- if (globalData && documento) {
56
- try {
57
- var relevantData = selectRelevantData(globalData, documento);
58
- var serialized = safeStringify(relevantData);
59
- setSerializedData(serialized);
60
- setQueryEnabled(true);
61
- }
62
- catch (error) {
63
- console.error('Erro ao preparar os dados para a API:', error);
64
- setSerializedData('{}');
65
- setQueryEnabled(false);
66
- }
67
- }
68
- }, [documento, globalData]);
69
- var messages = useMemo(function () {
70
- if (!serializedData || serializedData === '{}')
71
- return [];
72
- return [
73
- {
74
- role: 'system',
75
- content: 'Você é um assistente financeiro especializado em análise de crédito.'
76
- },
77
- {
78
- role: 'user',
79
- content: "Os seguintes dados s\u00E3o de uma empresa:\n\n".concat(serializedData, "\n\nA empresa est\u00E1 em boa sa\u00FAde financeira? Justifique sua resposta.")
80
- }
81
- ];
82
- }, [serializedData]);
83
- var queryData = useMemo(function () {
84
- if (!queryEnabled || !serializedData || serializedData === '{}')
85
- return undefined;
86
- return {
87
- model: 'llama3',
88
- messages: JSON.stringify(messages)
89
- };
90
- }, [queryEnabled, serializedData, messages]);
91
- var _d = useQuery("SELECT FROM 'LlamaApi'.'Consulta'", queryData, !!queryData), response = _d.response, error = _d.error, isLoading = _d.isLoading, loadingProgress = _d.loadingProgress;
92
- var documentData = response === null || response === void 0 ? void 0 : response.document;
93
- return (React.createElement(Section, { title: "An\u00E1lise da Intelig\u00EAncia Artificial", subtitle: "Consulta de cr\u00E9dito analisado pela intelig\u00EAncia artificial.", icon: ProtestosIcon, ctx: {
94
- response: response === null || response === void 0 ? void 0 : response.response,
95
- type: isLoading
96
- ? RequestStatus.Loading
97
- : error
98
- ? RequestStatus.Error
99
- : RequestStatus.Success,
100
- error: error || null,
101
- refetch: function () { },
102
- document: documentData,
103
- progress: loadingProgress,
104
- Section: Section
105
- }, onSuccess: function (data) {
106
- var children = (React.createElement("div", null,
107
- React.createElement("p", null, "An\u00E1lise de Cr\u00E9dito:"),
108
- React.createElement("p", null, safeStringify(data))));
109
- return {
110
- children: children,
111
- description: (React.createElement(StatusMessage, { type: "success" }, "An\u00E1lise de cr\u00E9dito conclu\u00EDda com sucesso.")),
112
- variant: 'default'
113
- };
114
- }, isError: function (err) { return ({
115
- children: React.createElement(React.Fragment, null),
116
- description: (React.createElement(StatusMessage, { type: "error" },
117
- "Erro ao realizar a an\u00E1lise: ",
118
- err.message)),
119
- variant: 'error'
120
- }); } }));
121
- };
122
- export default Llama;