@credithub/harlan-components 1.115.1 → 1.115.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.
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  };
37
37
  export function sendInstrumentoManualEmail(client, payload) {
38
38
  return __awaiter(this, void 0, void 0, function () {
39
- var res;
39
+ var response, json;
40
40
  return __generator(this, function (_a) {
41
41
  switch (_a.label) {
42
42
  case 0: return [4 /*yield*/, client.request("INSERT INTO 'IEPTB'.'InstrumentoManualSendmail'", {
@@ -45,27 +45,37 @@ export function sendInstrumentoManualEmail(client, payload) {
45
45
  livro: payload.livro,
46
46
  folha: payload.folha
47
47
  })];
48
- case 1: return [4 /*yield*/, (_a.sent()).json()];
48
+ case 1:
49
+ response = _a.sent();
50
+ return [4 /*yield*/, response
51
+ .clone()
52
+ .json()
53
+ .catch(function () { return null; })];
49
54
  case 2:
50
- res = _a.sent();
51
- return [2 /*return*/, (res !== null && res !== void 0 ? res : {})];
55
+ json = _a.sent();
56
+ return [2 /*return*/, (json !== null && json !== void 0 ? json : {})];
52
57
  }
53
58
  });
54
59
  });
55
60
  }
56
61
  export function sendInstrumentoDiscoveryEmail(client, payload) {
57
62
  return __awaiter(this, void 0, void 0, function () {
58
- var res;
63
+ var response, json;
59
64
  return __generator(this, function (_a) {
60
65
  switch (_a.label) {
61
66
  case 0: return [4 /*yield*/, client.request("INSERT INTO 'IEPTB'.'InstrumentoDiscoverySendmail'", {
62
67
  documento: payload.documento,
63
68
  nm_chave: payload.nm_chave
64
69
  })];
65
- case 1: return [4 /*yield*/, (_a.sent()).json()];
70
+ case 1:
71
+ response = _a.sent();
72
+ return [4 /*yield*/, response
73
+ .clone()
74
+ .json()
75
+ .catch(function () { return null; })];
66
76
  case 2:
67
- res = _a.sent();
68
- return [2 /*return*/, (res !== null && res !== void 0 ? res : {})];
77
+ json = _a.sent();
78
+ return [2 /*return*/, (json !== null && json !== void 0 ? json : {})];
69
79
  }
70
80
  });
71
81
  });
@@ -49,7 +49,9 @@ var Falencia = function (_a) {
49
49
  var documento = _a.documento;
50
50
  var setData = useGlobalData().setData;
51
51
  var _b = useState(false), dataUpdated = _b[0], setDataUpdated = _b[1];
52
- var _c = useQuery("SELECT FROM 'ValorEconomico'.'Falencia'", { documento: documento }), response = _c.response, error = _c.error, isLoading = _c.isLoading, loadingProgress = _c.loadingProgress, refetch = _c.refetch;
52
+ // Desabilitado: endpoint legado `ValorEconomico.Falencia` está retornando 500.
53
+ // Reativar quando a rota estiver estável.
54
+ var _c = useQuery("SELECT FROM 'ValorEconomico'.'Falencia'", { documento: documento }, false), response = _c.response, error = _c.error, isLoading = _c.isLoading, loadingProgress = _c.loadingProgress, refetch = _c.refetch;
53
55
  // Transforma o retorno em array tipado ----------------------------------
54
56
  var records = useMemo(function () {
55
57
  if (!(response === null || response === void 0 ? void 0 : response.document))
@@ -5,12 +5,11 @@ interface LiminarProtestosDoPassadoProps {
5
5
  /**
6
6
  * Hook que identifica indícios de liminar de sustação de protesto.
7
7
  *
8
- * Regras (20250701)
9
- * Um instrumento é **oculto** se a consulta a `PDFPROTESTO.PDF` **não** retornar PDF.
10
- * Se todos ainda possuem PDF, não indício de liminar. (!?)
8
+ * Regra simplificada (20260119):
9
+ * - Considera "oculto" todo protesto que aparece no histórico e está ausente
10
+ * na lista atual (missingAt), sem consultar `PDFPROTESTO.PDF` (rota legado).
11
11
  *
12
- * Esta versão limita a concorrência (10 chamadas em paralelo) e aplica
13
- * timeout defensivo para cada requisição.
12
+ * Motivo: `PDFPROTESTO.PDF` está instável/legado e gera erros no console.
14
13
  */
15
14
  declare const useLiminarProtestosDoPassado: ({ documento }: LiminarProtestosDoPassadoProps) => {
16
15
  readonly fetchLiminarProtestosDoPassado: () => Promise<{
@@ -53,12 +53,11 @@ import { WebService } from '../webservice';
53
53
  /**
54
54
  * Hook que identifica indícios de liminar de sustação de protesto.
55
55
  *
56
- * Regras (20250701)
57
- * Um instrumento é **oculto** se a consulta a `PDFPROTESTO.PDF` **não** retornar PDF.
58
- * Se todos ainda possuem PDF, não indício de liminar. (!?)
56
+ * Regra simplificada (20260119):
57
+ * - Considera "oculto" todo protesto que aparece no histórico e está ausente
58
+ * na lista atual (missingAt), sem consultar `PDFPROTESTO.PDF` (rota legado).
59
59
  *
60
- * Esta versão limita a concorrência (10 chamadas em paralelo) e aplica
61
- * timeout defensivo para cada requisição.
60
+ * Motivo: `PDFPROTESTO.PDF` está instável/legado e gera erros no console.
62
61
  */
63
62
  var useLiminarProtestosDoPassado = function (_a) {
64
63
  var _b;
@@ -66,42 +65,8 @@ var useLiminarProtestosDoPassado = function (_a) {
66
65
  var client = useContext(WebService);
67
66
  var posthog = useContext(PostHogContext).posthog;
68
67
  var _c = useGlobalData(), globalData = _c.data, setData = _c.setData;
69
- /** Máximo de requisições simultâneas ao endpoint de PDF. */
70
- var MAX_CONCURRENT = 10;
71
- /** Timeout (ms) por requisição individual ao PDF. */
72
- var PDF_TIMEOUT = 80000;
73
- /**
74
- * Checa se um `nm_chave` ainda possui PDF no CENPROT.
75
- * Retorna `true` quando há PDF, `false` caso contrário ou erro.
76
- */
77
- var possuiPdf = function (nm_chave) { return __awaiter(void 0, void 0, void 0, function () {
78
- var ctrl, timer, response, error_1;
79
- return __generator(this, function (_a) {
80
- switch (_a.label) {
81
- case 0:
82
- ctrl = new AbortController();
83
- timer = setTimeout(function () { return ctrl.abort(); }, PDF_TIMEOUT);
84
- _a.label = 1;
85
- case 1:
86
- _a.trys.push([1, 4, 5, 6]);
87
- return [4 /*yield*/, client.request("SELECT FROM 'PDFPROTESTO'.'PDF'", { nm_chave: nm_chave, documento: documento }, undefined, ctrl.signal)];
88
- case 2:
89
- response = _a.sent();
90
- return [4 /*yield*/, response.json()];
91
- case 3: return [2 /*return*/, !!(_a.sent())];
92
- case 4:
93
- error_1 = _a.sent();
94
- console.error('Erro ao verificar PDF:', error_1);
95
- return [2 /*return*/, false]; // considera oculto se erro ou timeout
96
- case 5:
97
- clearTimeout(timer);
98
- return [7 /*endfinally*/];
99
- case 6: return [2 /*return*/];
100
- }
101
- });
102
- }); };
103
68
  var fetch = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
104
- var data, parsedData, _a, _b, numerosChave, ocultos, running, idx, launch, _loop_1, protestosDoPassado;
69
+ var data, parsedData, _a, _b, numerosChave, protestosDoPassado, ocultos;
105
70
  return __generator(this, function (_c) {
106
71
  switch (_c.label) {
107
72
  case 0: return [4 /*yield*/, client.request("SELECT FROM 'Protestos'.'History'", {
@@ -116,44 +81,8 @@ var useLiminarProtestosDoPassado = function (_a) {
116
81
  numerosChave = parsedData
117
82
  .filter(function (item) { return item.missingAt; })
118
83
  .map(function (item) { return item.chave; });
119
- ocultos = [];
120
- running = [];
121
- idx = 0;
122
- launch = function (chave) { return __awaiter(void 0, void 0, void 0, function () {
123
- return __generator(this, function (_a) {
124
- switch (_a.label) {
125
- case 0: return [4 /*yield*/, possuiPdf(chave)];
126
- case 1:
127
- if (_a.sent())
128
- ocultos.push(chave);
129
- return [2 /*return*/];
130
- }
131
- });
132
- }); };
133
- _c.label = 3;
134
- case 3:
135
- if (!(idx < numerosChave.length || running.length)) return [3 /*break*/, 6];
136
- _loop_1 = function () {
137
- var p = launch(numerosChave[idx++]).finally(function () {
138
- var i = running.indexOf(p);
139
- if (i >= 0)
140
- running.splice(i, 1);
141
- });
142
- running.push(p);
143
- };
144
- while (idx < numerosChave.length && running.length < MAX_CONCURRENT) {
145
- _loop_1();
146
- }
147
- if (!running.length) return [3 /*break*/, 5];
148
- return [4 /*yield*/, Promise.race(running)];
149
- case 4:
150
- _c.sent();
151
- _c.label = 5;
152
- case 5: return [3 /*break*/, 3];
153
- case 6:
154
- protestosDoPassado = parsedData
155
- .filter(function (item) { return item.missingAt; })
156
- .filter(function (item) { return !ocultos.includes(item.chave); });
84
+ protestosDoPassado = parsedData.filter(function (item) { return item.missingAt; });
85
+ ocultos = protestosDoPassado.map(function (item) { return item.chave; });
157
86
  setData(function (prev) { return (__assign(__assign({}, prev), { protestosPagosBaixados: {
158
87
  isLoaded: true,
159
88
  protestos: protestosDoPassado
@@ -232,10 +232,6 @@ export var Instrumento = function (_a) {
232
232
  var ctxProtestos = useContext(Queries.Protestos);
233
233
  var _b = useGlobalData(), setData = _b.setData, globalData = _b.data;
234
234
  var protestosData = (globalData === null || globalData === void 0 ? void 0 : globalData.protestosData) || {};
235
- var failedInstruments = protestosData.failedInstruments || {};
236
- var failedInstrumentReasons = protestosData.failedInstrumentReasons || {};
237
- var checkedInstruments = protestosData.checkedInstruments || {};
238
- var instrumentCache = protestosData.instrumentCache || {};
239
235
  var normalizedKey = useMemo(function () { return normalizeInstrumentKey(nm_chave); }, [nm_chave]);
240
236
  // Hook para gerenciar fluxo de instrumento (fase mockada)
241
237
  var instrumentoHook = useInstrumento({
@@ -245,131 +241,31 @@ export var Instrumento = function (_a) {
245
241
  });
246
242
  if (!nm_chave)
247
243
  return null;
248
- var hasFailedBefore = failedInstruments[nm_chave] === true;
249
- var failureReason = failedInstrumentReasons[nm_chave];
250
- var alreadyChecked = checkedInstruments[nm_chave] === true;
251
- var cachedInstrument = instrumentCache[nm_chave];
252
244
  var hasCpfCnpj = Boolean(cpfCnpj && cpfCnpj.trim() !== '');
253
245
  var isValidKey = useMemo(function () { return isInstrumentKeyValid(nm_chave); }, [nm_chave]);
254
- var shouldPrefetch = isValidKey &&
255
- hasCpfCnpj &&
256
- normalizedKey &&
257
- !hasFailedBefore &&
258
- !alreadyChecked;
259
246
  var classifyInstrumentError = function (err) {
260
247
  var rawMessage = err instanceof Error ? err.message : String(err !== null && err !== void 0 ? err : '').toString();
261
248
  if (/chave.+inv[aá]lid/i.test(rawMessage) ||
262
249
  /invalid key/i.test(rawMessage)) {
263
250
  return 'invalid-key';
264
251
  }
265
- return 'not-found';
252
+ return 'missing-doc';
266
253
  };
267
254
  var deriveErrorKind = useCallback(function () {
268
255
  if (!hasCpfCnpj)
269
256
  return 'missing-doc';
270
257
  if (!isValidKey)
271
258
  return 'invalid-key';
272
- if (failureReason === 'invalid-key' || failureReason === 'not-found')
273
- return failureReason;
274
- if (hasFailedBefore)
275
- return 'not-found';
276
259
  return null;
277
- }, [failureReason, hasCpfCnpj, hasFailedBefore, isValidKey]);
260
+ }, [hasCpfCnpj, isValidKey]);
278
261
  var _c = useState(deriveErrorKind), errorKind = _c[0], setErrorKind = _c[1];
279
262
  var _d = useState(false), isLoading = _d[0], setIsLoading = _d[1];
280
- var _e = useState(shouldPrefetch), isPrefetching = _e[0], setIsPrefetching = _e[1];
281
- var _f = useState(false), isDiscoveryConfirmOpen = _f[0], setIsDiscoveryConfirmOpen = _f[1];
263
+ var _e = useState(false), isDiscoveryConfirmOpen = _e[0], setIsDiscoveryConfirmOpen = _e[1];
282
264
  useEffect(function () {
283
265
  setErrorKind(deriveErrorKind());
284
266
  }, [deriveErrorKind]);
285
- useEffect(function () {
286
- if (!shouldPrefetch) {
287
- return;
288
- }
289
- var cancelled = false;
290
- var runRequest = function () { return __awaiter(void 0, void 0, void 0, function () {
291
- var response_1, prefetchError_1, failure_1;
292
- return __generator(this, function (_a) {
293
- switch (_a.label) {
294
- case 0:
295
- if (cancelled) {
296
- instrumentActiveRequests--;
297
- processInstrumentQueue();
298
- return [2 /*return*/];
299
- }
300
- setIsPrefetching(function (prev) { return (prev ? prev : true); });
301
- _a.label = 1;
302
- case 1:
303
- _a.trys.push([1, 4, 5, 6]);
304
- return [4 /*yield*/, client.request("SELECT FROM 'IEPTB'.'PDF'", {
305
- nm_chave: normalizedKey,
306
- documento: cpfCnpj
307
- })];
308
- case 2: return [4 /*yield*/, (_a.sent()).json()];
309
- case 3:
310
- response_1 = _a.sent();
311
- if (cancelled)
312
- return [2 /*return*/];
313
- if (!(response_1 === null || response_1 === void 0 ? void 0 : response_1.instrumentoProtesto)) {
314
- throw new Error('Instrumento não retornado pela API');
315
- }
316
- setData(function (prev) {
317
- var _a, _b;
318
- var base = prev || {};
319
- var prevProtestosData = base.protestosData || {};
320
- var _c = prevProtestosData.failedInstruments || {}, _d = nm_chave, _removedFailed = _c[_d], restFailed = __rest(_c, [typeof _d === "symbol" ? _d : _d + ""]);
321
- var _e = prevProtestosData.failedInstrumentReasons || {}, _f = nm_chave, _removedReason = _e[_f], restReasons = __rest(_e, [typeof _f === "symbol" ? _f : _f + ""]);
322
- return __assign(__assign({}, base), { protestosData: __assign(__assign({}, prevProtestosData), { failedInstruments: restFailed, failedInstrumentReasons: restReasons, checkedInstruments: __assign(__assign({}, (prevProtestosData.checkedInstruments || {})), (_a = {}, _a[nm_chave] = true, _a)), instrumentCache: __assign(__assign({}, (prevProtestosData.instrumentCache || {})), (_b = {}, _b[nm_chave] = response_1.instrumentoProtesto, _b)) }) });
323
- });
324
- setErrorKind(null);
325
- return [3 /*break*/, 6];
326
- case 4:
327
- prefetchError_1 = _a.sent();
328
- if (cancelled)
329
- return [2 /*return*/];
330
- failure_1 = classifyInstrumentError(prefetchError_1);
331
- setErrorKind(failure_1);
332
- setData(function (prev) {
333
- var _a, _b, _c;
334
- var base = prev || {};
335
- var prevProtestosData = base.protestosData || {};
336
- var _d = prevProtestosData.instrumentCache || {}, _e = nm_chave, _cachedInstrument = _d[_e], restCache = __rest(_d, [typeof _e === "symbol" ? _e : _e + ""]);
337
- return __assign(__assign({}, base), { protestosData: __assign(__assign({}, prevProtestosData), { instrumentCache: restCache, checkedInstruments: __assign(__assign({}, (prevProtestosData.checkedInstruments || {})), (_a = {}, _a[nm_chave] = true, _a)), failedInstruments: __assign(__assign({}, (prevProtestosData.failedInstruments || {})), (_b = {}, _b[nm_chave] = true, _b)), failedInstrumentReasons: __assign(__assign({}, (prevProtestosData.failedInstrumentReasons || {})), (_c = {}, _c[nm_chave] = failure_1, _c)) }) });
338
- });
339
- return [3 /*break*/, 6];
340
- case 5:
341
- if (!cancelled) {
342
- setIsPrefetching(false);
343
- }
344
- instrumentActiveRequests--;
345
- processInstrumentQueue();
346
- return [7 /*endfinally*/];
347
- case 6: return [2 /*return*/];
348
- }
349
- });
350
- }); };
351
- if (instrumentActiveRequests < MAX_CONCURRENT_INSTRUMENT_REQUESTS) {
352
- instrumentActiveRequests++;
353
- runRequest();
354
- }
355
- else {
356
- instrumentRequestQueue.push(runRequest);
357
- }
358
- return function () {
359
- cancelled = true;
360
- };
361
- }, [
362
- client,
363
- cpfCnpj,
364
- hasCpfCnpj,
365
- nm_chave,
366
- normalizedKey,
367
- setData,
368
- shouldPrefetch
369
- ]);
370
- // Mantém o botão clicável em `not-found` para permitir solicitar por e-mail
267
+ // Mantém o botão clicável para "Solicitar instrumento" mesmo durante prefetch
371
268
  var isDisabled = isLoading ||
372
- isPrefetching ||
373
269
  errorKind === 'invalid-key' ||
374
270
  errorKind === 'missing-doc';
375
271
  var getTooltipMessage = function () {
@@ -377,26 +273,16 @@ export var Instrumento = function (_a) {
377
273
  return 'Documento não disponível para consulta';
378
274
  if (errorKind === 'invalid-key')
379
275
  return 'Chave de instrumento inválida';
380
- if (errorKind === 'not-found')
381
- return 'PDF indisponível. Você pode solicitar o instrumento.';
382
- if (isPrefetching)
383
- return 'Verificando disponibilidade do instrumento...';
384
276
  return '';
385
277
  };
386
278
  var getButtonLabel = function () {
387
- if (errorKind === 'not-found' && !isProtestoSPByNmChave(normalizedKey))
388
- return 'Solicitar instrumento';
389
279
  if (errorKind === 'invalid-key' || errorKind === 'missing-doc')
390
280
  return 'Instrumento Indisponível';
281
+ if (!isProtestoSPByNmChave(normalizedKey))
282
+ return 'Solicitar instrumento';
391
283
  return 'Instrumento';
392
284
  };
393
285
  var tooltipMessage = getTooltipMessage();
394
- var openInstrumentPdf = function (base64) {
395
- var pdfWindow = window.open('', '_blank');
396
- if (!pdfWindow)
397
- return;
398
- pdfWindow.document.write("<iframe width='100%' height='100%' src='data:application/pdf;base64,".concat(base64, "'></iframe>"));
399
- };
400
286
  var isSP = isProtestoSPByNmChave(normalizedKey);
401
287
  var resetInstrumentStateForKey = useCallback(function () {
402
288
  if (!nm_chave)
@@ -415,80 +301,21 @@ export var Instrumento = function (_a) {
415
301
  return (React.createElement(React.Fragment, null,
416
302
  React.createElement("span", { title: tooltipMessage, style: { display: 'inline-block' } },
417
303
  React.createElement(Button, { isLoading: isLoading || instrumentoHook.isProcessandoDescoberta, onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
418
- var request_1, e_1, failure_2;
419
304
  return __generator(this, function (_a) {
420
- switch (_a.label) {
421
- case 0:
422
- if (isDisabled)
423
- return [2 /*return*/];
424
- // Fluxo SP: abre modal para Livro/Folha
425
- if (isSP) {
426
- instrumentoHook.openModalSP();
427
- return [2 /*return*/];
428
- }
429
- // Se já sabemos que o PDF está indisponível, oferecemos o fluxo por e-mail
430
- if (errorKind === 'not-found') {
431
- setIsDiscoveryConfirmOpen(true);
432
- return [2 /*return*/];
433
- }
434
- // Fluxo não-SP: tenta abrir PDF se disponível
435
- if (cachedInstrument) {
436
- openInstrumentPdf(cachedInstrument);
437
- return [2 /*return*/];
438
- }
439
- // Tenta buscar PDF do backend
440
- setIsLoading(true);
441
- _a.label = 1;
442
- case 1:
443
- _a.trys.push([1, 4, 5, 6]);
444
- return [4 /*yield*/, client.request("SELECT FROM 'IEPTB'.'PDF'", {
445
- nm_chave: normalizedKey,
446
- documento: cpfCnpj
447
- })];
448
- case 2: return [4 /*yield*/, (_a.sent()).json()];
449
- case 3:
450
- request_1 = _a.sent();
451
- if (!(request_1 === null || request_1 === void 0 ? void 0 : request_1.instrumentoProtesto)) {
452
- throw new Error('Instrumento não retornado pela API');
453
- }
454
- openInstrumentPdf(request_1.instrumentoProtesto);
455
- setData(function (prev) {
456
- var _a, _b;
457
- var base = prev || {};
458
- var prevProtestosData = base.protestosData || {};
459
- var _c = prevProtestosData.failedInstruments || {}, _d = nm_chave, _removedFailed = _c[_d], restFailed = __rest(_c, [typeof _d === "symbol" ? _d : _d + ""]);
460
- var _e = prevProtestosData.failedInstrumentReasons || {}, _f = nm_chave, _removedReason = _e[_f], restReasons = __rest(_e, [typeof _f === "symbol" ? _f : _f + ""]);
461
- return __assign(__assign({}, base), { protestosData: __assign(__assign({}, prevProtestosData), { failedInstruments: restFailed, failedInstrumentReasons: restReasons, instrumentCache: __assign(__assign({}, (prevProtestosData.instrumentCache || {})), (_a = {}, _a[nm_chave] = request_1.instrumentoProtesto, _a)), checkedInstruments: __assign(__assign({}, (prevProtestosData.checkedInstruments || {})), (_b = {}, _b[nm_chave] = true, _b)) }) });
462
- });
463
- setErrorKind(null);
464
- return [3 /*break*/, 6];
465
- case 4:
466
- e_1 = _a.sent();
467
- console.error(e_1);
468
- failure_2 = classifyInstrumentError(e_1);
469
- setErrorKind(failure_2);
470
- // Quando PDF não está disponível, oferece descoberta automática com confirmação (UX)
471
- if (failure_2 === 'not-found' && hasCpfCnpj && isValidKey) {
472
- setIsDiscoveryConfirmOpen(true);
473
- }
474
- // Persistimos falha/cache para evitar loops de prefetch
475
- setData(function (prev) {
476
- var _a, _b, _c;
477
- var base = prev || {};
478
- var prevProtestosData = base.protestosData || {};
479
- var _d = prevProtestosData.instrumentCache || {}, _e = nm_chave, _cachedInstrument = _d[_e], restCache = __rest(_d, [typeof _e === "symbol" ? _e : _e + ""]);
480
- return __assign(__assign({}, base), { protestosData: __assign(__assign({}, prevProtestosData), { instrumentCache: restCache, failedInstruments: __assign(__assign({}, (prevProtestosData.failedInstruments || {})), (_a = {}, _a[nm_chave] = true, _a)), checkedInstruments: __assign(__assign({}, (prevProtestosData.checkedInstruments || {})), (_b = {}, _b[nm_chave] = true, _b)), failedInstrumentReasons: __assign(__assign({}, (prevProtestosData.failedInstrumentReasons || {})), (_c = {}, _c[nm_chave] = failure_2, _c)) }) });
481
- });
482
- return [3 /*break*/, 6];
483
- case 5:
484
- setIsLoading(false);
485
- return [7 /*endfinally*/];
486
- case 6: return [2 /*return*/];
305
+ if (isDisabled)
306
+ return [2 /*return*/];
307
+ // Fluxo SP: abre modal para Livro/Folha
308
+ if (isSP) {
309
+ instrumentoHook.openModalSP();
310
+ return [2 /*return*/];
487
311
  }
312
+ // Fluxo não-SP: IEPTB.PDF foi depreciado. Vai direto para solicitação.
313
+ setIsDiscoveryConfirmOpen(true);
314
+ return [2 /*return*/];
488
315
  });
489
316
  }); }, disabled: isDisabled }, getButtonLabel())),
490
317
  React.createElement(ModalInstrumentoProtestoSP, { isOpen: instrumentoHook.isModalSPOpen, onClose: instrumentoHook.closeModalSP, onEnviarEmail: instrumentoHook.handleEnviarEmail, isEnviandoEmail: instrumentoHook.isEnviandoEmail }),
491
- React.createElement(InstrumentoEmailStatusModal, { isOpen: instrumentoHook.isEmailModalOpen, onClose: instrumentoHook.closeEmailModal, message: instrumentoHook.emailMessage, title: instrumentoHook.emailTitle, secondaryActionLabel: instrumentoHook.isSuccess ? 'Atualizar consulta (hoje)' : undefined, secondaryActionDisabled: isPrefetching || isLoading, onSecondaryAction: instrumentoHook.isSuccess
318
+ React.createElement(InstrumentoEmailStatusModal, { isOpen: instrumentoHook.isEmailModalOpen, onClose: instrumentoHook.closeEmailModal, message: instrumentoHook.emailMessage, title: instrumentoHook.emailTitle, secondaryActionLabel: instrumentoHook.isSuccess ? 'Atualizar consulta (hoje)' : undefined, secondaryActionDisabled: false, onSecondaryAction: instrumentoHook.isSuccess
492
319
  ? function () {
493
320
  var _a;
494
321
  // Permite reconsultar no mesmo dia para tentar “desocultar” instrumento/nome
@@ -167,15 +167,6 @@ export declare const Queries: {
167
167
  urlData?: Client.Form;
168
168
  }>>;
169
169
  };
170
- Falencia: React.Context<RequestContext<Document>> & {
171
- Request: React.FC<React.PropsWithChildren<{
172
- data?: {
173
- documento: string;
174
- } | undefined;
175
- depends?: RequestContext<unknown>[];
176
- urlData?: Client.Form;
177
- }>>;
178
- };
179
170
  Edital: React.Context<RequestContext<EditalResponse>> & {
180
171
  Request: React.FC<React.PropsWithChildren<{
181
172
  data?: {
@@ -509,6 +509,8 @@ export var Queries = {
509
509
  ReclameAqui: query("SELECT FROM 'RECLAMEAQUI'.'CONSULTA'"),
510
510
  Dominios: query("SELECT FROM 'DOMINIOS'.'CONSULTA'"),
511
511
  GraficosAnaliticos: query("SELECT FROM 'DOCUMENTHISTORY'.'BASICHISTORY'"),
512
- Falencia: query("SELECT FROM 'ValorEconomico'.'Falencia'"),
512
+ // Falencia: query<{ documento: string }, Document>(
513
+ // "SELECT FROM 'ValorEconomico'.'Falencia'"
514
+ // ),
513
515
  Edital: query("SELECT FROM 'APICENPROT'.'EDITAL'")
514
516
  };