@kwirthmagnify/kwirth-common 0.5.15 → 0.5.18

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.
@@ -0,0 +1,11 @@
1
+ declare enum EAuthMethodKind {
2
+ PASSWORD = "password",// método kwirth → formulario usuario/contraseña
3
+ REDIRECT = "redirect"
4
+ }
5
+ interface IAuthMethod {
6
+ id: string;
7
+ label: string;
8
+ kind: EAuthMethodKind;
9
+ startUrl?: string;
10
+ }
11
+ export { EAuthMethodKind, IAuthMethod };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EAuthMethodKind = void 0;
4
+ /*
5
+ Métodos de autenticación que el back publica (GET /core/auth/method) y el front
6
+ usa para pintar la pantalla de login. 'kwirth' es el login user/password incorporado;
7
+ los IdP (Google, ...) son métodos REDIRECT que navegan a su startUrl.
8
+ */
9
+ var EAuthMethodKind;
10
+ (function (EAuthMethodKind) {
11
+ EAuthMethodKind["PASSWORD"] = "password";
12
+ EAuthMethodKind["REDIRECT"] = "redirect"; // IdP (OIDC/OAuth2) → botón que navega a startUrl
13
+ })(EAuthMethodKind || (exports.EAuthMethodKind = EAuthMethodKind = {}));
package/dist/Global.d.ts CHANGED
@@ -5,6 +5,7 @@ interface IUser {
5
5
  password: string;
6
6
  accessKey: AccessKey;
7
7
  resources: string;
8
+ idp?: string;
8
9
  }
9
10
  interface ILoginResponse {
10
11
  id: string;
package/dist/index.d.ts CHANGED
@@ -7,6 +7,8 @@ export * from './SignalMessage';
7
7
  export * from './ApiKey';
8
8
  export * from './AccessKey';
9
9
  export * from './Global';
10
+ export * from './AuthMethod';
10
11
  export * from './Version';
11
12
  export * from './FrontChannel';
12
13
  export * from './Daemon';
14
+ export * from './nameGenerator';
package/dist/index.js CHANGED
@@ -38,6 +38,8 @@ __exportStar(require("./SignalMessage"), exports);
38
38
  __exportStar(require("./ApiKey"), exports);
39
39
  __exportStar(require("./AccessKey"), exports);
40
40
  __exportStar(require("./Global"), exports);
41
+ __exportStar(require("./AuthMethod"), exports);
41
42
  __exportStar(require("./Version"), exports);
42
43
  __exportStar(require("./FrontChannel"), exports);
43
44
  __exportStar(require("./Daemon"), exports);
45
+ __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,37 @@
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
+ 'wirth', 'galileo', 'davinci'
16
+ ];
17
+ const TECH_NOUNS = [
18
+ 'cipher', 'trace', 'phantom', 'scanner', 'signal', 'pattern', 'filter', 'watcher',
19
+ 'sentinel', 'daemon', 'probe', 'stream', 'lens', 'monitor', 'shadow', 'vector',
20
+ 'parser', 'inspector', 'relay', 'vault'
21
+ ];
22
+ const pick = (arr) => arr[Math.floor(Math.random() * arr.length)];
23
+ exports.pick = pick;
24
+ const pickAdjective = () => (0, exports.pick)(ADJECTIVES);
25
+ exports.pickAdjective = pickAdjective;
26
+ const generateSessionName = (usedNames = []) => {
27
+ const used = new Set(usedNames);
28
+ for (let i = 0; i < 20; i++) {
29
+ const adj = (0, exports.pick)(ADJECTIVES);
30
+ const noun = Math.random() < 0.5 ? (0, exports.pick)(SCIENTISTS) : (0, exports.pick)(TECH_NOUNS);
31
+ const name = `${adj}_${noun}`;
32
+ if (!used.has(name))
33
+ return name;
34
+ }
35
+ return `session_${Date.now()}`;
36
+ };
37
+ exports.generateSessionName = generateSessionName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common",
3
- "version": "0.5.15",
3
+ "version": "0.5.18",
4
4
  "description": "Common interfaces for integrating applications with Kwirth",
5
5
  "scripts": {
6
6
  "build": "del .\\dist\\* /s /q && tsc"