@kwirthmagnify/kwirth-common-back 0.5.41 → 0.5.42

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.
@@ -1,10 +1,10 @@
1
- import { EConfigFieldType, IConfigFieldDef } from './IExtensionConfig';
1
+ import { TConfigFieldType, IConfigFieldDef } from '@kwirthmagnify/kwirth-common';
2
2
  export declare enum EIdpConnectorKind {
3
3
  OIDC = "oidc",
4
4
  OAUTH2 = "oauth2"
5
5
  }
6
- /** @deprecated usa EConfigFieldType, comun a todas las extensiones. */
7
- export type IdpFieldType = EConfigFieldType;
6
+ /** @deprecated usa TConfigFieldType, comun a todas las extensiones. */
7
+ export type IdpFieldType = TConfigFieldType;
8
8
  export type IIdpConfigFieldDef = IConfigFieldDef;
9
9
  export interface IIdpIdentity {
10
10
  email: string;
package/dist/ILogin.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { EConfigFieldType, IConfigFieldDef } from './IExtensionConfig';
2
- /** @deprecated usa EConfigFieldType, comun a todas las extensiones. */
3
- export type LoginFieldType = EConfigFieldType;
1
+ import { TConfigFieldType, IConfigFieldDef } from '@kwirthmagnify/kwirth-common';
2
+ /** @deprecated usa TConfigFieldType, comun a todas las extensiones. */
3
+ export type LoginFieldType = TConfigFieldType;
4
4
  /** Campo de configuracion de un login. Es el contrato comun IConfigFieldDef, sin nada propio. */
5
5
  export type ILoginFieldDef = IConfigFieldDef;
@@ -1,5 +1,4 @@
1
- import { KwirthData } from '@kwirthmagnify/kwirth-common';
2
- import { IConfigFieldDef } from './IExtensionConfig';
1
+ import { KwirthData, IConfigFieldDef } from '@kwirthmagnify/kwirth-common';
3
2
  /**
4
3
  * Minimal interface representing the channel side that providers interact with.
5
4
  * Providers only need to call processProviderEvent on their subscribers.
package/dist/ISender.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { ISenderMessage, ISenderConfig, ISenderAccess, ISenderStoredConfig, ISenderResult } from '@kwirthmagnify/kwirth-common';
2
- import { EConfigFieldType, IConfigFieldDef, IExtensionNodeMeta } from './IExtensionConfig';
1
+ import { ISenderMessage, ISenderConfig, ISenderAccess, ISenderStoredConfig, ISenderResult, TConfigFieldType, IConfigFieldDef, IExtensionNodeMeta } from '@kwirthmagnify/kwirth-common';
3
2
  export { ISenderMessage, ISenderConfig, ISenderAccess, ISenderStoredConfig, ISenderResult };
4
- /** @deprecated usa EConfigFieldType, comun a todas las extensiones. */
5
- export type SenderFieldType = EConfigFieldType;
3
+ /** @deprecated usa TConfigFieldType, comun a todas las extensiones. */
4
+ export type SenderFieldType = TConfigFieldType;
6
5
  /** Campo de configuracion de un sender. Es el contrato comun IConfigFieldDef, sin nada propio. */
7
6
  export type ISenderFieldDef = IConfigFieldDef;
8
7
  /** @deprecated usa IExtensionNodeMeta, comun a todas las extensiones. */
@@ -1,8 +1,7 @@
1
- import { IWebhookEvent, IWebhookConfig, IWebhookAccess, IWebhookConsumer, IWebhookStoredConfig } from '@kwirthmagnify/kwirth-common';
2
- import { EConfigFieldType, IConfigFieldDef, IExtensionNodeMeta } from './IExtensionConfig';
1
+ import { IWebhookEvent, IWebhookConfig, IWebhookAccess, IWebhookConsumer, IWebhookStoredConfig, TConfigFieldType, IConfigFieldDef, IExtensionNodeMeta } from '@kwirthmagnify/kwirth-common';
3
2
  export { IWebhookEvent, IWebhookConfig, IWebhookAccess, IWebhookConsumer, IWebhookStoredConfig };
4
- /** @deprecated usa EConfigFieldType, comun a todas las extensiones. */
5
- export type WebhookFieldType = EConfigFieldType;
3
+ /** @deprecated usa TConfigFieldType, comun a todas las extensiones. */
4
+ export type WebhookFieldType = TConfigFieldType;
6
5
  /** Campo de configuracion de un webhook. Es el contrato comun IConfigFieldDef, sin nada propio. */
7
6
  export type IWebhookFieldDef = IConfigFieldDef;
8
7
  /** @deprecated usa IExtensionNodeMeta, comun a todas las extensiones. */
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from './IExtensionConfig';
2
1
  export * from './IBackChannelObject';
3
2
  export * from './ILogin';
4
3
  export * from './IChannel';
package/dist/index.js CHANGED
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./IExtensionConfig"), exports);
18
17
  __exportStar(require("./IBackChannelObject"), exports);
19
18
  __exportStar(require("./ILogin"), exports);
20
19
  __exportStar(require("./IChannel"), exports);
package/dist/oauth2.js CHANGED
@@ -3,13 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.oauth2ConfigSchema = oauth2ConfigSchema;
4
4
  exports.oauth2BuildAuthorizationUrl = oauth2BuildAuthorizationUrl;
5
5
  exports.oauth2HandleCallback = oauth2HandleCallback;
6
- const IExtensionConfig_1 = require("./IExtensionConfig");
7
6
  // esquema base de un IdP OAuth2 (el conector añade sus URLs si aplica; clientSecret 'password' → se enmascara)
8
7
  function oauth2ConfigSchema() {
9
8
  return [
10
- { name: 'clientId', label: 'Client ID', type: IExtensionConfig_1.EConfigFieldType.TEXT, required: true },
11
- { name: 'clientSecret', label: 'Client Secret', type: IExtensionConfig_1.EConfigFieldType.PASSWORD, required: true },
12
- { name: 'scopes', label: 'Scopes', type: IExtensionConfig_1.EConfigFieldType.TEXT }
9
+ { name: 'clientId', label: 'Client ID', type: 'text', required: true },
10
+ { name: 'clientSecret', label: 'Client Secret', type: 'password', required: true },
11
+ { name: 'scopes', label: 'Scopes', type: 'text' }
13
12
  ];
14
13
  }
15
14
  function oauth2BuildAuthorizationUrl(config, ctx, ep) {
package/dist/oidc.js CHANGED
@@ -4,7 +4,6 @@ exports.oidcConfigSchema = oidcConfigSchema;
4
4
  exports.oidcBuildAuthorizationUrl = oidcBuildAuthorizationUrl;
5
5
  exports.oidcHandleCallback = oidcHandleCallback;
6
6
  const openid_client_1 = require("openid-client");
7
- const IExtensionConfig_1 = require("./IExtensionConfig");
8
7
  /*
9
8
  Lógica OIDC compartida por todos los conectores OIDC (Google, Keycloak, GitLab, Microsoft, ...).
10
9
  Vive en common-back y el back la expone como global (__kwirth_back__.kwirthCommonBack), de modo
@@ -16,10 +15,10 @@ const IExtensionConfig_1 = require("./IExtensionConfig");
16
15
  // esquema de config estándar de un IdP OIDC (clientSecret es 'password' → se enmascara en la UI)
17
16
  function oidcConfigSchema() {
18
17
  return [
19
- { name: 'clientId', label: 'Client ID', type: IExtensionConfig_1.EConfigFieldType.TEXT, required: true },
20
- { name: 'clientSecret', label: 'Client Secret', type: IExtensionConfig_1.EConfigFieldType.PASSWORD, required: true },
21
- { name: 'scopes', label: 'Scopes', type: IExtensionConfig_1.EConfigFieldType.TEXT },
22
- { name: 'issuer', label: 'Issuer URL', type: IExtensionConfig_1.EConfigFieldType.TEXT }
18
+ { name: 'clientId', label: 'Client ID', type: 'text', required: true },
19
+ { name: 'clientSecret', label: 'Client Secret', type: 'password', required: true },
20
+ { name: 'scopes', label: 'Scopes', type: 'text' },
21
+ { name: 'issuer', label: 'Issuer URL', type: 'text' }
23
22
  ];
24
23
  }
25
24
  async function makeClient(config, redirectUri, defaultIssuer) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common-back",
3
- "version": "0.5.41",
3
+ "version": "0.5.42",
4
4
  "description": "Backend interfaces for building Kwirth provider and channel plugins",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -26,7 +26,7 @@
26
26
  "license": "ISC",
27
27
  "dependencies": {
28
28
  "@kubernetes/client-node": "^1.4.0",
29
- "@kwirthmagnify/kwirth-common": "^0.5.45",
29
+ "@kwirthmagnify/kwirth-common": "^0.5.46",
30
30
  "express": "^4.18.0",
31
31
  "js-yaml": "^4.1.0",
32
32
  "openid-client": "^5.7.0"
@@ -1,28 +0,0 @@
1
- export declare enum EConfigFieldType {
2
- TEXT = "text",
3
- NUMBER = "number",
4
- BOOLEAN = "boolean",
5
- PASSWORD = "password",
6
- SELECT = "select",
7
- JSON = "json"
8
- }
9
- export interface IConfigFieldDef {
10
- /** Clave con la que el valor se guarda en la configuracion. */
11
- name: string;
12
- /** Etiqueta que ve el usuario en el formulario. */
13
- label: string;
14
- /** Ausente = EConfigFieldType.TEXT. */
15
- type?: EConfigFieldType;
16
- required?: boolean;
17
- /** Valores admitidos cuando 'type' es SELECT. Ignorado en el resto. */
18
- options?: string[];
19
- /** Valor con el que se precarga el campo mientras no haya nada guardado. */
20
- default?: string | number | boolean;
21
- /** El campo es comun a TODAS las configuraciones de la extension, no propio de cada una. */
22
- common?: boolean;
23
- }
24
- export interface IExtensionNodeMeta {
25
- label: string;
26
- icon?: string;
27
- description?: string;
28
- }
@@ -1,38 +0,0 @@
1
- "use strict";
2
- /*
3
- Contrato COMUN de configuracion de extensiones.
4
-
5
- Toda extension que publique un formulario de configuracion (senders, webhooks, conectores IdP,
6
- logins y providers) describe sus campos con ESTE tipo. Antes cada familia tenia el suyo, casi
7
- identico pero divergente: provider decia 'string' donde el resto decia 'text', solo el tenia
8
- 'default', solo sender y webhook tenian 'common', y su definicion ni siquiera vivia aqui (estaba
9
- dentro del core, en back/src/tools/ProviderManager.ts).
10
-
11
- OJO: no confundir EConfigFieldType (el tipo de UN CAMPO del formulario) con EExtensionType (el
12
- tipo de la extension: provider, sender, plugin...), que vive en kwirth-common y es lo que declara
13
- el package.json del artefacto.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.EConfigFieldType = void 0;
17
- /*
18
- Tipo de un campo del formulario de configuracion.
19
-
20
- Lo que hoy pinta el front para cada valor:
21
- TEXT campo de texto. Es el comportamiento por defecto cuando 'type' se omite.
22
- NUMBER campo numerico.
23
- BOOLEAN switch. Los gestores de sender, webhook, idp y provider lo pintan; el de login no.
24
- PASSWORD campo enmascarado con ojo de visibilidad.
25
- SELECT desplegable alimentado por 'options'. Los gestores de sender, webhook y login lo
26
- pintan; los de idp y provider no.
27
- JSON area de texto libre para JSON. NINGUN gestor lo pinta todavia: hoy cae a campo de
28
- texto. Declararlo es valido, pero no esperes editor estructurado.
29
- */
30
- var EConfigFieldType;
31
- (function (EConfigFieldType) {
32
- EConfigFieldType["TEXT"] = "text";
33
- EConfigFieldType["NUMBER"] = "number";
34
- EConfigFieldType["BOOLEAN"] = "boolean";
35
- EConfigFieldType["PASSWORD"] = "password";
36
- EConfigFieldType["SELECT"] = "select";
37
- EConfigFieldType["JSON"] = "json";
38
- })(EConfigFieldType || (exports.EConfigFieldType = EConfigFieldType = {}));