@kwirthmagnify/kwirth-common-back 0.5.43 → 0.5.45
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/IBackChannelObject.d.ts +4 -1
- package/dist/IFederation.d.ts +21 -0
- package/dist/IFederation.js +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ISenderAccess, IWebhookAccess, IUserInfo } from '@kwirthmagnify/kwirth-common';
|
|
1
|
+
import { ISenderAccess, IWebhookAccess, IUserInfo, IInstanceConfig } from '@kwirthmagnify/kwirth-common';
|
|
2
|
+
import { IClusterEndpoint, IRemoteChannelHandlers, IRemoteChannelHandle } from './IFederation';
|
|
2
3
|
export interface IBackChannelObject {
|
|
3
4
|
writeStorage?(id: string, secret: boolean, data: any): Promise<void>;
|
|
4
5
|
readStorage?(id: string, secret: boolean): Promise<any>;
|
|
@@ -12,4 +13,6 @@ export interface IBackChannelObject {
|
|
|
12
13
|
getPluginConfig?(pluginId: string): Promise<Record<string, unknown>>;
|
|
13
14
|
senders?: ISenderAccess;
|
|
14
15
|
webhooks?: IWebhookAccess;
|
|
16
|
+
openRemoteChannel?(endpoint: IClusterEndpoint, config: IInstanceConfig, handlers: IRemoteChannelHandlers): IRemoteChannelHandle;
|
|
17
|
+
readUserStore?(userId: string, group: string, key: string): Promise<unknown>;
|
|
15
18
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IInstanceMessage } from '@kwirthmagnify/kwirth-common';
|
|
2
|
+
export interface IClusterEndpoint {
|
|
3
|
+
name: string;
|
|
4
|
+
url: string;
|
|
5
|
+
accessString: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare enum ERemoteConnState {
|
|
9
|
+
CONNECTED = "connected",// socket abierto Y instance válido capturado → operativo
|
|
10
|
+
HANDSHAKING = "handshaking",// socket abierto pero SIN instance aún (canal remoto arrancando / re-handshake)
|
|
11
|
+
RECONNECTING = "reconnecting",// sin socket, reintentando con backoff
|
|
12
|
+
DOWN = "down"
|
|
13
|
+
}
|
|
14
|
+
export interface IRemoteChannelHandlers {
|
|
15
|
+
onMessage: (msg: IInstanceMessage) => void;
|
|
16
|
+
onState: (state: ERemoteConnState) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface IRemoteChannelHandle {
|
|
19
|
+
send: (msg: IInstanceMessage) => void;
|
|
20
|
+
close: () => void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERemoteConnState = void 0;
|
|
4
|
+
// Estado de una conexión remota gestionada por el core. Nunca string literals.
|
|
5
|
+
// Progresión al establecerse: DOWN → RECONNECTING (buscando socket) → HANDSHAKING (socket abierto, pidiendo
|
|
6
|
+
// instance al canal remoto) → CONNECTED (socket + instance = operativo). CONNECTED es el ÚNICO estado en el
|
|
7
|
+
// que un comando llega de verdad al canal remoto.
|
|
8
|
+
var ERemoteConnState;
|
|
9
|
+
(function (ERemoteConnState) {
|
|
10
|
+
ERemoteConnState["CONNECTED"] = "connected";
|
|
11
|
+
ERemoteConnState["HANDSHAKING"] = "handshaking";
|
|
12
|
+
ERemoteConnState["RECONNECTING"] = "reconnecting";
|
|
13
|
+
ERemoteConnState["DOWN"] = "down"; // conexión cerrada / nunca establecida (terminal o sin credenciales)
|
|
14
|
+
})(ERemoteConnState || (exports.ERemoteConnState = ERemoteConnState = {}));
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./IBackChannelObject"), exports);
|
|
18
|
+
__exportStar(require("./IFederation"), exports);
|
|
18
19
|
__exportStar(require("./ILogin"), exports);
|
|
19
20
|
__exportStar(require("./IChannel"), exports);
|
|
20
21
|
__exportStar(require("./IProvider"), exports);
|