@carno.js/core 1.1.0 → 1.1.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.
Files changed (119) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +188 -188
  3. package/dist/Carno.js +46 -26
  4. package/dist/Carno.mjs +46 -26
  5. package/dist/bun/index.js +4 -4
  6. package/dist/bun/index.js.map +29 -29
  7. package/package.json +2 -2
  8. package/src/Carno.ts +718 -673
  9. package/src/DefaultRoutes.ts +34 -34
  10. package/src/cache/CacheDriver.ts +50 -50
  11. package/src/cache/CacheService.ts +139 -139
  12. package/src/cache/MemoryDriver.ts +104 -104
  13. package/src/cache/RedisDriver.ts +116 -116
  14. package/src/compiler/JITCompiler.ts +167 -167
  15. package/src/container/Container.ts +168 -168
  16. package/src/context/Context.ts +130 -130
  17. package/src/cors/CorsHandler.ts +145 -145
  18. package/src/decorators/Controller.ts +63 -63
  19. package/src/decorators/Inject.ts +16 -16
  20. package/src/decorators/Middleware.ts +22 -22
  21. package/src/decorators/Service.ts +18 -18
  22. package/src/decorators/methods.ts +58 -58
  23. package/src/decorators/params.ts +47 -47
  24. package/src/events/Lifecycle.ts +97 -97
  25. package/src/exceptions/HttpException.ts +99 -99
  26. package/src/index.ts +95 -95
  27. package/src/metadata.ts +46 -46
  28. package/src/middleware/CarnoMiddleware.ts +14 -14
  29. package/src/router/RadixRouter.ts +225 -225
  30. package/src/testing/TestHarness.ts +185 -185
  31. package/src/utils/Metadata.ts +43 -43
  32. package/src/utils/parseQuery.ts +161 -161
  33. package/src/validation/ValibotAdapter.ts +95 -95
  34. package/src/validation/ValidatorAdapter.ts +69 -69
  35. package/src/validation/ZodAdapter.ts +102 -102
  36. package/dist/Carno.d.js +0 -14
  37. package/dist/Carno.d.mjs +0 -1
  38. package/dist/DefaultRoutes.d.js +0 -13
  39. package/dist/DefaultRoutes.d.mjs +0 -0
  40. package/dist/cache/CacheDriver.d.js +0 -13
  41. package/dist/cache/CacheDriver.d.mjs +0 -0
  42. package/dist/cache/CacheService.d.js +0 -13
  43. package/dist/cache/CacheService.d.mjs +0 -0
  44. package/dist/cache/MemoryDriver.d.js +0 -13
  45. package/dist/cache/MemoryDriver.d.mjs +0 -0
  46. package/dist/cache/RedisDriver.d.js +0 -13
  47. package/dist/cache/RedisDriver.d.mjs +0 -0
  48. package/dist/compiler/JITCompiler.d.js +0 -13
  49. package/dist/compiler/JITCompiler.d.mjs +0 -0
  50. package/dist/container/Container.d.js +0 -13
  51. package/dist/container/Container.d.mjs +0 -0
  52. package/dist/context/Context.d.js +0 -13
  53. package/dist/context/Context.d.mjs +0 -0
  54. package/dist/cors/CorsHandler.d.js +0 -13
  55. package/dist/cors/CorsHandler.d.mjs +0 -0
  56. package/dist/decorators/Controller.d.js +0 -13
  57. package/dist/decorators/Controller.d.mjs +0 -0
  58. package/dist/decorators/Inject.d.js +0 -13
  59. package/dist/decorators/Inject.d.mjs +0 -0
  60. package/dist/decorators/Middleware.d.js +0 -13
  61. package/dist/decorators/Middleware.d.mjs +0 -0
  62. package/dist/decorators/Service.d.js +0 -13
  63. package/dist/decorators/Service.d.mjs +0 -0
  64. package/dist/decorators/methods.d.js +0 -13
  65. package/dist/decorators/methods.d.mjs +0 -0
  66. package/dist/decorators/params.d.js +0 -13
  67. package/dist/decorators/params.d.mjs +0 -0
  68. package/dist/events/Lifecycle.d.js +0 -13
  69. package/dist/events/Lifecycle.d.mjs +0 -0
  70. package/dist/exceptions/HttpException.d.js +0 -13
  71. package/dist/exceptions/HttpException.d.mjs +0 -0
  72. package/dist/index.d.js +0 -130
  73. package/dist/index.d.mjs +0 -78
  74. package/dist/metadata.d.js +0 -13
  75. package/dist/metadata.d.mjs +0 -0
  76. package/dist/middleware/CarnoMiddleware.d.js +0 -13
  77. package/dist/middleware/CarnoMiddleware.d.mjs +0 -0
  78. package/dist/router/RadixRouter.d.js +0 -13
  79. package/dist/router/RadixRouter.d.mjs +0 -0
  80. package/dist/testing/TestHarness.d.js +0 -13
  81. package/dist/testing/TestHarness.d.mjs +0 -0
  82. package/dist/utils/Metadata.d.js +0 -13
  83. package/dist/utils/Metadata.d.mjs +0 -0
  84. package/dist/utils/parseQuery.d.js +0 -13
  85. package/dist/utils/parseQuery.d.mjs +0 -0
  86. package/dist/validation/ValibotAdapter.d.js +0 -13
  87. package/dist/validation/ValibotAdapter.d.mjs +0 -0
  88. package/dist/validation/ValidatorAdapter.d.js +0 -13
  89. package/dist/validation/ValidatorAdapter.d.mjs +0 -0
  90. package/dist/validation/ZodAdapter.d.js +0 -13
  91. package/dist/validation/ZodAdapter.d.mjs +0 -0
  92. package/src/Carno.d.ts +0 -135
  93. package/src/DefaultRoutes.d.ts +0 -19
  94. package/src/cache/CacheDriver.d.ts +0 -43
  95. package/src/cache/CacheService.d.ts +0 -89
  96. package/src/cache/MemoryDriver.d.ts +0 -32
  97. package/src/cache/RedisDriver.d.ts +0 -34
  98. package/src/compiler/JITCompiler.d.ts +0 -36
  99. package/src/container/Container.d.ts +0 -38
  100. package/src/context/Context.d.ts +0 -36
  101. package/src/cors/CorsHandler.d.ts +0 -47
  102. package/src/decorators/Controller.d.ts +0 -13
  103. package/src/decorators/Inject.d.ts +0 -6
  104. package/src/decorators/Middleware.d.ts +0 -5
  105. package/src/decorators/Service.d.ts +0 -9
  106. package/src/decorators/methods.d.ts +0 -7
  107. package/src/decorators/params.d.ts +0 -13
  108. package/src/events/Lifecycle.d.ts +0 -54
  109. package/src/exceptions/HttpException.d.ts +0 -43
  110. package/src/index.d.ts +0 -42
  111. package/src/metadata.d.ts +0 -41
  112. package/src/middleware/CarnoMiddleware.d.ts +0 -12
  113. package/src/router/RadixRouter.d.ts +0 -19
  114. package/src/testing/TestHarness.d.ts +0 -71
  115. package/src/utils/Metadata.d.ts +0 -20
  116. package/src/utils/parseQuery.d.ts +0 -23
  117. package/src/validation/ValibotAdapter.d.ts +0 -30
  118. package/src/validation/ValidatorAdapter.d.ts +0 -54
  119. package/src/validation/ZodAdapter.d.ts +0 -35
@@ -1,102 +1,102 @@
1
- import type { ValidatorAdapter, ValidationResult, ValidationError } from './ValidatorAdapter';
2
- import { VALIDATION_SCHEMA, getSchema } from './ValidatorAdapter';
3
-
4
- /**
5
- * Zod Adapter - Default validation adapter for Turbo.
6
- *
7
- * Usage:
8
- * ```typescript
9
- * import { z } from 'zod';
10
- *
11
- * @Schema(z.object({
12
- * name: z.string().min(1),
13
- * email: z.string().email()
14
- * }))
15
- * class CreateUserDto {
16
- * name: string;
17
- * email: string;
18
- * }
19
- * ```
20
- */
21
- export class ZodAdapter implements ValidatorAdapter {
22
- readonly name = 'ZodAdapter';
23
-
24
- // Cache parsed schemas for performance
25
- private schemaCache = new Map<any, any>();
26
-
27
- hasValidation(target: any): boolean {
28
- return getSchema(target) !== undefined;
29
- }
30
-
31
- validate<T>(target: any, value: unknown): ValidationResult<T> {
32
- const schema = this.getOrCacheSchema(target);
33
-
34
- if (!schema) {
35
- return { success: true, data: value as T };
36
- }
37
-
38
- const result = schema.safeParse(value);
39
-
40
- if (result.success) {
41
- return { success: true, data: result.data };
42
- }
43
-
44
- return {
45
- success: false,
46
- errors: this.formatErrors(result.error)
47
- };
48
- }
49
-
50
- validateOrThrow<T>(target: any, value: unknown): T {
51
- const schema = this.getOrCacheSchema(target);
52
-
53
- if (!schema) {
54
- return value as T;
55
- }
56
-
57
- const result = schema.safeParse(value);
58
-
59
- if (result.success) {
60
- return result.data;
61
- }
62
-
63
- const errors = this.formatErrors(result.error);
64
- throw new ValidationException(errors);
65
- }
66
-
67
- private getOrCacheSchema(target: any): any {
68
- let schema = this.schemaCache.get(target);
69
-
70
- if (schema === undefined) {
71
- schema = getSchema(target) ?? null;
72
- this.schemaCache.set(target, schema);
73
- }
74
-
75
- return schema;
76
- }
77
-
78
- private formatErrors(zodError: any): ValidationError[] {
79
- return zodError.issues.map((issue: any) => ({
80
- path: issue.path.join('.'),
81
- message: issue.message
82
- }));
83
- }
84
- }
85
-
86
- /**
87
- * Validation exception thrown when validation fails.
88
- */
89
- export class ValidationException extends Error {
90
- constructor(public readonly errors: ValidationError[]) {
91
- super(`Validation failed: ${errors.map(e => `${e.path}: ${e.message}`).join(', ')}`);
92
- this.name = 'ValidationException';
93
- }
94
-
95
- toResponse(): Response {
96
- return Response.json({
97
- statusCode: 400,
98
- message: 'Validation failed',
99
- errors: this.errors
100
- }, { status: 400 });
101
- }
102
- }
1
+ import type { ValidatorAdapter, ValidationResult, ValidationError } from './ValidatorAdapter';
2
+ import { VALIDATION_SCHEMA, getSchema } from './ValidatorAdapter';
3
+
4
+ /**
5
+ * Zod Adapter - Default validation adapter for Turbo.
6
+ *
7
+ * Usage:
8
+ * ```typescript
9
+ * import { z } from 'zod';
10
+ *
11
+ * @Schema(z.object({
12
+ * name: z.string().min(1),
13
+ * email: z.string().email()
14
+ * }))
15
+ * class CreateUserDto {
16
+ * name: string;
17
+ * email: string;
18
+ * }
19
+ * ```
20
+ */
21
+ export class ZodAdapter implements ValidatorAdapter {
22
+ readonly name = 'ZodAdapter';
23
+
24
+ // Cache parsed schemas for performance
25
+ private schemaCache = new Map<any, any>();
26
+
27
+ hasValidation(target: any): boolean {
28
+ return getSchema(target) !== undefined;
29
+ }
30
+
31
+ validate<T>(target: any, value: unknown): ValidationResult<T> {
32
+ const schema = this.getOrCacheSchema(target);
33
+
34
+ if (!schema) {
35
+ return { success: true, data: value as T };
36
+ }
37
+
38
+ const result = schema.safeParse(value);
39
+
40
+ if (result.success) {
41
+ return { success: true, data: result.data };
42
+ }
43
+
44
+ return {
45
+ success: false,
46
+ errors: this.formatErrors(result.error)
47
+ };
48
+ }
49
+
50
+ validateOrThrow<T>(target: any, value: unknown): T {
51
+ const schema = this.getOrCacheSchema(target);
52
+
53
+ if (!schema) {
54
+ return value as T;
55
+ }
56
+
57
+ const result = schema.safeParse(value);
58
+
59
+ if (result.success) {
60
+ return result.data;
61
+ }
62
+
63
+ const errors = this.formatErrors(result.error);
64
+ throw new ValidationException(errors);
65
+ }
66
+
67
+ private getOrCacheSchema(target: any): any {
68
+ let schema = this.schemaCache.get(target);
69
+
70
+ if (schema === undefined) {
71
+ schema = getSchema(target) ?? null;
72
+ this.schemaCache.set(target, schema);
73
+ }
74
+
75
+ return schema;
76
+ }
77
+
78
+ private formatErrors(zodError: any): ValidationError[] {
79
+ return zodError.issues.map((issue: any) => ({
80
+ path: issue.path.join('.'),
81
+ message: issue.message
82
+ }));
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Validation exception thrown when validation fails.
88
+ */
89
+ export class ValidationException extends Error {
90
+ constructor(public readonly errors: ValidationError[]) {
91
+ super(`Validation failed: ${errors.map(e => `${e.path}: ${e.message}`).join(', ')}`);
92
+ this.name = 'ValidationException';
93
+ }
94
+
95
+ toResponse(): Response {
96
+ return Response.json({
97
+ statusCode: 400,
98
+ message: 'Validation failed',
99
+ errors: this.errors
100
+ }, { status: 400 });
101
+ }
102
+ }
package/dist/Carno.d.js DELETED
@@ -1,14 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var Carno_d_exports = {};
13
- module.exports = __toCommonJS(Carno_d_exports);
14
- var import_reflect_metadata = require("reflect-metadata");
package/dist/Carno.d.mjs DELETED
@@ -1 +0,0 @@
1
- import "reflect-metadata";
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var DefaultRoutes_d_exports = {};
13
- module.exports = __toCommonJS(DefaultRoutes_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var CacheDriver_d_exports = {};
13
- module.exports = __toCommonJS(CacheDriver_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var CacheService_d_exports = {};
13
- module.exports = __toCommonJS(CacheService_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var MemoryDriver_d_exports = {};
13
- module.exports = __toCommonJS(MemoryDriver_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var RedisDriver_d_exports = {};
13
- module.exports = __toCommonJS(RedisDriver_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var JITCompiler_d_exports = {};
13
- module.exports = __toCommonJS(JITCompiler_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var Container_d_exports = {};
13
- module.exports = __toCommonJS(Container_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var Context_d_exports = {};
13
- module.exports = __toCommonJS(Context_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var CorsHandler_d_exports = {};
13
- module.exports = __toCommonJS(CorsHandler_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var Controller_d_exports = {};
13
- module.exports = __toCommonJS(Controller_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var Inject_d_exports = {};
13
- module.exports = __toCommonJS(Inject_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var Middleware_d_exports = {};
13
- module.exports = __toCommonJS(Middleware_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var Service_d_exports = {};
13
- module.exports = __toCommonJS(Service_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var methods_d_exports = {};
13
- module.exports = __toCommonJS(methods_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var params_d_exports = {};
13
- module.exports = __toCommonJS(params_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var Lifecycle_d_exports = {};
13
- module.exports = __toCommonJS(Lifecycle_d_exports);
File without changes
@@ -1,13 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- };
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var HttpException_d_exports = {};
13
- module.exports = __toCommonJS(HttpException_d_exports);
File without changes
package/dist/index.d.js DELETED
@@ -1,130 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var index_d_exports = {};
16
- __export(index_d_exports, {
17
- BadRequestException: () => import_HttpException.BadRequestException,
18
- Body: () => import_params.Body,
19
- CacheService: () => import_CacheService.CacheService,
20
- Carno: () => import_Carno.Carno,
21
- ConflictException: () => import_HttpException.ConflictException,
22
- Container: () => import_Container.Container,
23
- Context: () => import_Context.Context,
24
- Controller: () => import_Controller.Controller,
25
- CorsHandler: () => import_CorsHandler.CorsHandler,
26
- Ctx: () => import_params.Ctx,
27
- Delete: () => import_methods.Delete,
28
- EventType: () => import_Lifecycle.EventType,
29
- ForbiddenException: () => import_HttpException.ForbiddenException,
30
- Get: () => import_methods.Get,
31
- Head: () => import_methods.Head,
32
- Header: () => import_params.Header,
33
- HttpException: () => import_HttpException.HttpException,
34
- Inject: () => import_Inject.Inject,
35
- InternalServerErrorException: () => import_HttpException.InternalServerErrorException,
36
- Locals: () => import_params.Locals,
37
- MemoryDriver: () => import_MemoryDriver.MemoryDriver,
38
- Metadata: () => import_Metadata.Metadata,
39
- MethodNotAllowedException: () => import_HttpException.MethodNotAllowedException,
40
- Middleware: () => import_Middleware.Use,
41
- NotFoundException: () => import_HttpException.NotFoundException,
42
- OnApplicationBoot: () => import_Lifecycle.OnApplicationBoot,
43
- OnApplicationInit: () => import_Lifecycle.OnApplicationInit,
44
- OnApplicationShutdown: () => import_Lifecycle.OnApplicationShutdown,
45
- Options: () => import_methods.Options,
46
- Param: () => import_params.Param,
47
- Patch: () => import_methods.Patch,
48
- Post: () => import_methods.Post,
49
- Put: () => import_methods.Put,
50
- Query: () => import_params.Query,
51
- RadixRouter: () => import_RadixRouter.RadixRouter,
52
- RedisDriver: () => import_RedisDriver.RedisDriver,
53
- Req: () => import_params.Req,
54
- Schema: () => import_ValidatorAdapter.Schema,
55
- Scope: () => import_Container.Scope,
56
- Service: () => import_Service.Service,
57
- ServiceUnavailableException: () => import_HttpException.ServiceUnavailableException,
58
- TooManyRequestsException: () => import_HttpException.TooManyRequestsException,
59
- UnauthorizedException: () => import_HttpException.UnauthorizedException,
60
- UnprocessableEntityException: () => import_HttpException.UnprocessableEntityException,
61
- Use: () => import_Middleware.Use,
62
- VALIDATION_SCHEMA: () => import_ValidatorAdapter.VALIDATION_SCHEMA,
63
- ValibotAdapter: () => import_ValibotAdapter.ValibotAdapter,
64
- ValidationException: () => import_ZodAdapter.ValidationException,
65
- ZodAdapter: () => import_ZodAdapter.ZodAdapter,
66
- createTestHarness: () => import_TestHarness.createTestHarness,
67
- getSchema: () => import_ValidatorAdapter.getSchema,
68
- isObject: () => import_Metadata.isObject,
69
- isString: () => import_Metadata.isString,
70
- withTestApp: () => import_TestHarness.withTestApp
71
- });
72
- module.exports = __toCommonJS(index_d_exports);
73
- var import_reflect_metadata = require("reflect-metadata"), import_Carno = require('./Carno.js'), import_Context = require('./context/Context.js'), import_Controller = require('./decorators/Controller.js'), import_methods = require('./decorators/methods.js'), import_params = require('./decorators/params.js'), import_Middleware = require('./decorators/Middleware.js'), import_Service = require('./decorators/Service.js'), import_Inject = require('./decorators/Inject.js'), import_Container = require('./container/Container.js'), import_RadixRouter = require('./router/RadixRouter.js'), import_CorsHandler = require('./cors/CorsHandler.js'), import_ValidatorAdapter = require('./validation/ValidatorAdapter.js'), import_ZodAdapter = require('./validation/ZodAdapter.js'), import_ValibotAdapter = require('./validation/ValibotAdapter.js'), import_HttpException = require('./exceptions/HttpException.js'), import_Lifecycle = require('./events/Lifecycle.js'), import_CacheService = require('./cache/CacheService.js'), import_MemoryDriver = require('./cache/MemoryDriver.js'), import_RedisDriver = require('./cache/RedisDriver.js'), import_TestHarness = require('./testing/TestHarness.js'), import_Metadata = require('./utils/Metadata.js');
74
- // Annotate the CommonJS export names for ESM import in node:
75
- 0 && (module.exports = {
76
- BadRequestException,
77
- Body,
78
- CacheService,
79
- Carno,
80
- ConflictException,
81
- Container,
82
- Context,
83
- Controller,
84
- CorsHandler,
85
- Ctx,
86
- Delete,
87
- EventType,
88
- ForbiddenException,
89
- Get,
90
- Head,
91
- Header,
92
- HttpException,
93
- Inject,
94
- InternalServerErrorException,
95
- Locals,
96
- MemoryDriver,
97
- Metadata,
98
- MethodNotAllowedException,
99
- Middleware,
100
- NotFoundException,
101
- OnApplicationBoot,
102
- OnApplicationInit,
103
- OnApplicationShutdown,
104
- Options,
105
- Param,
106
- Patch,
107
- Post,
108
- Put,
109
- Query,
110
- RadixRouter,
111
- RedisDriver,
112
- Req,
113
- Schema,
114
- Scope,
115
- Service,
116
- ServiceUnavailableException,
117
- TooManyRequestsException,
118
- UnauthorizedException,
119
- UnprocessableEntityException,
120
- Use,
121
- VALIDATION_SCHEMA,
122
- ValibotAdapter,
123
- ValidationException,
124
- ZodAdapter,
125
- createTestHarness,
126
- getSchema,
127
- isObject,
128
- isString,
129
- withTestApp
130
- });