@kwirthmagnify/kwirth-common 0.5.6 → 0.5.7

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
@@ -1,4 +1,5 @@
1
1
  import { ISenderAccess } from './Sender';
2
+ import { IDaemonManager } from './Daemon';
2
3
  declare enum ClusterTypeEnum {
3
4
  KUBERNETES = "kubernetes",
4
5
  DOCKER = "docker"
@@ -49,5 +50,6 @@ interface IBackChannelObject {
49
50
  logWarning?(message: unknown): void;
50
51
  logError?(message: unknown): void;
51
52
  senders?: ISenderAccess;
53
+ daemonManager?: IDaemonManager;
52
54
  }
53
55
  export { ClusterTypeEnum, KwirthData, BackChannelData, EClusterType, IBackChannelRequirements, IBackChannelObject };
@@ -0,0 +1,47 @@
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
+ resourced: boolean;
20
+ cluster: boolean;
21
+ sources: string[];
22
+ }
23
+ export interface IBackDaemonRequirements {
24
+ storage: boolean;
25
+ providers: string[];
26
+ }
27
+ export interface IBackDaemonObject {
28
+ writeStorage?(id: string, secret: boolean, data: unknown): Promise<void>;
29
+ readStorage?(id: string, secret: boolean): Promise<unknown>;
30
+ logInfo?(message: unknown): void;
31
+ logTrace?(message: unknown): void;
32
+ logWarning?(message: unknown): void;
33
+ logError?(message: unknown): void;
34
+ senders?: ISenderAccess;
35
+ }
36
+ export interface IDaemonEvent {
37
+ instanceId: string;
38
+ type: string;
39
+ data: unknown;
40
+ }
41
+ export interface IDaemonManager {
42
+ createInstance(daemonId: string, instanceConfig: IDaemonInstanceConfig): Promise<void>;
43
+ stopInstance(instanceId: string): Promise<void>;
44
+ listInstances(daemonId?: string): IDaemonInstanceConfig[];
45
+ subscribe(instanceId: string, callback: (event: IDaemonEvent) => void): () => void;
46
+ sendCommand(instanceId: string, command: string, data: unknown): Promise<unknown>;
47
+ }
package/dist/Daemon.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export * from './AccessKey';
9
9
  export * from './Global';
10
10
  export * from './Version';
11
11
  export * from './FrontChannel';
12
+ export * from './Daemon';
package/dist/index.js CHANGED
@@ -40,3 +40,4 @@ __exportStar(require("./AccessKey"), exports);
40
40
  __exportStar(require("./Global"), exports);
41
41
  __exportStar(require("./Version"), exports);
42
42
  __exportStar(require("./FrontChannel"), exports);
43
+ __exportStar(require("./Daemon"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "Common interfaces for integrating applications with Kwirth",
5
5
  "scripts": {
6
6
  "build": "del .\\dist\\* /s /q && tsc"