@hexaijs/plugin-contracts-generator 0.1.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 (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +337 -0
  3. package/dist/ast-utils.d.ts +6 -0
  4. package/dist/ast-utils.d.ts.map +1 -0
  5. package/dist/ast-utils.js +111 -0
  6. package/dist/ast-utils.js.map +1 -0
  7. package/dist/class-analyzer.d.ts +16 -0
  8. package/dist/class-analyzer.d.ts.map +1 -0
  9. package/dist/class-analyzer.js +155 -0
  10. package/dist/class-analyzer.js.map +1 -0
  11. package/dist/cli.d.ts +36 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +321 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/config-loader.d.ts +34 -0
  16. package/dist/config-loader.d.ts.map +1 -0
  17. package/dist/config-loader.js +188 -0
  18. package/dist/config-loader.js.map +1 -0
  19. package/dist/decorators/index.d.ts +143 -0
  20. package/dist/decorators/index.d.ts.map +1 -0
  21. package/dist/decorators/index.js +123 -0
  22. package/dist/decorators/index.js.map +1 -0
  23. package/dist/domain/index.d.ts +2 -0
  24. package/dist/domain/index.d.ts.map +1 -0
  25. package/dist/domain/index.js +18 -0
  26. package/dist/domain/index.js.map +1 -0
  27. package/dist/domain/types.d.ts +182 -0
  28. package/dist/domain/types.d.ts.map +1 -0
  29. package/dist/domain/types.js +65 -0
  30. package/dist/domain/types.js.map +1 -0
  31. package/dist/errors.d.ts +79 -0
  32. package/dist/errors.d.ts.map +1 -0
  33. package/dist/errors.js +138 -0
  34. package/dist/errors.js.map +1 -0
  35. package/dist/file-copier.d.ts +85 -0
  36. package/dist/file-copier.d.ts.map +1 -0
  37. package/dist/file-copier.js +773 -0
  38. package/dist/file-copier.js.map +1 -0
  39. package/dist/file-graph-resolver.d.ts +47 -0
  40. package/dist/file-graph-resolver.d.ts.map +1 -0
  41. package/dist/file-graph-resolver.js +230 -0
  42. package/dist/file-graph-resolver.js.map +1 -0
  43. package/dist/file-system.d.ts +26 -0
  44. package/dist/file-system.d.ts.map +1 -0
  45. package/dist/file-system.js +34 -0
  46. package/dist/file-system.js.map +1 -0
  47. package/dist/hexai-plugin.d.ts +16 -0
  48. package/dist/hexai-plugin.d.ts.map +1 -0
  49. package/dist/hexai-plugin.js +59 -0
  50. package/dist/hexai-plugin.js.map +1 -0
  51. package/dist/import-analyzer.d.ts +6 -0
  52. package/dist/import-analyzer.d.ts.map +1 -0
  53. package/dist/import-analyzer.js +77 -0
  54. package/dist/import-analyzer.js.map +1 -0
  55. package/dist/index.d.ts +58 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +97 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/logger.d.ts +21 -0
  60. package/dist/logger.d.ts.map +1 -0
  61. package/dist/logger.js +47 -0
  62. package/dist/logger.js.map +1 -0
  63. package/dist/parser.d.ts +32 -0
  64. package/dist/parser.d.ts.map +1 -0
  65. package/dist/parser.js +209 -0
  66. package/dist/parser.js.map +1 -0
  67. package/dist/pipeline.d.ts +56 -0
  68. package/dist/pipeline.d.ts.map +1 -0
  69. package/dist/pipeline.js +152 -0
  70. package/dist/pipeline.js.map +1 -0
  71. package/dist/reexport-generator.d.ts +81 -0
  72. package/dist/reexport-generator.d.ts.map +1 -0
  73. package/dist/reexport-generator.js +208 -0
  74. package/dist/reexport-generator.js.map +1 -0
  75. package/dist/registry-generator.d.ts +27 -0
  76. package/dist/registry-generator.d.ts.map +1 -0
  77. package/dist/registry-generator.js +108 -0
  78. package/dist/registry-generator.js.map +1 -0
  79. package/dist/runtime/index.d.ts +2 -0
  80. package/dist/runtime/index.d.ts.map +1 -0
  81. package/dist/runtime/index.js +6 -0
  82. package/dist/runtime/index.js.map +1 -0
  83. package/dist/runtime/message-registry.d.ts +23 -0
  84. package/dist/runtime/message-registry.d.ts.map +1 -0
  85. package/dist/runtime/message-registry.js +39 -0
  86. package/dist/runtime/message-registry.js.map +1 -0
  87. package/dist/scanner.d.ts +21 -0
  88. package/dist/scanner.d.ts.map +1 -0
  89. package/dist/scanner.js +53 -0
  90. package/dist/scanner.js.map +1 -0
  91. package/dist/test-utils.d.ts +23 -0
  92. package/dist/test-utils.d.ts.map +1 -0
  93. package/dist/test-utils.js +198 -0
  94. package/dist/test-utils.js.map +1 -0
  95. package/dist/tsconfig-loader.d.ts +8 -0
  96. package/dist/tsconfig-loader.d.ts.map +1 -0
  97. package/dist/tsconfig-loader.js +64 -0
  98. package/dist/tsconfig-loader.js.map +1 -0
  99. package/package.json +79 -0
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Decorators for marking Domain Events and Commands.
3
+ * These decorators have no runtime effect - the Message Parser
4
+ * statically analyzes source code to find and extract them.
5
+ */
6
+ import "reflect-metadata";
7
+ export interface PublicEventOptions {
8
+ /**
9
+ * Event version for versioned events
10
+ * @example @PublicEvent({ version: 2 })
11
+ */
12
+ version?: number;
13
+ /**
14
+ * Business context this event belongs to
15
+ * If not specified, inferred from package name
16
+ * @example @PublicEvent({ context: 'lecture' })
17
+ */
18
+ context?: string;
19
+ }
20
+ export interface PublicCommandOptions {
21
+ /**
22
+ * Business context this command belongs to
23
+ * If not specified, inferred from package name
24
+ * @example @PublicCommand({ context: 'auth' })
25
+ */
26
+ context?: string;
27
+ /**
28
+ * Explicit response type name for this command
29
+ * If specified, the parser will look for this type in the same file
30
+ * @example @PublicCommand({ response: 'CreateUserResult' })
31
+ */
32
+ response?: string;
33
+ }
34
+ export interface PublicQueryOptions {
35
+ /**
36
+ * Business context this query belongs to
37
+ * If not specified, inferred from package name
38
+ * @example @PublicQuery({ context: 'catalog' })
39
+ */
40
+ context?: string;
41
+ /**
42
+ * Explicit response type name for this query
43
+ * If specified, the parser will look for this type in the same file
44
+ * @example @PublicQuery({ response: 'UserProfile' })
45
+ */
46
+ response?: string;
47
+ }
48
+ export declare const PUBLIC_EVENT_METADATA: unique symbol;
49
+ export declare const PUBLIC_COMMAND_METADATA: unique symbol;
50
+ export declare const PUBLIC_QUERY_METADATA: unique symbol;
51
+ /**
52
+ * Marks a class as a Domain Event for extraction to public contracts
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * @PublicEvent()
57
+ * export class UserRegistered extends Message {
58
+ * constructor(
59
+ * public readonly userId: string,
60
+ * public readonly email: string,
61
+ * ) {
62
+ * super();
63
+ * }
64
+ * }
65
+ * ```
66
+ *
67
+ * @example With options
68
+ * ```typescript
69
+ * @PublicEvent({ version: 2, context: 'auth' })
70
+ * export class UserRegisteredV2 extends Message {
71
+ * // ...
72
+ * }
73
+ * ```
74
+ */
75
+ export declare function PublicEvent(options?: PublicEventOptions): ClassDecorator;
76
+ /**
77
+ * Marks a class as a Command for extraction to public contracts
78
+ *
79
+ * @example
80
+ * ```typescript
81
+ * @PublicCommand()
82
+ * export class CreateUser extends Request<CreateUserResult> {
83
+ * constructor(
84
+ * public readonly email: string,
85
+ * public readonly name: string,
86
+ * ) {
87
+ * super();
88
+ * }
89
+ * }
90
+ * ```
91
+ *
92
+ * @example With context option
93
+ * ```typescript
94
+ * @PublicCommand({ context: 'auth' })
95
+ * export class CreateUser extends Request<CreateUserResult> {
96
+ * // ...
97
+ * }
98
+ * ```
99
+ *
100
+ * @example With explicit response type
101
+ * ```typescript
102
+ * @PublicCommand({ response: 'DialogueCreatedResult' })
103
+ * export class BeginDialogueRequest extends Request<DialogueCreatedResult> {
104
+ * // ...
105
+ * }
106
+ * export type DialogueCreatedResult = { dialogueId: string };
107
+ * ```
108
+ */
109
+ export declare function PublicCommand(options?: PublicCommandOptions): ClassDecorator;
110
+ /**
111
+ * Marks a class as a Query for extraction to public contracts
112
+ *
113
+ * @example
114
+ * ```typescript
115
+ * @PublicQuery()
116
+ * export class GetUserProfile extends Request<UserProfile> {
117
+ * constructor(
118
+ * public readonly userId: string,
119
+ * ) {
120
+ * super();
121
+ * }
122
+ * }
123
+ * ```
124
+ *
125
+ * @example With context option
126
+ * ```typescript
127
+ * @PublicQuery({ context: 'catalog' })
128
+ * export class GetProductDetails extends Request<ProductDetails> {
129
+ * // ...
130
+ * }
131
+ * ```
132
+ *
133
+ * @example With explicit response type
134
+ * ```typescript
135
+ * @PublicQuery({ response: 'UserProfileResult' })
136
+ * export class GetUserProfile extends Request<UserProfileResult> {
137
+ * // ...
138
+ * }
139
+ * export type UserProfileResult = { name: string; email: string };
140
+ * ```
141
+ */
142
+ export declare function PublicQuery(options?: PublicQueryOptions): ClassDecorator;
143
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,qBAAqB,eAAwB,CAAC;AAC3D,eAAO,MAAM,uBAAuB,eAA0B,CAAC;AAC/D,eAAO,MAAM,qBAAqB,eAAwB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,cAAc,CAK5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,cAAc,CAKhF;AAGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,cAAc,CAK5E"}
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PUBLIC_QUERY_METADATA = exports.PUBLIC_COMMAND_METADATA = exports.PUBLIC_EVENT_METADATA = void 0;
4
+ exports.PublicEvent = PublicEvent;
5
+ exports.PublicCommand = PublicCommand;
6
+ exports.PublicQuery = PublicQuery;
7
+ /**
8
+ * Decorators for marking Domain Events and Commands.
9
+ * These decorators have no runtime effect - the Message Parser
10
+ * statically analyzes source code to find and extract them.
11
+ */
12
+ require("reflect-metadata");
13
+ exports.PUBLIC_EVENT_METADATA = Symbol('publicEvent');
14
+ exports.PUBLIC_COMMAND_METADATA = Symbol('publicCommand');
15
+ exports.PUBLIC_QUERY_METADATA = Symbol('publicQuery');
16
+ /**
17
+ * Marks a class as a Domain Event for extraction to public contracts
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * @PublicEvent()
22
+ * export class UserRegistered extends Message {
23
+ * constructor(
24
+ * public readonly userId: string,
25
+ * public readonly email: string,
26
+ * ) {
27
+ * super();
28
+ * }
29
+ * }
30
+ * ```
31
+ *
32
+ * @example With options
33
+ * ```typescript
34
+ * @PublicEvent({ version: 2, context: 'auth' })
35
+ * export class UserRegisteredV2 extends Message {
36
+ * // ...
37
+ * }
38
+ * ```
39
+ */
40
+ function PublicEvent(options = {}) {
41
+ return (target) => {
42
+ Reflect.defineMetadata(exports.PUBLIC_EVENT_METADATA, options, target);
43
+ return target;
44
+ };
45
+ }
46
+ /**
47
+ * Marks a class as a Command for extraction to public contracts
48
+ *
49
+ * @example
50
+ * ```typescript
51
+ * @PublicCommand()
52
+ * export class CreateUser extends Request<CreateUserResult> {
53
+ * constructor(
54
+ * public readonly email: string,
55
+ * public readonly name: string,
56
+ * ) {
57
+ * super();
58
+ * }
59
+ * }
60
+ * ```
61
+ *
62
+ * @example With context option
63
+ * ```typescript
64
+ * @PublicCommand({ context: 'auth' })
65
+ * export class CreateUser extends Request<CreateUserResult> {
66
+ * // ...
67
+ * }
68
+ * ```
69
+ *
70
+ * @example With explicit response type
71
+ * ```typescript
72
+ * @PublicCommand({ response: 'DialogueCreatedResult' })
73
+ * export class BeginDialogueRequest extends Request<DialogueCreatedResult> {
74
+ * // ...
75
+ * }
76
+ * export type DialogueCreatedResult = { dialogueId: string };
77
+ * ```
78
+ */
79
+ function PublicCommand(options = {}) {
80
+ return (target) => {
81
+ Reflect.defineMetadata(exports.PUBLIC_COMMAND_METADATA, options, target);
82
+ return target;
83
+ };
84
+ }
85
+ /**
86
+ * Marks a class as a Query for extraction to public contracts
87
+ *
88
+ * @example
89
+ * ```typescript
90
+ * @PublicQuery()
91
+ * export class GetUserProfile extends Request<UserProfile> {
92
+ * constructor(
93
+ * public readonly userId: string,
94
+ * ) {
95
+ * super();
96
+ * }
97
+ * }
98
+ * ```
99
+ *
100
+ * @example With context option
101
+ * ```typescript
102
+ * @PublicQuery({ context: 'catalog' })
103
+ * export class GetProductDetails extends Request<ProductDetails> {
104
+ * // ...
105
+ * }
106
+ * ```
107
+ *
108
+ * @example With explicit response type
109
+ * ```typescript
110
+ * @PublicQuery({ response: 'UserProfileResult' })
111
+ * export class GetUserProfile extends Request<UserProfileResult> {
112
+ * // ...
113
+ * }
114
+ * export type UserProfileResult = { name: string; email: string };
115
+ * ```
116
+ */
117
+ function PublicQuery(options = {}) {
118
+ return (target) => {
119
+ Reflect.defineMetadata(exports.PUBLIC_QUERY_METADATA, options, target);
120
+ return target;
121
+ };
122
+ }
123
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;AAmFA,kCAKC;AAmCD,sCAKC;AAmCD,kCAKC;AAxKD;;;;GAIG;AACH,4BAA0B;AAkDb,QAAA,qBAAqB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC9C,QAAA,uBAAuB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAClD,QAAA,qBAAqB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAgB,WAAW,CAAC,UAA8B,EAAE;IAC1D,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,OAAO,CAAC,cAAc,CAAC,6BAAqB,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAC/D,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,SAAgB,aAAa,CAAC,UAAgC,EAAE;IAC9D,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,OAAO,CAAC,cAAc,CAAC,+BAAuB,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QACjE,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,SAAgB,WAAW,CAAC,UAA8B,EAAE;IAC1D,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,OAAO,CAAC,cAAc,CAAC,6BAAqB,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAC/D,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./types";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
@@ -0,0 +1,182 @@
1
+ export interface SourceFile {
2
+ readonly absolutePath: string;
3
+ readonly relativePath: string;
4
+ readonly packageName?: string;
5
+ }
6
+ export type TypeRef = PrimitiveType | ArrayType | ObjectType | UnionType | IntersectionType | ReferenceType | LiteralType | TupleType | FunctionType;
7
+ export interface PrimitiveType {
8
+ readonly kind: 'primitive';
9
+ readonly name: 'string' | 'number' | 'boolean' | 'null' | 'undefined' | 'void' | 'any' | 'unknown' | 'never' | 'bigint' | 'symbol';
10
+ }
11
+ export interface ArrayType {
12
+ readonly kind: 'array';
13
+ readonly elementType: TypeRef;
14
+ }
15
+ export interface ObjectType {
16
+ readonly kind: 'object';
17
+ readonly fields: readonly Field[];
18
+ }
19
+ export interface UnionType {
20
+ readonly kind: 'union';
21
+ readonly types: readonly TypeRef[];
22
+ }
23
+ export interface IntersectionType {
24
+ readonly kind: 'intersection';
25
+ readonly types: readonly TypeRef[];
26
+ }
27
+ export interface ReferenceType {
28
+ readonly kind: 'reference';
29
+ readonly name: string;
30
+ readonly typeArguments?: readonly TypeRef[];
31
+ }
32
+ export interface LiteralType {
33
+ readonly kind: 'literal';
34
+ readonly value: string | number | boolean;
35
+ }
36
+ export interface TupleType {
37
+ readonly kind: 'tuple';
38
+ readonly elements: readonly TypeRef[];
39
+ }
40
+ export interface FunctionType {
41
+ readonly kind: 'function';
42
+ readonly parameters: readonly FunctionParameter[];
43
+ readonly returnType: TypeRef;
44
+ }
45
+ export interface FunctionParameter {
46
+ readonly name: string;
47
+ readonly type: TypeRef;
48
+ readonly optional: boolean;
49
+ }
50
+ export interface Field {
51
+ readonly name: string;
52
+ readonly type: TypeRef;
53
+ readonly optional: boolean;
54
+ readonly readonly: boolean;
55
+ }
56
+ export type TypeDefinitionKind = 'interface' | 'type' | 'enum' | 'class';
57
+ export interface TypeDefinition {
58
+ readonly name: string;
59
+ readonly kind: TypeDefinitionKind;
60
+ readonly sourceFile: SourceFile;
61
+ readonly body: TypeRef;
62
+ readonly typeParameters?: readonly string[];
63
+ readonly exported: boolean;
64
+ }
65
+ export interface EnumMember {
66
+ readonly name: string;
67
+ readonly value?: string | number;
68
+ }
69
+ export interface EnumDefinition extends Omit<TypeDefinition, 'kind' | 'body'> {
70
+ readonly kind: 'enum';
71
+ readonly members: readonly EnumMember[];
72
+ }
73
+ export interface ClassImport {
74
+ readonly names: readonly string[];
75
+ readonly source: string;
76
+ readonly isTypeOnly: boolean;
77
+ readonly isExternal: boolean;
78
+ }
79
+ export interface ClassDefinition {
80
+ readonly name: string;
81
+ readonly kind: 'class';
82
+ readonly sourceFile: SourceFile;
83
+ readonly sourceText: string;
84
+ readonly imports: readonly ClassImport[];
85
+ readonly dependencies: readonly string[];
86
+ readonly baseClass?: string;
87
+ readonly exported: boolean;
88
+ }
89
+ export interface MessageBase {
90
+ readonly name: string;
91
+ readonly sourceFile: SourceFile;
92
+ readonly fields: readonly Field[];
93
+ readonly baseClass?: string;
94
+ readonly sourceText: string;
95
+ readonly imports: readonly ClassImport[];
96
+ }
97
+ export interface DomainEvent extends MessageBase {
98
+ readonly messageType: 'event';
99
+ readonly version?: number;
100
+ readonly context?: string;
101
+ readonly payloadType?: TypeRef;
102
+ }
103
+ export interface Command extends MessageBase {
104
+ readonly messageType: 'command';
105
+ readonly resultType?: TypeRef;
106
+ readonly context?: string;
107
+ readonly payloadType?: TypeRef;
108
+ }
109
+ export interface Query extends MessageBase {
110
+ readonly messageType: 'query';
111
+ readonly resultType?: TypeRef;
112
+ readonly context?: string;
113
+ readonly payloadType?: TypeRef;
114
+ }
115
+ export type Message = DomainEvent | Command | Query;
116
+ /** Used to filter which decorators the scanner should look for. */
117
+ export type MessageType = Message['messageType'];
118
+ export type ImportSource = {
119
+ readonly type: 'local';
120
+ readonly path: string;
121
+ } | {
122
+ readonly type: 'external';
123
+ readonly package: string;
124
+ };
125
+ export type DependencyKind = 'type' | 'value' | 'class';
126
+ export interface Dependency {
127
+ readonly name: string;
128
+ readonly source: ImportSource;
129
+ readonly kind: DependencyKind;
130
+ readonly definition?: TypeDefinition;
131
+ }
132
+ export interface SourceLocation {
133
+ readonly file: string;
134
+ readonly message: string;
135
+ readonly line?: number;
136
+ readonly column?: number;
137
+ }
138
+ export type ExtractionError = SourceLocation;
139
+ export type ExtractionWarning = SourceLocation;
140
+ export interface ExtractionResult {
141
+ readonly events: readonly DomainEvent[];
142
+ readonly commands: readonly Command[];
143
+ readonly types: readonly TypeDefinition[];
144
+ readonly dependencies: readonly Dependency[];
145
+ readonly errors: readonly ExtractionError[];
146
+ readonly warnings: readonly ExtractionWarning[];
147
+ }
148
+ /** Customizes decorator names used to identify public messages. Unspecified names use defaults. */
149
+ export interface DecoratorNames {
150
+ event?: string;
151
+ command?: string;
152
+ query?: string;
153
+ }
154
+ export declare const DEFAULT_DECORATOR_NAMES: Required<DecoratorNames>;
155
+ /** Merges partial decorator names with defaults for backward compatibility. */
156
+ export declare function mergeDecoratorNames(partial?: DecoratorNames): Required<DecoratorNames>;
157
+ export interface ResponseNamingConvention {
158
+ readonly messageSuffix: string;
159
+ readonly responseSuffix: string;
160
+ }
161
+ export interface Config {
162
+ readonly sourceDir: string;
163
+ readonly outputDir: string;
164
+ readonly include?: readonly string[];
165
+ readonly exclude?: readonly string[];
166
+ readonly externalPackages?: Readonly<Record<string, string>>;
167
+ readonly decoratorNames?: DecoratorNames;
168
+ readonly responseNamingConventions?: readonly ResponseNamingConvention[];
169
+ }
170
+ export declare function isPrimitiveType(type: TypeRef): type is PrimitiveType;
171
+ export declare function isArrayType(type: TypeRef): type is ArrayType;
172
+ export declare function isObjectType(type: TypeRef): type is ObjectType;
173
+ export declare function isUnionType(type: TypeRef): type is UnionType;
174
+ export declare function isIntersectionType(type: TypeRef): type is IntersectionType;
175
+ export declare function isReferenceType(type: TypeRef): type is ReferenceType;
176
+ export declare function isLiteralType(type: TypeRef): type is LiteralType;
177
+ export declare function isTupleType(type: TypeRef): type is TupleType;
178
+ export declare function isFunctionType(type: TypeRef): type is FunctionType;
179
+ export declare function isDomainEvent(message: Message): message is DomainEvent;
180
+ export declare function isCommand(message: Message): message is Command;
181
+ export declare function isQuery(message: Message): message is Query;
182
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/domain/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,MAAM,OAAO,GACf,aAAa,GACb,SAAS,GACT,UAAU,GACV,SAAS,GACT,gBAAgB,GAChB,aAAa,GACb,WAAW,GACX,SAAS,GACT,YAAY,CAAC;AAEjB,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,EACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,MAAM,GACN,WAAW,GACX,MAAM,GACN,KAAK,GACL,SAAS,GACT,OAAO,GACP,QAAQ,GACR,QAAQ,CAAC;CACd;AAED,MAAM,W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,aAAa,CAEpE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,SAAS,CAE5D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,UAAU,CAE9D;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,SAAS,CAE5D;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,gBAAgB,CAE1E;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,aAAa,CAEpE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,WAAW,CAEhE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,SAAS,CAE5D;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,YAAY,CAElE;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,WAAW,CAEtE;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,OAAO,CAE9D;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,KAAK,CAE1D"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_DECORATOR_NAMES = void 0;
4
+ exports.mergeDecoratorNames = mergeDecoratorNames;
5
+ exports.isPrimitiveType = isPrimitiveType;
6
+ exports.isArrayType = isArrayType;
7
+ exports.isObjectType = isObjectType;
8
+ exports.isUnionType = isUnionType;
9
+ exports.isIntersectionType = isIntersectionType;
10
+ exports.isReferenceType = isReferenceType;
11
+ exports.isLiteralType = isLiteralType;
12
+ exports.isTupleType = isTupleType;
13
+ exports.isFunctionType = isFunctionType;
14
+ exports.isDomainEvent = isDomainEvent;
15
+ exports.isCommand = isCommand;
16
+ exports.isQuery = isQuery;
17
+ exports.DEFAULT_DECORATOR_NAMES = {
18
+ event: "PublicEvent",
19
+ command: "PublicCommand",
20
+ query: "PublicQuery",
21
+ };
22
+ /** Merges partial decorator names with defaults for backward compatibility. */
23
+ function mergeDecoratorNames(partial) {
24
+ return {
25
+ ...exports.DEFAULT_DECORATOR_NAMES,
26
+ ...partial,
27
+ };
28
+ }
29
+ function isPrimitiveType(type) {
30
+ return type.kind === 'primitive';
31
+ }
32
+ function isArrayType(type) {
33
+ return type.kind === 'array';
34
+ }
35
+ function isObjectType(type) {
36
+ return type.kind === 'object';
37
+ }
38
+ function isUnionType(type) {
39
+ return type.kind === 'union';
40
+ }
41
+ function isIntersectionType(type) {
42
+ return type.kind === 'intersection';
43
+ }
44
+ function isReferenceType(type) {
45
+ return type.kind === 'reference';
46
+ }
47
+ function isLiteralType(type) {
48
+ return type.kind === 'literal';
49
+ }
50
+ function isTupleType(type) {
51
+ return type.kind === 'tuple';
52
+ }
53
+ function isFunctionType(type) {
54
+ return type.kind === 'function';
55
+ }
56
+ function isDomainEvent(message) {
57
+ return message.messageType === 'event';
58
+ }
59
+ function isCommand(message) {
60
+ return message.messageType === 'command';
61
+ }
62
+ function isQuery(message) {
63
+ return message.messageType === 'query';
64
+ }
65
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/domain/types.ts"],"names":[],"mappings":";;;AAgNA,kDAKC;AAiBD,0CAEC;AAED,kCAEC;AAED,oCAEC;AAED,kCAEC;AAED,gDAEC;AAED,0CAEC;AAED,sCAEC;AAED,kCAEC;AAED,wCAEC;AAED,sCAEC;AAED,8BAEC;AAED,0BAEC;AA3EY,QAAA,uBAAuB,GAA6B;IAC/D,KAAK,EAAE,aAAa;IACpB,OAAO,EAAE,eAAe;IACxB,KAAK,EAAE,aAAa;CACrB,CAAC;AAEF,+EAA+E;AAC/E,S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/**
2
+ * Base error class for all contracts-generator errors.
3
+ * Allows catching all library errors with `instanceof MessageParserError`.
4
+ */
5
+ export declare class MessageParserError extends Error {
6
+ constructor(message: string, options?: ErrorOptions);
7
+ }
8
+ /**
9
+ * Base class for configuration-related errors.
10
+ */
11
+ export declare class ConfigurationError extends MessageParserError {
12
+ constructor(message: string, options?: ErrorOptions);
13
+ }
14
+ /**
15
+ * Error thrown when loading application.config.ts fails.
16
+ */
17
+ export declare class ConfigLoadError extends ConfigurationError {
18
+ constructor(message: string, options?: ErrorOptions);
19
+ }
20
+ /**
21
+ * Error thrown when loading tsconfig.json fails.
22
+ */
23
+ export declare class TsconfigLoadError extends ConfigurationError {
24
+ readonly tsconfigPath: string;
25
+ constructor(message: string, tsconfigPath: string, options?: ErrorOptions);
26
+ }
27
+ /**
28
+ * Base class for file system operation errors.
29
+ */
30
+ export declare class FileSystemError extends MessageParserError {
31
+ readonly path: string;
32
+ constructor(message: string, path: string, options?: ErrorOptions);
33
+ }
34
+ /**
35
+ * Error thrown when a required file is not found.
36
+ */
37
+ export declare class FileNotFoundError extends FileSystemError {
38
+ constructor(path: string, options?: ErrorOptions);
39
+ }
40
+ /**
41
+ * Error thrown when reading a file fails.
42
+ */
43
+ export declare class FileReadError extends FileSystemError {
44
+ constructor(path: string, options?: ErrorOptions);
45
+ }
46
+ /**
47
+ * Error thrown when writing a file fails.
48
+ */
49
+ export declare class FileWriteError extends FileSystemError {
50
+ constructor(path: string, options?: ErrorOptions);
51
+ }
52
+ /**
53
+ * Base class for parsing errors.
54
+ */
55
+ export declare class ParseError extends MessageParserError {
56
+ constructor(message: string, options?: ErrorOptions);
57
+ }
58
+ /**
59
+ * Error thrown when JSON parsing fails.
60
+ */
61
+ export declare class JsonParseError extends ParseError {
62
+ readonly filePath?: string;
63
+ constructor(message: string, filePath?: string, options?: ErrorOptions);
64
+ }
65
+ /**
66
+ * Base class for module/path resolution errors.
67
+ */
68
+ export declare class ResolutionError extends MessageParserError {
69
+ constructor(message: string, options?: ErrorOptions);
70
+ }
71
+ /**
72
+ * Error thrown when module resolution fails.
73
+ */
74
+ export declare class ModuleResolutionError extends ResolutionError {
75
+ readonly moduleSpecifier: string;
76
+ readonly fromFile: string;
77
+ constructor(moduleSpecifier: string, fromFile: string, options?: ErrorOptions);
78
+ }
79
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAItD;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,kBAAkB;gBAC1C,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAItD;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,kBAAkB;gBACvC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAItD;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,kBAAkB;IACrD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;gBAElB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAK5E;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,kBAAkB;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAKpE;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;gBACtC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAInD;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,eAAe;gBAClC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAInD;AAED;;GAEG;AACH,qBAAa,cAAe,S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