@hazeljs/core 0.2.0-beta.26 → 0.2.0-beta.28
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/LICENSE +192 -21
- package/README.md +2 -2
- package/dist/hazel-app.d.ts.map +1 -1
- package/dist/hazel-app.js +6 -5
- package/dist/hazel-module.d.ts.map +1 -1
- package/dist/hazel-module.js +44 -19
- package/dist/hazel-response.d.ts +3 -0
- package/dist/hazel-response.d.ts.map +1 -1
- package/dist/hazel-response.js +10 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +33 -16
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +4 -0
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,21 +1,192 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2024 HazelJS Team
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
22
|
+
|
|
23
|
+
1. Definitions.
|
|
24
|
+
|
|
25
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
26
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
27
|
+
|
|
28
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
29
|
+
the copyright owner that is granting the License.
|
|
30
|
+
|
|
31
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
32
|
+
other entities that control, are controlled by, or are under common
|
|
33
|
+
control with that entity. For the purposes of this definition,
|
|
34
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
35
|
+
direction or management of such entity, whether by contract or
|
|
36
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
37
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
38
|
+
|
|
39
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
40
|
+
exercising permissions granted by this License.
|
|
41
|
+
|
|
42
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
43
|
+
including but not limited to software source code, documentation
|
|
44
|
+
source, and configuration files.
|
|
45
|
+
|
|
46
|
+
"Object" form shall mean any form resulting from mechanical
|
|
47
|
+
transformation or translation of a Source form, including but
|
|
48
|
+
not limited to compiled object code, generated documentation,
|
|
49
|
+
and conversions to other media types.
|
|
50
|
+
|
|
51
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
52
|
+
Object form, made available under the License, as indicated by a
|
|
53
|
+
copyright notice that is included in or attached to the work
|
|
54
|
+
(an example is provided in the Appendix below).
|
|
55
|
+
|
|
56
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
57
|
+
form, that is based on (or derived from) the Work and for which the
|
|
58
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
59
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
60
|
+
of this License, Derivative Works shall not include works that remain
|
|
61
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
62
|
+
the Work and Derivative Works thereof.
|
|
63
|
+
|
|
64
|
+
"Contribution" shall mean any work of authorship, including
|
|
65
|
+
the original version of the Work and any modifications or additions
|
|
66
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
67
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
68
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
69
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
70
|
+
means any form of electronic, verbal, or written communication sent
|
|
71
|
+
to the Licensor or its representatives, including but not limited to
|
|
72
|
+
communication on electronic mailing lists, source code control systems,
|
|
73
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
74
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
75
|
+
excluding communication that is conspicuously marked or otherwise
|
|
76
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
77
|
+
|
|
78
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
79
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
80
|
+
subsequently incorporated within the Work.
|
|
81
|
+
|
|
82
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
83
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
84
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
85
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
86
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
87
|
+
Work and such Derivative Works in Source or Object form.
|
|
88
|
+
|
|
89
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
90
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
91
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
92
|
+
(except as stated in this section) patent license to make, have made,
|
|
93
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
94
|
+
where such license applies only to those patent claims licensable
|
|
95
|
+
by such Contributor that are necessarily infringed by their
|
|
96
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
97
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
98
|
+
institute patent litigation against any entity (including a
|
|
99
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
100
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
101
|
+
or contributory patent infringement, then any patent licenses
|
|
102
|
+
granted to You under this License for that Work shall terminate
|
|
103
|
+
as of the date such litigation is filed.
|
|
104
|
+
|
|
105
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
106
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
107
|
+
modifications, and in Source or Object form, provided that You
|
|
108
|
+
meet the following conditions:
|
|
109
|
+
|
|
110
|
+
(a) You must give any other recipients of the Work or
|
|
111
|
+
Derivative Works a copy of this License; and
|
|
112
|
+
|
|
113
|
+
(b) You must cause any modified files to carry prominent notices
|
|
114
|
+
stating that You changed the files; and
|
|
115
|
+
|
|
116
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
117
|
+
that You distribute, all copyright, patent, trademark, and
|
|
118
|
+
attribution notices from the Source form of the Work,
|
|
119
|
+
excluding those notices that do not pertain to any part of
|
|
120
|
+
the Derivative Works; and
|
|
121
|
+
|
|
122
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
123
|
+
distribution, then any Derivative Works that You distribute must
|
|
124
|
+
include a readable copy of the attribution notices contained
|
|
125
|
+
within such NOTICE file, excluding those notices that do not
|
|
126
|
+
pertain to any part of the Derivative Works, in at least one
|
|
127
|
+
of the following places: within a NOTICE text file distributed
|
|
128
|
+
as part of the Derivative Works; within the Source form or
|
|
129
|
+
documentation, if provided along with the Derivative Works; or,
|
|
130
|
+
within a display generated by the Derivative Works, if and
|
|
131
|
+
wherever such third-party notices normally appear. The contents
|
|
132
|
+
of the NOTICE file are for informational purposes only and
|
|
133
|
+
do not modify the License. You may add Your own attribution
|
|
134
|
+
notices within Derivative Works that You distribute, alongside
|
|
135
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
136
|
+
that such additional attribution notices cannot be construed
|
|
137
|
+
as modifying the License.
|
|
138
|
+
|
|
139
|
+
You may add Your own copyright statement to Your modifications and
|
|
140
|
+
may provide additional or different license terms and conditions
|
|
141
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
142
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
143
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
144
|
+
the conditions stated in this License.
|
|
145
|
+
|
|
146
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
147
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
148
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
149
|
+
this License, without any additional terms or conditions.
|
|
150
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
151
|
+
the terms of any separate license agreement you may have executed
|
|
152
|
+
with Licensor regarding such Contributions.
|
|
153
|
+
|
|
154
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
155
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
156
|
+
except as required for reasonable and customary use in describing the
|
|
157
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
158
|
+
|
|
159
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
160
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
161
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
162
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
163
|
+
implied, including, without limitation, any warranties or conditions
|
|
164
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
165
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
166
|
+
appropriateness of using or redistributing the Work and assume any
|
|
167
|
+
risks associated with Your exercise of permissions under this License.
|
|
168
|
+
|
|
169
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
170
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
171
|
+
unless required by applicable law (such as deliberate and grossly
|
|
172
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
173
|
+
liable to You for damages, including any direct, indirect, special,
|
|
174
|
+
incidental, or consequential damages of any character arising as a
|
|
175
|
+
result of this License or out of the use or inability to use the
|
|
176
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
177
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
178
|
+
other commercial damages or losses), even if such Contributor
|
|
179
|
+
has been advised of the possibility of such damages.
|
|
180
|
+
|
|
181
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
182
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
183
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
184
|
+
or other liability obligations and/or rights consistent with this
|
|
185
|
+
License. However, in accepting such obligations, You may act only
|
|
186
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
187
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
188
|
+
defend, and hold each Contributor harmless for any liability
|
|
189
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
190
|
+
of your accepting any such warranty or additional liability.
|
|
191
|
+
|
|
192
|
+
END OF TERMS AND CONDITIONS
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
The foundation of the HazelJS framework, providing enterprise-grade dependency injection, decorator-based routing, middleware support, and production-ready features.
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@hazeljs/core)
|
|
8
|
-
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
9
9
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
@@ -512,7 +512,7 @@ Contributions are welcome! Please read our [Contributing Guide](../../CONTRIBUTI
|
|
|
512
512
|
|
|
513
513
|
## License
|
|
514
514
|
|
|
515
|
-
|
|
515
|
+
Apache 2.0 © [HazelJS](https://hazeljs.com)
|
|
516
516
|
|
|
517
517
|
## Links
|
|
518
518
|
|
package/dist/hazel-app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hazel-app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EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAIxG;;OAEG;IACH,mBAAmB,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,OAAO,CAAC;YAAE,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE,CAAC,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAIrN;;OAEG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI;IAMlE;;OAEG;IACH,UAAU,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI;IAMvC;;OAEG;IACH,WAAW,IAAI,IAAI;IAMnB;;OAEG;IACH,gBAAgB,IAAI,kBAAkB;IAItC;;OAEG;IACH,kBAAkB,IAAI,eAAe;IAIrC,YAAY,IAAI,SAAS;IAIzB,SAAS,IAAI,MAAM;CAGpB"}
|
package/dist/hazel-app.js
CHANGED
|
@@ -94,7 +94,7 @@ class HazelApp {
|
|
|
94
94
|
if (visited.has(moduleType))
|
|
95
95
|
return [];
|
|
96
96
|
visited.add(moduleType);
|
|
97
|
-
const metadata =
|
|
97
|
+
const metadata = (0, hazel_module_1.getModuleMetadata)(moduleType) || {};
|
|
98
98
|
const controllers = [];
|
|
99
99
|
// Collect from imported modules first
|
|
100
100
|
if (metadata.imports) {
|
|
@@ -160,7 +160,7 @@ class HazelApp {
|
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
162
|
const { method, url, headers } = req;
|
|
163
|
-
logger_1.default.
|
|
163
|
+
logger_1.default.debug('Incoming request:', { method, url, headers });
|
|
164
164
|
// Handle CORS
|
|
165
165
|
if (this.corsEnabled) {
|
|
166
166
|
const origin = headers['origin'] || '*';
|
|
@@ -183,9 +183,11 @@ class HazelApp {
|
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
// Parse request body for POST/PUT/PATCH requests
|
|
186
|
+
// Parse request body for POST/PUT/PATCH requests (skip multipart - let route handle it)
|
|
187
187
|
let body = undefined;
|
|
188
|
-
|
|
188
|
+
const contentType = headers['content-type'] || '';
|
|
189
|
+
const isMultipart = contentType.includes('multipart/form-data');
|
|
190
|
+
if ((method === 'POST' || method === 'PUT' || method === 'PATCH') && !isMultipart) {
|
|
189
191
|
try {
|
|
190
192
|
const chunks = [];
|
|
191
193
|
req.on('data', (chunk) => chunks.push(chunk));
|
|
@@ -194,7 +196,6 @@ class HazelApp {
|
|
|
194
196
|
try {
|
|
195
197
|
const bodyStr = Buffer.concat(chunks).toString();
|
|
196
198
|
if (bodyStr) {
|
|
197
|
-
const contentType = headers['content-type'] || '';
|
|
198
199
|
if (contentType.includes('application/json')) {
|
|
199
200
|
body = JSON.parse(bodyStr);
|
|
200
201
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hazel-module.d.ts","sourceRoot":"","sources":["../src/hazel-module.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAS,MAAM,aAAa,CAAC;AAM/C,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,CAIlE;AAGD,eAAO,MAAM,MAAM,oBAAc,CAAC;AAElC,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"hazel-module.d.ts","sourceRoot":"","sources":["../src/hazel-module.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAS,MAAM,aAAa,CAAC;AAM/C,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,CAIlE;AAGD,eAAO,MAAM,MAAM,oBAAc,CAAC;AAElC,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAa3E;AAED,qBAAa,mBAAmB;IAGlB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAFvC,OAAO,CAAC,SAAS,CAAY;gBAEA,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC;IAOtD,OAAO,CAAC,UAAU;IA0GlB,YAAY,IAAI,SAAS;CAG1B"}
|
package/dist/hazel-module.js
CHANGED
|
@@ -19,45 +19,77 @@ function HazelModule(options) {
|
|
|
19
19
|
// Alias for backward compatibility
|
|
20
20
|
exports.Module = HazelModule;
|
|
21
21
|
function getModuleMetadata(target) {
|
|
22
|
-
|
|
22
|
+
const fromDecorator = Reflect.getMetadata(MODULE_METADATA_KEY, target);
|
|
23
|
+
if (fromDecorator)
|
|
24
|
+
return fromDecorator;
|
|
25
|
+
// Support dynamic modules: { module, providers?, controllers?, imports? }
|
|
26
|
+
if (target && typeof target === 'object' && 'module' in target) {
|
|
27
|
+
const dyn = target;
|
|
28
|
+
return {
|
|
29
|
+
providers: dyn.providers,
|
|
30
|
+
controllers: dyn.controllers,
|
|
31
|
+
imports: dyn.imports,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
23
35
|
}
|
|
24
36
|
class HazelModuleInstance {
|
|
25
37
|
constructor(moduleType) {
|
|
26
38
|
this.moduleType = moduleType;
|
|
27
|
-
|
|
39
|
+
const name = moduleType?.name ?? moduleType?.module?.name ?? 'DynamicModule';
|
|
40
|
+
logger_1.default.debug(`Initializing HazelModule: ${name}`);
|
|
28
41
|
this.container = container_1.Container.getInstance();
|
|
29
42
|
this.initialize();
|
|
30
43
|
}
|
|
31
44
|
initialize() {
|
|
32
45
|
const metadata = getModuleMetadata(this.moduleType) || {};
|
|
33
46
|
logger_1.default.debug('Module metadata:', metadata);
|
|
47
|
+
// Initialize imported modules first (so their providers are available)
|
|
48
|
+
if (metadata.imports) {
|
|
49
|
+
logger_1.default.debug('Initializing imported modules:', metadata.imports.map((m) => (m && typeof m === 'object' && 'module' in m ? m.module?.name : m?.name)));
|
|
50
|
+
metadata.imports.forEach((moduleType) => {
|
|
51
|
+
new HazelModuleInstance(moduleType);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
34
54
|
// Register providers
|
|
35
55
|
if (metadata.providers) {
|
|
36
|
-
logger_1.default.debug('Registering providers:', metadata.providers.map((p) => p.name));
|
|
56
|
+
logger_1.default.debug('Registering providers:', metadata.providers.map((p) => (p && typeof p === 'object' && 'provide' in p ? p.provide : p?.name)));
|
|
37
57
|
metadata.providers.forEach((provider) => {
|
|
38
|
-
|
|
58
|
+
// Dynamic module provider: { provide, useFactory?, useClass?, useValue? } (NestJS-style)
|
|
59
|
+
if (provider && typeof provider === 'object' && ('provide' in provider || 'token' in provider)) {
|
|
60
|
+
const p = provider;
|
|
61
|
+
const token = p.token ?? p.provide;
|
|
62
|
+
logger_1.default.debug(`Registering provider config for: ${token}`);
|
|
63
|
+
this.container.registerProvider({
|
|
64
|
+
token,
|
|
65
|
+
useFactory: p.useFactory,
|
|
66
|
+
useClass: p.useClass,
|
|
67
|
+
useValue: p.useValue,
|
|
68
|
+
inject: p.inject,
|
|
69
|
+
});
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const cls = provider;
|
|
73
|
+
logger_1.default.debug(`Registering provider: ${cls?.name}`);
|
|
39
74
|
// Check if provider is request-scoped
|
|
40
|
-
const scope = Reflect.getMetadata('hazel:scope',
|
|
75
|
+
const scope = Reflect.getMetadata('hazel:scope', cls);
|
|
41
76
|
if (scope === 'request') {
|
|
42
77
|
// Don't eagerly resolve request-scoped providers
|
|
43
|
-
// They will be resolved per-request by the container
|
|
44
|
-
logger_1.default.debug(`Skipping eager resolution for request-scoped provider: ${provider.name}`);
|
|
45
|
-
// Just register the class itself, not an instance
|
|
46
78
|
this.container.registerProvider({
|
|
47
|
-
token:
|
|
48
|
-
useClass:
|
|
79
|
+
token: cls,
|
|
80
|
+
useClass: cls,
|
|
49
81
|
scope: container_1.Scope.REQUEST,
|
|
50
82
|
});
|
|
51
83
|
}
|
|
52
84
|
else {
|
|
53
85
|
// Eagerly resolve singleton and transient providers
|
|
54
|
-
this.container.register(
|
|
86
|
+
this.container.register(cls, this.container.resolve(cls));
|
|
55
87
|
}
|
|
56
88
|
});
|
|
57
89
|
}
|
|
58
90
|
// Register controllers
|
|
59
91
|
if (metadata.controllers) {
|
|
60
|
-
logger_1.default.debug('Registering controllers:', metadata.controllers.map((c) => c
|
|
92
|
+
logger_1.default.debug('Registering controllers:', metadata.controllers.map((c) => c?.name));
|
|
61
93
|
metadata.controllers.forEach((controller) => {
|
|
62
94
|
logger_1.default.debug(`Registering controller: ${controller.name}`);
|
|
63
95
|
// Check if controller has request-scoped dependencies
|
|
@@ -94,13 +126,6 @@ class HazelModuleInstance {
|
|
|
94
126
|
});
|
|
95
127
|
});
|
|
96
128
|
}
|
|
97
|
-
// Initialize imported modules
|
|
98
|
-
if (metadata.imports) {
|
|
99
|
-
logger_1.default.debug('Initializing imported modules:', metadata.imports.map((m) => m.name));
|
|
100
|
-
metadata.imports.forEach((moduleType) => {
|
|
101
|
-
new HazelModuleInstance(moduleType);
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
129
|
}
|
|
105
130
|
getContainer() {
|
|
106
131
|
return this.container;
|
package/dist/hazel-response.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export interface HazelResponse {
|
|
|
5
5
|
end(): void;
|
|
6
6
|
status(code: number): HazelResponse;
|
|
7
7
|
json(data: unknown): void;
|
|
8
|
+
/** Send a Buffer as binary (e.g. audio, PDF). Sets Content-Type if provided. */
|
|
9
|
+
sendBuffer?(buffer: Buffer, contentType?: string): void;
|
|
8
10
|
}
|
|
9
11
|
export declare class HazelExpressResponse implements HazelResponse {
|
|
10
12
|
private res;
|
|
@@ -15,6 +17,7 @@ export declare class HazelExpressResponse implements HazelResponse {
|
|
|
15
17
|
write(chunk: string): void;
|
|
16
18
|
end(): void;
|
|
17
19
|
status(code: number): HazelResponse;
|
|
20
|
+
sendBuffer(buffer: Buffer, contentType?: string): void;
|
|
18
21
|
json(data: unknown): void;
|
|
19
22
|
}
|
|
20
23
|
//# sourceMappingURL=hazel-response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hazel-response.d.ts","sourceRoot":"","sources":["../src/hazel-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAA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|
package/dist/hazel-response.js
CHANGED
|
@@ -35,6 +35,16 @@ class HazelExpressResponse {
|
|
|
35
35
|
}
|
|
36
36
|
return this;
|
|
37
37
|
}
|
|
38
|
+
sendBuffer(buffer, contentType) {
|
|
39
|
+
if (this.isStreaming || this.headersSent) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (contentType) {
|
|
43
|
+
this.res.setHeader('Content-Type', contentType);
|
|
44
|
+
}
|
|
45
|
+
this.res.send(buffer);
|
|
46
|
+
this.headersSent = true;
|
|
47
|
+
}
|
|
38
48
|
json(data) {
|
|
39
49
|
if (this.isStreaming || this.headersSent) {
|
|
40
50
|
return; // Don't try to send JSON if we're already streaming or headers are sent
|
package/dist/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAK9B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAK9B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAmQvD,eAAO,MAAM,aAAa,GACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,MAAM,MAAM,IAAI,KACf,IAuBF,CAAC;AAQF,QAAA,MAAM,cAAc;0BALO,OAAO;CAOhC,CAAC;AAGH,eAAe,cAAc,CAAC"}
|
package/dist/logger.js
CHANGED
|
@@ -13,8 +13,10 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
13
13
|
dotenv_1.default.config();
|
|
14
14
|
const logLevel = process.env.LOG_LEVEL || 'info';
|
|
15
15
|
const logDir = process.env.LOG_DIR || 'logs';
|
|
16
|
+
const logEnabled = process.env.LOG_ENABLED !== 'false'; // default: true
|
|
17
|
+
const logPackage = process.env.LOG_PACKAGE || ''; // e.g. "http" = only HTTP request logs
|
|
16
18
|
// Ensure log directory exists
|
|
17
|
-
if (!fs_1.default.existsSync(logDir)) {
|
|
19
|
+
if (logDir && !fs_1.default.existsSync(logDir)) {
|
|
18
20
|
fs_1.default.mkdirSync(logDir, { recursive: true });
|
|
19
21
|
}
|
|
20
22
|
// Professional color scheme for different log levels
|
|
@@ -151,17 +153,25 @@ const customFormat = winston_1.default.format.printf(({ level, message, timestam
|
|
|
151
153
|
}
|
|
152
154
|
return `${time} ${levelStr} ${msg}${metaStr}`;
|
|
153
155
|
});
|
|
154
|
-
//
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
// When LOG_PACKAGE=http, only allow logs that look like HTTP requests
|
|
157
|
+
const isHttpLog = (info) => {
|
|
158
|
+
const msg = String(info.message ?? '');
|
|
159
|
+
return /^(GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD)\s+/i.test(msg) || msg.includes(' → ') || msg.includes(' ← ');
|
|
160
|
+
};
|
|
161
|
+
const transports = [];
|
|
162
|
+
if (logEnabled) {
|
|
163
|
+
if (logPackage === 'http') {
|
|
164
|
+
transports.push(new winston_1.default.transports.Console({
|
|
165
|
+
format: winston_1.default.format.combine(winston_1.default.format((info) => (isHttpLog(info) ? info : false))(), customFormat),
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
transports.push(new winston_1.default.transports.Console({
|
|
161
170
|
format: winston_1.default.format.combine(customFormat),
|
|
162
|
-
})
|
|
163
|
-
|
|
164
|
-
|
|
171
|
+
}));
|
|
172
|
+
}
|
|
173
|
+
if (logDir) {
|
|
174
|
+
transports.push(new winston_1.default.transports.File({
|
|
165
175
|
filename: path_1.default.join(logDir, 'combined.log'),
|
|
166
176
|
format: winston_1.default.format.combine(winston_1.default.format.timestamp(), winston_1.default.format.printf(({ level, message, timestamp, ...metadata }) => {
|
|
167
177
|
let msg = `${timestamp} [${level.toUpperCase()}] ${message}`;
|
|
@@ -175,9 +185,7 @@ const logger = winston_1.default.createLogger({
|
|
|
175
185
|
}
|
|
176
186
|
return msg;
|
|
177
187
|
})),
|
|
178
|
-
}),
|
|
179
|
-
// File transport for errors only (without colors)
|
|
180
|
-
new winston_1.default.transports.File({
|
|
188
|
+
}), new winston_1.default.transports.File({
|
|
181
189
|
filename: path_1.default.join(logDir, 'error.log'),
|
|
182
190
|
level: 'error',
|
|
183
191
|
format: winston_1.default.format.combine(winston_1.default.format.timestamp(), winston_1.default.format.printf(({ level, message, timestamp, ...metadata }) => {
|
|
@@ -192,8 +200,17 @@ const logger = winston_1.default.createLogger({
|
|
|
192
200
|
}
|
|
193
201
|
return msg;
|
|
194
202
|
})),
|
|
195
|
-
})
|
|
196
|
-
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
transports.push(new winston_1.default.transports.Console({ silent: true }));
|
|
208
|
+
}
|
|
209
|
+
// Create logger instance
|
|
210
|
+
const logger = winston_1.default.createLogger({
|
|
211
|
+
level: logLevel,
|
|
212
|
+
format: winston_1.default.format.combine(winston_1.default.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), customFormat),
|
|
213
|
+
transports,
|
|
197
214
|
});
|
|
198
215
|
// Log application info when starting
|
|
199
216
|
const appInfo = {
|
package/dist/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAMxC,OAAO,kBAAkB,CAAC;AAY1B,UAAU,U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BAAiB;IAe/B,OAAO,CAAC,kBAAkB;IAwQ1B,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,SAAS;IAiBjB,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,aAAa;IAOf,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IA0C7F,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI;IAIjD,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI;IAIlD,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI;IAIjD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI;IAIpD,OAAO,CAAC,QAAQ;IAKV,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAkChE"}
|
package/dist/router.js
CHANGED
|
@@ -195,6 +195,10 @@ class Router {
|
|
|
195
195
|
args[i] = context.headers;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
+
else if (injection.type === 'request') {
|
|
199
|
+
// Handle @Req() / @Request() decorator - raw request for multipart, etc.
|
|
200
|
+
args[i] = req;
|
|
201
|
+
}
|
|
198
202
|
else if (injection.type === 'response') {
|
|
199
203
|
// Handle @Res decorator
|
|
200
204
|
args[i] = new hazel_response_1.HazelExpressResponse(res);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hazeljs/core",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.28",
|
|
4
4
|
"description": "Core HazelJS framework - Dependency injection, routing, decorators, and base functionality",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"routing"
|
|
59
59
|
],
|
|
60
60
|
"author": "Muhammad Arslan <muhammad.arslan@hazeljs.com>",
|
|
61
|
-
"license": "
|
|
61
|
+
"license": "Apache-2.0",
|
|
62
62
|
"bugs": {
|
|
63
63
|
"url": "https://github.com/hazeljs/hazel-js/issues"
|
|
64
64
|
},
|
|
65
65
|
"homepage": "https://hazeljs.com",
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "6d1e18578960246e007d563f736a3a286d20b111"
|
|
67
67
|
}
|