@kwirthmagnify/kwirth-common 0.5.14 → 0.5.16

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/Daemon.d.ts CHANGED
@@ -43,6 +43,7 @@ export interface IDaemonManager {
43
43
  listInstances(daemonId?: string): IDaemonInstanceConfig[];
44
44
  subscribe(instanceId: string, callback: (event: IDaemonEvent) => void): () => void;
45
45
  sendCommand(instanceId: string, command: string, data: unknown): Promise<unknown>;
46
+ sendDaemonCommand(daemonId: string, command: string, data: unknown): Promise<unknown>;
46
47
  routeAddObject(podNamespace: string, podName: string, containerName: string): Promise<void>;
47
48
  directAddObject(instanceId: string, podNamespace: string, podName: string, containerName: string): Promise<void>;
48
49
  directDeleteObject(instanceId: string, podNamespace: string, podName: string, containerName: string): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -10,3 +10,4 @@ export * from './Global';
10
10
  export * from './Version';
11
11
  export * from './FrontChannel';
12
12
  export * from './Daemon';
13
+ export * from './nameGenerator';
package/dist/index.js CHANGED
@@ -41,3 +41,4 @@ __exportStar(require("./Global"), exports);
41
41
  __exportStar(require("./Version"), exports);
42
42
  __exportStar(require("./FrontChannel"), exports);
43
43
  __exportStar(require("./Daemon"), exports);
44
+ __exportStar(require("./nameGenerator"), exports);
@@ -0,0 +1,3 @@
1
+ export declare const pick: <T>(arr: T[]) => T;
2
+ export declare const pickAdjective: () => string;
3
+ export declare const generateSessionName: (usedNames?: string[]) => string;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateSessionName = exports.pickAdjective = exports.pick = void 0;
4
+ const ADJECTIVES = [
5
+ 'eager', 'silent', 'clever', 'swift', 'bold', 'dark', 'bright', 'cold', 'wild', 'calm',
6
+ 'deep', 'sharp', 'quiet', 'fierce', 'lone', 'hidden', 'fast', 'ancient', 'distant', 'electric',
7
+ 'phantom', 'rogue', 'broken', 'noble', 'hollow', 'frozen', 'burning', 'glowing', 'twisted', 'sacred',
8
+ 'lost', 'raw', 'free', 'pure', 'strange', 'cursed', 'lucid', 'restless', 'ashen', 'wandering'
9
+ ];
10
+ const SCIENTISTS = [
11
+ 'turing', 'lovelace', 'hopper', 'knuth', 'dijkstra', 'shannon', 'neumann', 'babbage', 'boole', 'hamilton',
12
+ 'liskov', 'engelbart', 'wozniak', 'ritchie', 'kernighan', 'torvalds', 'stallman', 'euler', 'gauss', 'tesla',
13
+ 'curie', 'feynman', 'hawking', 'einstein', 'darwin', 'fermat', 'pascal', 'leibniz', 'church', 'godel',
14
+ 'chomsky', 'diffie', 'hellman', 'rivest', 'shamir', 'vigenere', 'stroustrup', 'gosling', 'kay', 'cerf'
15
+ ];
16
+ const TECH_NOUNS = [
17
+ 'cipher', 'trace', 'phantom', 'scanner', 'signal', 'pattern', 'filter', 'watcher',
18
+ 'sentinel', 'daemon', 'probe', 'stream', 'lens', 'monitor', 'shadow', 'vector',
19
+ 'parser', 'inspector', 'relay', 'vault'
20
+ ];
21
+ const pick = (arr) => arr[Math.floor(Math.random() * arr.length)];
22
+ exports.pick = pick;
23
+ const pickAdjective = () => (0, exports.pick)(ADJECTIVES);
24
+ exports.pickAdjective = pickAdjective;
25
+ const generateSessionName = (usedNames = []) => {
26
+ const used = new Set(usedNames);
27
+ for (let i = 0; i < 20; i++) {
28
+ const adj = (0, exports.pick)(ADJECTIVES);
29
+ const noun = Math.random() < 0.5 ? (0, exports.pick)(SCIENTISTS) : (0, exports.pick)(TECH_NOUNS);
30
+ const name = `${adj}_${noun}`;
31
+ if (!used.has(name))
32
+ return name;
33
+ }
34
+ return `session_${Date.now()}`;
35
+ };
36
+ exports.generateSessionName = generateSessionName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common",
3
- "version": "0.5.14",
3
+ "version": "0.5.16",
4
4
  "description": "Common interfaces for integrating applications with Kwirth",
5
5
  "scripts": {
6
6
  "build": "del .\\dist\\* /s /q && tsc"