@credithub/harlan-components 1.112.0 → 1.112.1
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/adapters/instrumentoProtesto/ieptbInstrumento.js +2 -2
- package/dist/components/common/modalInstrumentoProtestoSP.d.ts +0 -3
- package/dist/components/common/modalInstrumentoProtestoSP.js +5 -6
- package/dist/components/protestos/instrumento/useInstrumento.d.ts +2 -4
- package/dist/components/protestos/instrumento/useInstrumento.js +18 -84
- package/dist/components/protestos/protestosList.js +2 -2
- package/lib/cjs/index.js +80 -286
- package/lib/esm/index.js +80 -286
- package/package.json +1 -1
- package/dist/components/protestos/instrumento/mocks/instrumentoMocks.d.ts +0 -33
- package/dist/components/protestos/instrumento/mocks/instrumentoMocks.js +0 -142
package/package.json
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Funções mockadas para simular o comportamento do backend
|
|
3
|
-
* durante o desenvolvimento da fase mockada.
|
|
4
|
-
*
|
|
5
|
-
* Estas funções serão substituídas por chamadas reais ao Client.WebService
|
|
6
|
-
* na fase de integração.
|
|
7
|
-
*/
|
|
8
|
-
export interface MockInstrumentoResult {
|
|
9
|
-
success: boolean;
|
|
10
|
-
message: string;
|
|
11
|
-
jobId?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Simula a descoberta automática do instrumento de protesto
|
|
15
|
-
* @param livro - Número do livro
|
|
16
|
-
* @param folha - Número da folha
|
|
17
|
-
* @returns Promise com resultado mockado
|
|
18
|
-
*/
|
|
19
|
-
export declare const mockDescobrirInstrumento: (livro: string, folha: string) => Promise<MockInstrumentoResult>;
|
|
20
|
-
/**
|
|
21
|
-
* Simula o envio do instrumento por e-mail (SP manual)
|
|
22
|
-
* @param livro - Número do livro
|
|
23
|
-
* @param folha - Número da folha
|
|
24
|
-
* @returns Promise com resultado mockado
|
|
25
|
-
*/
|
|
26
|
-
export declare const mockEnviarEmailSP: (livro: string, folha: string) => Promise<MockInstrumentoResult>;
|
|
27
|
-
/**
|
|
28
|
-
* Simula a descoberta automática e envio por e-mail (não-SP)
|
|
29
|
-
* @param nmChave - Chave do instrumento
|
|
30
|
-
* @param cpfCnpj - CPF/CNPJ do devedor
|
|
31
|
-
* @returns Promise com resultado mockado
|
|
32
|
-
*/
|
|
33
|
-
export declare const mockDescobertaAutomaticaEmail: (nmChave: string, cpfCnpj: string) => Promise<MockInstrumentoResult>;
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Funções mockadas para simular o comportamento do backend
|
|
3
|
-
* durante o desenvolvimento da fase mockada.
|
|
4
|
-
*
|
|
5
|
-
* Estas funções serão substituídas por chamadas reais ao Client.WebService
|
|
6
|
-
* na fase de integração.
|
|
7
|
-
*/
|
|
8
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
18
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
19
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
20
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
21
|
-
function step(op) {
|
|
22
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
23
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
24
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
25
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
26
|
-
switch (op[0]) {
|
|
27
|
-
case 0: case 1: t = op; break;
|
|
28
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
29
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
30
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
31
|
-
default:
|
|
32
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
34
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
35
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
36
|
-
if (t[2]) _.ops.pop();
|
|
37
|
-
_.trys.pop(); continue;
|
|
38
|
-
}
|
|
39
|
-
op = body.call(thisArg, _);
|
|
40
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
41
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Simula a descoberta automática do instrumento de protesto
|
|
46
|
-
* @param livro - Número do livro
|
|
47
|
-
* @param folha - Número da folha
|
|
48
|
-
* @returns Promise com resultado mockado
|
|
49
|
-
*/
|
|
50
|
-
export var mockDescobrirInstrumento = function (livro, folha) { return __awaiter(void 0, void 0, void 0, function () {
|
|
51
|
-
var delay, success;
|
|
52
|
-
return __generator(this, function (_a) {
|
|
53
|
-
switch (_a.label) {
|
|
54
|
-
case 0:
|
|
55
|
-
delay = Math.random() * 1000 + 1000;
|
|
56
|
-
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, delay); })];
|
|
57
|
-
case 1:
|
|
58
|
-
_a.sent();
|
|
59
|
-
success = Math.random() > 0.2;
|
|
60
|
-
if (success) {
|
|
61
|
-
return [2 /*return*/, {
|
|
62
|
-
success: true,
|
|
63
|
-
message: "Instrumento localizado com sucesso! Livro: ".concat(livro, ", Folha: ").concat(folha),
|
|
64
|
-
jobId: "job-".concat(Date.now())
|
|
65
|
-
}];
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
return [2 /*return*/, {
|
|
69
|
-
success: false,
|
|
70
|
-
message: 'Não foi possível localizar o instrumento com os dados fornecidos. Verifique os dados e tente novamente.'
|
|
71
|
-
}];
|
|
72
|
-
}
|
|
73
|
-
return [2 /*return*/];
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}); };
|
|
77
|
-
/**
|
|
78
|
-
* Simula o envio do instrumento por e-mail (SP manual)
|
|
79
|
-
* @param livro - Número do livro
|
|
80
|
-
* @param folha - Número da folha
|
|
81
|
-
* @returns Promise com resultado mockado
|
|
82
|
-
*/
|
|
83
|
-
export var mockEnviarEmailSP = function (livro, folha) { return __awaiter(void 0, void 0, void 0, function () {
|
|
84
|
-
var delay, success;
|
|
85
|
-
return __generator(this, function (_a) {
|
|
86
|
-
switch (_a.label) {
|
|
87
|
-
case 0:
|
|
88
|
-
delay = Math.random() * 1000 + 1000;
|
|
89
|
-
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, delay); })];
|
|
90
|
-
case 1:
|
|
91
|
-
_a.sent();
|
|
92
|
-
success = Math.random() > 0.1;
|
|
93
|
-
if (success) {
|
|
94
|
-
return [2 /*return*/, {
|
|
95
|
-
success: true,
|
|
96
|
-
message: "O instrumento de protesto foi enviado para seu e-mail com sucesso. Livro: ".concat(livro, ", Folha: ").concat(folha),
|
|
97
|
-
jobId: "email-job-".concat(Date.now())
|
|
98
|
-
}];
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
return [2 /*return*/, {
|
|
102
|
-
success: false,
|
|
103
|
-
message: 'Falha ao enviar o instrumento por e-mail. Tente novamente mais tarde.'
|
|
104
|
-
}];
|
|
105
|
-
}
|
|
106
|
-
return [2 /*return*/];
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}); };
|
|
110
|
-
/**
|
|
111
|
-
* Simula a descoberta automática e envio por e-mail (não-SP)
|
|
112
|
-
* @param nmChave - Chave do instrumento
|
|
113
|
-
* @param cpfCnpj - CPF/CNPJ do devedor
|
|
114
|
-
* @returns Promise com resultado mockado
|
|
115
|
-
*/
|
|
116
|
-
export var mockDescobertaAutomaticaEmail = function (nmChave, cpfCnpj) { return __awaiter(void 0, void 0, void 0, function () {
|
|
117
|
-
var delay, success;
|
|
118
|
-
return __generator(this, function (_a) {
|
|
119
|
-
switch (_a.label) {
|
|
120
|
-
case 0:
|
|
121
|
-
delay = Math.random() * 1000 + 2000;
|
|
122
|
-
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, delay); })];
|
|
123
|
-
case 1:
|
|
124
|
-
_a.sent();
|
|
125
|
-
success = Math.random() > 0.15;
|
|
126
|
-
if (success) {
|
|
127
|
-
return [2 /*return*/, {
|
|
128
|
-
success: true,
|
|
129
|
-
message: 'O instrumento de protesto será processado e enviado para seu e-mail em breve. Você receberá uma notificação quando estiver disponível.',
|
|
130
|
-
jobId: "discovery-job-".concat(Date.now())
|
|
131
|
-
}];
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
return [2 /*return*/, {
|
|
135
|
-
success: false,
|
|
136
|
-
message: 'Não foi possível processar a descoberta automática do instrumento. Tente novamente mais tarde ou entre em contato com o suporte.'
|
|
137
|
-
}];
|
|
138
|
-
}
|
|
139
|
-
return [2 /*return*/];
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
}); };
|