jcc-express-mvc 1.8.6 → 1.8.8
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/Core/Auth/Event.d.ts +2 -0
- package/Core/Auth/Event.d.ts.map +1 -0
- package/Core/Auth/Event.js +17 -0
- package/Core/Auth/index.d.ts +2 -0
- package/Core/Auth/index.d.ts.map +1 -0
- package/Core/Auth/index.js +2 -0
- package/Core/Console/Command.d.ts +2 -0
- package/Core/Console/Command.d.ts.map +1 -0
- package/Core/Console/Command.js +17 -0
- package/Core/Dependency.d.ts +1 -1
- package/Core/Dependency.js +1 -1
- package/Core/Gate.d.ts +2 -0
- package/Core/Gate.d.ts.map +1 -0
- package/Core/Gate.js +17 -0
- package/Core/Mail.d.ts +5 -0
- package/Core/Mail.d.ts.map +1 -1
- package/Core/Mail.js +5 -0
- package/Core/Schedule.d.ts +2 -0
- package/Core/Schedule.d.ts.map +1 -0
- package/Core/Schedule.js +17 -0
- package/Core/index.d.ts +4 -0
- package/Core/index.d.ts.map +1 -1
- package/Core/index.js +5 -0
- package/Exception/index.d.ts +1 -1
- package/Exception/index.d.ts.map +1 -1
- package/Exception/index.js +1 -1
- package/__tests__/ApplicationBuilder.test.d.ts +2 -0
- package/__tests__/ApplicationBuilder.test.d.ts.map +1 -0
- package/__tests__/ApplicationBuilder.test.js +41 -0
- package/__tests__/Container.test.d.ts +2 -0
- package/__tests__/Container.test.d.ts.map +1 -0
- package/__tests__/Container.test.js +71 -0
- package/__tests__/Job.test.d.ts +2 -0
- package/__tests__/Job.test.d.ts.map +1 -0
- package/__tests__/Job.test.js +205 -0
- package/__tests__/ValidationException.test.d.ts +2 -0
- package/__tests__/ValidationException.test.d.ts.map +1 -0
- package/__tests__/ValidationException.test.js +24 -0
- package/lib/Application/Application.d.ts +1 -1
- package/lib/Application/Application.d.ts.map +1 -1
- package/lib/Application/Application.js +4 -4
- package/lib/Application/ApplicationBuilder.d.ts +1 -1
- package/lib/Application/ApplicationBuilder.d.ts.map +1 -1
- package/lib/Application/ApplicationBuilder.js +21 -11
- package/lib/Auth/AuthMiddleware.js +2 -2
- package/lib/Auth/Event/Registered.d.ts +5 -0
- package/lib/Auth/Event/Registered.d.ts.map +1 -0
- package/lib/Auth/Event/Registered.js +11 -0
- package/lib/Auth/Listener/SendEmail.d.ts +5 -0
- package/lib/Auth/Listener/SendEmail.d.ts.map +1 -0
- package/lib/Auth/Listener/SendEmail.js +29 -0
- package/lib/Auth/index.js +3 -3
- package/lib/Command-Line/MakeCommand.d.ts +2 -0
- package/lib/Command-Line/MakeCommand.d.ts.map +1 -1
- package/lib/Command-Line/MakeCommand.js +59 -30
- package/lib/Command-Line/NodeArtisanCommand.d.ts.map +1 -1
- package/lib/Command-Line/NodeArtisanCommand.js +6 -3
- package/lib/Command-Line/files/FeatureTest.d.ts +7 -0
- package/lib/Command-Line/files/FeatureTest.d.ts.map +1 -0
- package/lib/Command-Line/files/FeatureTest.js +31 -0
- package/lib/Command-Line/files/Models.d.ts.map +1 -1
- package/lib/Command-Line/files/Models.js +42 -0
- package/lib/Container/index.js +2 -2
- package/lib/Database/Database.d.ts +20 -0
- package/lib/Database/Database.d.ts.map +1 -0
- package/lib/Database/Database.js +54 -0
- package/lib/Database/DatabaseServiceProvider.d.ts +26 -0
- package/lib/Database/DatabaseServiceProvider.d.ts.map +1 -0
- package/lib/Database/DatabaseServiceProvider.js +97 -0
- package/lib/Database/Drivers/KnexDriver.d.ts +13 -0
- package/lib/Database/Drivers/KnexDriver.d.ts.map +1 -0
- package/lib/Database/Drivers/KnexDriver.js +29 -0
- package/lib/Database/Drivers/MongooseDriver.d.ts +18 -0
- package/lib/Database/Drivers/MongooseDriver.d.ts.map +1 -0
- package/lib/Database/Drivers/MongooseDriver.js +59 -0
- package/lib/Database/Drivers/SequelizeDriver.d.ts +16 -0
- package/lib/Database/Drivers/SequelizeDriver.d.ts.map +1 -0
- package/lib/Database/Drivers/SequelizeDriver.js +57 -0
- package/lib/Database/index.d.ts +7 -0
- package/lib/Database/index.d.ts.map +1 -0
- package/lib/Database/index.js +11 -0
- package/lib/Database/interface.d.ts +14 -0
- package/lib/Database/interface.d.ts.map +1 -0
- package/lib/Database/interface.js +2 -0
- package/lib/Database/type.d.ts +18 -0
- package/lib/Database/type.d.ts.map +1 -0
- package/lib/Database/type.js +2 -0
- package/lib/{Dependancy → Dependency}/Route.d.ts.map +1 -1
- package/lib/Dependency/Route.js +27 -0
- package/lib/{Dependancy → Dependency}/index.d.ts.map +1 -1
- package/lib/{Dependancy → Dependency}/index.js +0 -22
- package/lib/Error/DisplayErrorCode.d.ts.map +1 -1
- package/lib/Error/DisplayErrorCode.js +27 -17
- package/lib/Error/MissMatchTokenException/index.d.ts +4 -0
- package/lib/Error/MissMatchTokenException/index.d.ts.map +1 -0
- package/lib/Error/MissMatchTokenException/index.js +9 -0
- package/lib/Event/Event.d.ts.map +1 -1
- package/lib/Event/Event.js +14 -12
- package/lib/Interface/index.d.ts +6 -3
- package/lib/Interface/index.d.ts.map +1 -1
- package/lib/Jcc-eloquent/lib/Builder.d.ts.map +1 -1
- package/lib/Jcc-eloquent/lib/Builder.js +3 -1
- package/lib/Jcc-eloquent/lib/Database/index.d.ts.map +1 -1
- package/lib/Jcc-eloquent/lib/Database/index.js +2 -1
- package/lib/Mail/Attachment.d.ts +37 -0
- package/lib/Mail/Attachment.d.ts.map +1 -0
- package/lib/Mail/Attachment.js +116 -0
- package/lib/Mail/Content/index.d.ts +42 -0
- package/lib/Mail/Content/index.d.ts.map +1 -0
- package/lib/Mail/Content/index.js +46 -0
- package/lib/Mail/Drivers/Nodemailer.d.ts +13 -0
- package/lib/Mail/Drivers/Nodemailer.d.ts.map +1 -0
- package/lib/Mail/Drivers/Nodemailer.js +62 -0
- package/lib/Mail/Drivers/Resend.d.ts +14 -0
- package/lib/Mail/Drivers/Resend.d.ts.map +1 -0
- package/lib/Mail/Drivers/Resend.js +97 -0
- package/lib/Mail/Envelope.d.ts +24 -0
- package/lib/Mail/Envelope.d.ts.map +1 -0
- package/lib/Mail/Envelope.js +37 -0
- package/lib/Mail/Mailable.d.ts +54 -0
- package/lib/Mail/Mailable.d.ts.map +1 -0
- package/lib/Mail/Mailable.js +62 -0
- package/lib/Mail/Manager.d.ts +15 -0
- package/lib/Mail/Manager.d.ts.map +1 -0
- package/lib/Mail/Manager.js +53 -0
- package/lib/Mail/index.d.ts +44 -16
- package/lib/Mail/index.d.ts.map +1 -1
- package/lib/Mail/index.js +57 -46
- package/lib/Mail/interface/Mailer.d.ts +5 -2
- package/lib/Mail/interface/Mailer.d.ts.map +1 -1
- package/lib/Mail/interface/MailerDriver.d.ts +13 -0
- package/lib/Mail/interface/MailerDriver.d.ts.map +1 -0
- package/lib/Mail/interface/MailerDriver.js +2 -0
- package/lib/Middleware/index.d.ts +1 -0
- package/lib/Middleware/index.d.ts.map +1 -1
- package/lib/Middleware/index.js +23 -8
- package/lib/Providers/AuthServiceProvider.d.ts +7 -0
- package/lib/Providers/AuthServiceProvider.d.ts.map +1 -0
- package/lib/Providers/AuthServiceProvider.js +20 -0
- package/lib/Providers/EventServiceProvider.d.ts +1 -1
- package/lib/Providers/EventServiceProvider.d.ts.map +1 -1
- package/lib/Providers/RouteServiceProvider.d.ts +1 -1
- package/lib/Providers/RouteServiceProvider.d.ts.map +1 -1
- package/lib/Providers/RouteServiceProvider.js +3 -0
- package/lib/Providers/ServiceProvider.d.ts.map +1 -1
- package/lib/Providers/ServiceProvider.js +0 -4
- package/lib/Providers/SocketServiceProvider.d.ts +1 -1
- package/lib/Providers/SocketServiceProvider.d.ts.map +1 -1
- package/lib/Queue/Controllers/QueueControllers.d.ts +40 -0
- package/lib/Queue/Controllers/QueueControllers.d.ts.map +1 -0
- package/lib/Queue/Controllers/QueueControllers.js +141 -0
- package/lib/Queue/Drivers/DatabaseDriver.d.ts +6 -1
- package/lib/Queue/Drivers/DatabaseDriver.d.ts.map +1 -1
- package/lib/Queue/Drivers/DatabaseDriver.js +76 -21
- package/lib/Queue/Drivers/MemoryDriver.d.ts +17 -6
- package/lib/Queue/Drivers/MemoryDriver.d.ts.map +1 -1
- package/lib/Queue/Drivers/MemoryDriver.js +323 -14
- package/lib/Queue/Drivers/RedisDriver.d.ts +48 -0
- package/lib/Queue/Drivers/RedisDriver.d.ts.map +1 -0
- package/lib/Queue/Drivers/RedisDriver.js +533 -0
- package/lib/Queue/Job.d.ts +8 -0
- package/lib/Queue/Job.d.ts.map +1 -1
- package/lib/Queue/Job.js +25 -1
- package/lib/Queue/JobsLogger.d.ts.map +1 -1
- package/lib/Queue/JobsLogger.js +6 -3
- package/lib/Queue/Queue.d.ts +17 -0
- package/lib/Queue/Queue.d.ts.map +1 -1
- package/lib/Queue/Queue.js +146 -11
- package/lib/Queue/QueueServiceProvider.d.ts +6 -0
- package/lib/Queue/QueueServiceProvider.d.ts.map +1 -0
- package/lib/Queue/QueueServiceProvider.js +18 -0
- package/lib/Queue/Route/web.d.ts +2 -0
- package/lib/Queue/Route/web.d.ts.map +1 -0
- package/lib/Queue/Route/web.js +13 -0
- package/lib/Queue/interface.d.ts +25 -0
- package/lib/Queue/interface.d.ts.map +1 -1
- package/lib/Queue/type.d.ts +12 -1
- package/lib/Queue/type.d.ts.map +1 -1
- package/lib/Request/FormRequest.d.ts +0 -2
- package/lib/Request/FormRequest.d.ts.map +1 -1
- package/lib/Request/FormRequest.js +4 -9
- package/lib/Response/index.js +1 -1
- package/lib/Security/CsrfMiddleware.d.ts +37 -0
- package/lib/Security/CsrfMiddleware.d.ts.map +1 -0
- package/lib/Security/CsrfMiddleware.js +83 -0
- package/lib/Security/MethodSpoofingMiddleware.d.ts +36 -0
- package/lib/Security/MethodSpoofingMiddleware.d.ts.map +1 -0
- package/lib/Security/MethodSpoofingMiddleware.js +51 -0
- package/lib/Security/index.d.ts +5 -0
- package/lib/Security/index.d.ts.map +1 -0
- package/lib/Security/index.js +7 -0
- package/lib/Storage/index.d.ts +5 -0
- package/lib/Storage/index.d.ts.map +1 -1
- package/lib/Storage/index.js +12 -0
- package/lib/Templating-engine/benchmark.d.ts +7 -0
- package/lib/Templating-engine/benchmark.d.ts.map +1 -0
- package/lib/Templating-engine/benchmark.js +44 -0
- package/lib/Templating-engine/engineHelper.d.ts +37 -8
- package/lib/Templating-engine/engineHelper.d.ts.map +1 -1
- package/lib/Templating-engine/engineHelper.js +203 -26
- package/lib/Templating-engine/errors.d.ts +15 -0
- package/lib/Templating-engine/errors.d.ts.map +1 -0
- package/lib/Templating-engine/errors.js +35 -0
- package/lib/Templating-engine/expressions.d.ts +24 -0
- package/lib/Templating-engine/expressions.d.ts.map +1 -1
- package/lib/Templating-engine/expressions.js +27 -5
- package/lib/Templating-engine/index.d.ts +87 -17
- package/lib/Templating-engine/index.d.ts.map +1 -1
- package/lib/Templating-engine/index.js +701 -96
- package/lib/Templating-engine/plugins.d.ts +30 -0
- package/lib/Templating-engine/plugins.d.ts.map +1 -0
- package/lib/Templating-engine/plugins.js +47 -0
- package/lib/util/index.d.ts +6 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +43 -3
- package/package.json +1 -1
- package/lib/Dependancy/Route.js +0 -36
- /package/lib/{Dependancy → Dependency}/Route.d.ts +0 -0
- /package/lib/{Dependancy → Dependency}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/Core/Auth/Event.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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("../../lib/Auth/Event/Registered"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/Core/Auth/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/Core/Console/Command.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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("../../lib/Console/Command"), exports);
|
package/Core/Dependency.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "../lib/
|
|
1
|
+
export * from "../lib/Dependency";
|
|
2
2
|
//# sourceMappingURL=Dependency.d.ts.map
|
package/Core/Dependency.js
CHANGED
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("../lib/
|
|
17
|
+
__exportStar(require("../lib/Dependency"), exports);
|
package/Core/Gate.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gate.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/Core/Gate.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
|
package/Core/Gate.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
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("../lib/Authorization/index"), exports);
|
package/Core/Mail.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export * from "../lib/Mail/index";
|
|
2
|
+
export * from "../lib/Mail/Manager";
|
|
2
3
|
export * from "../lib/Mail/interface/Mailer";
|
|
4
|
+
export * from "../lib/Mail/Content";
|
|
5
|
+
export * from "../lib/Mail/Mailable";
|
|
6
|
+
export * from "../lib/Mail/Envelope";
|
|
7
|
+
export * from "../lib/Mail/Attachment";
|
|
3
8
|
//# sourceMappingURL=Mail.d.ts.map
|
package/Core/Mail.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mail.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/Core/Mail.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"Mail.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/Core/Mail.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
|
package/Core/Mail.js
CHANGED
|
@@ -15,4 +15,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("../lib/Mail/index"), exports);
|
|
18
|
+
__exportStar(require("../lib/Mail/Manager"), exports);
|
|
18
19
|
__exportStar(require("../lib/Mail/interface/Mailer"), exports);
|
|
20
|
+
__exportStar(require("../lib/Mail/Content"), exports);
|
|
21
|
+
__exportStar(require("../lib/Mail/Mailable"), exports);
|
|
22
|
+
__exportStar(require("../lib/Mail/Envelope"), exports);
|
|
23
|
+
__exportStar(require("../lib/Mail/Attachment"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Schedule.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/Core/Schedule.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/Core/Schedule.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
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("../lib/Schedule"), exports);
|
package/Core/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export * from "../lib/Application/Application";
|
|
2
2
|
export * from "../lib/Routes/Route";
|
|
3
|
+
export { csrf } from "../lib/Security/CsrfMiddleware";
|
|
4
|
+
export type { CsrfOptions } from "../lib/Security/CsrfMiddleware";
|
|
5
|
+
export { methodSpoofing } from "../lib/Security/MethodSpoofingMiddleware";
|
|
6
|
+
export type { MethodSpoofingOptions } from "../lib/Security/MethodSpoofingMiddleware";
|
|
3
7
|
//# sourceMappingURL=index.d.ts.map
|
package/Core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/Core/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/Core/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,YAAY,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC"}
|
package/Core/index.js
CHANGED
|
@@ -14,5 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.methodSpoofing = exports.csrf = void 0;
|
|
17
18
|
__exportStar(require("../lib/Application/Application"), exports);
|
|
18
19
|
__exportStar(require("../lib/Routes/Route"), exports);
|
|
20
|
+
var CsrfMiddleware_1 = require("../lib/Security/CsrfMiddleware");
|
|
21
|
+
Object.defineProperty(exports, "csrf", { enumerable: true, get: function () { return CsrfMiddleware_1.csrf; } });
|
|
22
|
+
var MethodSpoofingMiddleware_1 = require("../lib/Security/MethodSpoofingMiddleware");
|
|
23
|
+
Object.defineProperty(exports, "methodSpoofing", { enumerable: true, get: function () { return MethodSpoofingMiddleware_1.methodSpoofing; } });
|
package/Exception/index.d.ts
CHANGED
package/Exception/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/Exception/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/Exception/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC"}
|
package/Exception/index.js
CHANGED
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("../lib/Error/ValidationException"), exports);
|
|
17
|
+
__exportStar(require("../lib/Error/ValidationException-v2"), exports);
|
|
18
18
|
__exportStar(require("../lib/Error/AuthorizationException"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApplicationBuilder.test.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/__tests__/ApplicationBuilder.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const Application_1 = require("../lib/Application/Application");
|
|
5
|
+
const ApplicationBuilder_1 = require("../lib/Application/ApplicationBuilder");
|
|
6
|
+
(0, vitest_1.describe)("ApplicationBuilder", () => {
|
|
7
|
+
let app;
|
|
8
|
+
(0, vitest_1.beforeEach)(() => {
|
|
9
|
+
app = Application_1.Application.getInstance();
|
|
10
|
+
});
|
|
11
|
+
(0, vitest_1.it)("withConfig merges config without queue when queue is missing", () => {
|
|
12
|
+
const config = { custom: "value" };
|
|
13
|
+
const builder = new ApplicationBuilder_1.ApplicationBuilder(app);
|
|
14
|
+
(0, vitest_1.expect)(() => builder.withConfig(config)).not.toThrow();
|
|
15
|
+
(0, vitest_1.expect)(app.config).toMatchObject({ custom: "value" });
|
|
16
|
+
(0, vitest_1.expect)(app.has("Queue")).toBe(false);
|
|
17
|
+
});
|
|
18
|
+
(0, vitest_1.it)("withConfig registers Queue when queue config is present", () => {
|
|
19
|
+
const config = {
|
|
20
|
+
queue: {
|
|
21
|
+
default: "memory",
|
|
22
|
+
connections: {
|
|
23
|
+
memory: { driver: "memory", queue: "default" },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const builder = new ApplicationBuilder_1.ApplicationBuilder(app);
|
|
28
|
+
builder.withConfig(config);
|
|
29
|
+
(0, vitest_1.expect)(app.has("Queue")).toBe(true);
|
|
30
|
+
const queue = app.resolve("Queue");
|
|
31
|
+
(0, vitest_1.expect)(queue).toBeDefined();
|
|
32
|
+
});
|
|
33
|
+
(0, vitest_1.it)("withRouting maps route config with rootPath", () => {
|
|
34
|
+
const builder = new ApplicationBuilder_1.ApplicationBuilder(app);
|
|
35
|
+
const routes = [{ name: "route/api", prefix: "/api" }];
|
|
36
|
+
builder.withRouting(routes);
|
|
37
|
+
(0, vitest_1.expect)(app.configRoutes).toHaveLength(1);
|
|
38
|
+
(0, vitest_1.expect)(app.configRoutes[0].name).toContain("route/api");
|
|
39
|
+
(0, vitest_1.expect)(app.configRoutes[0].prefix).toBe("/api");
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.test.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/__tests__/Container.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const Application_1 = require("../lib/Application/Application");
|
|
5
|
+
/**
|
|
6
|
+
* Tests Container behavior via Application (extends ExpressApplication extends Container).
|
|
7
|
+
*/
|
|
8
|
+
(0, vitest_1.describe)("Container", () => {
|
|
9
|
+
let container;
|
|
10
|
+
(0, vitest_1.beforeEach)(() => {
|
|
11
|
+
container = Application_1.Application.getInstance();
|
|
12
|
+
});
|
|
13
|
+
(0, vitest_1.it)("binds and resolves a value via factory", () => {
|
|
14
|
+
container.bind("Foo", () => "bar");
|
|
15
|
+
(0, vitest_1.expect)(container.resolve("Foo")).toBe("bar");
|
|
16
|
+
});
|
|
17
|
+
(0, vitest_1.it)("binds a class and resolves instance", () => {
|
|
18
|
+
class Service {
|
|
19
|
+
}
|
|
20
|
+
container.bind("Service", Service, true);
|
|
21
|
+
const a = container.resolve("Service");
|
|
22
|
+
const b = container.resolve("Service");
|
|
23
|
+
(0, vitest_1.expect)(a).toBeInstanceOf(Service);
|
|
24
|
+
(0, vitest_1.expect)(a).toBe(b); // shared
|
|
25
|
+
});
|
|
26
|
+
(0, vitest_1.it)("singleton returns same instance", () => {
|
|
27
|
+
class Singleton {
|
|
28
|
+
}
|
|
29
|
+
container.singleton("Singleton", Singleton);
|
|
30
|
+
const a = container.resolve("Singleton");
|
|
31
|
+
const b = container.resolve("Singleton");
|
|
32
|
+
(0, vitest_1.expect)(a).toBe(b);
|
|
33
|
+
});
|
|
34
|
+
(0, vitest_1.it)("instance sets concrete instance", () => {
|
|
35
|
+
const obj = { id: 1 };
|
|
36
|
+
container.instance("Obj", obj);
|
|
37
|
+
(0, vitest_1.expect)(container.resolve("Obj")).toBe(obj);
|
|
38
|
+
});
|
|
39
|
+
(0, vitest_1.it)("alias resolves to original binding", () => {
|
|
40
|
+
container.bind("Original", () => "value");
|
|
41
|
+
container.alias("Original", "Alias");
|
|
42
|
+
(0, vitest_1.expect)(container.resolve("Alias")).toBe("value");
|
|
43
|
+
});
|
|
44
|
+
(0, vitest_1.it)("has returns true for registered bindings", () => {
|
|
45
|
+
container.bind("X", "y");
|
|
46
|
+
(0, vitest_1.expect)(container.has("X")).toBe(true);
|
|
47
|
+
(0, vitest_1.expect)(container.has("Unknown")).toBe(false);
|
|
48
|
+
});
|
|
49
|
+
(0, vitest_1.it)("forget removes instance", () => {
|
|
50
|
+
class Temp {
|
|
51
|
+
}
|
|
52
|
+
container.singleton("Temp", Temp);
|
|
53
|
+
const a = container.resolve("Temp");
|
|
54
|
+
container.forget("Temp");
|
|
55
|
+
const b = container.resolve("Temp");
|
|
56
|
+
(0, vitest_1.expect)(a).not.toBe(b);
|
|
57
|
+
});
|
|
58
|
+
(0, vitest_1.it)("make instantiates class with auto-binding", () => {
|
|
59
|
+
class MyService {
|
|
60
|
+
constructor() {
|
|
61
|
+
this.name = "test";
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const instance = container.make(MyService);
|
|
65
|
+
(0, vitest_1.expect)(instance).toBeInstanceOf(MyService);
|
|
66
|
+
(0, vitest_1.expect)(instance?.name).toBe("test");
|
|
67
|
+
});
|
|
68
|
+
(0, vitest_1.it)("resolve throws for unregistered binding", () => {
|
|
69
|
+
(0, vitest_1.expect)(() => container.resolve("NonExistent")).toThrow(/No binding registered/);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Job.test.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/__tests__/Job.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const Job_1 = require("../lib/Queue/Job");
|
|
5
|
+
const Application_1 = require("../lib/Application/Application");
|
|
6
|
+
const ApplicationBuilder_1 = require("../lib/Application/ApplicationBuilder");
|
|
7
|
+
const util_1 = require("../lib/util");
|
|
8
|
+
class TestJob extends Job_1.Job {
|
|
9
|
+
async handle() {
|
|
10
|
+
// no-op for tests
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
class DelayedTestJob extends Job_1.Job {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.delay = 5;
|
|
17
|
+
}
|
|
18
|
+
async handle() {
|
|
19
|
+
// no-op for tests
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class NestedFolderJob extends Job_1.Job {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.path = "Notifications/SendEmail";
|
|
26
|
+
}
|
|
27
|
+
async handle() {
|
|
28
|
+
// no-op for tests
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
(0, vitest_1.describe)("Job", () => {
|
|
32
|
+
(0, vitest_1.describe)("serialize", () => {
|
|
33
|
+
(0, vitest_1.it)("includes job name, data, and metadata", () => {
|
|
34
|
+
const job = new TestJob({ value: "hello" });
|
|
35
|
+
const serialized = job.serialize();
|
|
36
|
+
const parsed = JSON.parse(serialized);
|
|
37
|
+
(0, vitest_1.expect)(parsed.job).toBe("TestJob");
|
|
38
|
+
(0, vitest_1.expect)(parsed.data).toEqual({ value: "hello" });
|
|
39
|
+
(0, vitest_1.expect)(parsed.displayName).toBe("TestJob");
|
|
40
|
+
(0, vitest_1.expect)(parsed.maxAttempts).toBe(3);
|
|
41
|
+
(0, vitest_1.expect)(parsed.timeout).toBe(60);
|
|
42
|
+
(0, vitest_1.expect)(parsed.attempts).toBe(0);
|
|
43
|
+
(0, vitest_1.expect)(parsed.delay).toBe(0);
|
|
44
|
+
});
|
|
45
|
+
(0, vitest_1.it)("includes delay when set", () => {
|
|
46
|
+
const job = new DelayedTestJob({ value: "delayed" });
|
|
47
|
+
const serialized = job.serialize();
|
|
48
|
+
const parsed = JSON.parse(serialized);
|
|
49
|
+
(0, vitest_1.expect)(parsed.delay).toBe(5);
|
|
50
|
+
});
|
|
51
|
+
(0, vitest_1.it)("uses default path (constructor name) when path is empty", () => {
|
|
52
|
+
const job = new TestJob({ value: "x" });
|
|
53
|
+
(0, vitest_1.expect)(job.jobPath).toBe("TestJob");
|
|
54
|
+
const serialized = job.serialize();
|
|
55
|
+
const parsed = JSON.parse(serialized);
|
|
56
|
+
(0, vitest_1.expect)(parsed.path).toBe("TestJob");
|
|
57
|
+
});
|
|
58
|
+
(0, vitest_1.it)("includes custom path when set for nested folders", () => {
|
|
59
|
+
const job = new NestedFolderJob({ value: "x" });
|
|
60
|
+
(0, vitest_1.expect)(job.jobPath).toBe("Notifications/SendEmail");
|
|
61
|
+
const serialized = job.serialize();
|
|
62
|
+
const parsed = JSON.parse(serialized);
|
|
63
|
+
(0, vitest_1.expect)(parsed.path).toBe("Notifications/SendEmail");
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
(0, vitest_1.describe)("fromSerialized", () => {
|
|
67
|
+
(0, vitest_1.it)("reconstructs job from serialized string", () => {
|
|
68
|
+
const job = new TestJob({ value: "restored" });
|
|
69
|
+
job.id = "test-id";
|
|
70
|
+
job.attempts = 2;
|
|
71
|
+
const serialized = job.serialize();
|
|
72
|
+
const jobClasses = { TestJob };
|
|
73
|
+
const restored = Job_1.Job.fromSerialized(serialized, jobClasses);
|
|
74
|
+
(0, vitest_1.expect)(restored).toBeInstanceOf(TestJob);
|
|
75
|
+
(0, vitest_1.expect)(restored.data).toEqual({ value: "restored" });
|
|
76
|
+
(0, vitest_1.expect)(restored.id).toBe("test-id");
|
|
77
|
+
(0, vitest_1.expect)(restored.attempts).toBe(2);
|
|
78
|
+
(0, vitest_1.expect)(restored.path).toBe("TestJob");
|
|
79
|
+
});
|
|
80
|
+
(0, vitest_1.it)("restores custom path from serialized string", () => {
|
|
81
|
+
const job = new NestedFolderJob({ value: "x" });
|
|
82
|
+
const serialized = job.serialize();
|
|
83
|
+
const jobClasses = { NestedFolderJob };
|
|
84
|
+
const restored = Job_1.Job.fromSerialized(serialized, jobClasses);
|
|
85
|
+
(0, vitest_1.expect)(restored.path).toBe("Notifications/SendEmail");
|
|
86
|
+
});
|
|
87
|
+
(0, vitest_1.it)("throws for unknown job class", () => {
|
|
88
|
+
const serialized = JSON.stringify({
|
|
89
|
+
job: "UnknownJob",
|
|
90
|
+
data: {},
|
|
91
|
+
id: "x",
|
|
92
|
+
displayName: "UnknownJob",
|
|
93
|
+
maxAttempts: 3,
|
|
94
|
+
timeout: 60,
|
|
95
|
+
attempts: 0,
|
|
96
|
+
});
|
|
97
|
+
(0, vitest_1.expect)(() => Job_1.Job.fromSerialized(serialized, { TestJob })).toThrow(/Unknown job class: UnknownJob/);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
(0, vitest_1.describe)("backoff", () => {
|
|
101
|
+
(0, vitest_1.it)("returns exponential backoff in ms", () => {
|
|
102
|
+
const job = new TestJob({ value: "x" });
|
|
103
|
+
(0, vitest_1.expect)(job.backoff(0)).toBe(1000);
|
|
104
|
+
(0, vitest_1.expect)(job.backoff(1)).toBe(2000);
|
|
105
|
+
(0, vitest_1.expect)(job.backoff(2)).toBe(4000);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
(0, vitest_1.describe)("dispatch", () => {
|
|
109
|
+
let app;
|
|
110
|
+
let originalApp;
|
|
111
|
+
(0, vitest_1.beforeEach)(() => {
|
|
112
|
+
app = Application_1.Application.getInstance();
|
|
113
|
+
originalApp = globalThis.app;
|
|
114
|
+
globalThis.app = app;
|
|
115
|
+
const config = {
|
|
116
|
+
queue: {
|
|
117
|
+
default: "memory",
|
|
118
|
+
connections: {
|
|
119
|
+
memory: { driver: "memory", queue: "default" },
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
new ApplicationBuilder_1.ApplicationBuilder(app).withConfig(config);
|
|
124
|
+
});
|
|
125
|
+
(0, vitest_1.afterEach)(() => {
|
|
126
|
+
globalThis.app = originalApp;
|
|
127
|
+
});
|
|
128
|
+
(0, vitest_1.it)("dispatches job to queue and returns job id", async () => {
|
|
129
|
+
const id = await TestJob.dispatch({ value: "dispatched" });
|
|
130
|
+
(0, vitest_1.expect)(id).toBeDefined();
|
|
131
|
+
(0, vitest_1.expect)(typeof id).toBe("string");
|
|
132
|
+
(0, vitest_1.expect)(id.length).toBeGreaterThan(0);
|
|
133
|
+
});
|
|
134
|
+
(0, vitest_1.it)("throws when Queue is not registered", async () => {
|
|
135
|
+
globalThis.app = { resolve: () => undefined };
|
|
136
|
+
await (0, vitest_1.expect)(TestJob.dispatch({ value: "x" })).rejects.toThrow(/Queue not registered/);
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
(0, vitest_1.describe)("Queue", () => {
|
|
141
|
+
let queue;
|
|
142
|
+
let app;
|
|
143
|
+
let originalApp;
|
|
144
|
+
(0, vitest_1.beforeEach)(() => {
|
|
145
|
+
app = Application_1.Application.getInstance();
|
|
146
|
+
originalApp = globalThis.app;
|
|
147
|
+
globalThis.app = app;
|
|
148
|
+
const config = {
|
|
149
|
+
queue: {
|
|
150
|
+
default: "memory",
|
|
151
|
+
connections: {
|
|
152
|
+
memory: { driver: "memory", queue: "default" },
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
new ApplicationBuilder_1.ApplicationBuilder(app).withConfig(config);
|
|
157
|
+
queue = app.resolve("Queue");
|
|
158
|
+
});
|
|
159
|
+
(0, vitest_1.afterEach)(() => {
|
|
160
|
+
globalThis.app = originalApp;
|
|
161
|
+
});
|
|
162
|
+
(0, vitest_1.describe)("push", () => {
|
|
163
|
+
(0, vitest_1.it)("stores job class (constructor) not instance for later resolution", async () => {
|
|
164
|
+
const job = new TestJob({ value: "push-test" });
|
|
165
|
+
const id = await queue.push(job);
|
|
166
|
+
(0, vitest_1.expect)(id).toBeDefined();
|
|
167
|
+
// Process the job - this would fail if we stored the instance
|
|
168
|
+
// because we need to instantiate a fresh job from the class
|
|
169
|
+
const processed = await queue.processNext();
|
|
170
|
+
(0, vitest_1.expect)(processed).toBe(true);
|
|
171
|
+
});
|
|
172
|
+
(0, vitest_1.it)("returns a valid uuid", async () => {
|
|
173
|
+
const job = new TestJob({ value: "uuid-test" });
|
|
174
|
+
const id = await queue.push(job);
|
|
175
|
+
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
176
|
+
(0, vitest_1.expect)(id).toMatch(uuidRegex);
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
(0, vitest_1.describe)("later", () => {
|
|
180
|
+
(0, vitest_1.it)("registers job class for delayed jobs", async () => {
|
|
181
|
+
const job = new TestJob({ value: "later-test" });
|
|
182
|
+
const id = await queue.later(job, 0);
|
|
183
|
+
(0, vitest_1.expect)(id).toBeDefined();
|
|
184
|
+
// With delay 0, job should be available immediately
|
|
185
|
+
const processed = await queue.processNext();
|
|
186
|
+
(0, vitest_1.expect)(processed).toBe(true);
|
|
187
|
+
});
|
|
188
|
+
(0, vitest_1.it)("processes job with custom path (nested folder)", async () => {
|
|
189
|
+
const job = new NestedFolderJob({ value: "nested-test" });
|
|
190
|
+
const id = await queue.push(job);
|
|
191
|
+
(0, vitest_1.expect)(id).toBeDefined();
|
|
192
|
+
// jobClasses has the class, so path is used for getJobClass fallback only
|
|
193
|
+
const processed = await queue.processNext();
|
|
194
|
+
(0, vitest_1.expect)(processed).toBe(true);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
(0, vitest_1.describe)("getJobClass", () => {
|
|
199
|
+
(0, vitest_1.it)("returns false for non-existent job", () => {
|
|
200
|
+
const spy = vitest_1.vi.spyOn(console, "log").mockImplementation(() => { });
|
|
201
|
+
const result = (0, util_1.getJobClass)("NonExistentJob12345");
|
|
202
|
+
(0, vitest_1.expect)(result).toBe(false);
|
|
203
|
+
spy.mockRestore();
|
|
204
|
+
});
|
|
205
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidationException.test.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/__tests__/ValidationException.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const ValidationException_v2_1 = require("../lib/Error/ValidationException-v2");
|
|
5
|
+
(0, vitest_1.describe)("ValidationException", () => {
|
|
6
|
+
(0, vitest_1.it)("creates exception with errors", () => {
|
|
7
|
+
const errors = { email: ["Invalid email"], name: ["Required"] };
|
|
8
|
+
const ex = new ValidationException_v2_1.ValidationException(errors);
|
|
9
|
+
(0, vitest_1.expect)(ex.errors).toEqual(errors);
|
|
10
|
+
(0, vitest_1.expect)(ex).toBeInstanceOf(Error);
|
|
11
|
+
(0, vitest_1.expect)(ex).toBeInstanceOf(ValidationException_v2_1.ValidationException);
|
|
12
|
+
});
|
|
13
|
+
(0, vitest_1.it)("flattens message to first error per field", () => {
|
|
14
|
+
const errors = { email: ["Invalid", "Too short"], name: ["Required"] };
|
|
15
|
+
const ex = new ValidationException_v2_1.ValidationException(errors);
|
|
16
|
+
(0, vitest_1.expect)(ex.message).toEqual({ email: "Invalid", name: "Required" });
|
|
17
|
+
});
|
|
18
|
+
(0, vitest_1.it)("accepts custom messages", () => {
|
|
19
|
+
const errors = { field: ["validation.failed"] };
|
|
20
|
+
const customMessages = { "field.validation.failed": "Custom message" };
|
|
21
|
+
const ex = new ValidationException_v2_1.ValidationException(errors, customMessages);
|
|
22
|
+
(0, vitest_1.expect)(ex.errors).toEqual(errors);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -10,7 +10,7 @@ export declare class Application extends ExpressApplication {
|
|
|
10
10
|
private VERSION;
|
|
11
11
|
config: Record<string, any>;
|
|
12
12
|
constructor();
|
|
13
|
-
registerProviders(Provider: new (app: Application) => ServiceProvider): this
|
|
13
|
+
registerProviders(Provider: new (app: Application) => ServiceProvider): Promise<this>;
|
|
14
14
|
boot(): this;
|
|
15
15
|
private bootProvider;
|
|
16
16
|
private bootSubscribers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Application/Application.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAQnE,qBAAa,WAAY,SAAQ,kBAAkB;IACjD,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,SAAS,CAAyB;IACnC,QAAQ,EAAE,MAAM,CAAY;IAC5B,YAAY,EAAE,WAAW,EAAE,CAAM;IACxC,OAAO,CAAC,OAAO,CAAW;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;;
|
|
1
|
+
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Application/Application.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAQnE,qBAAa,WAAY,SAAQ,kBAAkB;IACjD,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,SAAS,CAAyB;IACnC,QAAQ,EAAE,MAAM,CAAY;IAC5B,YAAY,EAAE,WAAW,EAAE,CAAM;IACxC,OAAO,CAAC,OAAO,CAAW;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;;IAYlC,iBAAiB,CACrB,QAAQ,EAAE,KAAK,GAAG,EAAE,WAAW,KAAK,eAAe,GAClD,OAAO,CAAC,IAAI,CAAC;IAqBhB,IAAI,IAAI,IAAI;YAUE,YAAY;IAI1B,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,aAAa;IAId,OAAO;IAKR,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB1B,MAAM,CAAC,aAAa;IAIpB,MAAM,CAAC,WAAW;CAGnB"}
|
|
@@ -29,9 +29,9 @@ class Application extends ExpressApplication_1.ExpressApplication {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
// Register a service provider
|
|
32
|
-
registerProviders(Provider) {
|
|
32
|
+
async registerProviders(Provider) {
|
|
33
33
|
const provider = new Provider(this);
|
|
34
|
-
provider.register();
|
|
34
|
+
await provider.register();
|
|
35
35
|
this.providers.push(provider);
|
|
36
36
|
if (this.booted) {
|
|
37
37
|
this.bootProvider(provider);
|
|
@@ -53,8 +53,8 @@ class Application extends ExpressApplication_1.ExpressApplication {
|
|
|
53
53
|
return this;
|
|
54
54
|
}
|
|
55
55
|
// Boot a specific provider
|
|
56
|
-
bootProvider(provider) {
|
|
57
|
-
provider.boot();
|
|
56
|
+
async bootProvider(provider) {
|
|
57
|
+
await provider.boot();
|
|
58
58
|
}
|
|
59
59
|
bootSubscribers(provider) {
|
|
60
60
|
provider.subscribers();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationBuilder.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Application/ApplicationBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ApplicationBuilder.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Application/ApplicationBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAS3C,qBAAa,kBAAkB;IACtB,GAAG,EAAE,WAAW,CAAC;gBAEZ,GAAG,EAAE,WAAW;IAIrB,UAAU,CAAC,MAAM,EAAE,GAAG;IAKtB,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IActC,WAAW,CAAC,WAAW,EAAE,WAAW,EAAE;IAOtC,aAAa,CAClB,SAAS,EAAE,KAAK,CAAC,KAAK,GAAG,EAAE,WAAW,KAAK,eAAe,CAAC;IAqB7D,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,gBAAgB;IAIjB,WAAW;IAKX,cAAc;IAWd,MAAM;CAKd"}
|