@jsnw/srv-utils 1.1.3 → 1.1.5
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/dist/config/predefined-schemas/index.js +3 -1
- package/dist/config/predefined-schemas/rabbit-connection.schema.js +8 -0
- package/dist/types/config/predefined-schemas/index.d.ts +7 -0
- package/dist/types/config/predefined-schemas/rabbit-connection.schema.d.ts +8 -0
- package/dist/useTsconfigPaths.js +7 -3
- package/package.json +1 -1
|
@@ -6,10 +6,12 @@ const connection_schema_1 = require("./connection.schema");
|
|
|
6
6
|
const mongodb_connection_schema_1 = require("./mongodb-connection.schema");
|
|
7
7
|
const mysql_connection_schema_1 = require("./mysql-connection.schema");
|
|
8
8
|
const redis_connection_schema_1 = require("./redis-connection.schema");
|
|
9
|
+
const rabbit_connection_schema_1 = require("./rabbit-connection.schema");
|
|
9
10
|
exports.configSchemas = {
|
|
10
11
|
timeString: timestring_schema_1.timeStringSchema,
|
|
11
12
|
connection: connection_schema_1.connectionSchema,
|
|
12
13
|
mongodbConnection: mongodb_connection_schema_1.mongodbConnectionSchema,
|
|
13
14
|
mysqlConnection: mysql_connection_schema_1.mysqlConnectionSchema,
|
|
14
|
-
redisConnection: redis_connection_schema_1.redisConnectionSchema
|
|
15
|
+
redisConnection: redis_connection_schema_1.redisConnectionSchema,
|
|
16
|
+
rabbitConnection: rabbit_connection_schema_1.rabbitConnectionSchema
|
|
15
17
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rabbitConnectionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const connection_schema_1 = require("./connection.schema");
|
|
6
|
+
exports.rabbitConnectionSchema = connection_schema_1.connectionSchema.extend({
|
|
7
|
+
vhost: zod_1.z.string().default('/')
|
|
8
|
+
});
|
|
@@ -47,4 +47,11 @@ export declare const configSchemas: {
|
|
|
47
47
|
db: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
48
48
|
keyPrefix: import("zod").ZodDefault<import("zod").ZodString>;
|
|
49
49
|
}, import("zod/v4/core").$strip>;
|
|
50
|
+
rabbitConnection: import("zod").ZodObject<{
|
|
51
|
+
host: import("zod").ZodString;
|
|
52
|
+
port: import("zod").ZodNumber;
|
|
53
|
+
user: import("zod").ZodString;
|
|
54
|
+
pass: import("zod").ZodString;
|
|
55
|
+
vhost: import("zod").ZodDefault<import("zod").ZodString>;
|
|
56
|
+
}, import("zod/v4/core").$strip>;
|
|
50
57
|
};
|
package/dist/useTsconfigPaths.js
CHANGED
|
@@ -17,9 +17,13 @@ function useTsconfigPaths({ basePath, tsconfigPath }) {
|
|
|
17
17
|
const tsconfig = require((0, node_path_1.resolve)(tsconfigPath)), tsconfigDirPathname = (0, node_path_1.dirname)(tsconfigPath), paths = {};
|
|
18
18
|
if (!basePath && !tsconfig?.compilerOptions?.baseUrl)
|
|
19
19
|
throw new TypeError('Either basePath option should be provided or tsconfig.json should contain compilerOptions.baseUrl property');
|
|
20
|
-
const baseUrl =
|
|
21
|
-
? (0, node_path_1.resolve)(
|
|
22
|
-
:
|
|
20
|
+
const baseUrl = basePath
|
|
21
|
+
? (0, node_path_1.resolve)(basePath)
|
|
22
|
+
: tsconfig?.compilerOptions?.baseUrl
|
|
23
|
+
? (0, node_path_1.resolve)(tsconfig.compilerOptions.baseUrl)
|
|
24
|
+
: undefined;
|
|
25
|
+
if (baseUrl === undefined)
|
|
26
|
+
throw new Error('Unable to resolve base path for tsconfig paths');
|
|
23
27
|
Object.entries((tsconfig?.compilerOptions?.paths ?? {}))
|
|
24
28
|
.forEach(([moduleName, pathArray]) => {
|
|
25
29
|
if (pathArray.length === 0)
|
package/package.json
CHANGED