ddd-node 35.1.0 → 36.0.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.
Files changed (114) hide show
  1. package/base/decorators/model.js +1 -1
  2. package/base/decorators/static.d.ts +2 -2
  3. package/base/decorators/static.js +2 -2
  4. package/base/meta/index.d.ts +4 -4
  5. package/base/meta/index.js +4 -4
  6. package/base/meta/model-domain.d.ts +1 -1
  7. package/base/meta/model-domain.js +4 -4
  8. package/base/meta/model-id.d.ts +2 -2
  9. package/base/meta/model-id.js +9 -9
  10. package/base/meta/model-mutable.d.ts +1 -1
  11. package/base/meta/model-mutable.js +4 -4
  12. package/base/meta/model-name.d.ts +1 -1
  13. package/base/meta/model-name.js +4 -4
  14. package/base/meta/model-property-accessor.d.ts +2 -2
  15. package/base/meta/model-property-accessor.js +8 -8
  16. package/base/meta/model-props-type.d.ts +1 -1
  17. package/base/meta/model-props-type.js +4 -4
  18. package/base/meta/model-props-validator.d.ts +2 -2
  19. package/base/meta/model-props-validator.js +7 -7
  20. package/base/meta/model-version.d.ts +1 -1
  21. package/base/meta/model-version.js +4 -4
  22. package/base/meta/static-entry.d.ts +13 -0
  23. package/base/meta/static-entry.js +54 -0
  24. package/base/model/model-descriptor.d.ts +4 -4
  25. package/base/model/model-descriptor.js +14 -14
  26. package/base/model/model.js +1 -1
  27. package/base/model-registry.d.ts +1 -1
  28. package/base/model-registry.js +4 -4
  29. package/common/props-validator/use-class-validator.js +1 -1
  30. package/core/decorators/index.d.ts +3 -3
  31. package/core/decorators/index.js +3 -3
  32. package/core/decorators/{enum/is-enum.d.ts → is-enum.d.ts} +1 -1
  33. package/core/decorators/{enum/is-enum.js → is-enum.js} +3 -3
  34. package/core/decorators/is-event.d.ts +4 -0
  35. package/core/decorators/{message/is-event.js → is-event.js} +2 -2
  36. package/core/decorators/{es-aggregate/when.js → when.js} +1 -1
  37. package/core/meta/enum.d.ts +2 -2
  38. package/core/meta/enum.js +8 -8
  39. package/core/meta/{es-aggregate/event-applier.d.ts → event-applier.d.ts} +3 -3
  40. package/core/meta/{es-aggregate/event-applier.js → event-applier.js} +9 -9
  41. package/core/meta/event.d.ts +1 -1
  42. package/core/meta/event.js +4 -4
  43. package/core/meta/index.d.ts +1 -2
  44. package/core/meta/index.js +1 -2
  45. package/core/model/aggregate/aggregate.d.ts +3 -7
  46. package/core/model/aggregate/aggregate.js +2 -11
  47. package/core/model/aggregate/es-aggregate.d.ts +19 -29
  48. package/core/model/aggregate/es-aggregate.js +34 -66
  49. package/core/model/aggregate/state-aggregate.d.ts +6 -11
  50. package/core/model/aggregate/state-aggregate.js +10 -19
  51. package/core/model/entity/entity.d.ts +4 -7
  52. package/core/model/entity/entity.js +1 -1
  53. package/core/model/enum/enum.d.ts +3 -5
  54. package/core/model/enum/enum.js +4 -4
  55. package/core/model/event/event.d.ts +25 -0
  56. package/core/model/event/event.js +47 -0
  57. package/core/model/event/index.d.ts +1 -0
  58. package/core/{decorators/enum → model/event}/index.js +1 -1
  59. package/core/model/identified-model/identified-model.d.ts +3 -7
  60. package/core/model/identified-model/identified-model.js +2 -9
  61. package/core/model/index.d.ts +1 -1
  62. package/core/model/index.js +1 -1
  63. package/core/model/value-object/value-object.d.ts +5 -6
  64. package/core/model/value-object/value-object.js +7 -4
  65. package/{handling-event → event-handling}/decorators/subscribe-to-events.js +1 -1
  66. package/index.d.ts +1 -1
  67. package/index.js +1 -1
  68. package/package.json +1 -1
  69. package/base/meta/model-static-values.d.ts +0 -13
  70. package/base/meta/model-static-values.js +0 -54
  71. package/core/decorators/enum/index.d.ts +0 -1
  72. package/core/decorators/es-aggregate/handle.d.ts +0 -2
  73. package/core/decorators/es-aggregate/handle.js +0 -13
  74. package/core/decorators/es-aggregate/index.d.ts +0 -2
  75. package/core/decorators/es-aggregate/index.js +0 -18
  76. package/core/decorators/message/index.d.ts +0 -2
  77. package/core/decorators/message/index.js +0 -18
  78. package/core/decorators/message/is-command.d.ts +0 -4
  79. package/core/decorators/message/is-command.js +0 -12
  80. package/core/decorators/message/is-event.d.ts +0 -4
  81. package/core/meta/command.d.ts +0 -8
  82. package/core/meta/command.js +0 -27
  83. package/core/meta/es-aggregate/command-handler.d.ts +0 -7
  84. package/core/meta/es-aggregate/command-handler.js +0 -44
  85. package/core/meta/es-aggregate/index.d.ts +0 -2
  86. package/core/meta/es-aggregate/index.js +0 -18
  87. package/core/model/message/command.d.ts +0 -22
  88. package/core/model/message/command.js +0 -25
  89. package/core/model/message/event.d.ts +0 -30
  90. package/core/model/message/event.js +0 -29
  91. package/core/model/message/index.d.ts +0 -3
  92. package/core/model/message/index.js +0 -19
  93. package/core/model/message/message.d.ts +0 -27
  94. package/core/model/message/message.js +0 -59
  95. /package/core/decorators/{es-aggregate/when.d.ts → when.d.ts} +0 -0
  96. /package/{handling-event → event-handling}/decorators/index.d.ts +0 -0
  97. /package/{handling-event → event-handling}/decorators/index.js +0 -0
  98. /package/{handling-event → event-handling}/decorators/subscribe-to-events.d.ts +0 -0
  99. /package/{handling-event → event-handling}/event-dispatcher.d.ts +0 -0
  100. /package/{handling-event → event-handling}/event-dispatcher.js +0 -0
  101. /package/{handling-event → event-handling}/event-subscriber-registry.d.ts +0 -0
  102. /package/{handling-event → event-handling}/event-subscriber-registry.js +0 -0
  103. /package/{handling-event → event-handling}/event-subscriber.d.ts +0 -0
  104. /package/{handling-event → event-handling}/event-subscriber.js +0 -0
  105. /package/{handling-event → event-handling}/index.d.ts +0 -0
  106. /package/{handling-event → event-handling}/index.js +0 -0
  107. /package/{handling-event → event-handling}/interfaces/event-dispatcher.interface.d.ts +0 -0
  108. /package/{handling-event → event-handling}/interfaces/event-dispatcher.interface.js +0 -0
  109. /package/{handling-event → event-handling}/interfaces/event-subscriber-registry.interface.d.ts +0 -0
  110. /package/{handling-event → event-handling}/interfaces/event-subscriber-registry.interface.js +0 -0
  111. /package/{handling-event → event-handling}/interfaces/event-subscriber.interface.d.ts +0 -0
  112. /package/{handling-event → event-handling}/interfaces/event-subscriber.interface.js +0 -0
  113. /package/{handling-event → event-handling}/interfaces/index.d.ts +0 -0
  114. /package/{handling-event → event-handling}/interfaces/index.js +0 -0
@@ -1,27 +0,0 @@
1
- import { Class } from "type-fest";
2
- import { DomainModelClass, InferredProps, Props } from "../../../base";
3
- import { ClassStatic } from "../../../types";
4
- import { Id, IdentifiedModel } from "../identified-model";
5
- export type Timestamp = number;
6
- export type CausationId = string;
7
- export interface CorrelationIds {
8
- [type: string]: string | undefined;
9
- }
10
- export declare class Message<P extends Props> extends IdentifiedModel<P> {
11
- private _timestamp;
12
- private _causationId?;
13
- private _correlationIds;
14
- constructor(id: Id, timestamp: Timestamp, props: P, causationId?: CausationId, correlationIds?: CorrelationIds);
15
- props(): P;
16
- get timestamp(): number;
17
- get correlationIds(): CorrelationIds;
18
- get causationId(): string | undefined;
19
- setTimestamp(timestamp: number): void;
20
- setCausationId(causationId: string): void;
21
- setCorrelationId(type: string, correlationId: string): void;
22
- setCorrelationIds(correlationIds: CorrelationIds): void;
23
- mergeCorrelationIds(correlationIds: CorrelationIds): void;
24
- }
25
- export type AnyMessage = Message<Props>;
26
- export type MessageClass<T extends AnyMessage = AnyMessage, Arguments extends unknown[] = any[]> = DomainModelClass<T> & Class<T, Arguments> & ClassStatic<typeof Message<InferredProps<T>>>;
27
- export type MessageClassWithTypedConstructor<T extends AnyMessage = AnyMessage> = MessageClass<T, ConstructorParameters<typeof Message<InferredProps<T>>>>;
@@ -1,59 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.Message = void 0;
16
- const lodash_1 = __importDefault(require("lodash"));
17
- const base_1 = require("../../../base");
18
- const identified_model_1 = require("../identified-model");
19
- let Message = class Message extends identified_model_1.IdentifiedModel {
20
- constructor(id, timestamp, props, causationId, correlationIds) {
21
- super(id);
22
- this._timestamp = timestamp;
23
- this._causationId = causationId;
24
- this._correlationIds = correlationIds ?? {};
25
- this.initializeProps(props);
26
- }
27
- props() {
28
- return super.props();
29
- }
30
- get timestamp() {
31
- return this._timestamp;
32
- }
33
- get correlationIds() {
34
- return this._correlationIds;
35
- }
36
- get causationId() {
37
- return this._causationId;
38
- }
39
- setTimestamp(timestamp) {
40
- this._timestamp = timestamp;
41
- }
42
- setCausationId(causationId) {
43
- this._causationId = causationId;
44
- }
45
- setCorrelationId(type, correlationId) {
46
- this._correlationIds[type] = correlationId;
47
- }
48
- setCorrelationIds(correlationIds) {
49
- this._correlationIds = correlationIds;
50
- }
51
- mergeCorrelationIds(correlationIds) {
52
- this.setCorrelationIds(lodash_1.default.merge(this._correlationIds, correlationIds));
53
- }
54
- };
55
- exports.Message = Message;
56
- exports.Message = Message = __decorate([
57
- (0, base_1.Mutable)(false),
58
- __metadata("design:paramtypes", [String, Number, Object, String, Object])
59
- ], Message);
File without changes
File without changes