@velony/contracts 2.0.0 → 2.0.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/identity/user-avatar-path-added.integration-event.d.ts +11 -10
- package/dist/identity/user-avatar-path-changed.integration-event.d.ts +11 -10
- package/dist/identity/user-avatar-path-removed.integration-event.d.ts +10 -9
- package/dist/identity/user-deleted.integration-event.d.ts +10 -9
- package/dist/identity/user-email-added.integration-event.d.ts +11 -10
- package/dist/identity/user-email-change-issued.integration-event.d.ts +11 -10
- package/dist/identity/user-email-change-revoked.integration-event.d.ts +10 -9
- package/dist/identity/user-email-changed.integration-event.d.ts +11 -10
- package/dist/identity/user-email-removed.integration-event.d.ts +10 -9
- package/dist/identity/user-name-changed.integration-event.d.ts +11 -10
- package/dist/identity/user-phone-number-added.integration-event.d.ts +11 -10
- package/dist/identity/user-phone-number-change-issued.integration-event.d.ts +11 -10
- package/dist/identity/user-phone-number-change-revoked.integration-event.d.ts +10 -9
- package/dist/identity/user-phone-number-changed.integration-event.d.ts +11 -10
- package/dist/identity/user-phone-number-removed.integration-event.d.ts +10 -9
- package/dist/identity/user-registered-local.integration-event.d.ts +12 -11
- package/dist/identity/user-username-changed.integration-event.d.ts +11 -10
- package/dist/index.d.ts +1 -1
- package/dist/integration-event.d.ts +67 -0
- package/dist/{integration-event.interface.js → integration-event.js} +1 -1
- package/dist/integration-event.js.map +1 -0
- package/package.json +1 -1
- package/dist/integration-event.interface.d.ts +0 -10
- package/dist/integration-event.interface.js.map +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.avatar-path.added': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
avatarPath: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
|
-
export
|
|
8
|
-
type: Type;
|
|
9
|
-
payload: Payload;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
+
export type UserAvatarPathAddedIntegrationEvent = IntegrationEvent<'user.avatar-path.added'>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.avatar-path.changed': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
avatarPath: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
|
-
export
|
|
8
|
-
type: Type;
|
|
9
|
-
payload: Payload;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
+
export type UserAvatarPathChangedIntegrationEvent = IntegrationEvent<'user.avatar-path.changed'>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.avatar-path.removed': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
}
|
|
5
10
|
}
|
|
6
|
-
export
|
|
7
|
-
type: Type;
|
|
8
|
-
payload: Payload;
|
|
9
|
-
}
|
|
10
|
-
export {};
|
|
11
|
+
export type UserAvatarPathRemovedIntegrationEvent = IntegrationEvent<'user.avatar-path.removed'>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.deleted': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
}
|
|
5
10
|
}
|
|
6
|
-
export
|
|
7
|
-
type: Type;
|
|
8
|
-
payload: Payload;
|
|
9
|
-
}
|
|
10
|
-
export {};
|
|
11
|
+
export type UserDeletedIntegrationEvent = IntegrationEvent<'user.deleted'>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.email.added': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
email: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
|
-
export
|
|
8
|
-
type: Type;
|
|
9
|
-
payload: Payload;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
+
export type UserEmailAddedIntegrationEvent = IntegrationEvent<'user.email.added'>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.email-change.issued': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
email: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
|
-
export
|
|
8
|
-
type: Type;
|
|
9
|
-
payload: Payload;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
+
export type UserEmailChangeIssuedIntegrationEvent = IntegrationEvent<'user.email-change.issued'>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.email-change.revoked': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
}
|
|
5
10
|
}
|
|
6
|
-
export
|
|
7
|
-
type: Type;
|
|
8
|
-
payload: Payload;
|
|
9
|
-
}
|
|
10
|
-
export {};
|
|
11
|
+
export type UserEmailChangeRevokedIntegrationEvent = IntegrationEvent<'user.email-change.revoked'>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.email.changed': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
email: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
|
-
export
|
|
8
|
-
type: Type;
|
|
9
|
-
payload: Payload;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
+
export type UserEmailChangedIntegrationEvent = IntegrationEvent<'user.email.changed'>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.email.removed': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
}
|
|
5
10
|
}
|
|
6
|
-
export
|
|
7
|
-
type: Type;
|
|
8
|
-
payload: Payload;
|
|
9
|
-
}
|
|
10
|
-
export {};
|
|
11
|
+
export type UserEmailRemovedIntegrationEvent = IntegrationEvent<'user.email.removed'>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.name.changed': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
|
-
export
|
|
8
|
-
type: Type;
|
|
9
|
-
payload: Payload;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
+
export type UserNameChangedIntegrationEvent = IntegrationEvent<'user.name.changed'>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.phone-number.added': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
phoneNumber: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
|
-
export
|
|
8
|
-
type: Type;
|
|
9
|
-
payload: Payload;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
+
export type UserPhoneNumberAddedIntegrationEvent = IntegrationEvent<'user.phone-number.added'>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.phone-number-change.issued': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
phoneNumber: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
|
-
export
|
|
8
|
-
type: Type;
|
|
9
|
-
payload: Payload;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
+
export type UserPhoneNumberChangeIssuedIntegrationEvent = IntegrationEvent<'user.phone-number-change.issued'>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.phone-number-change.revoked': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
}
|
|
5
10
|
}
|
|
6
|
-
export
|
|
7
|
-
type: Type;
|
|
8
|
-
payload: Payload;
|
|
9
|
-
}
|
|
10
|
-
export {};
|
|
11
|
+
export type UserPhoneNumberChangeRevokedIntegrationEvent = IntegrationEvent<'user.phone-number-change.revoked'>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.phone-number.changed': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
phoneNumber: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
|
-
export
|
|
8
|
-
type: Type;
|
|
9
|
-
payload: Payload;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
+
export type UserPhoneNumberChangedIntegrationEvent = IntegrationEvent<'user.phone-number.changed'>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.phone-number.removed': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
}
|
|
5
10
|
}
|
|
6
|
-
export
|
|
7
|
-
type: Type;
|
|
8
|
-
payload: Payload;
|
|
9
|
-
}
|
|
10
|
-
export {};
|
|
11
|
+
export type UserPhoneNumberRemovedIntegrationEvent = IntegrationEvent<'user.phone-number.removed'>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.registered-local': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
username: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}
|
|
7
12
|
}
|
|
8
|
-
export
|
|
9
|
-
type: Type;
|
|
10
|
-
payload: Payload;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
13
|
+
export type UserRegisteredLocalIntegrationEvent = IntegrationEvent<'user.registered-local'>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { IntegrationEvent } from '../integration-event
|
|
2
|
-
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IntegrationEvent } from '../integration-event';
|
|
2
|
+
declare module '../integration-event' {
|
|
3
|
+
interface IntegrationEventRegistry {
|
|
4
|
+
'user.username.changed': {
|
|
5
|
+
payload: {
|
|
6
|
+
userId: string;
|
|
7
|
+
username: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
|
-
export
|
|
8
|
-
type: Type;
|
|
9
|
-
payload: Payload;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
+
export type UserUsernameChangedIntegrationEvent = IntegrationEvent<'user.username.changed'>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { IntegrationEvent } from './integration-event
|
|
1
|
+
export type { IntegrationEvent } from './integration-event';
|
|
2
2
|
export type { UserAvatarPathAddedIntegrationEvent } from './identity/user-avatar-path-added.integration-event';
|
|
3
3
|
export type { UserAvatarPathChangedIntegrationEvent } from './identity/user-avatar-path-changed.integration-event';
|
|
4
4
|
export type { UserAvatarPathRemovedIntegrationEvent } from './identity/user-avatar-path-removed.integration-event';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
declare const INTEGRATION_EVENT_BRAND: unique symbol;
|
|
2
|
+
/**
|
|
3
|
+
* Registry that maps integration event types to their payload types.
|
|
4
|
+
* Extend this interface to register new integration event types.
|
|
5
|
+
*/
|
|
6
|
+
export interface IntegrationEventRegistry {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
payload: unknown;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Integration event represents a significant business event that has occurred
|
|
13
|
+
* and needs to be communicated to external systems or bounded contexts.
|
|
14
|
+
* Unlike domain events which are internal, integration events cross bounded context boundaries.
|
|
15
|
+
*
|
|
16
|
+
* @template TType - The type identifier for the event (must be registered in IntegrationEventRegistry)
|
|
17
|
+
*/
|
|
18
|
+
export type IntegrationEvent<TType extends keyof IntegrationEventRegistry> = {
|
|
19
|
+
readonly [INTEGRATION_EVENT_BRAND]: void;
|
|
20
|
+
/**
|
|
21
|
+
* Unique identifier for this event instance.
|
|
22
|
+
* @readonly
|
|
23
|
+
*/
|
|
24
|
+
readonly id: string;
|
|
25
|
+
/**
|
|
26
|
+
* Type identifier for the event.
|
|
27
|
+
* @readonly
|
|
28
|
+
*/
|
|
29
|
+
readonly type: TType;
|
|
30
|
+
/**
|
|
31
|
+
* Version of the event schema for backward compatibility.
|
|
32
|
+
* @readonly
|
|
33
|
+
*/
|
|
34
|
+
readonly version: string;
|
|
35
|
+
/**
|
|
36
|
+
* The timestamp when the original domain event occurred.
|
|
37
|
+
* @readonly
|
|
38
|
+
*/
|
|
39
|
+
readonly occurredAt: Date;
|
|
40
|
+
/**
|
|
41
|
+
* The data payload specific to this event.
|
|
42
|
+
* @readonly
|
|
43
|
+
*/
|
|
44
|
+
readonly payload: IntegrationEventRegistry[TType]['payload'];
|
|
45
|
+
/**
|
|
46
|
+
* Key used for partitioning in message brokers for ordering guarantees.
|
|
47
|
+
* @readonly
|
|
48
|
+
*/
|
|
49
|
+
readonly partitionKey: string;
|
|
50
|
+
/**
|
|
51
|
+
* The timestamp when this integration event was created.
|
|
52
|
+
* @readonly
|
|
53
|
+
*/
|
|
54
|
+
readonly createdAt: Date;
|
|
55
|
+
/**
|
|
56
|
+
* The timestamp when this event was published to the message broker.
|
|
57
|
+
* Null if not yet published.
|
|
58
|
+
* @readonly
|
|
59
|
+
*/
|
|
60
|
+
readonly publishedAt: Date | null;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Union type representing any integration event registered in the IntegrationEventRegistry.
|
|
64
|
+
* Useful for type-safe collections and handlers that work with multiple integration event types.
|
|
65
|
+
*/
|
|
66
|
+
export type AnyIntegrationEvent = IntegrationEvent<keyof IntegrationEventRegistry>;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-event.js","sourceRoot":"","sources":["../src/integration-event.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integration-event.interface.js","sourceRoot":"","sources":["../src/integration-event.interface.ts"],"names":[],"mappings":""}
|