wsp-ms-core 1.0.78-beta-1 → 1.0.78-beta-2
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/index.cjs.map +1 -1
- package/dist/index.d.mts +56 -56
- package/dist/index.d.ts +56 -56
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -84,53 +84,12 @@ declare abstract class BaseEvent {
|
|
|
84
84
|
get ocurredAt(): DateTime;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
declare class
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
static readonly PROCESSED: ProcessStatus;
|
|
92
|
-
static readonly FAILED: ProcessStatus;
|
|
93
|
-
static readonly DEAD: ProcessStatus;
|
|
94
|
-
private constructor();
|
|
95
|
-
protected validate(value: string): void;
|
|
96
|
-
toPrimitives(): Record<string, unknown>;
|
|
97
|
-
static create(status: string): ProcessStatus;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
declare class OutboxRecord {
|
|
101
|
-
private readonly _eventUuid;
|
|
102
|
-
private readonly _eventType;
|
|
103
|
-
private readonly _tenantUuid;
|
|
104
|
-
private readonly _aggregateUuid;
|
|
105
|
-
private readonly _aggregateType;
|
|
106
|
-
private readonly _topic;
|
|
107
|
-
private readonly _payload;
|
|
108
|
-
private _status;
|
|
109
|
-
private _attempts;
|
|
110
|
-
private _errorMessage;
|
|
111
|
-
private _publishedAt;
|
|
112
|
-
private _lastAttempt;
|
|
113
|
-
private readonly _createdAt;
|
|
114
|
-
protected constructor(eventUuid: UUID, eventType: string, tenantUuid: UUID, aggregateUuid: UUID, aggregateType: string, topic: string, payload: string, status: ProcessStatus, attempts: number, errorMessage: string | undefined, publishedAt: DateTime | undefined, lastAttempt: DateTime | undefined, createdAt: DateTime);
|
|
115
|
-
get eventUuid(): UUID;
|
|
116
|
-
get tenantUuid(): UUID;
|
|
87
|
+
declare class DomainEvent extends BaseEvent {
|
|
88
|
+
protected readonly _aggregateUuid: UUID;
|
|
89
|
+
protected readonly _aggregateType: string;
|
|
90
|
+
protected constructor(tenantUuid: UUID, version: string, type: string, payload: Record<string, unknown>, aggregateUuid: UUID, aggregateType: string);
|
|
117
91
|
get aggregateUuid(): UUID;
|
|
118
92
|
get aggregateType(): string;
|
|
119
|
-
get eventType(): string;
|
|
120
|
-
get topic(): string;
|
|
121
|
-
get payload(): string;
|
|
122
|
-
get status(): ProcessStatus;
|
|
123
|
-
get attempts(): number;
|
|
124
|
-
get errorMessage(): string | undefined;
|
|
125
|
-
get publishedAt(): DateTime | undefined;
|
|
126
|
-
get lastAttempt(): DateTime | undefined;
|
|
127
|
-
get createdAt(): DateTime;
|
|
128
|
-
incrementAttempts(): void;
|
|
129
|
-
markProcessed(): void;
|
|
130
|
-
markProcessing(): void;
|
|
131
|
-
markWithError(error: string): void;
|
|
132
|
-
toPrimitives(): Record<string, unknown>;
|
|
133
|
-
static reconstitute(data: Record<string, any>): OutboxRecord;
|
|
134
93
|
}
|
|
135
94
|
|
|
136
95
|
interface BaseEntity {
|
|
@@ -141,16 +100,16 @@ interface BaseEntity {
|
|
|
141
100
|
}
|
|
142
101
|
declare abstract class DomainEntity<T extends BaseEntity> {
|
|
143
102
|
protected readonly props: T;
|
|
144
|
-
protected _events:
|
|
103
|
+
protected _events: DomainEvent[];
|
|
145
104
|
protected constructor(props: T);
|
|
146
|
-
protected recordEvent(event:
|
|
105
|
+
protected recordEvent(event: DomainEvent): void;
|
|
147
106
|
protected touch(): void;
|
|
148
107
|
get uuid(): UUID;
|
|
149
108
|
get createdAt(): DateTime;
|
|
150
109
|
get updatedAt(): DateTime;
|
|
151
110
|
get deletedAt(): DateTime | undefined;
|
|
152
111
|
get isDeleted(): boolean;
|
|
153
|
-
pullEvents():
|
|
112
|
+
pullEvents(): DomainEvent[];
|
|
154
113
|
abstract equals(entity?: DomainEntity<T>): boolean;
|
|
155
114
|
abstract toProps(): T;
|
|
156
115
|
abstract toPrimitives(): Record<string, unknown>;
|
|
@@ -181,14 +140,6 @@ declare class UsageError extends DomainError {
|
|
|
181
140
|
constructor(type: string, vars?: Record<string, any>);
|
|
182
141
|
}
|
|
183
142
|
|
|
184
|
-
declare class DomainEvent extends BaseEvent {
|
|
185
|
-
protected readonly _aggregateUuid: UUID;
|
|
186
|
-
protected readonly _aggregateType: string;
|
|
187
|
-
protected constructor(tenantUuid: UUID, version: string, type: string, payload: Record<string, unknown>, aggregateUuid: UUID, aggregateType: string);
|
|
188
|
-
get aggregateUuid(): UUID;
|
|
189
|
-
get aggregateType(): string;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
143
|
declare class PaymentGateway extends ValueObject<string> {
|
|
193
144
|
static readonly SUPPORTED: readonly string[];
|
|
194
145
|
private static readonly EXTERNALS;
|
|
@@ -369,6 +320,55 @@ declare class Price extends ValueObject<PriceProps> {
|
|
|
369
320
|
static createFromPrimitives(data: Record<string, unknown>): Price;
|
|
370
321
|
}
|
|
371
322
|
|
|
323
|
+
declare class ProcessStatus extends ValueObject<string> {
|
|
324
|
+
static readonly SUPPORTED: readonly string[];
|
|
325
|
+
static readonly PENDING: ProcessStatus;
|
|
326
|
+
static readonly PROCESSING: ProcessStatus;
|
|
327
|
+
static readonly PROCESSED: ProcessStatus;
|
|
328
|
+
static readonly FAILED: ProcessStatus;
|
|
329
|
+
static readonly DEAD: ProcessStatus;
|
|
330
|
+
private constructor();
|
|
331
|
+
protected validate(value: string): void;
|
|
332
|
+
toPrimitives(): Record<string, unknown>;
|
|
333
|
+
static create(status: string): ProcessStatus;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
declare class OutboxRecord {
|
|
337
|
+
private readonly _eventUuid;
|
|
338
|
+
private readonly _eventType;
|
|
339
|
+
private readonly _tenantUuid;
|
|
340
|
+
private readonly _aggregateUuid;
|
|
341
|
+
private readonly _aggregateType;
|
|
342
|
+
private readonly _topic;
|
|
343
|
+
private readonly _payload;
|
|
344
|
+
private _status;
|
|
345
|
+
private _attempts;
|
|
346
|
+
private _errorMessage;
|
|
347
|
+
private _publishedAt;
|
|
348
|
+
private _lastAttempt;
|
|
349
|
+
private readonly _createdAt;
|
|
350
|
+
protected constructor(eventUuid: UUID, eventType: string, tenantUuid: UUID, aggregateUuid: UUID, aggregateType: string, topic: string, payload: string, status: ProcessStatus, attempts: number, errorMessage: string | undefined, publishedAt: DateTime | undefined, lastAttempt: DateTime | undefined, createdAt: DateTime);
|
|
351
|
+
get eventUuid(): UUID;
|
|
352
|
+
get tenantUuid(): UUID;
|
|
353
|
+
get aggregateUuid(): UUID;
|
|
354
|
+
get aggregateType(): string;
|
|
355
|
+
get eventType(): string;
|
|
356
|
+
get topic(): string;
|
|
357
|
+
get payload(): string;
|
|
358
|
+
get status(): ProcessStatus;
|
|
359
|
+
get attempts(): number;
|
|
360
|
+
get errorMessage(): string | undefined;
|
|
361
|
+
get publishedAt(): DateTime | undefined;
|
|
362
|
+
get lastAttempt(): DateTime | undefined;
|
|
363
|
+
get createdAt(): DateTime;
|
|
364
|
+
incrementAttempts(): void;
|
|
365
|
+
markProcessed(): void;
|
|
366
|
+
markProcessing(): void;
|
|
367
|
+
markWithError(error: string): void;
|
|
368
|
+
toPrimitives(): Record<string, unknown>;
|
|
369
|
+
static reconstitute(data: Record<string, any>): OutboxRecord;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
372
|
interface EventBusRepository {
|
|
373
373
|
create(event: OutboxRecord): Promise<void>;
|
|
374
374
|
update(event: OutboxRecord): Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -84,53 +84,12 @@ declare abstract class BaseEvent {
|
|
|
84
84
|
get ocurredAt(): DateTime;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
declare class
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
static readonly PROCESSED: ProcessStatus;
|
|
92
|
-
static readonly FAILED: ProcessStatus;
|
|
93
|
-
static readonly DEAD: ProcessStatus;
|
|
94
|
-
private constructor();
|
|
95
|
-
protected validate(value: string): void;
|
|
96
|
-
toPrimitives(): Record<string, unknown>;
|
|
97
|
-
static create(status: string): ProcessStatus;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
declare class OutboxRecord {
|
|
101
|
-
private readonly _eventUuid;
|
|
102
|
-
private readonly _eventType;
|
|
103
|
-
private readonly _tenantUuid;
|
|
104
|
-
private readonly _aggregateUuid;
|
|
105
|
-
private readonly _aggregateType;
|
|
106
|
-
private readonly _topic;
|
|
107
|
-
private readonly _payload;
|
|
108
|
-
private _status;
|
|
109
|
-
private _attempts;
|
|
110
|
-
private _errorMessage;
|
|
111
|
-
private _publishedAt;
|
|
112
|
-
private _lastAttempt;
|
|
113
|
-
private readonly _createdAt;
|
|
114
|
-
protected constructor(eventUuid: UUID, eventType: string, tenantUuid: UUID, aggregateUuid: UUID, aggregateType: string, topic: string, payload: string, status: ProcessStatus, attempts: number, errorMessage: string | undefined, publishedAt: DateTime | undefined, lastAttempt: DateTime | undefined, createdAt: DateTime);
|
|
115
|
-
get eventUuid(): UUID;
|
|
116
|
-
get tenantUuid(): UUID;
|
|
87
|
+
declare class DomainEvent extends BaseEvent {
|
|
88
|
+
protected readonly _aggregateUuid: UUID;
|
|
89
|
+
protected readonly _aggregateType: string;
|
|
90
|
+
protected constructor(tenantUuid: UUID, version: string, type: string, payload: Record<string, unknown>, aggregateUuid: UUID, aggregateType: string);
|
|
117
91
|
get aggregateUuid(): UUID;
|
|
118
92
|
get aggregateType(): string;
|
|
119
|
-
get eventType(): string;
|
|
120
|
-
get topic(): string;
|
|
121
|
-
get payload(): string;
|
|
122
|
-
get status(): ProcessStatus;
|
|
123
|
-
get attempts(): number;
|
|
124
|
-
get errorMessage(): string | undefined;
|
|
125
|
-
get publishedAt(): DateTime | undefined;
|
|
126
|
-
get lastAttempt(): DateTime | undefined;
|
|
127
|
-
get createdAt(): DateTime;
|
|
128
|
-
incrementAttempts(): void;
|
|
129
|
-
markProcessed(): void;
|
|
130
|
-
markProcessing(): void;
|
|
131
|
-
markWithError(error: string): void;
|
|
132
|
-
toPrimitives(): Record<string, unknown>;
|
|
133
|
-
static reconstitute(data: Record<string, any>): OutboxRecord;
|
|
134
93
|
}
|
|
135
94
|
|
|
136
95
|
interface BaseEntity {
|
|
@@ -141,16 +100,16 @@ interface BaseEntity {
|
|
|
141
100
|
}
|
|
142
101
|
declare abstract class DomainEntity<T extends BaseEntity> {
|
|
143
102
|
protected readonly props: T;
|
|
144
|
-
protected _events:
|
|
103
|
+
protected _events: DomainEvent[];
|
|
145
104
|
protected constructor(props: T);
|
|
146
|
-
protected recordEvent(event:
|
|
105
|
+
protected recordEvent(event: DomainEvent): void;
|
|
147
106
|
protected touch(): void;
|
|
148
107
|
get uuid(): UUID;
|
|
149
108
|
get createdAt(): DateTime;
|
|
150
109
|
get updatedAt(): DateTime;
|
|
151
110
|
get deletedAt(): DateTime | undefined;
|
|
152
111
|
get isDeleted(): boolean;
|
|
153
|
-
pullEvents():
|
|
112
|
+
pullEvents(): DomainEvent[];
|
|
154
113
|
abstract equals(entity?: DomainEntity<T>): boolean;
|
|
155
114
|
abstract toProps(): T;
|
|
156
115
|
abstract toPrimitives(): Record<string, unknown>;
|
|
@@ -181,14 +140,6 @@ declare class UsageError extends DomainError {
|
|
|
181
140
|
constructor(type: string, vars?: Record<string, any>);
|
|
182
141
|
}
|
|
183
142
|
|
|
184
|
-
declare class DomainEvent extends BaseEvent {
|
|
185
|
-
protected readonly _aggregateUuid: UUID;
|
|
186
|
-
protected readonly _aggregateType: string;
|
|
187
|
-
protected constructor(tenantUuid: UUID, version: string, type: string, payload: Record<string, unknown>, aggregateUuid: UUID, aggregateType: string);
|
|
188
|
-
get aggregateUuid(): UUID;
|
|
189
|
-
get aggregateType(): string;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
143
|
declare class PaymentGateway extends ValueObject<string> {
|
|
193
144
|
static readonly SUPPORTED: readonly string[];
|
|
194
145
|
private static readonly EXTERNALS;
|
|
@@ -369,6 +320,55 @@ declare class Price extends ValueObject<PriceProps> {
|
|
|
369
320
|
static createFromPrimitives(data: Record<string, unknown>): Price;
|
|
370
321
|
}
|
|
371
322
|
|
|
323
|
+
declare class ProcessStatus extends ValueObject<string> {
|
|
324
|
+
static readonly SUPPORTED: readonly string[];
|
|
325
|
+
static readonly PENDING: ProcessStatus;
|
|
326
|
+
static readonly PROCESSING: ProcessStatus;
|
|
327
|
+
static readonly PROCESSED: ProcessStatus;
|
|
328
|
+
static readonly FAILED: ProcessStatus;
|
|
329
|
+
static readonly DEAD: ProcessStatus;
|
|
330
|
+
private constructor();
|
|
331
|
+
protected validate(value: string): void;
|
|
332
|
+
toPrimitives(): Record<string, unknown>;
|
|
333
|
+
static create(status: string): ProcessStatus;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
declare class OutboxRecord {
|
|
337
|
+
private readonly _eventUuid;
|
|
338
|
+
private readonly _eventType;
|
|
339
|
+
private readonly _tenantUuid;
|
|
340
|
+
private readonly _aggregateUuid;
|
|
341
|
+
private readonly _aggregateType;
|
|
342
|
+
private readonly _topic;
|
|
343
|
+
private readonly _payload;
|
|
344
|
+
private _status;
|
|
345
|
+
private _attempts;
|
|
346
|
+
private _errorMessage;
|
|
347
|
+
private _publishedAt;
|
|
348
|
+
private _lastAttempt;
|
|
349
|
+
private readonly _createdAt;
|
|
350
|
+
protected constructor(eventUuid: UUID, eventType: string, tenantUuid: UUID, aggregateUuid: UUID, aggregateType: string, topic: string, payload: string, status: ProcessStatus, attempts: number, errorMessage: string | undefined, publishedAt: DateTime | undefined, lastAttempt: DateTime | undefined, createdAt: DateTime);
|
|
351
|
+
get eventUuid(): UUID;
|
|
352
|
+
get tenantUuid(): UUID;
|
|
353
|
+
get aggregateUuid(): UUID;
|
|
354
|
+
get aggregateType(): string;
|
|
355
|
+
get eventType(): string;
|
|
356
|
+
get topic(): string;
|
|
357
|
+
get payload(): string;
|
|
358
|
+
get status(): ProcessStatus;
|
|
359
|
+
get attempts(): number;
|
|
360
|
+
get errorMessage(): string | undefined;
|
|
361
|
+
get publishedAt(): DateTime | undefined;
|
|
362
|
+
get lastAttempt(): DateTime | undefined;
|
|
363
|
+
get createdAt(): DateTime;
|
|
364
|
+
incrementAttempts(): void;
|
|
365
|
+
markProcessed(): void;
|
|
366
|
+
markProcessing(): void;
|
|
367
|
+
markWithError(error: string): void;
|
|
368
|
+
toPrimitives(): Record<string, unknown>;
|
|
369
|
+
static reconstitute(data: Record<string, any>): OutboxRecord;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
372
|
interface EventBusRepository {
|
|
373
373
|
create(event: OutboxRecord): Promise<void>;
|
|
374
374
|
update(event: OutboxRecord): Promise<void>;
|