@credithub/harlan-components 1.100.2 → 1.100.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.
- package/dist/components/liminar/useLiminarHistory.js +15 -14
- package/lib/cjs/index.js +244 -243
- package/lib/esm/index.js +244 -243
- package/package.json +1 -1
|
@@ -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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
2
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
3
|
if (ar || !(i in from)) {
|
|
@@ -30,24 +19,36 @@ export function useLiminarHistory(_a) {
|
|
|
30
19
|
return;
|
|
31
20
|
// Deriva o boolean do conteúdo de types para evitar falsos positivos
|
|
32
21
|
var effectiveTypes = Array.isArray(types) && indicioDeLiminar ? types : [];
|
|
22
|
+
// Indício só é verdadeiro se houver pelo menos um type válido
|
|
33
23
|
var safeIndicio = effectiveTypes.length > 0;
|
|
24
|
+
// Fingerprint para deduplicação de envios
|
|
34
25
|
var fingerprint = JSON.stringify({
|
|
35
26
|
documento: documento,
|
|
36
|
-
indicioDeLiminar: safeIndicio,
|
|
27
|
+
indicioDeLiminar: safeIndicio ? 1 : 0, // importante: 0/1 para evitar "false" como string truthy no backend
|
|
37
28
|
types: __spreadArray([], effectiveTypes, true).sort(),
|
|
38
29
|
protestKeys: protestKeys,
|
|
39
30
|
processIds: processIds
|
|
40
31
|
});
|
|
41
32
|
if (fingerprint === lastFingerprint.current)
|
|
42
33
|
return;
|
|
43
|
-
|
|
34
|
+
// Payload final: envia 0/1 e omite chaves vazias
|
|
35
|
+
var payload = {
|
|
36
|
+
documento: documento,
|
|
37
|
+
indicioDeLiminar: safeIndicio ? 1 : 0 // evita "false" string em form-urlencoded/FormData
|
|
38
|
+
};
|
|
39
|
+
if (effectiveTypes.length)
|
|
40
|
+
payload.types = effectiveTypes;
|
|
41
|
+
if (protestKeys.length)
|
|
42
|
+
payload.protestKeys = protestKeys;
|
|
43
|
+
if (processIds.length)
|
|
44
|
+
payload.processIds = processIds;
|
|
44
45
|
insertHistory(payload);
|
|
45
46
|
lastFingerprint.current = fingerprint;
|
|
46
47
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
48
|
}, [
|
|
48
49
|
documento,
|
|
49
50
|
indicioDeLiminar,
|
|
50
|
-
types.join(','),
|
|
51
|
+
Array.isArray(types) ? types.join(',') : '',
|
|
51
52
|
protestKeys.join(','),
|
|
52
53
|
processIds.join(','),
|
|
53
54
|
enabled
|