@kwirthmagnify/kwirth-common-back 0.5.41 → 0.5.43
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/IIdpConnector.d.ts +3 -3
- package/dist/ILogin.d.ts +3 -3
- package/dist/IProvider.d.ts +1 -2
- package/dist/ISender.d.ts +3 -4
- package/dist/IWebhook.d.ts +3 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/oauth2.js +3 -4
- package/dist/oidc.d.ts +9 -1
- package/dist/oidc.js +103 -26
- package/package.json +3 -2
- package/dist/IExtensionConfig.d.ts +0 -28
- package/dist/IExtensionConfig.js +0 -38
package/dist/IIdpConnector.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
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
|
|
7
|
-
export type IdpFieldType =
|
|
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 {
|
|
2
|
-
/** @deprecated usa
|
|
3
|
-
export type LoginFieldType =
|
|
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;
|
package/dist/IProvider.d.ts
CHANGED
|
@@ -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
|
|
5
|
-
export type SenderFieldType =
|
|
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. */
|
package/dist/IWebhook.d.ts
CHANGED
|
@@ -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
|
|
5
|
-
export type WebhookFieldType =
|
|
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
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:
|
|
11
|
-
{ name: 'clientSecret', label: 'Client Secret', type:
|
|
12
|
-
{ name: 'scopes', label: 'Scopes', type:
|
|
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.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { IIdpAuthContext, IIdpCallbackContext, IIdpConfigFieldDef, IIdpIdentity } from './IIdpConnector';
|
|
2
|
+
export interface IOidcCallbackOptions {
|
|
3
|
+
emailClaims?: string[];
|
|
4
|
+
assumeVerified?: boolean;
|
|
5
|
+
multiTenant?: boolean;
|
|
6
|
+
allowedTenants?: string[];
|
|
7
|
+
}
|
|
2
8
|
export declare function oidcConfigSchema(): IIdpConfigFieldDef[];
|
|
9
|
+
export declare function mapOidcIdentity(claims: Record<string, unknown>, opts?: IOidcCallbackOptions): IIdpIdentity;
|
|
10
|
+
export declare function tenantAllowed(tid: string | undefined, allowed?: string[]): boolean;
|
|
3
11
|
export declare function oidcBuildAuthorizationUrl(config: Record<string, unknown>, ctx: IIdpAuthContext, defaultIssuer?: string): Promise<string>;
|
|
4
|
-
export declare function oidcHandleCallback(config: Record<string, unknown>, ctx: IIdpCallbackContext, defaultIssuer?: string): Promise<IIdpIdentity>;
|
|
12
|
+
export declare function oidcHandleCallback(config: Record<string, unknown>, ctx: IIdpCallbackContext, defaultIssuer?: string, opts?: IOidcCallbackOptions): Promise<IIdpIdentity>;
|
package/dist/oidc.js
CHANGED
|
@@ -1,25 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.oidcConfigSchema = oidcConfigSchema;
|
|
37
|
+
exports.mapOidcIdentity = mapOidcIdentity;
|
|
38
|
+
exports.tenantAllowed = tenantAllowed;
|
|
4
39
|
exports.oidcBuildAuthorizationUrl = oidcBuildAuthorizationUrl;
|
|
5
40
|
exports.oidcHandleCallback = oidcHandleCallback;
|
|
6
41
|
const openid_client_1 = require("openid-client");
|
|
7
|
-
const
|
|
8
|
-
/*
|
|
9
|
-
Lógica OIDC compartida por todos los conectores OIDC (Google, Keycloak, GitLab, Microsoft, ...).
|
|
10
|
-
Vive en common-back y el back la expone como global (__kwirth_back__.kwirthCommonBack), de modo
|
|
11
|
-
que los conectores la usan por composición SIN bundlear openid-client ni duplicar el flujo.
|
|
12
|
-
|
|
13
|
-
Flujo Authorization Code + PKCE con intercambio back-channel (el id_token llega por TLS del
|
|
14
|
-
token endpoint, así que openid-client valida issuer/aud y basta con eso).
|
|
15
|
-
*/
|
|
42
|
+
const jose = __importStar(require("jose"));
|
|
16
43
|
// esquema de config estándar de un IdP OIDC (clientSecret es 'password' → se enmascara en la UI)
|
|
17
44
|
function oidcConfigSchema() {
|
|
18
45
|
return [
|
|
19
|
-
{ name: 'clientId', label: 'Client ID', type:
|
|
20
|
-
{ name: 'clientSecret', label: 'Client Secret', type:
|
|
21
|
-
{ name: 'scopes', label: 'Scopes', type:
|
|
22
|
-
{ name: 'issuer', label: 'Issuer URL', type:
|
|
46
|
+
{ name: 'clientId', label: 'Client ID', type: 'text', required: true },
|
|
47
|
+
{ name: 'clientSecret', label: 'Client Secret', type: 'password', required: true },
|
|
48
|
+
{ name: 'scopes', label: 'Scopes', type: 'text' },
|
|
49
|
+
{ name: 'issuer', label: 'Issuer URL', type: 'text' }
|
|
23
50
|
];
|
|
24
51
|
}
|
|
25
52
|
async function makeClient(config, redirectUri, defaultIssuer) {
|
|
@@ -27,15 +54,43 @@ async function makeClient(config, redirectUri, defaultIssuer) {
|
|
|
27
54
|
if (!issuerUrl)
|
|
28
55
|
throw new Error('OIDC issuer not configured');
|
|
29
56
|
const issuer = await openid_client_1.Issuer.discover(issuerUrl);
|
|
30
|
-
|
|
57
|
+
const client = new issuer.Client({
|
|
31
58
|
client_id: config.clientId,
|
|
32
59
|
client_secret: config.clientSecret,
|
|
33
60
|
redirect_uris: [redirectUri],
|
|
34
61
|
response_types: ['code']
|
|
35
62
|
});
|
|
63
|
+
return { issuer, client };
|
|
64
|
+
}
|
|
65
|
+
// mapea los claims del id_token a la identidad de Kwirth (fallback de email + verified asumido)
|
|
66
|
+
function mapOidcIdentity(claims, opts) {
|
|
67
|
+
const emailClaims = opts?.emailClaims ?? ['email'];
|
|
68
|
+
let email = '';
|
|
69
|
+
for (const claim of emailClaims) {
|
|
70
|
+
const value = claims[claim];
|
|
71
|
+
if (typeof value === 'string' && value !== '') {
|
|
72
|
+
email = value;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
email,
|
|
78
|
+
emailVerified: claims.email_verified === true || opts?.assumeVerified === true,
|
|
79
|
+
name: typeof claims.name === 'string' ? claims.name : undefined,
|
|
80
|
+
sub: claims.sub !== undefined ? String(claims.sub) : undefined
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
// ¿el tenant (tid) está permitido? (allowlist vacía = cualquier tenant)
|
|
84
|
+
function tenantAllowed(tid, allowed) {
|
|
85
|
+
if (!allowed || allowed.length === 0)
|
|
86
|
+
return true;
|
|
87
|
+
if (!tid)
|
|
88
|
+
return false;
|
|
89
|
+
const lower = tid.toLowerCase();
|
|
90
|
+
return allowed.some(t => t.toLowerCase() === lower);
|
|
36
91
|
}
|
|
37
92
|
async function oidcBuildAuthorizationUrl(config, ctx, defaultIssuer) {
|
|
38
|
-
const client = await makeClient(config, ctx.redirectUri, defaultIssuer);
|
|
93
|
+
const { client } = await makeClient(config, ctx.redirectUri, defaultIssuer);
|
|
39
94
|
const scope = config.scopes || 'openid email profile';
|
|
40
95
|
return client.authorizationUrl({
|
|
41
96
|
scope,
|
|
@@ -45,20 +100,42 @@ async function oidcBuildAuthorizationUrl(config, ctx, defaultIssuer) {
|
|
|
45
100
|
code_challenge_method: 'S256'
|
|
46
101
|
});
|
|
47
102
|
}
|
|
48
|
-
async function oidcHandleCallback(config, ctx, defaultIssuer) {
|
|
49
|
-
const client = await makeClient(config, ctx.redirectUri, defaultIssuer);
|
|
50
|
-
|
|
51
|
-
|
|
103
|
+
async function oidcHandleCallback(config, ctx, defaultIssuer, opts) {
|
|
104
|
+
const { issuer, client } = await makeClient(config, ctx.redirectUri, defaultIssuer);
|
|
105
|
+
if (opts?.multiTenant) {
|
|
106
|
+
// openid-client valida el iss de forma LITERAL y en multi-tenant el issuer descubierto lleva el
|
|
107
|
+
// placeholder {tenantid}; hacemos el intercambio crudo (grant, sin validar id_token) y validamos
|
|
108
|
+
// el id_token a mano con jose: firma (JWKS del issuer) + iss contra el tid concreto del token.
|
|
109
|
+
const tokenSet = await client.grant({
|
|
110
|
+
grant_type: 'authorization_code',
|
|
111
|
+
code: ctx.code,
|
|
112
|
+
redirect_uri: ctx.redirectUri,
|
|
113
|
+
code_verifier: ctx.codeVerifier
|
|
114
|
+
});
|
|
115
|
+
if (!tokenSet.id_token)
|
|
116
|
+
throw new Error('OIDC multi-tenant: token response has no id_token');
|
|
117
|
+
const tid = tokenSet.claims().tid; // sin verificar; solo para conocer el tenant
|
|
118
|
+
if (!tid)
|
|
119
|
+
throw new Error('OIDC multi-tenant: id_token has no tid claim');
|
|
120
|
+
if (!tenantAllowed(tid, opts.allowedTenants))
|
|
121
|
+
throw new Error(`OIDC multi-tenant: tenant '${tid}' not allowed`);
|
|
122
|
+
const jwksUri = issuer.metadata.jwks_uri;
|
|
123
|
+
if (!jwksUri)
|
|
124
|
+
throw new Error('OIDC multi-tenant: issuer metadata has no jwks_uri');
|
|
125
|
+
const jwks = jose.createRemoteJWKSet(new URL(jwksUri));
|
|
126
|
+
const { payload } = await jose.jwtVerify(tokenSet.id_token, jwks, {
|
|
127
|
+
issuer: `https://login.microsoftonline.com/${tid}/v2.0`,
|
|
128
|
+
audience: config.clientId,
|
|
129
|
+
clockTolerance: 5
|
|
130
|
+
});
|
|
131
|
+
return mapOidcIdentity(payload, opts);
|
|
132
|
+
}
|
|
133
|
+
// single-tenant: pasamos los params crudos del callback (incluyen iss para RFC 9207 y state); el state
|
|
134
|
+
// ya lo valida el core, pero openid-client exige checks.state si el param state viene presente.
|
|
52
135
|
const params = ctx.params ?? { code: ctx.code };
|
|
53
136
|
const checks = { code_verifier: ctx.codeVerifier };
|
|
54
137
|
if (params.state !== undefined)
|
|
55
138
|
checks.state = params.state;
|
|
56
139
|
const tokenSet = await client.callback(ctx.redirectUri, params, checks);
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
email: String(claims.email ?? ''),
|
|
60
|
-
emailVerified: claims.email_verified === true,
|
|
61
|
-
name: claims.name ? String(claims.name) : undefined,
|
|
62
|
-
sub: claims.sub
|
|
63
|
-
};
|
|
140
|
+
return mapOidcIdentity(tokenSet.claims(), opts);
|
|
64
141
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kwirthmagnify/kwirth-common-back",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.43",
|
|
4
4
|
"description": "Backend interfaces for building Kwirth provider and channel plugins",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc",
|
|
@@ -26,8 +26,9 @@
|
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@kubernetes/client-node": "^1.4.0",
|
|
29
|
-
"@kwirthmagnify/kwirth-common": "^0.5.
|
|
29
|
+
"@kwirthmagnify/kwirth-common": "^0.5.46",
|
|
30
30
|
"express": "^4.18.0",
|
|
31
|
+
"jose": "^4.15.9",
|
|
31
32
|
"js-yaml": "^4.1.0",
|
|
32
33
|
"openid-client": "^5.7.0"
|
|
33
34
|
},
|
|
@@ -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
|
-
}
|
package/dist/IExtensionConfig.js
DELETED
|
@@ -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 = {}));
|