@warlock.js/core 4.0.94 → 4.0.100
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/esm/dev2-server/connectors/communicator-connector.d.ts +23 -0
- package/esm/dev2-server/connectors/communicator-connector.d.ts.map +1 -0
- package/esm/dev2-server/connectors/communicator-connector.js +60 -0
- package/esm/dev2-server/connectors/communicator-connector.js.map +1 -0
- package/esm/dev2-server/connectors/connectors-manager.d.ts.map +1 -1
- package/esm/dev2-server/connectors/connectors-manager.js +2 -1
- package/esm/dev2-server/connectors/connectors-manager.js.map +1 -1
- package/esm/dev2-server/connectors/index.d.ts +1 -0
- package/esm/dev2-server/connectors/index.d.ts.map +1 -1
- package/esm/dev2-server/connectors/types.d.ts +5 -4
- package/esm/dev2-server/connectors/types.d.ts.map +1 -1
- package/esm/dev2-server/connectors/types.js +4 -3
- package/esm/dev2-server/connectors/types.js.map +1 -1
- package/esm/generations/add-command.action.d.ts.map +1 -1
- package/esm/generations/add-command.action.js +30 -3
- package/esm/generations/add-command.action.js.map +1 -1
- package/esm/generations/stubs.d.ts +2 -0
- package/esm/generations/stubs.d.ts.map +1 -0
- package/esm/generations/stubs.js +81 -0
- package/esm/generations/stubs.js.map +1 -0
- package/esm/index.js +1 -1
- package/esm/validation/plugins/database-plugin.d.ts.map +1 -1
- package/esm/validation/plugins/database-plugin.js +10 -7
- package/esm/validation/plugins/database-plugin.js.map +1 -1
- package/esm/validation/types.d.ts +6 -6
- package/esm/validation/types.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseConnector } from "./base-connector";
|
|
2
|
+
import { ConnectorPriority } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Communicator Connector
|
|
5
|
+
* Manages message broker connection lifecycle using @warlock.js/herald
|
|
6
|
+
*/
|
|
7
|
+
export declare class CommunicatorConnector extends BaseConnector {
|
|
8
|
+
readonly name = "communicator";
|
|
9
|
+
readonly priority = ConnectorPriority.COMMUNICATOR;
|
|
10
|
+
/**
|
|
11
|
+
* Files that trigger communicator restart
|
|
12
|
+
*/
|
|
13
|
+
protected readonly watchedFiles: string[];
|
|
14
|
+
/**
|
|
15
|
+
* Initialize communicator connection
|
|
16
|
+
*/
|
|
17
|
+
start(): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Shutdown communicator connection
|
|
20
|
+
*/
|
|
21
|
+
shutdown(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=communicator-connector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"communicator-connector.d.ts","sourceRoot":"","sources":["../../../src/dev2-server/connectors/communicator-connector.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,aAAa;IACtD,SAAgB,IAAI,kBAAkB;IACtC,SAAgB,QAAQ,kCAAkC;IAE1D;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,YAAY,WAI7B;IAEF;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BnC;;OAEG;IACU,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAwBvC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import config from'@mongez/config';import {connectToCommunicator,communicatorRegistry}from'@warlock.js/herald';import {log}from'@warlock.js/logger';import {BaseConnector}from'./base-connector.js';import {ConnectorPriority}from'./types.js';/**
|
|
2
|
+
* Communicator Connector
|
|
3
|
+
* Manages message broker connection lifecycle using @warlock.js/herald
|
|
4
|
+
*/
|
|
5
|
+
class CommunicatorConnector extends BaseConnector {
|
|
6
|
+
name = "communicator";
|
|
7
|
+
priority = ConnectorPriority.COMMUNICATOR;
|
|
8
|
+
/**
|
|
9
|
+
* Files that trigger communicator restart
|
|
10
|
+
*/
|
|
11
|
+
watchedFiles = [
|
|
12
|
+
".env",
|
|
13
|
+
"src/config/communicator.ts",
|
|
14
|
+
"src/config/communicator.tsx",
|
|
15
|
+
];
|
|
16
|
+
/**
|
|
17
|
+
* Initialize communicator connection
|
|
18
|
+
*/
|
|
19
|
+
async start() {
|
|
20
|
+
const communicatorConfig = config.get("communicator");
|
|
21
|
+
if (!communicatorConfig) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
log.info(`communicator.${communicatorConfig.driver}`, "connection", "Connecting to communicator");
|
|
26
|
+
await connectToCommunicator(communicatorConfig);
|
|
27
|
+
log.success(`communicator.${communicatorConfig.driver}`, "connection", "Connected to communicator");
|
|
28
|
+
this.active = true;
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
console.error("Failed to connect to communicator:", error);
|
|
32
|
+
log.error(`communicator.${communicatorConfig.driver}`, "connection", "Failed to connect to communicator");
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Shutdown communicator connection
|
|
38
|
+
*/
|
|
39
|
+
async shutdown() {
|
|
40
|
+
if (!this.active) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
// Disconnect all registered communicators
|
|
45
|
+
const communicators = communicatorRegistry.getAll();
|
|
46
|
+
for (const communicator of communicators) {
|
|
47
|
+
if (communicator.driver.isConnected) {
|
|
48
|
+
await communicator.driver.disconnect();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Clear the registry for clean restart
|
|
52
|
+
communicatorRegistry.clear();
|
|
53
|
+
this.active = false;
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
console.error("Failed to disconnect from communicator:", error);
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}export{CommunicatorConnector};//# sourceMappingURL=communicator-connector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"communicator-connector.js","sources":["../../../src/dev2-server/connectors/communicator-connector.ts"],"sourcesContent":[null],"names":[],"mappings":"+OAMA;;;AAGG;AACG,MAAO,qBAAsB,SAAQ,aAAa,CAAA;IACtC,IAAI,GAAG,cAAc,CAAC;AACtB,IAAA,QAAQ,GAAG,iBAAiB,CAAC,YAAY,CAAC;AAE1D;;AAEG;AACgB,IAAA,YAAY,GAAG;QAChC,MAAM;QACN,4BAA4B;QAC5B,6BAA6B;KAC9B,CAAC;AAEF;;AAEG;AACI,IAAA,MAAM,KAAK,GAAA;QAChB,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAEtD,IAAI,CAAC,kBAAkB,EAAE;YACvB,OAAO;AACR,SAAA;QAED,IAAI;AACF,YAAA,GAAG,CAAC,IAAI,CACN,CAAA,aAAA,EAAgB,kBAAkB,CAAC,MAAM,CAAA,CAAE,EAC3C,YAAY,EACZ,4BAA4B,CAC7B,CAAC;AACF,YAAA,MAAM,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;AAChD,YAAA,GAAG,CAAC,OAAO,CACT,CAAA,aAAA,EAAgB,kBAAkB,CAAC,MAAM,CAAA,CAAE,EAC3C,YAAY,EACZ,2BAA2B,CAC5B,CAAC;AACF,YAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;AACpB,SAAA;AAAC,QAAA,OAAO,KAAK,EAAE;AACd,YAAA,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;AAC3D,YAAA,GAAG,CAAC,KAAK,CACP,CAAA,aAAA,EAAgB,kBAAkB,CAAC,MAAM,CAAA,CAAE,EAC3C,YAAY,EACZ,mCAAmC,CACpC,CAAC;AACF,YAAA,MAAM,KAAK,CAAC;AACb,SAAA;KACF;AAED;;AAEG;AACI,IAAA,MAAM,QAAQ,GAAA;AACnB,QAAA,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,OAAO;AACR,SAAA;QAED,IAAI;;AAEF,YAAA,MAAM,aAAa,GAAG,oBAAoB,CAAC,MAAM,EAAE,CAAC;AAEpD,YAAA,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE;AACxC,gBAAA,IAAI,YAAY,CAAC,MAAM,CAAC,WAAW,EAAE;AACnC,oBAAA,MAAM,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;AACxC,iBAAA;AACF,aAAA;;YAGD,oBAAoB,CAAC,KAAK,EAAE,CAAC;AAE7B,YAAA,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;AACrB,SAAA;AAAC,QAAA,OAAO,KAAK,EAAE;AACd,YAAA,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;AAChE,YAAA,MAAM,KAAK,CAAC;AACb,SAAA;KACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectors-manager.d.ts","sourceRoot":"","sources":["../../../src/dev2-server/connectors/connectors-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connectors-manager.d.ts","sourceRoot":"","sources":["../../../src/dev2-server/connectors/connectors-manager.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExD,qBAAa,iBAAiB;IAC5B;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmB;IAE9C;;OAEG;;IASH;;OAEG;IACI,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAM3C;;OAEG;IACI,IAAI,IAAI,SAAS,EAAE;IAI1B;;OAEG;IACU,KAAK,CAAC,eAAe,CAAC,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQpE;;OAEG;IACU,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAUtC;;;;;;;OAOG;IACI,qBAAqB,IAAI,IAAI;CAuBrC;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {colors}from'@mongez/copper';import {devServeLog}from'../dev-logger.js';import {CacheConnector}from'./cache-connector.js';import {DatabaseConnector}from'./database-connector.js';import {HttpConnector}from'./http-connector.js';import {StorageConnector}from'./storage.connector.js';class ConnectorsManager {
|
|
1
|
+
import {colors}from'@mongez/copper';import {devServeLog}from'../dev-logger.js';import {CacheConnector}from'./cache-connector.js';import {CommunicatorConnector}from'./communicator-connector.js';import {DatabaseConnector}from'./database-connector.js';import {HttpConnector}from'./http-connector.js';import {StorageConnector}from'./storage.connector.js';class ConnectorsManager {
|
|
2
2
|
/**
|
|
3
3
|
* Connectors lsit
|
|
4
4
|
*/
|
|
@@ -9,6 +9,7 @@ import {colors}from'@mongez/copper';import {devServeLog}from'../dev-logger.js';i
|
|
|
9
9
|
constructor() {
|
|
10
10
|
this.register(new HttpConnector());
|
|
11
11
|
this.register(new DatabaseConnector());
|
|
12
|
+
this.register(new CommunicatorConnector());
|
|
12
13
|
this.register(new CacheConnector());
|
|
13
14
|
this.register(new StorageConnector());
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectors-manager.js","sources":["../../../src/dev2-server/connectors/connectors-manager.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connectors-manager.js","sources":["../../../src/dev2-server/connectors/connectors-manager.ts"],"sourcesContent":[null],"names":[],"mappings":"qWASa,iBAAiB,CAAA;AAC5B;;AAEG;IACc,UAAU,GAAgB,EAAE,CAAC;AAE9C;;AAEG;AACH,IAAA,WAAA,GAAA;AACE,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;AACnC,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,iBAAiB,EAAE,CAAC,CAAC;AACvC,QAAA,IAAI,CAAC,QAAQ,CA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,MAAM,gBAAgB,GAAG,OAAO,MAAc,KAAI;AAChD,YAAA,IAAI,cAAc;gBAAE,OAAO;YAC3B,cAAc,GAAG,IAAI,CAAC;AAEtB,YAAA,OAAO,CAAC,GAAG,CAAC,CAAA,YAAA,CAAc,CAAC,CAAC;AAC5B,YAAA,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;AACtB,YAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,SAAC,CAAC;;AAGF,QAAA,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,gBAAgB,CAAS,CAAC,CAAC,CAAC;AACvD,QAAA,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,gBAAgB,CAAU,CAAC,CAAC,CAAC;;;AAIzD,QAAA,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;;AAEhC,YAAA,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,gBAAgB,CAAS,CAAC,CAAC,CAAC;AACxD,SAAA;KACF;AACF,CAAA;AAEY,MAAA,iBAAiB,GAAG,IAAI,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dev2-server/connectors/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dev2-server/connectors/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC"}
|
|
@@ -38,14 +38,15 @@ export interface Connector {
|
|
|
38
38
|
*/
|
|
39
39
|
shouldRestart(changedFiles: string[]): boolean;
|
|
40
40
|
}
|
|
41
|
-
export type ConnectorName = "http" | "database" | "cache" | "storage";
|
|
41
|
+
export type ConnectorName = "http" | "database" | "cache" | "storage" | "communicator";
|
|
42
42
|
/**
|
|
43
43
|
* Connector priority constants
|
|
44
44
|
*/
|
|
45
45
|
export declare enum ConnectorPriority {
|
|
46
46
|
DATABASE = 1,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
COMMUNICATOR = 2,
|
|
48
|
+
CACHE = 3,
|
|
49
|
+
HTTP = 4,
|
|
50
|
+
STORAGE = 5
|
|
50
51
|
}
|
|
51
52
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/dev2-server/connectors/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC;IAEpB;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;;OAIG;IACH,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;CAChD;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/dev2-server/connectors/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC;IAEpB;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;;OAIG;IACH,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;CAChD;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,cAAc,CAAC;AAEvF;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,QAAQ,IAAI;IACZ,YAAY,IAAI;IAChB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,OAAO,IAAI;CACZ"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
var ConnectorPriority;
|
|
5
5
|
(function (ConnectorPriority) {
|
|
6
6
|
ConnectorPriority[ConnectorPriority["DATABASE"] = 1] = "DATABASE";
|
|
7
|
-
ConnectorPriority[ConnectorPriority["
|
|
8
|
-
ConnectorPriority[ConnectorPriority["
|
|
9
|
-
ConnectorPriority[ConnectorPriority["
|
|
7
|
+
ConnectorPriority[ConnectorPriority["COMMUNICATOR"] = 2] = "COMMUNICATOR";
|
|
8
|
+
ConnectorPriority[ConnectorPriority["CACHE"] = 3] = "CACHE";
|
|
9
|
+
ConnectorPriority[ConnectorPriority["HTTP"] = 4] = "HTTP";
|
|
10
|
+
ConnectorPriority[ConnectorPriority["STORAGE"] = 5] = "STORAGE";
|
|
10
11
|
})(ConnectorPriority || (ConnectorPriority = {}));export{ConnectorPriority};//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/dev2-server/connectors/types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAiDA;;AAEG;IACS,
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/dev2-server/connectors/types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAiDA;;AAEG;IACS,kBAMX;AAND,CAAA,UAAY,iBAAiB,EAAA;AAC3B,IAAA,iBAAA,CAAA,iBAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAY,CAAA;AACZ,IAAA,iBAAA,CAAA,iBAAA,CAAA,cAAA,CAAA,GAAA,CAAA,CAAA,GAAA,cAAgB,CAAA;AAChB,IAAA,iBAAA,CAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAS,CAAA;AACT,IAAA,iBAAA,CAAA,iBAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;AACR,IAAA,iBAAA,CAAA,iBAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW,CAAA;AACb,CAAC,EANW,iBAAiB,KAAjB,iBAAiB,GAM5B,EAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-command.action.d.ts","sourceRoot":"","sources":["../../src/generations/add-command.action.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"add-command.action.d.ts","sourceRoot":"","sources":["../../src/generations/add-command.action.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAiHjD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,iBA8EhE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {colors}from'@mongez/copper';import {fileExistsAsync}from'@mongez/fs';import {execSync}from'node:child_process';import'@warlock.js/logger';import'../database/models/database-log/database-log.js';import'../http/context/request-context.js';import {rootPath}from'../utils/paths.js';import'@mongez/slug';import'@mongez/supportive-is';import'@mongez/reinforcements';const featuresMap = {
|
|
1
|
+
import {colors}from'@mongez/copper';import {fileExistsAsync,putFileAsync}from'@mongez/fs';import {execSync}from'node:child_process';import'@warlock.js/logger';import'../database/models/database-log/database-log.js';import'../http/context/request-context.js';import {rootPath}from'../utils/paths.js';import'@mongez/slug';import'@mongez/supportive-is';import'@mongez/reinforcements';import {communicatorsConfigStub}from'./stubs.js';const featuresMap = {
|
|
2
2
|
react: {
|
|
3
3
|
description: "Installs React and React dom for SSR rendering, useful for sending mails using React components as well",
|
|
4
4
|
dependencies: {
|
|
@@ -49,8 +49,8 @@ import {colors}from'@mongez/copper';import {fileExistsAsync}from'@mongez/fs';imp
|
|
|
49
49
|
"@warlock.js/postman": "~4.0.0",
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
|
-
|
|
53
|
-
description: "Installs pg for
|
|
52
|
+
postgres: {
|
|
53
|
+
description: "Installs pg for Postgres database (Cascade Package)",
|
|
54
54
|
dependencies: {
|
|
55
55
|
pg: "^8.11.0",
|
|
56
56
|
},
|
|
@@ -75,6 +75,20 @@ import {colors}from'@mongez/copper';import {fileExistsAsync}from'@mongez/fs';imp
|
|
|
75
75
|
"@aws-sdk/s3-request-presigner": "^3.955.0",
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
|
+
herald: {
|
|
79
|
+
description: "Installs herald for message broker (Herald Package)",
|
|
80
|
+
dependencies: {
|
|
81
|
+
"@warlock.js/herald": "~4.0.0",
|
|
82
|
+
amqplib: "^0.10.0",
|
|
83
|
+
},
|
|
84
|
+
devDependencies: {
|
|
85
|
+
"@types/amqplib": "^0.10.0",
|
|
86
|
+
},
|
|
87
|
+
ejectConfig: {
|
|
88
|
+
content: communicatorsConfigStub,
|
|
89
|
+
name: "communicator",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
78
92
|
};
|
|
79
93
|
const allowedFeatures = Object.keys(featuresMap);
|
|
80
94
|
async function addCommandAction(options) {
|
|
@@ -91,12 +105,16 @@ async function addCommandAction(options) {
|
|
|
91
105
|
const packageManagerCommand = await getPackageManagerCommand(packageManager);
|
|
92
106
|
const dependencies = {};
|
|
93
107
|
const devDependencies = {};
|
|
108
|
+
const ejectConfigs = {};
|
|
94
109
|
for (const feature of features) {
|
|
95
110
|
const featurePackages = featuresMap[feature];
|
|
96
111
|
Object.assign(dependencies, featurePackages.dependencies);
|
|
97
112
|
if (featurePackages.devDependencies) {
|
|
98
113
|
Object.assign(devDependencies, featurePackages.devDependencies);
|
|
99
114
|
}
|
|
115
|
+
if (featurePackages.ejectConfig) {
|
|
116
|
+
ejectConfigs[feature] = featurePackages.ejectConfig;
|
|
117
|
+
}
|
|
100
118
|
}
|
|
101
119
|
// TODO: to reduce time of execution, check packages that are already installed
|
|
102
120
|
// install dependencies
|
|
@@ -117,6 +135,15 @@ async function addCommandAction(options) {
|
|
|
117
135
|
});
|
|
118
136
|
console.log(`Dev dependencies installed successfully ${colors.green(Object.keys(devDependencies).join(", "))}`);
|
|
119
137
|
}
|
|
138
|
+
for (const [name, config] of Object.entries(ejectConfigs)) {
|
|
139
|
+
if (await fileExistsAsync(rootPath(`config/${name}.ts`))) {
|
|
140
|
+
console.log(`${colors.yellowBright(name)} config already exists, skipping...`);
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
console.log(`Creating ${colors.magenta(name)} config...`);
|
|
144
|
+
await putFileAsync(rootPath(`config/${name}.ts`), config.content);
|
|
145
|
+
console.log(`${colors.green(name)} config created successfully`);
|
|
146
|
+
}
|
|
120
147
|
}
|
|
121
148
|
function validateFeatures(features) {
|
|
122
149
|
for (const feature of features) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-command.action.js","sources":["../../src/generations/add-command.action.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-command.action.js","sources":["../../src/generations/add-command.action.ts"],"sourcesContent":[null],"names":[],"mappings":"8aAOA,MAAM,WAAW,GAWb;AACF,IAAA,KAAK,EAAE;AACL,QAAA,WAAW,EACT,yGAAyG;AAC3G,QAAA,YAAY,EAAE;AACZ,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,WAAW,EAAE,SAAS;AACvB,SAAA;AACD,QAAA,eAAe,EAAE;AACf,YAAA,cAAc,EAAE,SAAS;AACzB,YAAA,kBAAkB,EAAE,SAAS;AAC9B,SAAA;AACF,KAAA;AACD,IAAA,KAAK,EAAE;AACL,QAAA,WAAW,EAAE,qCAAqC;AAClD,QAAA,YAAY,EAAE;AACZ,YAAA,KAAK,EAAE,SAAS;AACjB,SAAA;AACF,KAAA;AACD,IAAA,IAAI,EAAE;AACJ,QAAA,WAAW,EAAE,wCAAwC;AACrD,QAAA,YAAY,EAAE;AACZ,YAAA,UAAU,EAAE,SAAS;AACtB,SAAA;AACD,QAAA,eAAe,EAAE;AACf,YAAA,mBAAmB,EAAE,QAAQ;AAC9B,SAAA;AACF,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,WAAW,EAAE,+DAA+D;AAC5E,QAAA,YAAY,EAAE;AACZ,YAAA,OAAO,EAAE,QAAQ;AAClB,SAAA;AACF,KAAA;AACD,IAAA,SAAS,EAAE;AACT,QAAA,WAAW,EAAE,iDAAiD;AAC9D,QAAA,YAAY,EAAE;AACZ,YAAA,uBAAuB,EAAE,QAAQ;AAClC,SAAA;AACF,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,WAAW,EAAE,gDAAgD;AAC7D,QAAA,YAAY,EAAE;AACZ,YAAA,qBAAqB,EAAE,QAAQ;AAChC,SAAA;AACF,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,WAAW,EAAE,gDAAgD;AAC7D,Q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,EAAE,CAAC;AAC/C,KAAA;IAED,IAAI,cAAc,KAAK,KAAK,EAAE;AAC5B,QAAA,OAAO,aAAa,CAAC;AACtB,KAAA;IAED,IAAI,cAAc,KAAK,MAAM,EAAE;AAC7B,QAAA,OAAO,UAAU,CAAC;AACnB,KAAA;IAED,IAAI,cAAc,KAAK,MAAM,EAAE;AAC7B,QAAA,OAAO,UAAU,CAAC;AACnB,KAAA;AACH,CAAC;AAED,eAAe,oBAAoB,GAAA;IACjC,IAAI,MAAM,eAAe,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,EAAE;AACxD,QAAA,OAAO,KAAK,CAAC;AACd,KAAA;IAED,IAAI,MAAM,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE;AAChD,QAAA,OAAO,MAAM,CAAC;AACf,KAAA;IAED,IAAI,MAAM,eAAe,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,EAAE;AACrD,QAAA,OAAO,MAAM,CAAC;AACf,KAAA;AACH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const communicatorsConfigStub = "import { env } from \"@mongez/dotenv\";\nimport type { CommunicatorConfigurations, RabbitMQClientOptions } from \"@warlock.js/herald\";\n\nconst communicatorConfigurations: CommunicatorConfigurations<RabbitMQClientOptions> = {\n driver: \"rabbitmq\",\n name: \"default\",\n isDefault: true,\n\n // ============================================================================\n // Connection Settings\n // ============================================================================\n\n host: env(\"RABBITMQ_HOST\", \"localhost\"),\n port: env(\"RABBITMQ_PORT\", 5672),\n username: env(\"RABBITMQ_USERNAME\", \"guest\"),\n password: env(\"RABBITMQ_PASSWORD\", \"guest\"),\n vhost: env(\"RABBITMQ_VHOST\", \"/\"),\n\n // Or use connection URI (takes precedence over host/port)\n // uri: env(\"RABBITMQ_URL\"),\n\n // ============================================================================\n // Connection Options\n // ============================================================================\n\n /** Heartbeat interval in seconds */\n heartbeat: 60,\n\n /** Connection timeout in milliseconds */\n connectionTimeout: 10000,\n\n /** Enable automatic reconnection on disconnect */\n reconnect: true,\n\n /** Delay between reconnection attempts in milliseconds */\n reconnectDelay: 5000,\n\n // ============================================================================\n // Consumer Options\n // ============================================================================\n\n /** Default prefetch count (number of unacknowledged messages per consumer) */\n prefetch: 10,\n\n // ============================================================================\n // Client Options (Native amqplib options)\n // ============================================================================\n // These options are passed directly to amqplib.connect()\n // for low-level configuration like frame size, TLS, socket options, etc.\n // ============================================================================\n clientOptions: {\n // Frame max size in bytes (0 = no limit)\n // frameMax: 0,\n\n // Channel max (0 = unlimited)\n // channelMax: 0,\n\n // Socket options\n socket: {\n // Enable TCP keep-alive\n keepAlive: true,\n\n // Disable Nagle's algorithm for lower latency\n noDelay: true,\n\n // Socket timeout (in addition to heartbeat)\n // timeout: 30000,\n },\n\n // TLS/SSL options (uncomment for secure connections)\n // socket: {\n // ca: fs.readFileSync('/path/to/ca.pem'),\n // cert: fs.readFileSync('/path/to/cert.pem'),\n // key: fs.readFileSync('/path/to/key.pem'),\n // rejectUnauthorized: true,\n // },\n },\n};\n\nexport default communicatorConfigurations;\n";
|
|
2
|
+
//# sourceMappingURL=stubs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../../src/generations/stubs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,6uFAgFnC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
const communicatorsConfigStub = `import { env } from "@mongez/dotenv";
|
|
2
|
+
import type { CommunicatorConfigurations, RabbitMQClientOptions } from "@warlock.js/herald";
|
|
3
|
+
|
|
4
|
+
const communicatorConfigurations: CommunicatorConfigurations<RabbitMQClientOptions> = {
|
|
5
|
+
driver: "rabbitmq",
|
|
6
|
+
name: "default",
|
|
7
|
+
isDefault: true,
|
|
8
|
+
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Connection Settings
|
|
11
|
+
// ============================================================================
|
|
12
|
+
|
|
13
|
+
host: env("RABBITMQ_HOST", "localhost"),
|
|
14
|
+
port: env("RABBITMQ_PORT", 5672),
|
|
15
|
+
username: env("RABBITMQ_USERNAME", "guest"),
|
|
16
|
+
password: env("RABBITMQ_PASSWORD", "guest"),
|
|
17
|
+
vhost: env("RABBITMQ_VHOST", "/"),
|
|
18
|
+
|
|
19
|
+
// Or use connection URI (takes precedence over host/port)
|
|
20
|
+
// uri: env("RABBITMQ_URL"),
|
|
21
|
+
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// Connection Options
|
|
24
|
+
// ============================================================================
|
|
25
|
+
|
|
26
|
+
/** Heartbeat interval in seconds */
|
|
27
|
+
heartbeat: 60,
|
|
28
|
+
|
|
29
|
+
/** Connection timeout in milliseconds */
|
|
30
|
+
connectionTimeout: 10000,
|
|
31
|
+
|
|
32
|
+
/** Enable automatic reconnection on disconnect */
|
|
33
|
+
reconnect: true,
|
|
34
|
+
|
|
35
|
+
/** Delay between reconnection attempts in milliseconds */
|
|
36
|
+
reconnectDelay: 5000,
|
|
37
|
+
|
|
38
|
+
// ============================================================================
|
|
39
|
+
// Consumer Options
|
|
40
|
+
// ============================================================================
|
|
41
|
+
|
|
42
|
+
/** Default prefetch count (number of unacknowledged messages per consumer) */
|
|
43
|
+
prefetch: 10,
|
|
44
|
+
|
|
45
|
+
// ============================================================================
|
|
46
|
+
// Client Options (Native amqplib options)
|
|
47
|
+
// ============================================================================
|
|
48
|
+
// These options are passed directly to amqplib.connect()
|
|
49
|
+
// for low-level configuration like frame size, TLS, socket options, etc.
|
|
50
|
+
// ============================================================================
|
|
51
|
+
clientOptions: {
|
|
52
|
+
// Frame max size in bytes (0 = no limit)
|
|
53
|
+
// frameMax: 0,
|
|
54
|
+
|
|
55
|
+
// Channel max (0 = unlimited)
|
|
56
|
+
// channelMax: 0,
|
|
57
|
+
|
|
58
|
+
// Socket options
|
|
59
|
+
socket: {
|
|
60
|
+
// Enable TCP keep-alive
|
|
61
|
+
keepAlive: true,
|
|
62
|
+
|
|
63
|
+
// Disable Nagle's algorithm for lower latency
|
|
64
|
+
noDelay: true,
|
|
65
|
+
|
|
66
|
+
// Socket timeout (in addition to heartbeat)
|
|
67
|
+
// timeout: 30000,
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
// TLS/SSL options (uncomment for secure connections)
|
|
71
|
+
// socket: {
|
|
72
|
+
// ca: fs.readFileSync('/path/to/ca.pem'),
|
|
73
|
+
// cert: fs.readFileSync('/path/to/cert.pem'),
|
|
74
|
+
// key: fs.readFileSync('/path/to/key.pem'),
|
|
75
|
+
// rejectUnauthorized: true,
|
|
76
|
+
// },
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export default communicatorConfigurations;
|
|
81
|
+
`;export{communicatorsConfigStub};//# sourceMappingURL=stubs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stubs.js","sources":["../../src/generations/stubs.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAa,MAAA,uBAAuB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{env}from'@mongez/dotenv';import'./validation/init.js';export{colors}from'@mongez/copper';export{bootstrap}from'./bootstrap.js';export{displayEnvironmentMode}from'./bootstrap/setup.js';import'./cache/index.js';export{CLICommand,command}from'./cli/cli-command.js';export{config}from'./config/config-getter.js';export{registerAppConfig,registerLogConfig,registerMailConfig}from'./config/config-handlers.js';export{ConfigSpecialHandlers,configSpecialHandlers}from'./config/config-special-handlers.js';export{DatabaseLogModel}from'./database/models/database-log/database-log.js';export{seeder}from'./database/seeds/seeder.js';export{useComputedModel,useComputedSlug,useHashedPassword}from'./database/utils.js';export{BaseConnector}from'./dev2-server/connectors/base-connector.js';export{CacheConnector}from'./dev2-server/connectors/cache-connector.js';export{ConnectorsManager,connectorsManager}from'./dev2-server/connectors/connectors-manager.js';export{DatabaseConnector}from'./dev2-server/connectors/database-connector.js';export{HttpConnector}from'./dev2-server/connectors/http-connector.js';export{StorageConnector}from'./dev2-server/connectors/storage.connector.js';export{ConnectorPriority}from'./dev2-server/connectors/types.js';export{BaseHealthChecker}from'./dev2-server/health-checker/checkers/base-health-checker.js';export{EslintHealthChecker}from'./dev2-server/health-checker/checkers/eslint-health-checker.js';export{TypescriptHealthChecker}from'./dev2-server/health-checker/checkers/typescript-health-checker.js';import'./dev2-server/health-checker/workers/eslint-health.worker.js';import'./dev2-server/health-checker/workers/ts-health.worker.js';export{defaultHttpConfigurations,httpConfig}from'./http/config.js';export{createHttpApplication,stopHttpApplication}from'./http/createHttpApplication.js';export{RequestLog}from'./http/database/RequestLog.js';export{logResponse,wrapResponseInDataKey}from'./http/events.js';export{RequestController}from'./http/request-controller.js';export{UploadedFile}from'./http/uploaded-file.js';export{UPLOADS_DEFAULTS,uploadsConfig}from'./http/uploads-config.js';export{BadRequestError,ForbiddenError,ResourceNotFoundError,ServerError,UnAuthorizedError}from'./http/errors/resource-not-found.error.js';export{cacheMiddleware}from'./http/middleware/cache-response-middleware.js';export{createRequestStore,fromRequest,t}from'./http/middleware/inject-request-context.js';export{registerHttpPlugins}from'./http/plugins.js';export{Request}from'./http/request.js';export{Response,ResponseStatus}from'./http/response.js';export{getServer,startServer}from'./http/server.js';export{requestContext,useCurrentUser,useRequest,useRequestStore}from'./http/context/request-context.js';export{Image}from'./image/image.js';export{setLogConfigurations}from'./logger/logger.js';export{getDefaultMailConfig,getMailMode,getMailerConfig,isDevelopmentMode,isProductionMode,isTestMode,resetMailConfig,resolveMailConfig,setMailConfigurations,setMailMode}from'./mail/config.js';export{MAIL_EVENTS,generateMailId,getMailEventName,mailEvents}from'./mail/events.js';export{closeAllMailers,closeMailer,getMailer,getPoolStats,verifyMailer}from'./mail/mailer-pool.js';export{renderReactMail}from'./mail/react-mail.js';export{sendMail}from'./mail/send-mail.js';export{Mail}from'./mail/mail.js';export{assertMailCount,assertMailSent,captureMail,clearTestMailbox,findMailsBySubject,findMailsTo,getLastMail,getMailboxSize,getTestMailbox,wasMailSentTo,wasMailSentWithSubject}from'./mail/test-mailbox.js';export{MailError}from'./mail/types.js';export{renderReact}from'./react/index.js';export{CascadeAdapter}from'./repositories/adapters/cascade/cascade-adapter.js';export{CascadeQueryBuilder}from'./repositories/adapters/cascade/cascade-query-builder.js';export{RepositoryManager}from'./repositories/repository.manager.js';export{defineResource}from'./resource/define-resource.js';export{Resource}from'./resource/resource.js';export{ResourceFieldBuilder}from'./resource/resource-field-builder.js';export{Restful}from'./restful/restful.js';export{Router,router}from'./router/router.js';export{route}from'./router/utils.js';export{storageConfig,storageConfigurations}from'./storage/config.js';export{ScopedStorage}from'./storage/scoped-storage.js';export{Storage,storage}from'./storage/storage.js';export{StorageFile}from'./storage/storage-file.js';export{storageDriverContext}from'./storage/context/storage-driver-context.js';export{MimeTypes,getMimeType}from'./storage/utils/mime.js';export{CloudDriver}from'./storage/drivers/cloud-driver.js';export{DOSpacesDriver}from'./storage/drivers/do-spaces-driver.js';export{LocalDriver}from'./storage/drivers/local-driver.js';export{R2Driver}from'./storage/drivers/r2-driver.js';export{S3Driver}from'./storage/drivers/s3-driver.js';export{createStore,useStore}from'./store/index.js';export{appLog}from'./utils/app-log.js';export{DatabaseLog}from'./utils/database-log.js';export{environment,setEnvironment}from'./utils/environment.js';export{getLocalized}from'./utils/get-localized.js';export{appPath,cachePath,configPath,consolePath,publicPath,rootPath,sanitizePath,srcPath,storagePath,tempPath,uploadsPath,warlockPath}from'./utils/paths.js';export{promiseAllObject}from'./utils/promise-all-object.js';export{Queue}from'./utils/queue.js';export{sleep}from'./utils/sleep.js';export{sluggable}from'./utils/sluggable.js';export{toJson}from'./utils/to-json.js';export{assetsUrl,publicUrl,setBaseUrl,uploadsUrl,url}from'./utils/urls.js';export{FileValidator,uploadedFileMetadataSchema}from'./validation/validators/file-validator.js';export{existsRule}from'./validation/database/exists.js';export{existsExceptCurrentIdRule}from'./validation/database/exists-except-current-id.js';export{existsExceptCurrentUserRule}from'./validation/database/exists-except-current-user.js';export{uniqueRule}from'./validation/database/unique.js';export{uniqueExceptCurrentIdRule}from'./validation/database/unique-except-current-id.js';export{uniqueExceptCurrentUserRule}from'./validation/database/unique-except-current-user.js';export{fileExtensionRule,fileRule,fileTypeRule,imageRule}from'./validation/file/file.js';export{v}from'@warlock.js/seal';export{defineConfig}from'./warlock-config/define-config.js';export{WarlockConfigManager,warlockConfigManager}from'./warlock-config/warlock-config.manager.js';export{DatabaseCacheDriver}from'./cache/database-cache-driver.js';//# sourceMappingURL=index.js.map
|
|
1
|
+
export{env}from'@mongez/dotenv';import'./validation/init.js';export{colors}from'@mongez/copper';export{bootstrap}from'./bootstrap.js';export{displayEnvironmentMode}from'./bootstrap/setup.js';import'./cache/index.js';export{CLICommand,command}from'./cli/cli-command.js';export{config}from'./config/config-getter.js';export{registerAppConfig,registerLogConfig,registerMailConfig}from'./config/config-handlers.js';export{ConfigSpecialHandlers,configSpecialHandlers}from'./config/config-special-handlers.js';export{DatabaseLogModel}from'./database/models/database-log/database-log.js';export{seeder}from'./database/seeds/seeder.js';export{useComputedModel,useComputedSlug,useHashedPassword}from'./database/utils.js';export{BaseConnector}from'./dev2-server/connectors/base-connector.js';export{CacheConnector}from'./dev2-server/connectors/cache-connector.js';export{CommunicatorConnector}from'./dev2-server/connectors/communicator-connector.js';export{ConnectorsManager,connectorsManager}from'./dev2-server/connectors/connectors-manager.js';export{DatabaseConnector}from'./dev2-server/connectors/database-connector.js';export{HttpConnector}from'./dev2-server/connectors/http-connector.js';export{StorageConnector}from'./dev2-server/connectors/storage.connector.js';export{ConnectorPriority}from'./dev2-server/connectors/types.js';export{BaseHealthChecker}from'./dev2-server/health-checker/checkers/base-health-checker.js';export{EslintHealthChecker}from'./dev2-server/health-checker/checkers/eslint-health-checker.js';export{TypescriptHealthChecker}from'./dev2-server/health-checker/checkers/typescript-health-checker.js';import'./dev2-server/health-checker/workers/eslint-health.worker.js';import'./dev2-server/health-checker/workers/ts-health.worker.js';export{defaultHttpConfigurations,httpConfig}from'./http/config.js';export{createHttpApplication,stopHttpApplication}from'./http/createHttpApplication.js';export{RequestLog}from'./http/database/RequestLog.js';export{logResponse,wrapResponseInDataKey}from'./http/events.js';export{RequestController}from'./http/request-controller.js';export{UploadedFile}from'./http/uploaded-file.js';export{UPLOADS_DEFAULTS,uploadsConfig}from'./http/uploads-config.js';export{BadRequestError,ForbiddenError,ResourceNotFoundError,ServerError,UnAuthorizedError}from'./http/errors/resource-not-found.error.js';export{cacheMiddleware}from'./http/middleware/cache-response-middleware.js';export{createRequestStore,fromRequest,t}from'./http/middleware/inject-request-context.js';export{registerHttpPlugins}from'./http/plugins.js';export{Request}from'./http/request.js';export{Response,ResponseStatus}from'./http/response.js';export{getServer,startServer}from'./http/server.js';export{requestContext,useCurrentUser,useRequest,useRequestStore}from'./http/context/request-context.js';export{Image}from'./image/image.js';export{setLogConfigurations}from'./logger/logger.js';export{getDefaultMailConfig,getMailMode,getMailerConfig,isDevelopmentMode,isProductionMode,isTestMode,resetMailConfig,resolveMailConfig,setMailConfigurations,setMailMode}from'./mail/config.js';export{MAIL_EVENTS,generateMailId,getMailEventName,mailEvents}from'./mail/events.js';export{closeAllMailers,closeMailer,getMailer,getPoolStats,verifyMailer}from'./mail/mailer-pool.js';export{renderReactMail}from'./mail/react-mail.js';export{sendMail}from'./mail/send-mail.js';export{Mail}from'./mail/mail.js';export{assertMailCount,assertMailSent,captureMail,clearTestMailbox,findMailsBySubject,findMailsTo,getLastMail,getMailboxSize,getTestMailbox,wasMailSentTo,wasMailSentWithSubject}from'./mail/test-mailbox.js';export{MailError}from'./mail/types.js';export{renderReact}from'./react/index.js';export{CascadeAdapter}from'./repositories/adapters/cascade/cascade-adapter.js';export{CascadeQueryBuilder}from'./repositories/adapters/cascade/cascade-query-builder.js';export{RepositoryManager}from'./repositories/repository.manager.js';export{defineResource}from'./resource/define-resource.js';export{Resource}from'./resource/resource.js';export{ResourceFieldBuilder}from'./resource/resource-field-builder.js';export{Restful}from'./restful/restful.js';export{Router,router}from'./router/router.js';export{route}from'./router/utils.js';export{storageConfig,storageConfigurations}from'./storage/config.js';export{ScopedStorage}from'./storage/scoped-storage.js';export{Storage,storage}from'./storage/storage.js';export{StorageFile}from'./storage/storage-file.js';export{storageDriverContext}from'./storage/context/storage-driver-context.js';export{MimeTypes,getMimeType}from'./storage/utils/mime.js';export{CloudDriver}from'./storage/drivers/cloud-driver.js';export{DOSpacesDriver}from'./storage/drivers/do-spaces-driver.js';export{LocalDriver}from'./storage/drivers/local-driver.js';export{R2Driver}from'./storage/drivers/r2-driver.js';export{S3Driver}from'./storage/drivers/s3-driver.js';export{createStore,useStore}from'./store/index.js';export{appLog}from'./utils/app-log.js';export{DatabaseLog}from'./utils/database-log.js';export{environment,setEnvironment}from'./utils/environment.js';export{getLocalized}from'./utils/get-localized.js';export{appPath,cachePath,configPath,consolePath,publicPath,rootPath,sanitizePath,srcPath,storagePath,tempPath,uploadsPath,warlockPath}from'./utils/paths.js';export{promiseAllObject}from'./utils/promise-all-object.js';export{Queue}from'./utils/queue.js';export{sleep}from'./utils/sleep.js';export{sluggable}from'./utils/sluggable.js';export{toJson}from'./utils/to-json.js';export{assetsUrl,publicUrl,setBaseUrl,uploadsUrl,url}from'./utils/urls.js';export{FileValidator,uploadedFileMetadataSchema}from'./validation/validators/file-validator.js';export{existsRule}from'./validation/database/exists.js';export{existsExceptCurrentIdRule}from'./validation/database/exists-except-current-id.js';export{existsExceptCurrentUserRule}from'./validation/database/exists-except-current-user.js';export{uniqueRule}from'./validation/database/unique.js';export{uniqueExceptCurrentIdRule}from'./validation/database/unique-except-current-id.js';export{uniqueExceptCurrentUserRule}from'./validation/database/unique-except-current-user.js';export{fileExtensionRule,fileRule,fileTypeRule,imageRule}from'./validation/file/file.js';export{v}from'@warlock.js/seal';export{defineConfig}from'./warlock-config/define-config.js';export{WarlockConfigManager,warlockConfigManager}from'./warlock-config/warlock-config.manager.js';export{DatabaseCacheDriver}from'./cache/database-cache-driver.js';//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database-plugin.d.ts","sourceRoot":"","sources":["../../../src/validation/plugins/database-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"database-plugin.d.ts","sourceRoot":"","sources":["../../../src/validation/plugins/database-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAuBnD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,UA+H5B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ScalarValidator,StringValidator,NumberValidator}from'@warlock.js/seal';import {existsRule}from'../database/exists.js';import {existsExceptCurrentIdRule}from'../database/exists-except-current-id.js';import {existsExceptCurrentUserRule}from'../database/exists-except-current-user.js';import {uniqueRule}from'../database/unique.js';import {uniqueExceptCurrentIdRule}from'../database/unique-except-current-id.js';import {uniqueExceptCurrentUserRule}from'../database/unique-except-current-user.js';/**
|
|
1
|
+
import {getModelFromRegistry}from'@warlock.js/cascade';import {ScalarValidator,StringValidator,NumberValidator}from'@warlock.js/seal';import {existsRule}from'../database/exists.js';import {existsExceptCurrentIdRule}from'../database/exists-except-current-id.js';import {existsExceptCurrentUserRule}from'../database/exists-except-current-user.js';import {uniqueRule}from'../database/unique.js';import {uniqueExceptCurrentIdRule}from'../database/unique-except-current-id.js';import {uniqueExceptCurrentUserRule}from'../database/unique-except-current-user.js';/**
|
|
2
2
|
* Database Validation Plugin
|
|
3
3
|
*
|
|
4
4
|
* Adds database validation methods to Seal validators:
|
|
@@ -6,6 +6,9 @@ import {ScalarValidator,StringValidator,NumberValidator}from'@warlock.js/seal';i
|
|
|
6
6
|
* - exists() - Verify record exists
|
|
7
7
|
* - And variants (exceptCurrentUser, exceptCurrentId)
|
|
8
8
|
*/
|
|
9
|
+
function resolveModel(model) {
|
|
10
|
+
return typeof model === "string" ? getModelFromRegistry(model) : model;
|
|
11
|
+
}
|
|
9
12
|
/**
|
|
10
13
|
* Database validation plugin for Seal
|
|
11
14
|
*/
|
|
@@ -22,7 +25,7 @@ const databasePlugin = {
|
|
|
22
25
|
const rule = this.addRule(uniqueRule, errorMessage);
|
|
23
26
|
rule.context.options = {
|
|
24
27
|
...options,
|
|
25
|
-
Model: model,
|
|
28
|
+
Model: resolveModel(model),
|
|
26
29
|
};
|
|
27
30
|
return this;
|
|
28
31
|
},
|
|
@@ -32,7 +35,7 @@ const databasePlugin = {
|
|
|
32
35
|
const rule = this.addRule(uniqueExceptCurrentUserRule, errorMessage);
|
|
33
36
|
rule.context.options = {
|
|
34
37
|
...options,
|
|
35
|
-
Model: model,
|
|
38
|
+
Model: resolveModel(model),
|
|
36
39
|
};
|
|
37
40
|
return this;
|
|
38
41
|
},
|
|
@@ -42,7 +45,7 @@ const databasePlugin = {
|
|
|
42
45
|
const rule = this.addRule(uniqueExceptCurrentIdRule, errorMessage);
|
|
43
46
|
rule.context.options = {
|
|
44
47
|
...options,
|
|
45
|
-
Model: model,
|
|
48
|
+
Model: resolveModel(model),
|
|
46
49
|
};
|
|
47
50
|
return this;
|
|
48
51
|
},
|
|
@@ -52,7 +55,7 @@ const databasePlugin = {
|
|
|
52
55
|
const rule = this.addRule(existsRule, errorMessage);
|
|
53
56
|
rule.context.options = {
|
|
54
57
|
...options,
|
|
55
|
-
Model: model,
|
|
58
|
+
Model: resolveModel(model),
|
|
56
59
|
};
|
|
57
60
|
return this;
|
|
58
61
|
},
|
|
@@ -62,7 +65,7 @@ const databasePlugin = {
|
|
|
62
65
|
const rule = this.addRule(existsExceptCurrentUserRule, errorMessage);
|
|
63
66
|
rule.context.options = {
|
|
64
67
|
...options,
|
|
65
|
-
Model: model,
|
|
68
|
+
Model: resolveModel(model),
|
|
66
69
|
};
|
|
67
70
|
return this;
|
|
68
71
|
},
|
|
@@ -72,7 +75,7 @@ const databasePlugin = {
|
|
|
72
75
|
const rule = this.addRule(existsExceptCurrentIdRule, errorMessage);
|
|
73
76
|
rule.context.options = {
|
|
74
77
|
...options,
|
|
75
|
-
Model: model,
|
|
78
|
+
Model: resolveModel(model),
|
|
76
79
|
};
|
|
77
80
|
return this;
|
|
78
81
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database-plugin.js","sources":["../../../src/validation/plugins/database-plugin.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"database-plugin.js","sources":["../../../src/validation/plugins/database-plugin.ts"],"sourcesContent":[null],"names":[],"mappings":"4iBAAA;;;;;;;AAOG;AAsBH,SAAS,YAAY,CAAC,KAAiC,EAAA;AACrD,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAG,oBAAoB,CAAC,KAAK,CAAE,GAAG,KAAK,CAAC;AAC1E,CAAC;AAED;;AAEG;AACU,MAAA,cAAc,GAAe;AACxC,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,WAAW,EAAE,iEAAiE;IAE9E,OAAO,GAAA;;AAEL,QAAA,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE;;YAEvC,MAAM,CAEJ,KAAiC,EACjC,WAEC,EAAA;gBAED,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,GAAG,WAAW,IAAI,EAAE,CAAC;gBACvD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AACpD,gBAAA,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG;AACrB,oBAAA,GAAG,OAAO;AACV,oBAAA,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC;iBAC3B,C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AM,EAAE,eAAe,CAAC,SAAS,CAAC,MAAM;AACxC,YAAA,MAAM,EAAE,eAAe,CAAC,SAAS,CAAC,MAAM;AACzC,SAAA,CAAC,CAAC;KACJ;"}
|
|
@@ -16,27 +16,27 @@ declare module "@warlock.js/seal" {
|
|
|
16
16
|
}
|
|
17
17
|
interface ScalarValidator {
|
|
18
18
|
/** Value must be unique in database */
|
|
19
|
-
unique(model: ChildModel<Model
|
|
19
|
+
unique(model: ChildModel<Model> | string, optionsList?: Partial<UniqueRuleOptions> & {
|
|
20
20
|
errorMessage?: string;
|
|
21
21
|
}): this;
|
|
22
22
|
/** Value must be unique in database except current user */
|
|
23
|
-
uniqueExceptCurrentUser(model: ChildModel<Model
|
|
23
|
+
uniqueExceptCurrentUser(model: ChildModel<Model> | string, optionsList?: Partial<UniqueExceptCurrentUserRuleOptions> & {
|
|
24
24
|
errorMessage?: string;
|
|
25
25
|
}): this;
|
|
26
26
|
/** Value must be unique in database except current id */
|
|
27
|
-
uniqueExceptCurrentId(model: ChildModel<Model
|
|
27
|
+
uniqueExceptCurrentId(model: ChildModel<Model> | string, optionsList?: Partial<UniqueExceptCurrentIdRuleOptions> & {
|
|
28
28
|
errorMessage?: string;
|
|
29
29
|
}): this;
|
|
30
30
|
/** Value must exist in database */
|
|
31
|
-
exists(model: ChildModel<Model
|
|
31
|
+
exists(model: ChildModel<Model> | string, optionsList?: Partial<ExistsRuleOptions> & {
|
|
32
32
|
errorMessage?: string;
|
|
33
33
|
}): this;
|
|
34
34
|
/** Value must exist in database except current user */
|
|
35
|
-
existsExceptCurrentUser(model: ChildModel<Model
|
|
35
|
+
existsExceptCurrentUser(model: ChildModel<Model> | string, optionsList?: Partial<ExistsExceptCurrentUserRuleOptions> & {
|
|
36
36
|
errorMessage?: string;
|
|
37
37
|
}): this;
|
|
38
38
|
/** Value must exists in database except current id */
|
|
39
|
-
existsExceptCurrentId(model: ChildModel<Model
|
|
39
|
+
existsExceptCurrentId(model: ChildModel<Model> | string, optionsList?: Partial<ExistsExceptCurrentIdRuleOptions> & {
|
|
40
40
|
errorMessage?: string;
|
|
41
41
|
}): this;
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/validation/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,gCAAgC,EAChC,kCAAkC,EAClC,iBAAiB,EACjB,gCAAgC,EAChC,kCAAkC,EAClC,iBAAiB,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,QAAQ,kBAAkB,CAAC;IAEhC,UAAiB,UAAU;QACzB,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;QAC/C,SAAS,EAAE,CACT,cAAc,CAAC,EAAE,aAAa,EAC9B,YAAY,CAAC,EAAE,MAAM,KAClB,cAAc,GAAG;YACpB,SAAS,EAAE,aAAa,CAAC;SAC1B,CAAC;KACH;IAED,UAAU,eAAe;QACvB,uCAAuC;QACvC,MAAM,CACJ,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/validation/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,gCAAgC,EAChC,kCAAkC,EAClC,iBAAiB,EACj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CAAC;CACjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warlock.js/core",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.100",
|
|
4
4
|
"description": "A robust nodejs framework for building blazing fast applications",
|
|
5
5
|
"main": "./esm/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"@mongez/slug": "^1.0.7",
|
|
28
28
|
"@mongez/supportive-is": "^2.0.4",
|
|
29
29
|
"@mongez/time-wizard": "^1.0.6",
|
|
30
|
-
"@warlock.js/auth": "4.0.
|
|
31
|
-
"@warlock.js/cache": "4.0.
|
|
32
|
-
"@warlock.js/cascade": "4.0.
|
|
33
|
-
"@warlock.js/context": "4.0.
|
|
34
|
-
"@warlock.js/logger": "4.0.
|
|
35
|
-
"@warlock.js/seal": "4.0.
|
|
30
|
+
"@warlock.js/auth": "4.0.100",
|
|
31
|
+
"@warlock.js/cache": "4.0.100",
|
|
32
|
+
"@warlock.js/cascade": "4.0.100",
|
|
33
|
+
"@warlock.js/context": "4.0.100",
|
|
34
|
+
"@warlock.js/logger": "4.0.100",
|
|
35
|
+
"@warlock.js/seal": "4.0.100",
|
|
36
36
|
"axios": "^1.7.9",
|
|
37
37
|
"chokidar": "^5.0.0",
|
|
38
38
|
"dayjs": "^1.11.19",
|