@wrcb/cb-common 1.0.69 → 1.0.71
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.
|
@@ -7,12 +7,14 @@ class Listener {
|
|
|
7
7
|
this.client = client;
|
|
8
8
|
}
|
|
9
9
|
subscriptionOptions() {
|
|
10
|
+
// são eventos que podemos customizar quais eventos serão re-enviados
|
|
11
|
+
// que foram emitidos no passado, possivelmente quando o serviço estava offline
|
|
10
12
|
return this.client
|
|
11
13
|
.subscriptionOptions()
|
|
12
|
-
.setDeliverAllAvailable()
|
|
13
14
|
.setManualAckMode(true)
|
|
14
|
-
.
|
|
15
|
-
.setDurableName(this.queueGroupName)
|
|
15
|
+
.setDeliverAllAvailable() // sempre que uma subscrição é criada, NATS vai enviar todos os eventos que foram perdidos enquanto o serviço estava offline
|
|
16
|
+
.setDurableName(this.queueGroupName) // assim que criamos uma durable subscription, envia os eventos que o serviço ainda não recebeu
|
|
17
|
+
.setAckWait(this.ackWait);
|
|
16
18
|
}
|
|
17
19
|
listen() {
|
|
18
20
|
const subscription = this.client.subscribe(this.subject, this.queueGroupName, this.subscriptionOptions());
|
package/build/test/authHelper.js
CHANGED
|
@@ -14,6 +14,7 @@ function signUpReturnCookie(id) {
|
|
|
14
14
|
id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(),
|
|
15
15
|
email: 'test@test.com',
|
|
16
16
|
cpf: '05854744600',
|
|
17
|
+
nickName: 'apelido',
|
|
17
18
|
role: userRole_1.UserRole.User,
|
|
18
19
|
};
|
|
19
20
|
// Create the JWT
|
|
@@ -34,6 +35,7 @@ function signUpReturnCookieAdmin(id) {
|
|
|
34
35
|
id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(),
|
|
35
36
|
email: 'test@test.com',
|
|
36
37
|
cpf: '05854744600',
|
|
38
|
+
nickName: 'apelido',
|
|
37
39
|
role: userRole_1.UserRole.Admin,
|
|
38
40
|
};
|
|
39
41
|
// Create the JWT
|