@warlock.js/herald 4.0.161 → 4.0.163
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/cjs/communicators/communicator-registry.d.ts +155 -0
- package/cjs/communicators/communicator-registry.d.ts.map +1 -0
- package/cjs/communicators/communicator-registry.js +206 -0
- package/cjs/communicators/communicator-registry.js.map +1 -0
- package/cjs/communicators/communicator.d.ts +100 -0
- package/cjs/communicators/communicator.d.ts.map +1 -0
- package/cjs/communicators/communicator.js +105 -0
- package/cjs/communicators/communicator.js.map +1 -0
- package/cjs/communicators/index.d.ts +3 -0
- package/cjs/communicators/index.d.ts.map +1 -0
- package/cjs/contracts/channel.contract.d.ts +186 -0
- package/cjs/contracts/channel.contract.d.ts.map +1 -0
- package/cjs/contracts/communicator-driver.contract.d.ts +196 -0
- package/cjs/contracts/communicator-driver.contract.d.ts.map +1 -0
- package/cjs/contracts/index.d.ts +3 -0
- package/cjs/contracts/index.d.ts.map +1 -0
- package/cjs/decorators/consumable.d.ts +13 -0
- package/cjs/decorators/consumable.d.ts.map +1 -0
- package/cjs/decorators/consumable.js +33 -0
- package/cjs/decorators/consumable.js.map +1 -0
- package/cjs/decorators/index.d.ts +2 -0
- package/cjs/decorators/index.d.ts.map +1 -0
- package/cjs/drivers/index.d.ts +2 -0
- package/cjs/drivers/index.d.ts.map +1 -0
- package/cjs/drivers/rabbitmq/index.d.ts +3 -0
- package/cjs/drivers/rabbitmq/index.d.ts.map +1 -0
- package/cjs/drivers/rabbitmq/rabbitmq-channel.d.ts +78 -0
- package/cjs/drivers/rabbitmq/rabbitmq-channel.d.ts.map +1 -0
- package/cjs/drivers/rabbitmq/rabbitmq-channel.js +412 -0
- package/cjs/drivers/rabbitmq/rabbitmq-channel.js.map +1 -0
- package/cjs/drivers/rabbitmq/rabbitmq-driver.d.ts +122 -0
- package/cjs/drivers/rabbitmq/rabbitmq-driver.d.ts.map +1 -0
- package/cjs/drivers/rabbitmq/rabbitmq-driver.js +346 -0
- package/cjs/drivers/rabbitmq/rabbitmq-driver.js.map +1 -0
- package/cjs/index.d.ts +47 -0
- package/cjs/index.d.ts.map +1 -0
- package/cjs/index.js +1 -0
- package/cjs/index.js.map +1 -0
- package/cjs/message-managers/event-consumer.d.ts +63 -0
- package/cjs/message-managers/event-consumer.d.ts.map +1 -0
- package/cjs/message-managers/event-consumer.js +65 -0
- package/cjs/message-managers/event-consumer.js.map +1 -0
- package/cjs/message-managers/event-message.d.ts +87 -0
- package/cjs/message-managers/event-message.d.ts.map +1 -0
- package/cjs/message-managers/event-message.js +84 -0
- package/cjs/message-managers/event-message.js.map +1 -0
- package/cjs/message-managers/index.d.ts +4 -0
- package/cjs/message-managers/index.d.ts.map +1 -0
- package/cjs/message-managers/prepare-consumer-subscription.d.ts +4 -0
- package/cjs/message-managers/prepare-consumer-subscription.d.ts.map +1 -0
- package/cjs/message-managers/prepare-consumer-subscription.js +39 -0
- package/cjs/message-managers/prepare-consumer-subscription.js.map +1 -0
- package/cjs/message-managers/types.d.ts +20 -0
- package/cjs/message-managers/types.d.ts.map +1 -0
- package/cjs/types.d.ts +399 -0
- package/cjs/types.d.ts.map +1 -0
- package/cjs/utils/connect-to-communicator.d.ts +129 -0
- package/cjs/utils/connect-to-communicator.d.ts.map +1 -0
- package/cjs/utils/connect-to-communicator.js +169 -0
- package/cjs/utils/connect-to-communicator.js.map +1 -0
- package/cjs/utils/index.d.ts +2 -0
- package/cjs/utils/index.d.ts.map +1 -0
- package/esm/communicators/communicator-registry.d.ts +155 -0
- package/esm/communicators/communicator-registry.d.ts.map +1 -0
- package/esm/communicators/communicator-registry.js +206 -0
- package/esm/communicators/communicator-registry.js.map +1 -0
- package/esm/communicators/communicator.d.ts +100 -0
- package/esm/communicators/communicator.d.ts.map +1 -0
- package/esm/communicators/communicator.js +105 -0
- package/esm/communicators/communicator.js.map +1 -0
- package/esm/communicators/index.d.ts +3 -0
- package/esm/communicators/index.d.ts.map +1 -0
- package/esm/contracts/channel.contract.d.ts +186 -0
- package/esm/contracts/channel.contract.d.ts.map +1 -0
- package/esm/contracts/communicator-driver.contract.d.ts +196 -0
- package/esm/contracts/communicator-driver.contract.d.ts.map +1 -0
- package/esm/contracts/index.d.ts +3 -0
- package/esm/contracts/index.d.ts.map +1 -0
- package/esm/decorators/consumable.d.ts +13 -0
- package/esm/decorators/consumable.d.ts.map +1 -0
- package/esm/decorators/consumable.js +33 -0
- package/esm/decorators/consumable.js.map +1 -0
- package/esm/decorators/index.d.ts +2 -0
- package/esm/decorators/index.d.ts.map +1 -0
- package/esm/drivers/index.d.ts +2 -0
- package/esm/drivers/index.d.ts.map +1 -0
- package/esm/drivers/rabbitmq/index.d.ts +3 -0
- package/esm/drivers/rabbitmq/index.d.ts.map +1 -0
- package/esm/drivers/rabbitmq/rabbitmq-channel.d.ts +78 -0
- package/esm/drivers/rabbitmq/rabbitmq-channel.d.ts.map +1 -0
- package/esm/drivers/rabbitmq/rabbitmq-channel.js +412 -0
- package/esm/drivers/rabbitmq/rabbitmq-channel.js.map +1 -0
- package/esm/drivers/rabbitmq/rabbitmq-driver.d.ts +122 -0
- package/esm/drivers/rabbitmq/rabbitmq-driver.d.ts.map +1 -0
- package/esm/drivers/rabbitmq/rabbitmq-driver.js +346 -0
- package/esm/drivers/rabbitmq/rabbitmq-driver.js.map +1 -0
- package/esm/index.d.ts +47 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -0
- package/esm/message-managers/event-consumer.d.ts +63 -0
- package/esm/message-managers/event-consumer.d.ts.map +1 -0
- package/esm/message-managers/event-consumer.js +65 -0
- package/esm/message-managers/event-consumer.js.map +1 -0
- package/esm/message-managers/event-message.d.ts +87 -0
- package/esm/message-managers/event-message.d.ts.map +1 -0
- package/esm/message-managers/event-message.js +84 -0
- package/esm/message-managers/event-message.js.map +1 -0
- package/esm/message-managers/index.d.ts +4 -0
- package/esm/message-managers/index.d.ts.map +1 -0
- package/esm/message-managers/prepare-consumer-subscription.d.ts +4 -0
- package/esm/message-managers/prepare-consumer-subscription.d.ts.map +1 -0
- package/esm/message-managers/prepare-consumer-subscription.js +39 -0
- package/esm/message-managers/prepare-consumer-subscription.js.map +1 -0
- package/esm/message-managers/types.d.ts +20 -0
- package/esm/message-managers/types.d.ts.map +1 -0
- package/esm/types.d.ts +399 -0
- package/esm/types.d.ts.map +1 -0
- package/esm/utils/connect-to-communicator.d.ts +129 -0
- package/esm/utils/connect-to-communicator.d.ts.map +1 -0
- package/esm/utils/connect-to-communicator.js +169 -0
- package/esm/utils/connect-to-communicator.js.map +1 -0
- package/esm/utils/index.d.ts +2 -0
- package/esm/utils/index.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {randomUUID}from'crypto';class EventMessage {
|
|
2
|
+
data;
|
|
3
|
+
/**
|
|
4
|
+
* Event version
|
|
5
|
+
*/
|
|
6
|
+
version;
|
|
7
|
+
/**
|
|
8
|
+
* Additional metadata (if any)
|
|
9
|
+
*/
|
|
10
|
+
metadata;
|
|
11
|
+
/**
|
|
12
|
+
* Event Message id
|
|
13
|
+
*/
|
|
14
|
+
messageId;
|
|
15
|
+
/**
|
|
16
|
+
* Schema of payload that will be used to determine whether this event should be published
|
|
17
|
+
*/
|
|
18
|
+
schema;
|
|
19
|
+
/**
|
|
20
|
+
* Data that will be sent with the event (Payload)
|
|
21
|
+
*/
|
|
22
|
+
toJSON() {
|
|
23
|
+
if (!this.data) {
|
|
24
|
+
throw new Error(`no Data is defined for Event: ${this.eventName}`);
|
|
25
|
+
}
|
|
26
|
+
return this.data;
|
|
27
|
+
}
|
|
28
|
+
constructor(data) {
|
|
29
|
+
this.data = data;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Serialize the event to be ready for publishing
|
|
33
|
+
*/
|
|
34
|
+
serialize() {
|
|
35
|
+
if (!this.data && !this.toJSON) {
|
|
36
|
+
throw new Error("No data or toJSON method provided");
|
|
37
|
+
}
|
|
38
|
+
const payload = this.toJSON();
|
|
39
|
+
return {
|
|
40
|
+
payload,
|
|
41
|
+
metadata: this.metadata,
|
|
42
|
+
messageId: this.messageId ?? randomUUID(),
|
|
43
|
+
eventName: this.eventName,
|
|
44
|
+
version: this.version,
|
|
45
|
+
occurredAt: new Date(),
|
|
46
|
+
__through: "EventMessage",
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A shorthand to define an event without declaring an entire class.
|
|
52
|
+
*
|
|
53
|
+
* This factory function creates an EventMessage subclass that transforms
|
|
54
|
+
* input data (IncomingData) into a different output format (OutcomingData).
|
|
55
|
+
*
|
|
56
|
+
* @template IncomingData - The type of data passed to the constructor
|
|
57
|
+
* @template OutcomingData - The type of data returned by toJSON()
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* const UserCreatedEvent = defineEvent<User, { id: number; name: string }>(
|
|
62
|
+
* "user.created",
|
|
63
|
+
* { toJSON: (user) => user.only(["id", "name"]) }
|
|
64
|
+
* );
|
|
65
|
+
*
|
|
66
|
+
* publishEvent(new UserCreatedEvent(user));
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
function defineEvent(eventName, options = {}) {
|
|
70
|
+
// We need to use `any` here to bridge the IncomingData -> OutcomingData transformation
|
|
71
|
+
// The class accepts IncomingData in constructor but outputs OutcomingData via toJSON()
|
|
72
|
+
return class AnnouncedEvent extends EventMessage {
|
|
73
|
+
eventName = eventName;
|
|
74
|
+
schema = options.schema;
|
|
75
|
+
constructor(data) {
|
|
76
|
+
super(data);
|
|
77
|
+
}
|
|
78
|
+
toJSON() {
|
|
79
|
+
if (!options.toJSON)
|
|
80
|
+
return this.data;
|
|
81
|
+
return options.toJSON(this.data);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}export{EventMessage,defineEvent};//# sourceMappingURL=event-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-message.js","sources":["../../src/message-managers/event-message.ts"],"sourcesContent":[null],"names":[],"mappings":"sCAUsB,YAAY,CAAA;AAqCH,IAAA,IAAA,CAAA;AA/B7B;;AAEG;AACI,IAAA,OAAO,CAAU;AAExB;;AAEG;AACI,IAAA,QAAQ,CAAuB;AAEtC;;AAEG;AACI,IAAA,SAAS,CAAU;AAE1B;;AAEG;AACI,IAAA,MAAM,CAAmB;AAEhC;;AAEG;IACI,MAAM,GAAA;AACX,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,CAAA,8BAAA,EAAiC,IAAI,CAAC,SAAS,CAAE,CAAA,CAAC,CAAC;AACpE,SAAA;QAED,OAAO,IAAI,CAAC,IAAgB,CAAC;KAC9B;AAED,IAAA,WAAA,CAA6B,IAAe,EAAA;QAAf,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAW;KAAI;AAEhD;;AAEG;IACI,SAAS,GAAA;QACd,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;AAC9B,YAAA,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;AACtD,SAAA;AAED,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAE9B,OAAO;YACL,OAAO;YACP,QAAQ,EAAE,IAAI,CAAC,QAAQ;AACvB,YAAA,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,UAAU,EAAE;YACzC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,UAAU,EAAE,IAAI,IAAI,EAAE;AACtB,YAAA,SAAS,EAAE,cAAc;SAC1B,CAAC;KACH;AACF,CAAA;AAuBD;;;;;;;;;;;;;;;;;;AAkBG;SACa,WAAW,CACzB,SAAiB,EACjB,UAAsC,EAAE,EAAA;;;IAIxC,OAAO,MAAM,cAAe,SAAQ,YAA2B,CAAA;QACtD,SAAS,GAAG,SAAS,CAAC;AACtB,QAAA,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAE/B,QAAA,WAAA,CAAmB,IAAmB,EAAA;YACpC,KAAK,CAAC,IAAW,CAAC,CAAC;SACpB;QAEM,MAAM,GAAA;YACX,IAAI,CAAC,OAAO,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAC,IAAqB,CAAC;YAEvD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAoB,CAAkB,CAAC;SACnE;KACF,CAAC;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/message-managers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare-consumer-subscription.d.ts","sourceRoot":"","sources":["../../src/message-managers/prepare-consumer-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,kBAAkB,uBA0CvE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
function prepareConsumerSubscription(Consumer) {
|
|
2
|
+
const callback = async (message, ctx) => {
|
|
3
|
+
const envelope = message.payload;
|
|
4
|
+
let eventPayload = envelope.payload;
|
|
5
|
+
if (envelope.version) {
|
|
6
|
+
if (!Consumer.isAcceptedVersion(Number(envelope.version))) {
|
|
7
|
+
ctx.ack(); // Acknowledge but don't process
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const consumer = new Consumer();
|
|
12
|
+
if (consumer.schema) {
|
|
13
|
+
const result = await consumer.validate(eventPayload);
|
|
14
|
+
if (!result || result.isValid === false) {
|
|
15
|
+
ctx.nack();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
eventPayload = result.data;
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
await consumer.handle(eventPayload, {
|
|
22
|
+
payload: eventPayload,
|
|
23
|
+
eventName: Consumer.eventName,
|
|
24
|
+
messageId: message.metadata.messageId,
|
|
25
|
+
occurredAt: envelope.occurredAt ? new Date(envelope.occurredAt) : undefined,
|
|
26
|
+
metadata: envelope.metadata,
|
|
27
|
+
version: envelope.version,
|
|
28
|
+
message,
|
|
29
|
+
});
|
|
30
|
+
ctx.ack(); // Auto-ack on success?
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
ctx.nack(true); // Requeue on failure
|
|
34
|
+
// Or emit error event for logging
|
|
35
|
+
console.error(error);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return callback;
|
|
39
|
+
}export{prepareConsumerSubscription};//# sourceMappingURL=prepare-consumer-subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare-consumer-subscription.js","sources":["../../src/message-managers/prepare-consumer-subscription.ts"],"sourcesContent":[null],"names":[],"mappings":"AAGM,SAAU,2BAA2B,CAAC,QAA4B,EAAA;IACtE,MAAM,QAAQ,GAAwB,OAAO,OAAO,EAAE,GAAG,KAAI;AAC3D,QAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;AACjC,QAAA,IAAI,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC;QAEpC,IAAI,QAAQ,CAAC,OAAO,EAAE;AACpB,YAAA,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE;AACzD,gBAAA,GAAG,CAAC,GAAG,EAAE,CAAC;gBACV,OAAO;AACR,aAAA;AACF,SAAA;AAED,QAAA,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAEhC,IAAI,QAAQ,CAAC,MAAM,EAAE;YACnB,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;YACrD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,KAAK,KAAK,EAAE;gBACvC,GAAG,CAAC,IAAI,EAAE,CAAC;gBACX,OAAO;AACR,aAAA;AAED,YAAA,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC;AAC5B,SAAA;QACD,IAAI;AACF,YAAA,MAAM,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE;AAClC,gBAAA,OAAO,EAAE,YAAY;gBACrB,SAAS,EAAE,QAAQ,CAAC,SAAS;AAC7B,gBAAA,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,SAAU;AACtC,gBAAA,UAAU,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS;gBAC3E,QAAQ,EAAE,QAAQ,CAAC,QAAQ;gBAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,OAAO;AACR,aAAA,CAAC,CAAC;AACH,YAAA,GAAG,CAAC,GAAG,EAAE,CAAC;AACX,SAAA;AAAC,QAAA,OAAO,KAAK,EAAE;AACd,YAAA,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;AAEf,YAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACtB,SAAA;AACH,KAAC,CAAC;AAEF,IAAA,OAAO,QAAQ,CAAC;AAClB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Message } from "../types";
|
|
2
|
+
import { type EventConsumer } from "./event-consumer";
|
|
3
|
+
export type ConsumedEventMessage = {
|
|
4
|
+
version?: number;
|
|
5
|
+
occurredAt?: Date;
|
|
6
|
+
metadata?: Record<string, any>;
|
|
7
|
+
messageId: string;
|
|
8
|
+
eventName: string;
|
|
9
|
+
payload: Record<string, any>;
|
|
10
|
+
message: Message<any>;
|
|
11
|
+
};
|
|
12
|
+
export type EventConsumerClass<P = Record<string, any>> = {
|
|
13
|
+
new (): EventConsumer<P>;
|
|
14
|
+
eventName: string;
|
|
15
|
+
consumerId: string;
|
|
16
|
+
minVersion?: number;
|
|
17
|
+
maxVersion?: number;
|
|
18
|
+
isAcceptedVersion(version: number): boolean;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/message-managers/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;IACxD,QAAQ,aAAa,CAAC,CAAC,CAAC,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7C,CAAC"}
|
package/esm/types.d.ts
ADDED
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { BaseValidator } from "@warlock.js/seal";
|
|
3
|
+
import { CommunicatorDriverContract } from "./contracts";
|
|
4
|
+
/**
|
|
5
|
+
* Message metadata that accompanies every message
|
|
6
|
+
*/
|
|
7
|
+
export type MessageMetadata = {
|
|
8
|
+
/** Unique message ID (auto-generated) */
|
|
9
|
+
messageId: string;
|
|
10
|
+
/** Correlation ID for request-response patterns */
|
|
11
|
+
correlationId?: string;
|
|
12
|
+
/** Reply-to channel for RPC patterns */
|
|
13
|
+
replyTo?: string;
|
|
14
|
+
/** Message priority (0-9, where 9 is highest) */
|
|
15
|
+
priority?: number;
|
|
16
|
+
/** Timestamp when message was published */
|
|
17
|
+
timestamp: Date;
|
|
18
|
+
/** Custom headers */
|
|
19
|
+
headers?: Record<string, string>;
|
|
20
|
+
/** Retry count (incremented on each retry) */
|
|
21
|
+
retryCount?: number;
|
|
22
|
+
/** Original queue/channel name */
|
|
23
|
+
originalChannel?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A message received from a channel
|
|
27
|
+
*
|
|
28
|
+
* @template TPayload - The typed payload
|
|
29
|
+
*/
|
|
30
|
+
export type Message<TPayload = unknown> = {
|
|
31
|
+
/** Message metadata */
|
|
32
|
+
readonly metadata: MessageMetadata;
|
|
33
|
+
/** Typed payload data */
|
|
34
|
+
readonly payload: TPayload;
|
|
35
|
+
/** Raw message data from the driver */
|
|
36
|
+
readonly raw?: unknown;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Options when publishing a message
|
|
40
|
+
*/
|
|
41
|
+
export type PublishOptions = {
|
|
42
|
+
/** Message priority (0-9, where 9 is highest) */
|
|
43
|
+
priority?: number;
|
|
44
|
+
/** Time-to-live in milliseconds */
|
|
45
|
+
ttl?: number;
|
|
46
|
+
/** Delay before message is available (delayed messaging) */
|
|
47
|
+
delay?: number;
|
|
48
|
+
/** Custom headers */
|
|
49
|
+
headers?: Record<string, string>;
|
|
50
|
+
/** Enable message persistence (survives broker restart) */
|
|
51
|
+
persistent?: boolean;
|
|
52
|
+
/** Correlation ID for tracking related messages */
|
|
53
|
+
correlationId?: string;
|
|
54
|
+
/** Expiration time in milliseconds */
|
|
55
|
+
expiration?: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Retry configuration for failed message processing
|
|
59
|
+
*/
|
|
60
|
+
export type RetryOptions = {
|
|
61
|
+
/** Maximum number of retry attempts */
|
|
62
|
+
maxRetries: number;
|
|
63
|
+
/** Delay between retries in ms, or function for custom backoff */
|
|
64
|
+
delay: number | ((attempt: number) => number);
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Dead-letter configuration for messages that exceed retry attempts
|
|
68
|
+
*/
|
|
69
|
+
export type DeadLetterOptions = {
|
|
70
|
+
/** Dead-letter queue/channel name */
|
|
71
|
+
channel: string;
|
|
72
|
+
/** Whether to preserve original message metadata */
|
|
73
|
+
preserveOriginal?: boolean;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Options when subscribing to a channel
|
|
77
|
+
*/
|
|
78
|
+
export type SubscribeOptions = {
|
|
79
|
+
/** Consumer ID for tracking subscriptions (used for unsubscription) */
|
|
80
|
+
consumerId?: string;
|
|
81
|
+
/** Consumer group/tag name */
|
|
82
|
+
group?: string;
|
|
83
|
+
/** Number of messages to prefetch (concurrency) */
|
|
84
|
+
prefetch?: number;
|
|
85
|
+
/** Auto-acknowledge messages (default: false for manual ack) */
|
|
86
|
+
autoAck?: boolean;
|
|
87
|
+
/** Retry configuration for failed messages */
|
|
88
|
+
retry?: RetryOptions;
|
|
89
|
+
/** Dead-letter configuration */
|
|
90
|
+
deadLetter?: DeadLetterOptions;
|
|
91
|
+
/** Exclusive consumer (only one consumer on this queue) */
|
|
92
|
+
exclusive?: boolean;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Options for request-response (RPC) pattern
|
|
96
|
+
*/
|
|
97
|
+
export type RequestOptions = PublishOptions & {
|
|
98
|
+
/** Timeout in milliseconds to wait for response */
|
|
99
|
+
timeout?: number;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Context provided to message handlers for controlling message flow
|
|
103
|
+
*/
|
|
104
|
+
export type MessageContext = {
|
|
105
|
+
/** Acknowledge the message (mark as successfully processed) */
|
|
106
|
+
ack(): Promise<void>;
|
|
107
|
+
/** Negative acknowledge (requeue or send to dead-letter) */
|
|
108
|
+
nack(requeue?: boolean): Promise<void>;
|
|
109
|
+
/** Reject the message (don't requeue) */
|
|
110
|
+
reject(): Promise<void>;
|
|
111
|
+
/** Reply to a message (for RPC patterns) */
|
|
112
|
+
reply<T>(payload: T): Promise<void>;
|
|
113
|
+
/** Manually retry the message with optional delay */
|
|
114
|
+
retry(delay?: number): Promise<void>;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Represents an active subscription to a channel
|
|
118
|
+
*/
|
|
119
|
+
export type Subscription = {
|
|
120
|
+
/** Unique subscription ID */
|
|
121
|
+
readonly id: string;
|
|
122
|
+
/** Channel name this subscription is for */
|
|
123
|
+
readonly channel: string;
|
|
124
|
+
/** Consumer tag (driver-specific identifier) */
|
|
125
|
+
readonly consumerTag?: string;
|
|
126
|
+
/** Unsubscribe from the channel */
|
|
127
|
+
unsubscribe(): Promise<void>;
|
|
128
|
+
/** Pause message consumption */
|
|
129
|
+
pause(): Promise<void>;
|
|
130
|
+
/** Resume message consumption */
|
|
131
|
+
resume(): Promise<void>;
|
|
132
|
+
/** Check if subscription is active */
|
|
133
|
+
isActive(): boolean;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Handler function for processing messages
|
|
137
|
+
*
|
|
138
|
+
* @template TPayload - The typed payload
|
|
139
|
+
*/
|
|
140
|
+
export type MessageHandler<TPayload = unknown> = (message: Message<TPayload>, ctx: MessageContext) => Promise<void> | void;
|
|
141
|
+
/**
|
|
142
|
+
* Handler function for request-response (RPC) pattern
|
|
143
|
+
*
|
|
144
|
+
* @template TPayload - The request payload type
|
|
145
|
+
* @template TResponse - The response payload type
|
|
146
|
+
*/
|
|
147
|
+
export type ResponseHandler<TPayload = unknown, TResponse = unknown> = (message: Message<TPayload>, ctx: MessageContext) => Promise<TResponse> | TResponse;
|
|
148
|
+
/**
|
|
149
|
+
* Channel/queue configuration options
|
|
150
|
+
*/
|
|
151
|
+
export type ChannelOptions<TPayload = unknown> = {
|
|
152
|
+
/** Channel type (queue for point-to-point, topic for pub/sub, fanout for broadcast) */
|
|
153
|
+
type?: "queue" | "topic" | "fanout";
|
|
154
|
+
/** Durable channel (survives broker restart) */
|
|
155
|
+
durable?: boolean;
|
|
156
|
+
/** Auto-delete when last consumer disconnects */
|
|
157
|
+
autoDelete?: boolean;
|
|
158
|
+
/** Exclusive channel (single connection only) */
|
|
159
|
+
exclusive?: boolean;
|
|
160
|
+
/** Dead-letter configuration */
|
|
161
|
+
deadLetter?: DeadLetterOptions;
|
|
162
|
+
/** Maximum message size in bytes */
|
|
163
|
+
maxMessageSize?: number;
|
|
164
|
+
/** Default message TTL in milliseconds */
|
|
165
|
+
messageTtl?: number;
|
|
166
|
+
/** Maximum number of messages in queue */
|
|
167
|
+
maxLength?: number;
|
|
168
|
+
/** Seal schema for validation before message is published */
|
|
169
|
+
schema?: BaseValidator;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Statistics for a channel
|
|
173
|
+
*/
|
|
174
|
+
export type ChannelStats = {
|
|
175
|
+
/** Number of messages in the queue */
|
|
176
|
+
messageCount: number;
|
|
177
|
+
/** Number of active consumers */
|
|
178
|
+
consumerCount: number;
|
|
179
|
+
/** Channel name */
|
|
180
|
+
name: string;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Supported communicator driver types
|
|
184
|
+
*/
|
|
185
|
+
export type CommunicatorDriverType = "rabbitmq" | "kafka" | "redis-streams" | "sqs";
|
|
186
|
+
/**
|
|
187
|
+
* Events emitted by communicator drivers
|
|
188
|
+
*/
|
|
189
|
+
export type CommunicatorEvent = "connected" | "disconnected" | "error" | "reconnecting";
|
|
190
|
+
/**
|
|
191
|
+
* Listener function for communicator events
|
|
192
|
+
*/
|
|
193
|
+
export type CommunicatorEventListener = (...args: unknown[]) => void;
|
|
194
|
+
/**
|
|
195
|
+
* Result of a health check
|
|
196
|
+
*/
|
|
197
|
+
export type HealthCheckResult = {
|
|
198
|
+
/** Whether the communicator is healthy */
|
|
199
|
+
healthy: boolean;
|
|
200
|
+
/** Latency in milliseconds */
|
|
201
|
+
latency?: number;
|
|
202
|
+
/** Error message if unhealthy */
|
|
203
|
+
error?: string;
|
|
204
|
+
/** Additional details */
|
|
205
|
+
details?: Record<string, unknown>;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Base connection options shared across all drivers
|
|
209
|
+
*/
|
|
210
|
+
export type BaseConnectionOptions = {
|
|
211
|
+
/** Unique name for this communicator */
|
|
212
|
+
name?: string;
|
|
213
|
+
/** Whether this should be the default communicator */
|
|
214
|
+
isDefault?: boolean;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Native amqplib socket options
|
|
218
|
+
* These are passed directly to the underlying socket connection
|
|
219
|
+
*/
|
|
220
|
+
export type RabbitMQSocketOptions = {
|
|
221
|
+
/** Keep-alive delay in milliseconds */
|
|
222
|
+
keepAlive?: boolean | number;
|
|
223
|
+
/** Disable Nagle's algorithm */
|
|
224
|
+
noDelay?: boolean;
|
|
225
|
+
/** Socket timeout in milliseconds */
|
|
226
|
+
timeout?: number;
|
|
227
|
+
/** Custom certificate authority (for TLS) */
|
|
228
|
+
ca?: string | Buffer | Array<string | Buffer>;
|
|
229
|
+
/** Client certificate (for TLS) */
|
|
230
|
+
cert?: string | Buffer;
|
|
231
|
+
/** Client private key (for TLS) */
|
|
232
|
+
key?: string | Buffer;
|
|
233
|
+
/** Passphrase for the private key */
|
|
234
|
+
passphrase?: string;
|
|
235
|
+
/** Server name for SNI (TLS) */
|
|
236
|
+
servername?: string;
|
|
237
|
+
/** Reject unauthorized certificates (default: true) */
|
|
238
|
+
rejectUnauthorized?: boolean;
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* RabbitMQ client options (native amqplib options)
|
|
242
|
+
* These are passed directly to amqplib.connect()
|
|
243
|
+
*/
|
|
244
|
+
export type RabbitMQClientOptions = {
|
|
245
|
+
/** Frame max size in bytes */
|
|
246
|
+
frameMax?: number;
|
|
247
|
+
/** Channel max (0 = unlimited) */
|
|
248
|
+
channelMax?: number;
|
|
249
|
+
/** Locale (default: 'en_US') */
|
|
250
|
+
locale?: string;
|
|
251
|
+
/** Socket options for the underlying connection */
|
|
252
|
+
socket?: RabbitMQSocketOptions;
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* RabbitMQ-specific connection options
|
|
256
|
+
*
|
|
257
|
+
* @template TClientOptions - Native amqplib client options
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```typescript
|
|
261
|
+
* const config: RabbitMQConnectionOptions = {
|
|
262
|
+
* driver: "rabbitmq",
|
|
263
|
+
* host: "localhost",
|
|
264
|
+
* port: 5672,
|
|
265
|
+
* username: "guest",
|
|
266
|
+
* password: "guest",
|
|
267
|
+
*
|
|
268
|
+
* // Native amqplib options
|
|
269
|
+
* clientOptions: {
|
|
270
|
+
* frameMax: 0,
|
|
271
|
+
* channelMax: 0,
|
|
272
|
+
* socket: {
|
|
273
|
+
* keepAlive: true,
|
|
274
|
+
* noDelay: true,
|
|
275
|
+
* },
|
|
276
|
+
* },
|
|
277
|
+
* };
|
|
278
|
+
* ```
|
|
279
|
+
*/
|
|
280
|
+
export type RabbitMQConnectionOptions<TClientOptions extends RabbitMQClientOptions = RabbitMQClientOptions> = BaseConnectionOptions & {
|
|
281
|
+
driver: "rabbitmq";
|
|
282
|
+
/** Host address */
|
|
283
|
+
host?: string;
|
|
284
|
+
/** Port number */
|
|
285
|
+
port?: number;
|
|
286
|
+
/** Username for authentication */
|
|
287
|
+
username?: string;
|
|
288
|
+
/** Password for authentication */
|
|
289
|
+
password?: string;
|
|
290
|
+
/** Virtual host */
|
|
291
|
+
vhost?: string;
|
|
292
|
+
/** Connection URI (alternative to host/port) */
|
|
293
|
+
uri?: string;
|
|
294
|
+
/** Heartbeat interval in seconds */
|
|
295
|
+
heartbeat?: number;
|
|
296
|
+
/** Connection timeout in milliseconds */
|
|
297
|
+
connectionTimeout?: number;
|
|
298
|
+
/** Enable automatic reconnection */
|
|
299
|
+
reconnect?: boolean;
|
|
300
|
+
/** Delay between reconnection attempts in milliseconds */
|
|
301
|
+
reconnectDelay?: number;
|
|
302
|
+
/** Default prefetch count for consumers */
|
|
303
|
+
prefetch?: number;
|
|
304
|
+
/**
|
|
305
|
+
* Native amqplib client options
|
|
306
|
+
*
|
|
307
|
+
* These options are passed directly to amqplib.connect()
|
|
308
|
+
* for low-level configuration like frame size, TLS, etc.
|
|
309
|
+
*/
|
|
310
|
+
clientOptions?: TClientOptions;
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* Kafka client options (native kafkajs options)
|
|
314
|
+
*/
|
|
315
|
+
export type KafkaClientOptions = {
|
|
316
|
+
/** Retry configuration */
|
|
317
|
+
retry?: {
|
|
318
|
+
initialRetryTime?: number;
|
|
319
|
+
retries?: number;
|
|
320
|
+
maxRetryTime?: number;
|
|
321
|
+
factor?: number;
|
|
322
|
+
multiplier?: number;
|
|
323
|
+
};
|
|
324
|
+
/** Log level */
|
|
325
|
+
logLevel?: number;
|
|
326
|
+
/** Custom logger */
|
|
327
|
+
logCreator?: any;
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* Kafka-specific connection options
|
|
331
|
+
*
|
|
332
|
+
* @template TClientOptions - Native kafkajs client options
|
|
333
|
+
*/
|
|
334
|
+
export type KafkaConnectionOptions<TClientOptions extends KafkaClientOptions = KafkaClientOptions> = BaseConnectionOptions & {
|
|
335
|
+
driver: "kafka";
|
|
336
|
+
/** Broker addresses */
|
|
337
|
+
brokers: string[];
|
|
338
|
+
/** Client ID */
|
|
339
|
+
clientId?: string;
|
|
340
|
+
/** Connection timeout in milliseconds */
|
|
341
|
+
connectionTimeout?: number;
|
|
342
|
+
/** Request timeout in milliseconds */
|
|
343
|
+
requestTimeout?: number;
|
|
344
|
+
/** SSL configuration */
|
|
345
|
+
ssl?: boolean | object;
|
|
346
|
+
/** SASL authentication */
|
|
347
|
+
sasl?: {
|
|
348
|
+
mechanism: "plain" | "scram-sha-256" | "scram-sha-512";
|
|
349
|
+
username: string;
|
|
350
|
+
password: string;
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* Native kafkajs client options
|
|
354
|
+
*/
|
|
355
|
+
clientOptions?: TClientOptions;
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Union type for all connection options
|
|
359
|
+
*/
|
|
360
|
+
export type ConnectionOptions = RabbitMQConnectionOptions | KafkaConnectionOptions;
|
|
361
|
+
/**
|
|
362
|
+
* Communicator configuration options
|
|
363
|
+
*
|
|
364
|
+
* This is the main type for configuring communicators in your application.
|
|
365
|
+
* Similar to ConnectionOptions in @warlock.js/cascade.
|
|
366
|
+
*
|
|
367
|
+
* @template TClientOptions - Native client options (amqplib, kafkajs, etc.)
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* ```typescript
|
|
371
|
+
* // RabbitMQ with client options
|
|
372
|
+
* const config: CommunicatorConfigurations<RabbitMQClientOptions> = {
|
|
373
|
+
* driver: "rabbitmq",
|
|
374
|
+
* host: "localhost",
|
|
375
|
+
* clientOptions: {
|
|
376
|
+
* socket: { keepAlive: true },
|
|
377
|
+
* },
|
|
378
|
+
* };
|
|
379
|
+
*
|
|
380
|
+
* // Kafka
|
|
381
|
+
* const kafkaConfig: CommunicatorConfigurations<KafkaClientOptions> = {
|
|
382
|
+
* driver: "kafka",
|
|
383
|
+
* brokers: ["localhost:9092"],
|
|
384
|
+
* clientOptions: {
|
|
385
|
+
* retry: { retries: 5 },
|
|
386
|
+
* },
|
|
387
|
+
* };
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
390
|
+
export type CommunicatorConfigurations<TClientOptions = any> = RabbitMQConnectionOptions<TClientOptions extends RabbitMQClientOptions ? TClientOptions : RabbitMQClientOptions> | KafkaConnectionOptions<TClientOptions extends KafkaClientOptions ? TClientOptions : KafkaClientOptions>;
|
|
391
|
+
/**
|
|
392
|
+
* Events emitted by the communicator registry
|
|
393
|
+
*/
|
|
394
|
+
export type CommunicatorRegistryEvent = "registered" | "default-registered" | "connected" | "disconnected";
|
|
395
|
+
/**
|
|
396
|
+
* Listener for registry events
|
|
397
|
+
*/
|
|
398
|
+
export type CommunicatorRegistryListener = (communicator: CommunicatorDriverContract) => void;
|
|
399
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAMzD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,SAAS,EAAE,IAAI,CAAC;IAChB,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;GAI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