@seidor-cloud-produtos/orbit-backend-lib 2.0.101 → 2.0.102
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/clean-arch/application/consistency-event-dispatcher/consistency-event-dispatcher.d.ts +4 -3
- package/dist/clean-arch/application/consistency-event-dispatcher/consistency-event-dispatcher.js +1 -1
- package/dist/clean-arch/domain/events/{consistency-event.d.ts → consistency-event/consistency-event.d.ts} +5 -4
- package/dist/clean-arch/domain/events/{consistency-event.js → consistency-event/consistency-event.js} +1 -2
- package/dist/clean-arch/domain/events/consistency-event/events-enum.d.ts +3 -0
- package/dist/clean-arch/domain/events/consistency-event/events-enum.js +7 -0
- package/dist/clean-arch/infra/consistency-event-dispatcher/amqp-consistency-event-dispatcher.d.ts +1 -1
- package/dist/clean-arch/infra/consistency-event-dispatcher/amqp-consistency-event-dispatcher.js +4 -1
- package/dist/clean-arch/infra/consistency-event-dispatcher/exchanges-enum.d.ts +5 -0
- package/dist/clean-arch/infra/consistency-event-dispatcher/exchanges-enum.js +10 -0
- package/dist/clean-arch/infra/consistency-event-dispatcher/in-memory-consistency-event-dispatcher.d.ts +1 -1
- package/package.json +1 -1
package/dist/clean-arch/application/consistency-event-dispatcher/consistency-event-dispatcher.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AuthorizerHeaders } from '../../infra/http/handle-authorizer-headers';
|
|
2
2
|
import { Entity } from '../../domain/entities/entity';
|
|
3
|
-
import ConsistencyEvent from '../../domain/events/consistency-event';
|
|
3
|
+
import ConsistencyEvent from '../../domain/events/consistency-event/consistency-event';
|
|
4
|
+
import { EventsName } from '../../domain/events/consistency-event/events-enum';
|
|
4
5
|
export declare abstract class ConsistencyEventDispatcher {
|
|
5
|
-
dispatch(entity: Entity<any>, authorizerHeaders: AuthorizerHeaders, eventName:
|
|
6
|
-
dispatchBatch(entities: Entity<any>[], authorizerHeaders: AuthorizerHeaders, eventName:
|
|
6
|
+
dispatch(entity: Entity<any>, authorizerHeaders: AuthorizerHeaders, eventName: EventsName): Promise<void>;
|
|
7
|
+
dispatchBatch(entities: Entity<any>[], authorizerHeaders: AuthorizerHeaders, eventName: EventsName): Promise<void>;
|
|
7
8
|
abstract publish(event: ConsistencyEvent): Promise<void>;
|
|
8
9
|
}
|
package/dist/clean-arch/application/consistency-event-dispatcher/consistency-event-dispatcher.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConsistencyEventDispatcher = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const consistency_event_1 = tslib_1.__importDefault(require("../../domain/events/consistency-event"));
|
|
5
|
+
const consistency_event_1 = tslib_1.__importDefault(require("../../domain/events/consistency-event/consistency-event"));
|
|
6
6
|
class ConsistencyEventDispatcher {
|
|
7
7
|
async dispatch(entity, authorizerHeaders, eventName) {
|
|
8
8
|
try {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AuthorizerHeaders } from '
|
|
2
|
-
import { Entity } from '
|
|
3
|
-
import DomainEvent from '
|
|
1
|
+
import { AuthorizerHeaders } from '../../../infra/http/handle-authorizer-headers';
|
|
2
|
+
import { Entity } from '../../entities/entity';
|
|
3
|
+
import DomainEvent from '../domain-event';
|
|
4
|
+
import { EventsName } from './events-enum';
|
|
4
5
|
export interface ConsistencyEventMessage {
|
|
5
6
|
eventName: string;
|
|
6
7
|
origin: AuthorizerHeaders;
|
|
@@ -10,5 +11,5 @@ export default class ConsistencyEvent implements DomainEvent {
|
|
|
10
11
|
readonly eventDate: Date;
|
|
11
12
|
readonly name: string;
|
|
12
13
|
readonly input: ConsistencyEventMessage;
|
|
13
|
-
constructor(entity: Entity<any>, authorizerHeaders: AuthorizerHeaders, eventName:
|
|
14
|
+
constructor(entity: Entity<any>, authorizerHeaders: AuthorizerHeaders, eventName: EventsName);
|
|
14
15
|
}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class ConsistencyEvent {
|
|
4
4
|
eventDate = new Date();
|
|
5
|
-
name;
|
|
5
|
+
name = '';
|
|
6
6
|
input;
|
|
7
7
|
constructor(entity, authorizerHeaders, eventName) {
|
|
8
|
-
this.name = eventName;
|
|
9
8
|
this.input = {
|
|
10
9
|
eventName,
|
|
11
10
|
origin: authorizerHeaders,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventsName = void 0;
|
|
4
|
+
var EventsName;
|
|
5
|
+
(function (EventsName) {
|
|
6
|
+
EventsName["USER_TEMPORARY_PASSWORD_GENERATED"] = "user-temporary-password-generated";
|
|
7
|
+
})(EventsName || (exports.EventsName = EventsName = {}));
|
package/dist/clean-arch/infra/consistency-event-dispatcher/amqp-consistency-event-dispatcher.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConsistencyEventDispatcher } from '../../application/consistency-event-dispatcher/consistency-event-dispatcher';
|
|
2
2
|
import AmqpQueue from '../queue/rabbitmq/amqp-lib';
|
|
3
|
-
import ConsistencyEvent from '../../domain/events/consistency-event';
|
|
3
|
+
import ConsistencyEvent from '../../domain/events/consistency-event/consistency-event';
|
|
4
4
|
export declare class AmqpConsistencyEventDispatcher extends ConsistencyEventDispatcher {
|
|
5
5
|
protected amqp: AmqpQueue;
|
|
6
6
|
constructor(amqp: AmqpQueue);
|
package/dist/clean-arch/infra/consistency-event-dispatcher/amqp-consistency-event-dispatcher.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AmqpConsistencyEventDispatcher = void 0;
|
|
4
4
|
const consistency_event_dispatcher_1 = require("../../application/consistency-event-dispatcher/consistency-event-dispatcher");
|
|
5
|
+
const exchanges_enum_1 = require("./exchanges-enum");
|
|
5
6
|
class AmqpConsistencyEventDispatcher extends consistency_event_dispatcher_1.ConsistencyEventDispatcher {
|
|
6
7
|
amqp;
|
|
7
8
|
constructor(amqp) {
|
|
@@ -9,7 +10,9 @@ class AmqpConsistencyEventDispatcher extends consistency_event_dispatcher_1.Cons
|
|
|
9
10
|
this.amqp = amqp;
|
|
10
11
|
}
|
|
11
12
|
async publish(event) {
|
|
12
|
-
await this.amqp.publish(event.name
|
|
13
|
+
await this.amqp.publish(`${exchanges_enum_1.PREFIX}.${event.name}.${exchanges_enum_1.TYPE}`, event, {
|
|
14
|
+
storeMessageOnError: false,
|
|
15
|
+
});
|
|
13
16
|
}
|
|
14
17
|
}
|
|
15
18
|
exports.AmqpConsistencyEventDispatcher = AmqpConsistencyEventDispatcher;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExchangesEnum = exports.TYPE = exports.PREFIX = void 0;
|
|
4
|
+
const events_enum_1 = require("../../domain/events/consistency-event/events-enum");
|
|
5
|
+
exports.PREFIX = 'consistency';
|
|
6
|
+
exports.TYPE = 'fanout';
|
|
7
|
+
var ExchangesEnum;
|
|
8
|
+
(function (ExchangesEnum) {
|
|
9
|
+
ExchangesEnum["CONSISTENCY_USER_TEMPORARY_PASSWORD_GENERATED"] = "consistency.user-temporary-password-generated.fanout";
|
|
10
|
+
})(ExchangesEnum || (exports.ExchangesEnum = ExchangesEnum = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConsistencyEventDispatcher } from '../../application/consistency-event-dispatcher/consistency-event-dispatcher';
|
|
2
|
-
import ConsistencyEvent from '../../domain/events/consistency-event';
|
|
2
|
+
import ConsistencyEvent from '../../domain/events/consistency-event/consistency-event';
|
|
3
3
|
export declare class InMemoryConsistencyEventDispatcher extends ConsistencyEventDispatcher {
|
|
4
4
|
protected events: ConsistencyEvent[];
|
|
5
5
|
constructor(events?: ConsistencyEvent[]);
|