@credithub/harlan-components 1.118.0 → 1.119.0
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/dist/components/protestos/instrumento/ieptbInstrumento.d.ts +6 -4
- package/dist/components/protestos/instrumento/ieptbInstrumento.js +9 -14
- package/dist/components/protestos/instrumento/useInstrumento.js +19 -7
- package/dist/components/webservice.d.ts +5 -5
- package/dist/components/webservice.js +5 -3
- package/lib/cjs/index.js +226 -217
- package/lib/esm/index.js +226 -217
- package/package.json +1 -1
|
@@ -16,12 +16,14 @@ export declare function sendInstrumentoDiscoveryEmail(client: Client.WebService,
|
|
|
16
16
|
nm_chave: string;
|
|
17
17
|
}): Promise<InstrumentoSendmailResponse>;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Buscar PDF do cache do bipbop (busca por chave com prefixo PDF_)
|
|
20
20
|
* Verifica cache do bipbop antes de exibir o modal
|
|
21
|
-
* Busca
|
|
21
|
+
* Busca na collection DatabasePDFProtesto do banco bipbop
|
|
22
|
+
* Procura por documentos onde data.nm_chave = nm_chave e key começa com PDF_
|
|
23
|
+
* Retorna PDF em base64 se disponível no cache
|
|
24
|
+
*
|
|
25
|
+
* Lança ExceptionDatabase::NOT_FOUND se o PDF não for encontrado no cache
|
|
22
26
|
*/
|
|
23
27
|
export declare function discoverPDFProtesto(client: Client.WebService, payload: {
|
|
24
28
|
nm_chave: string;
|
|
25
|
-
livro?: string;
|
|
26
|
-
folha?: string;
|
|
27
29
|
}): Promise<PDFProtestoDiscoverResponse>;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -96,16 +85,22 @@ export function sendInstrumentoDiscoveryEmail(client, payload) {
|
|
|
96
85
|
});
|
|
97
86
|
}
|
|
98
87
|
/**
|
|
99
|
-
*
|
|
88
|
+
* Buscar PDF do cache do bipbop (busca por chave com prefixo PDF_)
|
|
100
89
|
* Verifica cache do bipbop antes de exibir o modal
|
|
101
|
-
* Busca
|
|
90
|
+
* Busca na collection DatabasePDFProtesto do banco bipbop
|
|
91
|
+
* Procura por documentos onde data.nm_chave = nm_chave e key começa com PDF_
|
|
92
|
+
* Retorna PDF em base64 se disponível no cache
|
|
93
|
+
*
|
|
94
|
+
* Lança ExceptionDatabase::NOT_FOUND se o PDF não for encontrado no cache
|
|
102
95
|
*/
|
|
103
96
|
export function discoverPDFProtesto(client, payload) {
|
|
104
97
|
return __awaiter(this, void 0, void 0, function () {
|
|
105
98
|
var response, parsed;
|
|
106
99
|
return __generator(this, function (_a) {
|
|
107
100
|
switch (_a.label) {
|
|
108
|
-
case 0: return [4 /*yield*/, client.request("SELECT FROM 'PDFPROTESTO'.'
|
|
101
|
+
case 0: return [4 /*yield*/, client.request("SELECT FROM 'PDFPROTESTO'.'DOWNLOADPDF'", {
|
|
102
|
+
nm_chave: payload.nm_chave
|
|
103
|
+
})];
|
|
109
104
|
case 1:
|
|
110
105
|
response = _a.sent();
|
|
111
106
|
return [4 /*yield*/, Client.WebService.parse(response)];
|
|
@@ -103,20 +103,21 @@ export var useInstrumento = function (_a) {
|
|
|
103
103
|
});
|
|
104
104
|
}); }, [client, cpfCnpj, nmChave]);
|
|
105
105
|
var handleDescobertaAutomatica = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
106
|
-
var res, error_2;
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
var res, error_2, errorMessage, isSolicitacaoEmProcessamento;
|
|
107
|
+
var _a;
|
|
108
|
+
return __generator(this, function (_b) {
|
|
109
|
+
switch (_b.label) {
|
|
109
110
|
case 0:
|
|
110
111
|
setIsProcessandoDescoberta(true);
|
|
111
|
-
|
|
112
|
+
_b.label = 1;
|
|
112
113
|
case 1:
|
|
113
|
-
|
|
114
|
+
_b.trys.push([1, 3, 4, 5]);
|
|
114
115
|
return [4 /*yield*/, sendInstrumentoDiscoveryEmail(client, {
|
|
115
116
|
documento: cpfCnpj,
|
|
116
117
|
nm_chave: nmChave
|
|
117
118
|
})];
|
|
118
119
|
case 2:
|
|
119
|
-
res =
|
|
120
|
+
res = _b.sent();
|
|
120
121
|
setEmailTitle('Solicitação enviada');
|
|
121
122
|
setEmailMessage((res === null || res === void 0 ? void 0 : res.message) ||
|
|
122
123
|
'Pedido registrado.\n\nAgora é só aguardar: vamos tentar obter o instrumento e enviar por e-mail. Isso pode levar alguns minutos.\n\nQuando possível, também vamos identificar o credor (quem protestou).');
|
|
@@ -124,7 +125,18 @@ export var useInstrumento = function (_a) {
|
|
|
124
125
|
setIsEmailModalOpen(true);
|
|
125
126
|
return [3 /*break*/, 5];
|
|
126
127
|
case 3:
|
|
127
|
-
error_2 =
|
|
128
|
+
error_2 = _b.sent();
|
|
129
|
+
errorMessage = String((_a = error_2 === null || error_2 === void 0 ? void 0 : error_2.message) !== null && _a !== void 0 ? _a : error_2);
|
|
130
|
+
isSolicitacaoEmProcessamento = errorMessage
|
|
131
|
+
.toLocaleLowerCase()
|
|
132
|
+
.includes('já existe um processamento para este instrumento');
|
|
133
|
+
if (isSolicitacaoEmProcessamento) {
|
|
134
|
+
setEmailTitle('Solicitação em processamento');
|
|
135
|
+
setEmailMessage('Já existe uma solicitação em processamento para este instrumento.\n\nAguarde alguns instantes e tente novamente. Se preferir, aguarde o e-mail com o instrumento assim que estiver disponível.');
|
|
136
|
+
setIsSuccess(false);
|
|
137
|
+
setIsEmailModalOpen(true);
|
|
138
|
+
return [2 /*return*/];
|
|
139
|
+
}
|
|
128
140
|
setEmailTitle('Erro na solicitação');
|
|
129
141
|
setEmailMessage('Não foi possível iniciar a solicitação por e-mail agora. Tente novamente em instantes.');
|
|
130
142
|
setIsSuccess(false);
|
|
@@ -177,16 +177,16 @@ export declare const Queries: {
|
|
|
177
177
|
}>>;
|
|
178
178
|
};
|
|
179
179
|
/**
|
|
180
|
-
*
|
|
180
|
+
* Buscar PDF do cache do bipbop (busca por chave com prefixo PDF_)
|
|
181
181
|
* Verifica cache do bipbop antes de exibir o modal
|
|
182
|
-
* Busca
|
|
182
|
+
* Busca na collection DatabasePDFProtesto do banco bipbop
|
|
183
|
+
* Procura por documentos onde data.nm_chave = nm_chave e key começa com PDF_
|
|
184
|
+
* Retorna PDF em base64 se disponível no cache
|
|
183
185
|
*/
|
|
184
|
-
|
|
186
|
+
PDFProtestoDownloadPDF: React.Context<RequestContext<PDFProtestoDiscoverResponse>> & {
|
|
185
187
|
Request: React.FC<React.PropsWithChildren<{
|
|
186
188
|
data?: {
|
|
187
189
|
nm_chave: string;
|
|
188
|
-
livro?: string;
|
|
189
|
-
folha?: string;
|
|
190
190
|
} | undefined;
|
|
191
191
|
depends?: RequestContext<unknown>[];
|
|
192
192
|
urlData?: Client.Form;
|
|
@@ -514,9 +514,11 @@ export var Queries = {
|
|
|
514
514
|
// ),
|
|
515
515
|
Edital: query("SELECT FROM 'APICENPROT'.'EDITAL'"),
|
|
516
516
|
/**
|
|
517
|
-
*
|
|
517
|
+
* Buscar PDF do cache do bipbop (busca por chave com prefixo PDF_)
|
|
518
518
|
* Verifica cache do bipbop antes de exibir o modal
|
|
519
|
-
* Busca
|
|
519
|
+
* Busca na collection DatabasePDFProtesto do banco bipbop
|
|
520
|
+
* Procura por documentos onde data.nm_chave = nm_chave e key começa com PDF_
|
|
521
|
+
* Retorna PDF em base64 se disponível no cache
|
|
520
522
|
*/
|
|
521
|
-
|
|
523
|
+
PDFProtestoDownloadPDF: query("SELECT FROM 'PDFPROTESTO'.'DownloadPDF'")
|
|
522
524
|
};
|