@carlosdiazz/lottodiz-shared 2.9.0 → 2.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ResponseInterface } from "../common";
|
|
2
2
|
export interface ObsServiceInterface {
|
|
3
|
-
startStream(key: string): Promise<
|
|
4
|
-
stopStream(): Promise<
|
|
5
|
-
showScene(scene_name: string): Promise<
|
|
6
|
-
changeVolumen(key_volumen: string, value_volumen: number): Promise<
|
|
3
|
+
startStream(key: string): Promise<void>;
|
|
4
|
+
stopStream(): Promise<void>;
|
|
5
|
+
showScene(scene_name: string): Promise<void>;
|
|
6
|
+
changeVolumen(key_volumen: string, value_volumen: number): Promise<void>;
|
|
7
7
|
verify_obs(): Promise<ResponseInterface>;
|
|
8
8
|
execute_action(id_config_obs: number): Promise<ResponseInterface>;
|
|
9
9
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface NatsTlsEnv {
|
|
2
|
+
NATS_SERVERS: string[];
|
|
3
|
+
NATS_USER: string;
|
|
4
|
+
NATS_PASSWORD: string;
|
|
5
|
+
NATS_CA_PATH?: string;
|
|
6
|
+
}
|
|
7
|
+
interface NatsOptionsResult {
|
|
8
|
+
servers: string[];
|
|
9
|
+
user: string;
|
|
10
|
+
pass: string;
|
|
11
|
+
queue?: string;
|
|
12
|
+
timeout?: number;
|
|
13
|
+
tls?: {
|
|
14
|
+
ca: Buffer[];
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Construye las opciones de conexión NATS con soporte TLS condicional.
|
|
19
|
+
* Si NATS_CA_PATH está definido, lee el certificado CA y agrega la configuración TLS.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildNatsOptions(env: NatsTlsEnv, extra?: {
|
|
22
|
+
queue?: string;
|
|
23
|
+
timeout?: number;
|
|
24
|
+
}): NatsOptionsResult;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildNatsOptions = buildNatsOptions;
|
|
4
|
+
/**
|
|
5
|
+
* Construye las opciones de conexión NATS con soporte TLS condicional.
|
|
6
|
+
* Si NATS_CA_PATH está definido, lee el certificado CA y agrega la configuración TLS.
|
|
7
|
+
*/
|
|
8
|
+
function buildNatsOptions(env, extra) {
|
|
9
|
+
const options = {
|
|
10
|
+
servers: env.NATS_SERVERS,
|
|
11
|
+
user: env.NATS_USER,
|
|
12
|
+
pass: env.NATS_PASSWORD,
|
|
13
|
+
};
|
|
14
|
+
if (extra === null || extra === void 0 ? void 0 : extra.queue) {
|
|
15
|
+
options.queue = extra.queue;
|
|
16
|
+
}
|
|
17
|
+
if (extra === null || extra === void 0 ? void 0 : extra.timeout) {
|
|
18
|
+
options.timeout = extra.timeout;
|
|
19
|
+
}
|
|
20
|
+
if (env.NATS_CA_PATH) {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
22
|
+
const fs = require("fs");
|
|
23
|
+
options.tls = {
|
|
24
|
+
ca: [fs.readFileSync(env.NATS_CA_PATH)],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return options;
|
|
28
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -38,3 +38,4 @@ __exportStar(require("./validate-template_result"), exports);
|
|
|
38
38
|
__exportStar(require("./validate-xpath"), exports);
|
|
39
39
|
__exportStar(require("./validatePositionsResult"), exports);
|
|
40
40
|
__exportStar(require("./validate_propety"), exports);
|
|
41
|
+
__exportStar(require("./build-nats-tls-options"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carlosdiazz/lottodiz-shared",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"description": "Shared Dtos, models, constants and utils",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/luxon": "^3.7.1",
|
|
18
|
+
"@types/node": "^25.6.0",
|
|
18
19
|
"typescript": "^5.9.3"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|