@warlock.js/herald 5.31.0 → 5.33.0
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/CHANGELOG.md +12 -0
- package/cjs/index.cjs +4 -3
- package/cjs/index.cjs.map +1 -1
- package/esm/communicators/broker-registry.d.mts +4 -3
- package/esm/communicators/broker-registry.d.mts.map +1 -1
- package/esm/communicators/broker.d.mts +5 -3
- package/esm/communicators/broker.d.mts.map +1 -1
- package/esm/communicators/index.d.mts +2 -1
- package/esm/communicators/index.mjs +1 -1
- package/esm/contracts/broker-driver.contract.d.mts +2 -2
- package/esm/contracts/broker-driver.contract.d.mts.map +1 -1
- package/esm/contracts/channel.contract.d.mts +2 -2
- package/esm/contracts/channel.contract.d.mts.map +1 -1
- package/esm/contracts/index.d.mts +2 -1
- package/esm/decorators/consumable.d.mts +3 -5
- package/esm/decorators/consumable.d.mts.map +1 -1
- package/esm/decorators/index.d.mts +2 -1
- package/esm/decorators/index.mjs +1 -1
- package/esm/drivers/index.d.mts +3 -1
- package/esm/drivers/index.mjs +1 -1
- package/esm/drivers/rabbitmq/index.d.mts +2 -1
- package/esm/drivers/rabbitmq/index.mjs +1 -1
- package/esm/drivers/rabbitmq/rabbitmq-channel.d.mts +3 -2
- package/esm/drivers/rabbitmq/rabbitmq-channel.d.mts.map +1 -1
- package/esm/drivers/rabbitmq/rabbitmq-channel.mjs +4 -3
- package/esm/drivers/rabbitmq/rabbitmq-channel.mjs.map +1 -1
- package/esm/drivers/rabbitmq/rabbitmq-driver.d.mts +3 -2
- package/esm/drivers/rabbitmq/rabbitmq-driver.d.mts.map +1 -1
- package/esm/index.d.mts +7 -0
- package/esm/message-managers/event-consumer.d.mts +3 -4
- package/esm/message-managers/event-consumer.d.mts.map +1 -1
- package/esm/message-managers/event-message.d.mts +3 -4
- package/esm/message-managers/event-message.d.mts.map +1 -1
- package/esm/message-managers/index.d.mts +2 -1
- package/esm/message-managers/index.mjs +1 -1
- package/esm/message-managers/types.d.mts +3 -3
- package/esm/message-managers/types.d.mts.map +1 -1
- package/esm/types/channel.types.d.mts +2 -4
- package/esm/types/channel.types.d.mts.map +1 -1
- package/esm/types/connection.types.d.mts +8 -9
- package/esm/types/connection.types.d.mts.map +1 -1
- package/esm/types/driver.types.d.mts +4 -5
- package/esm/types/driver.types.d.mts.map +1 -1
- package/esm/types/index.d.mts +2 -1
- package/esm/types/message.types.d.mts +6 -7
- package/esm/types/message.types.d.mts.map +1 -1
- package/esm/types/publish.types.d.mts +2 -3
- package/esm/types/publish.types.d.mts.map +1 -1
- package/esm/types/registry.types.d.mts +2 -4
- package/esm/types/registry.types.d.mts.map +1 -1
- package/esm/types/subscribe.types.d.mts +3 -4
- package/esm/types/subscribe.types.d.mts.map +1 -1
- package/esm/use-case-broadcast.d.mts +2 -3
- package/esm/use-case-broadcast.d.mts.map +1 -1
- package/esm/utils/connect-to-broker.d.mts +9 -6
- package/esm/utils/connect-to-broker.d.mts.map +1 -1
- package/esm/utils/index.d.mts +2 -1
- package/esm/utils/index.mjs +1 -1
- package/package.json +3 -3
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* takes no dependency on `@warlock.js/core`. The shape only needs the fields the
|
|
7
7
|
* adapter reads (`event` for the channel, `payload` for the body).
|
|
8
8
|
*/
|
|
9
|
-
type UseCaseBroadcastEvent = {
|
|
9
|
+
export type UseCaseBroadcastEvent = {
|
|
10
10
|
useCase: string;
|
|
11
11
|
event: string;
|
|
12
12
|
id: string;
|
|
@@ -31,11 +31,10 @@ type UseCaseBroadcastEvent = {
|
|
|
31
31
|
*
|
|
32
32
|
* @param options - Optional broker name (defaults to the default broker)
|
|
33
33
|
*/
|
|
34
|
-
declare function heraldBroadcast(options?: {
|
|
34
|
+
export declare function heraldBroadcast(options?: {
|
|
35
35
|
broker?: string;
|
|
36
36
|
}): {
|
|
37
37
|
broadcast(event: UseCaseBroadcastEvent): Promise<void>;
|
|
38
38
|
};
|
|
39
39
|
//#endregion
|
|
40
|
-
export { UseCaseBroadcastEvent, heraldBroadcast };
|
|
41
40
|
//# sourceMappingURL=use-case-broadcast.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-case-broadcast.d.mts","names":[],"sources":["../../../../../../../packages/herald/src/use-case-broadcast.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-case-broadcast.d.mts","names":[],"sources":["../../../../../../../packages/herald/src/use-case-broadcast.ts"],"mappings":";;;;;;;;YASY;EACV;EACA;EACA;EACA,IAAI;EACJ;;;;;;;;;;;;;;;;;;;;wBAqBc,gBAAgB;EAAY;;EAElC,UAAS,OAAQ,wBAAwB"}
|
|
@@ -3,7 +3,11 @@ import { ConnectionOptions } from "../types/connection.types.mjs";
|
|
|
3
3
|
import { ChannelContract } from "../contracts/channel.contract.mjs";
|
|
4
4
|
import { EventMessage } from "../message-managers/event-message.mjs";
|
|
5
5
|
import { EventConsumerClass } from "../message-managers/types.mjs";
|
|
6
|
+
import "../contracts/index.mjs";
|
|
6
7
|
import { Broker } from "../communicators/broker.mjs";
|
|
8
|
+
import "../types/index.mjs";
|
|
9
|
+
import "../communicators/index.mjs";
|
|
10
|
+
import "../message-managers/index.mjs";
|
|
7
11
|
//#region ../../packages/herald/src/utils/connect-to-broker.d.ts
|
|
8
12
|
/**
|
|
9
13
|
* Connect to a message broker and register it.
|
|
@@ -58,7 +62,7 @@ import { Broker } from "../communicators/broker.mjs";
|
|
|
58
62
|
* herald("analytics").channel("events").publish({ ... });
|
|
59
63
|
* ```
|
|
60
64
|
*/
|
|
61
|
-
declare function connectToBroker(options: ConnectionOptions): Promise<Broker>;
|
|
65
|
+
export declare function connectToBroker(options: ConnectionOptions): Promise<Broker>;
|
|
62
66
|
/**
|
|
63
67
|
* Get a broker by name or the default one.
|
|
64
68
|
*
|
|
@@ -87,7 +91,7 @@ declare function connectToBroker(options: ConnectionOptions): Promise<Broker>;
|
|
|
87
91
|
* });
|
|
88
92
|
* ```
|
|
89
93
|
*/
|
|
90
|
-
declare function herald(name?: string): Broker;
|
|
94
|
+
export declare function herald(name?: string): Broker;
|
|
91
95
|
/**
|
|
92
96
|
* Get channel instance for the given name from default broker.
|
|
93
97
|
*
|
|
@@ -104,7 +108,7 @@ declare function herald(name?: string): Broker;
|
|
|
104
108
|
* await channel.publish({ userId: 1 });
|
|
105
109
|
* ```
|
|
106
110
|
*/
|
|
107
|
-
declare function heraldChannel<TPayload = unknown>(name: string, options?: ChannelOptions<TPayload>): ChannelContract<TPayload>;
|
|
111
|
+
export declare function heraldChannel<TPayload = unknown>(name: string, options?: ChannelOptions<TPayload>): ChannelContract<TPayload>;
|
|
108
112
|
/**
|
|
109
113
|
* Publish an EventMessage to the default broker.
|
|
110
114
|
*
|
|
@@ -117,7 +121,7 @@ declare function heraldChannel<TPayload = unknown>(name: string, options?: Chann
|
|
|
117
121
|
* await publishEvent(new UserUpdatedEvent({ id: 1, name: "John Doe" }));
|
|
118
122
|
* ```
|
|
119
123
|
*/
|
|
120
|
-
declare function publishEvent<TPayload = Record<string, any>>(event: EventMessage<TPayload>): Promise<void>;
|
|
124
|
+
export declare function publishEvent<TPayload = Record<string, any>>(event: EventMessage<TPayload>): Promise<void>;
|
|
121
125
|
/**
|
|
122
126
|
* Subscribe an EventConsumer class to the default broker.
|
|
123
127
|
*
|
|
@@ -130,7 +134,6 @@ declare function publishEvent<TPayload = Record<string, any>>(event: EventMessag
|
|
|
130
134
|
* await subscribeConsumer(UserUpdatedConsumer);
|
|
131
135
|
* ```
|
|
132
136
|
*/
|
|
133
|
-
declare function subscribeConsumer<TPayload = Record<string, any>>(Consumer: EventConsumerClass<TPayload>): Promise<() => void>;
|
|
137
|
+
export declare function subscribeConsumer<TPayload = Record<string, any>>(Consumer: EventConsumerClass<TPayload>): Promise<() => void>;
|
|
134
138
|
//#endregion
|
|
135
|
-
export { connectToBroker, herald, heraldChannel, publishEvent, subscribeConsumer };
|
|
136
139
|
//# sourceMappingURL=connect-to-broker.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-to-broker.d.mts","names":[],"sources":["../../../../../../../../packages/herald/src/utils/connect-to-broker.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"connect-to-broker.d.mts","names":[],"sources":["../../../../../../../../packages/herald/src/utils/connect-to-broker.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0DsB,gBAAgB,SAAS,oBAAoB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6E3D,OAAO,gBAAgB;;;;;;;;;;;;;;;;;wBAoBvB,cAAc,oBAC5B,cACA,UAAU,eAAe,YACxB,gBAAgB;;;;;;;;;;;;;wBAgBG,aAAa,WAAW,qBAAqB,OAAO,aAAa,YAAS;;;;;;;;;;;;;wBAgB1E,kBAAkB,WAAW,qBACjD,UAAU,mBAAmB,YAAS"}
|
package/esm/utils/index.d.mts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import { connectToBroker, herald, heraldChannel, publishEvent, subscribeConsumer } from "./connect-to-broker.mjs";
|
|
1
|
+
import { connectToBroker, herald, heraldChannel, publishEvent, subscribeConsumer } from "./connect-to-broker.mjs";
|
|
2
|
+
export { connectToBroker, herald, heraldChannel, publishEvent, subscribeConsumer };
|
package/esm/utils/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"@mongez/copper": "^2.1.3",
|
|
9
9
|
"@mongez/events": "^2.2.8",
|
|
10
10
|
"@mongez/reinforcements": "^4.0.2",
|
|
11
|
-
"@warlock.js/logger": "5.
|
|
12
|
-
"@warlock.js/seal": "5.
|
|
11
|
+
"@warlock.js/logger": "5.33.0",
|
|
12
|
+
"@warlock.js/seal": "5.33.0"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
],
|
|
38
38
|
"author": "hassanzohdy",
|
|
39
39
|
"license": "MIT",
|
|
40
|
-
"version": "5.
|
|
40
|
+
"version": "5.33.0",
|
|
41
41
|
"main": "./cjs/index.cjs",
|
|
42
42
|
"module": "./esm/index.mjs",
|
|
43
43
|
"types": "./esm/index.d.mts",
|