jcc-express-mvc 1.8.25 → 1.8.27
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/Cache.d.ts +1 -1
- package/Core/Cache.d.ts.map +1 -1
- package/Core/Cache.js +3 -15
- package/Core/index.d.ts +2 -0
- package/Core/index.d.ts.map +1 -1
- package/Core/index.js +5 -1
- package/lib/Cache/FileCacheDriver.d.ts.map +1 -1
- package/lib/Cache/FileCacheDriver.js +8 -1
- package/lib/Cache/index.d.ts.map +1 -1
- package/lib/Cache/index.js +23 -24
- package/lib/Command-Line/CacheCommand.d.ts +7 -0
- package/lib/Command-Line/CacheCommand.d.ts.map +1 -0
- package/lib/Command-Line/CacheCommand.js +21 -0
- package/lib/Command-Line/NodeArtisanCommand.d.ts +2 -0
- package/lib/Command-Line/NodeArtisanCommand.d.ts.map +1 -1
- package/lib/Command-Line/NodeArtisanCommand.js +11 -0
- package/lib/Command-Line/WatchCommand.d.ts.map +1 -1
- package/lib/Command-Line/WatchCommand.js +6 -1
- package/lib/Command-Line/files/Request.d.ts.map +1 -1
- package/lib/Command-Line/files/Request.js +3 -5
- package/lib/Error/AppError.d.ts.map +1 -1
- package/lib/Error/AppErrorHandler.js +3 -4
- package/lib/Inertia/index.d.ts.map +1 -1
- package/lib/Inertia/index.js +3 -1
- package/lib/Validation/Validator/index.d.ts.map +1 -1
- package/lib/Validation/Validator/index.js +1 -4
- package/package.json +1 -1
package/Core/Cache.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { CacheFacade as Cache } from "../lib/Cache/CacheFacade";
|
|
2
2
|
//# sourceMappingURL=Cache.d.ts.map
|
package/Core/Cache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/Core/Cache.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/Core/Cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,KAAK,EAAE,MAAM,0BAA0B,CAAC"}
|
package/Core/Cache.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
3
|
+
exports.Cache = void 0;
|
|
4
|
+
var CacheFacade_1 = require("../lib/Cache/CacheFacade");
|
|
5
|
+
Object.defineProperty(exports, "Cache", { enumerable: true, get: function () { return CacheFacade_1.CacheFacade; } });
|
package/Core/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from "../lib/Application/Application";
|
|
2
|
+
export { SessionServiceProvider } from "../lib/Providers/SessionServiceProvider";
|
|
3
|
+
export { SessionManager } from "../lib/Session/SessionManager";
|
|
2
4
|
export * from "../lib/Routes/Route";
|
|
3
5
|
export { csrf } from "../lib/Security/CsrfMiddleware";
|
|
4
6
|
export type { CsrfOptions } from "../lib/Security/CsrfMiddleware";
|
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;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"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../jcc-express-mvc/Core/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,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,8 +14,12 @@ 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
|
+
exports.methodSpoofing = exports.csrf = exports.SessionManager = exports.SessionServiceProvider = void 0;
|
|
18
18
|
__exportStar(require("../lib/Application/Application"), exports);
|
|
19
|
+
var SessionServiceProvider_1 = require("../lib/Providers/SessionServiceProvider");
|
|
20
|
+
Object.defineProperty(exports, "SessionServiceProvider", { enumerable: true, get: function () { return SessionServiceProvider_1.SessionServiceProvider; } });
|
|
21
|
+
var SessionManager_1 = require("../lib/Session/SessionManager");
|
|
22
|
+
Object.defineProperty(exports, "SessionManager", { enumerable: true, get: function () { return SessionManager_1.SessionManager; } });
|
|
19
23
|
__exportStar(require("../lib/Routes/Route"), exports);
|
|
20
24
|
var CsrfMiddleware_1 = require("../lib/Security/CsrfMiddleware");
|
|
21
25
|
Object.defineProperty(exports, "csrf", { enumerable: true, get: function () { return CsrfMiddleware_1.csrf; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileCacheDriver.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Cache/FileCacheDriver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"FileCacheDriver.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Cache/FileCacheDriver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAM3C,qBAAa,UAAW,YAAW,WAAW;IAC5C,OAAO,CAAC,QAAQ,CAAS;gBAEb,MAAM,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO;YAShC,cAAc;IAQ5B,OAAO,CAAC,WAAW;YAML,aAAa;YAWb,cAAc;IAQtB,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAc5C,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMpE,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAUrC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAetB,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAKtD,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAO1D,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1D,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAUlD,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIlC,QAAQ,CAAC,CAAC,GAAG,GAAG,EACpB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAC7B,OAAO,CAAC,CAAC,CAAC;IAWP,eAAe,CAAC,CAAC,GAAG,GAAG,EAC3B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAC7B,OAAO,CAAC,CAAC,CAAC;IAYP,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IASvB,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;CAoBjC"}
|
|
@@ -32,14 +32,21 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
35
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
39
|
exports.FileDriver = void 0;
|
|
37
40
|
const fs = __importStar(require("fs/promises"));
|
|
38
41
|
const path = __importStar(require("path"));
|
|
39
42
|
const crypto = __importStar(require("crypto"));
|
|
43
|
+
const app_root_path_1 = __importDefault(require("app-root-path"));
|
|
44
|
+
const Config_1 = require("../Config/Config");
|
|
40
45
|
class FileDriver {
|
|
41
46
|
constructor(config = {}) {
|
|
42
|
-
this.cacheDir =
|
|
47
|
+
this.cacheDir =
|
|
48
|
+
config.cacheDir ||
|
|
49
|
+
path.join(app_root_path_1.default.path, Config_1.config.get("CACHE_PATH", "storage/framework/cache"));
|
|
43
50
|
}
|
|
44
51
|
async ensureCacheDir() {
|
|
45
52
|
try {
|
package/lib/Cache/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAkB5C,qBAAa,KAAK;IAChB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAQ;IAC/B,OAAO,CAAC,OAAO,CAAuC;IACtD,OAAO,CAAC,MAAM,CAAc;gBAEhB,MAAM,EAAE,WAAW;IAK/B,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK;IAa/C,OAAO,CAAC,iBAAiB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAkB5C,qBAA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
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
72
|
+
let driver;
|
|
73
|
+
switch (this.config.default) {
|
|
74
|
+
case "memory":
|
|
75
|
+
driver = new MemoryDriver_1.MemoryDriver();
|
|
76
|
+
break;
|
|
77
|
+
case "redis":
|
|
78
|
+
const redisConfig = {
|
|
79
|
+
host: this.config.stores.host,
|
|
80
|
+
port: this.config.stores.port,
|
|
81
|
+
password: this.config.stores.password,
|
|
82
|
+
database: this.config.stores.database,
|
|
83
|
+
};
|
|
84
|
+
driver = new RedisDriver_1.RedisDriver(redisConfig);
|
|
85
|
+
break;
|
|
86
|
+
case "file":
|
|
87
|
+
driver = new FileCacheDriver_1.FileDriver({
|
|
88
|
+
cacheDir: this.config.stores.cacheDir,
|
|
89
|
+
});
|
|
90
|
+
break;
|
|
91
|
+
default:
|
|
92
|
+
throw new Error(`Unsupported cache driver: ${this.config.stores.driver}`);
|
|
93
|
+
}
|
|
94
|
+
this.drivers.set(this.config.default, driver);
|
|
96
95
|
}
|
|
97
96
|
store(name) {
|
|
98
97
|
const storeName = name || this.config.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CacheCommand.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Command-Line/CacheCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,qBAAa,YAAY;IACX,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,WAAW;IAC9B,KAAK;CAQZ"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CacheCommand = void 0;
|
|
7
|
+
const Cache_1 = require("../Cache");
|
|
8
|
+
const colors_1 = __importDefault(require("colors"));
|
|
9
|
+
class CacheCommand {
|
|
10
|
+
constructor(app) {
|
|
11
|
+
this.app = app;
|
|
12
|
+
}
|
|
13
|
+
async clear() {
|
|
14
|
+
try {
|
|
15
|
+
await Cache_1.CacheFacade.flush();
|
|
16
|
+
console.log(`${colors_1.default.bgBlue(colors_1.default.white(" INFO "))} Application cache cleared successfully`);
|
|
17
|
+
}
|
|
18
|
+
catch (error) { }
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.CacheCommand = CacheCommand;
|
|
@@ -11,12 +11,14 @@ export declare class ConsoleKernel {
|
|
|
11
11
|
private _schedule;
|
|
12
12
|
private _watch;
|
|
13
13
|
private _app;
|
|
14
|
+
private _cache;
|
|
14
15
|
private get migrate();
|
|
15
16
|
private get db();
|
|
16
17
|
private get make();
|
|
17
18
|
private get route();
|
|
18
19
|
private get schedule();
|
|
19
20
|
private get watch();
|
|
21
|
+
private get cache();
|
|
20
22
|
private app;
|
|
21
23
|
constructor();
|
|
22
24
|
/** Load user commands from app/Console/Command (guarded, non-blocking for missing dir) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeArtisanCommand.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Command-Line/NodeArtisanCommand.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"NodeArtisanCommand.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Command-Line/NodeArtisanCommand.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuCpC,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAK1B;IACF,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,GAAG,CAA0B;IACrC,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,SAAS,CAAgC;IACjD,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,MAAM,CAA6B;IAE3C,OAAO,KAAK,OAAO,GAElB;IAED,OAAO,KAAK,EAAE,GAEb;IAED,OAAO,KAAK,IAAI,GAEf;IAED,OAAO,KAAK,KAAK,GAEhB;IAED,OAAO,KAAK,QAAQ,GAEnB;IAED,OAAO,KAAK,KAAK,GAEhB;IAED,OAAO,KAAK,KAAK,GAEhB;IAED,OAAO,CAAC,GAAG;;IAWX,0FAA0F;IAC1F,OAAO,CAAC,kBAAkB;IA0B1B,OAAO,CAAC,aAAa;IAOrB,wFAAwF;IACxF,OAAO,CAAC,SAAS;IAkBjB,OAAO,CAAC,aAAa;IA8LrB,OAAO,CAAC,QAAQ;IAiIhB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;CA4BpD"}
|
|
@@ -22,6 +22,7 @@ const KeyGenerateCommand_1 = require("./KeyGenerateCommand");
|
|
|
22
22
|
const Tinker_1 = require("./NodeTinker/Tinker");
|
|
23
23
|
const WatchCommand_1 = require("./WatchCommand");
|
|
24
24
|
const util_1 = require("../util");
|
|
25
|
+
const CacheCommand_1 = require("./CacheCommand");
|
|
25
26
|
/** Parse key=value from secondArg (e.g. steps=2, class=UserSeeder) */
|
|
26
27
|
const parseOption = (secondArg, key) => {
|
|
27
28
|
if (!secondArg?.includes("="))
|
|
@@ -48,6 +49,9 @@ class ConsoleKernel {
|
|
|
48
49
|
get watch() {
|
|
49
50
|
return (this._watch ??= new WatchCommand_1.WatchCommand());
|
|
50
51
|
}
|
|
52
|
+
get cache() {
|
|
53
|
+
return (this._cache ??= new CacheCommand_1.CacheCommand(this._app));
|
|
54
|
+
}
|
|
51
55
|
app() {
|
|
52
56
|
const bootstrap = require(`${app_root_path_1.default.path}/bootstrap/app`);
|
|
53
57
|
const app = bootstrap.app;
|
|
@@ -63,6 +67,7 @@ class ConsoleKernel {
|
|
|
63
67
|
this._route = null;
|
|
64
68
|
this._schedule = null;
|
|
65
69
|
this._watch = null;
|
|
70
|
+
this._cache = null;
|
|
66
71
|
this._app = this.app();
|
|
67
72
|
this.loadCustomCommands();
|
|
68
73
|
}
|
|
@@ -197,6 +202,12 @@ class ConsoleKernel {
|
|
|
197
202
|
.action(this.runAction((firstArg) => this.watch.run(firstArg || "server.ts"), {
|
|
198
203
|
exit: false,
|
|
199
204
|
}));
|
|
205
|
+
this.defineCommand("cache:clear")
|
|
206
|
+
.alias("clear:cache")
|
|
207
|
+
.action(this.runAction(() => this.cache.clear(), {
|
|
208
|
+
exit: true,
|
|
209
|
+
}));
|
|
210
|
+
//cache
|
|
200
211
|
// ─── schedule (was missing) ─────────────────────────────────────────
|
|
201
212
|
this.defineCommand("schedule:run").action(this.runAction(() => this.schedule.run(), { exit: false }));
|
|
202
213
|
this.defineCommand("schedule:list").action(this.runAction(() => this.schedule.list()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WatchCommand.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Command-Line/WatchCommand.ts"],"names":[],"mappings":"AAOA,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"WatchCommand.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Command-Line/WatchCommand.ts"],"names":[],"mappings":"AAOA,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAWzB;IACH,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAUlC;IACF,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IAEtD,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,mBAAmB,CAAS;IACpC,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAO;IACvC,OAAO,CAAC,SAAS,CAAe;IAE1B,GAAG,CAAC,SAAS,SAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAcjD,OAAO,CAAC,eAAe;IAoDvB,OAAO,CAAC,uBAAuB;IAuC/B,OAAO,CAAC,eAAe;IAoBvB,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,aAAa;IA8BrB,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,aAAa;CAQtB"}
|
|
@@ -20,6 +20,9 @@ class WatchCommand {
|
|
|
20
20
|
".idea",
|
|
21
21
|
".vscode",
|
|
22
22
|
"storage",
|
|
23
|
+
".claude",
|
|
24
|
+
".cursor",
|
|
25
|
+
"CLAUDE.md",
|
|
23
26
|
"node_modules",
|
|
24
27
|
]);
|
|
25
28
|
this.defaultWatchTargets = [
|
|
@@ -126,7 +129,9 @@ class WatchCommand {
|
|
|
126
129
|
// This means folders the user creates (e.g. services/, lib/) are picked up
|
|
127
130
|
// automatically on the next restart without any config change.
|
|
128
131
|
try {
|
|
129
|
-
const rootEntries = fs_1.default.readdirSync(this.rootPath, {
|
|
132
|
+
const rootEntries = fs_1.default.readdirSync(this.rootPath, {
|
|
133
|
+
withFileTypes: true,
|
|
134
|
+
});
|
|
130
135
|
for (const entry of rootEntries) {
|
|
131
136
|
if (!entry.isDirectory())
|
|
132
137
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../../../jcc-express-mvc/lib/Command-Line/files/Request.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,aAAa,GAAI,UAAU,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"Request.d.ts","sourceRoot":"","sources":["../../../../jcc-express-mvc/lib/Command-Line/files/Request.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,QAAA,MAAM,aAAa,GAAI,UAAU,MAAM,KAAG,MA0BzC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -11,10 +11,8 @@ import { FormRequest } from "jcc-express-mvc/Core/FormRequest";
|
|
|
11
11
|
import {Request} from "jcc-express-mvc"
|
|
12
12
|
|
|
13
13
|
export class ${fileName} extends FormRequest {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
14
|
+
|
|
15
|
+
|
|
18
16
|
protected authorize(): boolean {
|
|
19
17
|
return false;
|
|
20
18
|
}
|
|
@@ -28,7 +26,7 @@ import {Request} from "jcc-express-mvc"
|
|
|
28
26
|
|
|
29
27
|
async save()
|
|
30
28
|
{
|
|
31
|
-
|
|
29
|
+
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppError.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Error/AppError.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAS,SAAQ,KAAK;aAMf,OAAO,EAAE,MAAM,GAAG,GAAG;aACrB,IAAI,CAAC,EAAE,MAAM;aACb,KAAK,CAAC,GAAE,KAAK,GAAG,OAAO;IAPzC,SAAgB,IAAI,cAAc;IAClC,SAAgB,SAAS,EAAE,IAAI,CAAC;IAChC,SAAgB,YAAY,EAAE,MAAM,CAAe;gBAGjC,OAAO,EAAE,MAAM,GAAG,GAAG,EACrB,IAAI,CAAC,EAAE,MAAM,YAAA,EACb,KAAK,CAAC,GAAE,KAAK,GAAG,OAAO,aAAA;
|
|
1
|
+
{"version":3,"file":"AppError.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Error/AppError.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAS,SAAQ,KAAK;aAMf,OAAO,EAAE,MAAM,GAAG,GAAG;aACrB,IAAI,CAAC,EAAE,MAAM;aACb,KAAK,CAAC,GAAE,KAAK,GAAG,OAAO;IAPzC,SAAgB,IAAI,cAAc;IAClC,SAAgB,SAAS,EAAE,IAAI,CAAC;IAChC,SAAgB,YAAY,EAAE,MAAM,CAAe;gBAGjC,OAAO,EAAE,MAAM,GAAG,GAAG,EACrB,IAAI,CAAC,EAAE,MAAM,YAAA,EACb,KAAK,CAAC,GAAE,KAAK,GAAG,OAAO,aAAA;CAgB1C"}
|
|
@@ -56,12 +56,11 @@ class AppErrorHandler {
|
|
|
56
56
|
}
|
|
57
57
|
//
|
|
58
58
|
if (err.type === error_1.VALIDATION_ERROR || err instanceof ValidationException_v2_1.ValidationException) {
|
|
59
|
-
|
|
59
|
+
//
|
|
60
60
|
if (req.expectsJson() && !req.isInertia()) {
|
|
61
|
-
return res.status(422).json({ errors: err.
|
|
61
|
+
return res.status(422).json({ errors: err.errors });
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
if (err instanceof ValidationException_v2_1.ValidationException && err.errors) {
|
|
63
|
+
if (err.errors) {
|
|
65
64
|
req.flash(error_1.VALIDATION_ERROR, err.errors);
|
|
66
65
|
}
|
|
67
66
|
return res.status(422).redirectBack();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Inertia/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../jcc-express-mvc/lib/Inertia/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,WAAW,EACX,OAAO,EACP,cAAc,EAEf,MAAM,cAAc,CAAC;AA0HtB,eAAO,MAAM,OAAO,GAAI,SAAS,cAAc,WA1ExB,UAAU,OAAO,WAAW,QAAQ,OAAO,kBA2E9B,CAAC"}
|
package/lib/Inertia/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.inertia = void 0;
|
|
4
4
|
const Http_1 = require("../Http");
|
|
5
|
+
const Config_1 = require("../Config/Config");
|
|
5
6
|
class InertiaMiddleware {
|
|
6
7
|
getSharedProps(options, req, res) {
|
|
7
8
|
if (typeof options.props === "function") {
|
|
@@ -68,7 +69,8 @@ class InertiaMiddleware {
|
|
|
68
69
|
let ssrResult = null;
|
|
69
70
|
if (options.ssr) {
|
|
70
71
|
try {
|
|
71
|
-
const
|
|
72
|
+
const ssrPort = Config_1.config.get("SSR_PORT", "13714");
|
|
73
|
+
const { data } = await Http_1.Http.post(`http://localhost:${ssrPort}/render`, inertiaData);
|
|
72
74
|
ssrResult = data;
|
|
73
75
|
}
|
|
74
76
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../jcc-express-mvc/lib/Validation/Validator/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAK7C,qBAAa,SAAS;WACP,QAAQ,CACnB,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../jcc-express-mvc/lib/Validation/Validator/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAK7C,qBAAa,SAAS;WACP,QAAQ,CACnB,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAmBtC,MAAM,CAAC,eAAe;IAKtB,OAAO,CAAC,MAAM,CAAC,aAAa;CAoC7B"}
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Validator = void 0;
|
|
7
7
|
const validatorjs_1 = __importDefault(require("validatorjs"));
|
|
8
|
-
const error_1 = require("../../Error/Constants/error");
|
|
9
8
|
const index_1 = require("../../Error/ValidationException-v2/index");
|
|
10
9
|
const CustomValidation_1 = require("./CustomValidation");
|
|
11
10
|
class Validator {
|
|
@@ -16,9 +15,7 @@ class Validator {
|
|
|
16
15
|
await new Promise((resolve, reject) => {
|
|
17
16
|
vd.checkAsync(() => resolve(), () => {
|
|
18
17
|
req.flash("old", req.body);
|
|
19
|
-
|
|
20
|
-
req.flash(error_1.VALIDATION_ERROR, errorArry);
|
|
21
|
-
reject(new index_1.ValidationException(errorArry));
|
|
18
|
+
reject(new index_1.ValidationException(vd.errors.all()));
|
|
22
19
|
});
|
|
23
20
|
});
|
|
24
21
|
req.validated = () => req.body;
|