@kwirthmagnify/kwirth-common 0.5.19 → 0.5.21

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/Channel.d.ts CHANGED
@@ -8,6 +8,14 @@ declare enum EClusterType {
8
8
  KUBERNETES = "kubernetes",
9
9
  DOCKER = "docker"
10
10
  }
11
+ declare enum EChannelInstances {
12
+ MULTI = "multi",// several backs per cluster are valid (default: log, metrics, mirc…)
13
+ SINGLE = "single"
14
+ }
15
+ declare enum EChannelMode {
16
+ LOCAL = "local",// hosted here (current behavior)
17
+ REMOTE = "remote"
18
+ }
11
19
  interface IEndpointConfig {
12
20
  name: string;
13
21
  methods: string[];
@@ -25,6 +33,7 @@ interface BackChannelData {
25
33
  websocket: boolean;
26
34
  cluster: boolean;
27
35
  resourced: boolean;
36
+ mode?: EChannelMode;
28
37
  }
29
38
  interface KwirthData {
30
39
  version: string;
@@ -41,6 +50,7 @@ interface KwirthData {
41
50
  interface IBackChannelRequirements {
42
51
  storage: boolean;
43
52
  providers: string[];
53
+ instances?: EChannelInstances;
44
54
  }
45
55
  interface IBackChannelObject {
46
56
  writeStorage?(id: string, secret: boolean, data: any): Promise<void>;
@@ -54,4 +64,4 @@ interface IBackChannelObject {
54
64
  getUsers?(): Promise<IUserInfo[]>;
55
65
  senders?: ISenderAccess;
56
66
  }
57
- export { ClusterTypeEnum, KwirthData, BackChannelData, EClusterType, IBackChannelRequirements, IBackChannelObject };
67
+ export { ClusterTypeEnum, KwirthData, BackChannelData, EClusterType, EChannelInstances, EChannelMode, IBackChannelRequirements, IBackChannelObject };
package/dist/Channel.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EClusterType = exports.ClusterTypeEnum = void 0;
3
+ exports.EChannelMode = exports.EChannelInstances = exports.EClusterType = exports.ClusterTypeEnum = void 0;
4
4
  //transient
5
5
  var ClusterTypeEnum;
6
6
  (function (ClusterTypeEnum) {
@@ -12,3 +12,15 @@ var EClusterType;
12
12
  EClusterType["KUBERNETES"] = "kubernetes";
13
13
  EClusterType["DOCKER"] = "docker";
14
14
  })(EClusterType || (exports.EClusterType = EClusterType = {}));
15
+ // How many back instances of a channel make sense per cluster.
16
+ var EChannelInstances;
17
+ (function (EChannelInstances) {
18
+ EChannelInstances["MULTI"] = "multi";
19
+ EChannelInstances["SINGLE"] = "single"; // exactly one back per cluster (the old "daemon"); home = in-cluster Kwirth
20
+ })(EChannelInstances || (exports.EChannelInstances = EChannelInstances = {}));
21
+ // Whether a channel's back is hosted by this Kwirth or lives elsewhere (resolved by the front-hub).
22
+ var EChannelMode;
23
+ (function (EChannelMode) {
24
+ EChannelMode["LOCAL"] = "local";
25
+ EChannelMode["REMOTE"] = "remote"; // not hosted here; find it on the in-cluster Kwirth
26
+ })(EChannelMode || (exports.EChannelMode = EChannelMode = {}));
@@ -0,0 +1,7 @@
1
+ export declare enum EExtensionType {
2
+ PLUGIN = "plugin",
3
+ PROVIDER = "provider",
4
+ SENDER = "sender",
5
+ THEME = "theme",
6
+ HOMEPAGE = "homepage"
7
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EExtensionType = void 0;
4
+ // Tipo de extensión de Kwirth. Enum (regla: no string-literals para valores enumerados que cruzan
5
+ // back↔front). Nombre y valores en SINGULAR.
6
+ //
7
+ // OJO: no confundir estos valores con las RUTAS HTTP (plurales: `/plugins`, `/providers`, …) ni con
8
+ // las CLAVES del JSON de licencia (`channels`/`providers`/…): esos contratos se mantienen literales.
9
+ // El enum ordena el CÓDIGO (tipo); rutas/claves quedan como strings en su frontera.
10
+ var EExtensionType;
11
+ (function (EExtensionType) {
12
+ EExtensionType["PLUGIN"] = "plugin";
13
+ EExtensionType["PROVIDER"] = "provider";
14
+ EExtensionType["SENDER"] = "sender";
15
+ EExtensionType["THEME"] = "theme";
16
+ EExtensionType["HOMEPAGE"] = "homepage";
17
+ })(EExtensionType || (exports.EExtensionType = EExtensionType = {}));
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ export * from './ApiKey';
8
8
  export * from './AccessKey';
9
9
  export * from './Global';
10
10
  export * from './AuthMethod';
11
+ export * from './ExtensionType';
11
12
  export * from './Version';
12
13
  export * from './FrontChannel';
13
- export * from './Daemon';
14
14
  export * from './nameGenerator';
package/dist/index.js CHANGED
@@ -39,7 +39,8 @@ __exportStar(require("./ApiKey"), exports);
39
39
  __exportStar(require("./AccessKey"), exports);
40
40
  __exportStar(require("./Global"), exports);
41
41
  __exportStar(require("./AuthMethod"), exports);
42
+ __exportStar(require("./ExtensionType"), exports);
43
+ // (daemons eliminados: se retira export * from './Daemon')
42
44
  __exportStar(require("./Version"), exports);
43
45
  __exportStar(require("./FrontChannel"), exports);
44
- __exportStar(require("./Daemon"), exports);
45
46
  __exportStar(require("./nameGenerator"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common",
3
- "version": "0.5.19",
3
+ "version": "0.5.21",
4
4
  "description": "Common interfaces for integrating applications with Kwirth",
5
5
  "scripts": {
6
6
  "build": "del .\\dist\\* /s /q && tsc"
package/dist/Daemon.d.ts DELETED
@@ -1,51 +0,0 @@
1
- import { ISenderAccess } from './Sender';
2
- import { EInstanceConfigObject, EInstanceConfigView } from './InstanceConfig';
3
- export interface IDaemonInstanceConfig {
4
- id: string;
5
- daemonId: string;
6
- description: string;
7
- view: EInstanceConfigView;
8
- namespace: string;
9
- group?: string;
10
- pod?: string;
11
- container?: string;
12
- objects?: EInstanceConfigObject;
13
- data?: unknown;
14
- started?: boolean;
15
- createdAt?: string;
16
- }
17
- export interface BackDaemonData {
18
- id: string;
19
- }
20
- export interface IBackDaemonRequirements {
21
- storage: boolean;
22
- providers: string[];
23
- }
24
- export interface IBackDaemonObject {
25
- writeStorage?(id: string, secret: boolean, data: unknown): Promise<void>;
26
- readStorage?(id: string, secret: boolean): Promise<unknown>;
27
- writeStorageCommon?(id: string, secret: boolean, data: unknown): Promise<void>;
28
- readStorageCommon?(id: string, secret: boolean): Promise<unknown>;
29
- logInfo?(message: unknown): void;
30
- logTrace?(message: unknown): void;
31
- logWarning?(message: unknown): void;
32
- logError?(message: unknown): void;
33
- senders?: ISenderAccess;
34
- }
35
- export interface IDaemonEvent {
36
- instanceId: string;
37
- type: string;
38
- data: unknown;
39
- }
40
- export interface IDaemonManager {
41
- createInstance(daemonId: string, instanceConfig: IDaemonInstanceConfig): Promise<void>;
42
- stopInstance(instanceId: string): Promise<void>;
43
- listInstances(daemonId?: string): IDaemonInstanceConfig[];
44
- subscribe(instanceId: string, callback: (event: IDaemonEvent) => void): () => void;
45
- sendCommand(instanceId: string, command: string, data: unknown): Promise<unknown>;
46
- sendDaemonCommand(daemonId: string, command: string, data: unknown): Promise<unknown>;
47
- routeAddObject(podNamespace: string, podName: string, containerName: string): Promise<void>;
48
- directAddObject(instanceId: string, podNamespace: string, podName: string, containerName: string): Promise<void>;
49
- directDeleteObject(instanceId: string, podNamespace: string, podName: string, containerName: string): Promise<void>;
50
- routeProviderEvent(providerId: string, event: unknown): void;
51
- }
package/dist/Daemon.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });