@kwirthmagnify/kwirth-common-back 0.5.40 → 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,15 +1,11 @@
1
+ import { TConfigFieldType, IConfigFieldDef } from '@kwirthmagnify/kwirth-common';
1
2
  export declare enum EIdpConnectorKind {
2
3
  OIDC = "oidc",
3
4
  OAUTH2 = "oauth2"
4
5
  }
5
- export type IdpFieldType = 'text' | 'number' | 'boolean' | 'password';
6
- export interface IIdpConfigFieldDef {
7
- name: string;
8
- label: string;
9
- type?: IdpFieldType;
10
- required?: boolean;
11
- options?: string[];
12
- }
6
+ /** @deprecated usa TConfigFieldType, comun a todas las extensiones. */
7
+ export type IdpFieldType = TConfigFieldType;
8
+ export type IIdpConfigFieldDef = IConfigFieldDef;
13
9
  export interface IIdpIdentity {
14
10
  email: string;
15
11
  emailVerified: boolean;
package/dist/ILogin.d.ts CHANGED
@@ -1,8 +1,5 @@
1
- export type LoginFieldType = 'text' | 'number' | 'boolean' | 'password' | 'select';
2
- export interface ILoginFieldDef {
3
- name: string;
4
- label: string;
5
- type?: LoginFieldType;
6
- required?: boolean;
7
- options?: string[];
8
- }
1
+ import { TConfigFieldType, IConfigFieldDef } from '@kwirthmagnify/kwirth-common';
2
+ /** @deprecated usa TConfigFieldType, comun a todas las extensiones. */
3
+ export type LoginFieldType = TConfigFieldType;
4
+ /** Campo de configuracion de un login. Es el contrato comun IConfigFieldDef, sin nada propio. */
5
+ export type ILoginFieldDef = IConfigFieldDef;
@@ -1,4 +1,4 @@
1
- import { KwirthData } from '@kwirthmagnify/kwirth-common';
1
+ import { KwirthData, IConfigFieldDef } from '@kwirthmagnify/kwirth-common';
2
2
  /**
3
3
  * Minimal interface representing the channel side that providers interact with.
4
4
  * Providers only need to call processProviderEvent on their subscribers.
@@ -44,6 +44,11 @@ export interface IProviderSubscriptionHelp {
44
44
  /** Descripcion campo a campo. Opcional: solo para payloads planos. */
45
45
  fields?: IProviderSubscriptionField[];
46
46
  }
47
+ /**
48
+ * Un campo de la configuracion del PROPIO provider (no de la suscripcion). Es el contrato comun
49
+ * IConfigFieldDef, el mismo que usan senders, webhooks, idps y logins.
50
+ */
51
+ export type IProviderFieldDef = IConfigFieldDef;
47
52
  /**
48
53
  * Interface that all provider plugins must implement.
49
54
  * Use 'any' for clusterInfo to avoid pulling in kubernetes/docker dependencies.
@@ -67,6 +72,22 @@ export interface IProvider {
67
72
  * payload escribir.
68
73
  */
69
74
  getSubscriptionHelp?(): IProviderSubscriptionHelp;
75
+ /**
76
+ * Nombres de las configuraciones que el provider tiene definidas (equivalente a
77
+ * ISender.getConfigNames). OPCIONAL: solo tiene sentido en un provider que sea dueño de su
78
+ * configuracion. El gestor de extensiones lo usa para mostrar cuantas hay en la tarjeta, igual
79
+ * que hace con los senders. No expone valores, solo nombres.
80
+ */
81
+ getConfigNames?(): string[];
82
+ /**
83
+ * Schema de configuracion del propio provider, con el que kwirth pinta un formulario generico.
84
+ * Es la forma ESTANDAR de declararlo, la misma que ISender.getConfigSchema e IWebhook.
85
+ *
86
+ * Un provider al que nadie se suscribe y que no expone router NO se instancia nunca, asi que en
87
+ * ese caso no hay a quien preguntarselo: para esos, exporta ademas una constante 'schema' con el
88
+ * mismo array desde el back.js, que el core lee al instalar sin instanciar nada.
89
+ */
90
+ getConfigSchema?(): IProviderFieldDef[];
70
91
  startProvider(): Promise<void>;
71
92
  stopProvider(): Promise<void>;
72
93
  router: any;
package/dist/ISender.d.ts CHANGED
@@ -1,19 +1,11 @@
1
- import { ISenderMessage, ISenderConfig, ISenderAccess, ISenderStoredConfig, ISenderResult } from '@kwirthmagnify/kwirth-common';
1
+ import { ISenderMessage, ISenderConfig, ISenderAccess, ISenderStoredConfig, ISenderResult, TConfigFieldType, IConfigFieldDef, IExtensionNodeMeta } from '@kwirthmagnify/kwirth-common';
2
2
  export { ISenderMessage, ISenderConfig, ISenderAccess, ISenderStoredConfig, ISenderResult };
3
- export type SenderFieldType = 'text' | 'number' | 'boolean' | 'password' | 'select' | 'json';
4
- export interface ISenderFieldDef {
5
- name: string;
6
- label: string;
7
- type?: SenderFieldType;
8
- required?: boolean;
9
- options?: string[];
10
- common?: boolean;
11
- }
12
- export interface ISenderNodeMeta {
13
- label: string;
14
- icon?: string;
15
- description?: string;
16
- }
3
+ /** @deprecated usa TConfigFieldType, comun a todas las extensiones. */
4
+ export type SenderFieldType = TConfigFieldType;
5
+ /** Campo de configuracion de un sender. Es el contrato comun IConfigFieldDef, sin nada propio. */
6
+ export type ISenderFieldDef = IConfigFieldDef;
7
+ /** @deprecated usa IExtensionNodeMeta, comun a todas las extensiones. */
8
+ export type ISenderNodeMeta = IExtensionNodeMeta;
17
9
  export interface ISender {
18
10
  readonly id: string;
19
11
  readonly senderType?: 'filter' | 'output';
@@ -1,19 +1,11 @@
1
- import { IWebhookEvent, IWebhookConfig, IWebhookAccess, IWebhookConsumer, IWebhookStoredConfig } from '@kwirthmagnify/kwirth-common';
1
+ import { IWebhookEvent, IWebhookConfig, IWebhookAccess, IWebhookConsumer, IWebhookStoredConfig, TConfigFieldType, IConfigFieldDef, IExtensionNodeMeta } from '@kwirthmagnify/kwirth-common';
2
2
  export { IWebhookEvent, IWebhookConfig, IWebhookAccess, IWebhookConsumer, IWebhookStoredConfig };
3
- export type WebhookFieldType = 'text' | 'number' | 'boolean' | 'password' | 'select' | 'json';
4
- export interface IWebhookFieldDef {
5
- name: string;
6
- label: string;
7
- type?: WebhookFieldType;
8
- required?: boolean;
9
- options?: string[];
10
- common?: boolean;
11
- }
12
- export interface IWebhookNodeMeta {
13
- label: string;
14
- icon?: string;
15
- description?: string;
16
- }
3
+ /** @deprecated usa TConfigFieldType, comun a todas las extensiones. */
4
+ export type WebhookFieldType = TConfigFieldType;
5
+ /** Campo de configuracion de un webhook. Es el contrato comun IConfigFieldDef, sin nada propio. */
6
+ export type IWebhookFieldDef = IConfigFieldDef;
7
+ /** @deprecated usa IExtensionNodeMeta, comun a todas las extensiones. */
8
+ export type IWebhookNodeMeta = IExtensionNodeMeta;
17
9
  export interface IWebhook {
18
10
  readonly id: string;
19
11
  verify(rawBody: Buffer, headers: Record<string, string | string[] | undefined>, config: IWebhookConfig): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common-back",
3
- "version": "0.5.40",
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"