@hostwebhook/node-types 1.68.0 → 1.69.0
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/credentials.d.ts +89 -2
- package/dist/credentials.js +31 -4
- package/package.json +2 -2
package/dist/credentials.d.ts
CHANGED
|
@@ -36,7 +36,89 @@ export interface CredentialTypeRegistration {
|
|
|
36
36
|
* Registry — order matters for fallthrough behavior in pickers (most
|
|
37
37
|
* common types first), but not for correctness.
|
|
38
38
|
*/
|
|
39
|
-
export declare const CREDENTIAL_TYPES: readonly
|
|
39
|
+
export declare const CREDENTIAL_TYPES: readonly [{
|
|
40
|
+
readonly type: "google_service_account";
|
|
41
|
+
}, {
|
|
42
|
+
readonly type: "oauth2_google";
|
|
43
|
+
}, {
|
|
44
|
+
readonly type: "oauth2_atlassian";
|
|
45
|
+
}, {
|
|
46
|
+
readonly type: "mongodb";
|
|
47
|
+
readonly ssrfValidated: true;
|
|
48
|
+
readonly tunnelable: true;
|
|
49
|
+
}, {
|
|
50
|
+
readonly type: "postgres";
|
|
51
|
+
readonly ssrfValidated: true;
|
|
52
|
+
readonly tunnelable: true;
|
|
53
|
+
}, {
|
|
54
|
+
readonly type: "slack_webhook";
|
|
55
|
+
}, {
|
|
56
|
+
readonly type: "slack_oauth";
|
|
57
|
+
}, {
|
|
58
|
+
readonly type: "discord_webhook";
|
|
59
|
+
}, {
|
|
60
|
+
readonly type: "llm_anthropic";
|
|
61
|
+
}, {
|
|
62
|
+
readonly type: "llm_openai";
|
|
63
|
+
}, {
|
|
64
|
+
readonly type: "llm_google";
|
|
65
|
+
}, {
|
|
66
|
+
readonly type: "llm_groq";
|
|
67
|
+
}, {
|
|
68
|
+
readonly type: "llm_openrouter";
|
|
69
|
+
}, {
|
|
70
|
+
readonly type: "llm_ollama";
|
|
71
|
+
}, {
|
|
72
|
+
readonly type: "firecrawl";
|
|
73
|
+
}, {
|
|
74
|
+
readonly type: "http_auth";
|
|
75
|
+
}, {
|
|
76
|
+
readonly type: "aws_s3";
|
|
77
|
+
}, {
|
|
78
|
+
readonly type: "memory_contextwindow";
|
|
79
|
+
}, {
|
|
80
|
+
readonly type: "memory_mongodb";
|
|
81
|
+
readonly ssrfValidated: true;
|
|
82
|
+
readonly tunnelable: true;
|
|
83
|
+
}, {
|
|
84
|
+
readonly type: "mcp_server";
|
|
85
|
+
}, {
|
|
86
|
+
readonly type: "voice_agent";
|
|
87
|
+
}, {
|
|
88
|
+
readonly type: "telegram_bot";
|
|
89
|
+
}, {
|
|
90
|
+
readonly type: "whatsapp_business";
|
|
91
|
+
}, {
|
|
92
|
+
readonly type: "discord_bot";
|
|
93
|
+
}, {
|
|
94
|
+
readonly type: "discord_oauth";
|
|
95
|
+
}, {
|
|
96
|
+
readonly type: "bluesky_app_password";
|
|
97
|
+
}, {
|
|
98
|
+
readonly type: "twitter_oauth2";
|
|
99
|
+
}, {
|
|
100
|
+
readonly type: "mastodon_oauth2";
|
|
101
|
+
}, {
|
|
102
|
+
readonly type: "linkedin_oauth2";
|
|
103
|
+
}, {
|
|
104
|
+
readonly type: "threads_oauth2";
|
|
105
|
+
}, {
|
|
106
|
+
readonly type: "instagram_oauth2";
|
|
107
|
+
}, {
|
|
108
|
+
readonly type: "facebook_oauth2";
|
|
109
|
+
}, {
|
|
110
|
+
readonly type: "notion_internal";
|
|
111
|
+
}, {
|
|
112
|
+
readonly type: "notion_oauth";
|
|
113
|
+
}, {
|
|
114
|
+
readonly type: "mailchimp_oauth2";
|
|
115
|
+
}, {
|
|
116
|
+
readonly type: "shopify_oauth2";
|
|
117
|
+
}, {
|
|
118
|
+
readonly type: "github_app";
|
|
119
|
+
}, {
|
|
120
|
+
readonly type: "github_pat";
|
|
121
|
+
}];
|
|
40
122
|
/**
|
|
41
123
|
* Plain string array — what the Mongoose `enum` field and the
|
|
42
124
|
* class-validator `@IsIn(...)` decorator both consume. Keep it as a
|
|
@@ -51,7 +133,12 @@ export declare const credentialTypeValues: () => string[];
|
|
|
51
133
|
* Discriminated union of every supported type. Use as the field type
|
|
52
134
|
* on entities + DTOs so a typo at the call site fails at compile
|
|
53
135
|
* time, not at runtime via a Mongoose validation error.
|
|
136
|
+
*
|
|
137
|
+
* ⚠️ Y ahora ES una unión. Hasta la 1.69.0 esto valía `string` —la anotación
|
|
138
|
+
* de `CREDENTIAL_TYPES` ensanchaba los literales— así que la frase de arriba
|
|
139
|
+
* describía una protección que no existía. Ver el comentario del `satisfies`
|
|
140
|
+
* al final del registro.
|
|
54
141
|
*/
|
|
55
|
-
export type CredentialType = typeof CREDENTIAL_TYPES[number]['type'];
|
|
142
|
+
export type CredentialType = (typeof CREDENTIAL_TYPES)[number]['type'];
|
|
56
143
|
export declare function getCredentialType(type: string): CredentialTypeRegistration | undefined;
|
|
57
144
|
export declare function isCredentialType(type: string): type is CredentialType;
|
package/dist/credentials.js
CHANGED
|
@@ -19,6 +19,23 @@ exports.CREDENTIAL_TYPES = [
|
|
|
19
19
|
{ type: 'llm_anthropic' },
|
|
20
20
|
{ type: 'llm_openai' },
|
|
21
21
|
{ type: 'llm_google' },
|
|
22
|
+
// La clave de API de Groq (`gsk_…`), que el usuario saca de
|
|
23
|
+
// https://console.groq.com/keys y pega. Un secreto suyo, sin OAuth de por
|
|
24
|
+
// medio, igual que los tres de arriba y que `llm_openrouter` de abajo.
|
|
25
|
+
//
|
|
26
|
+
// El sufijo es `groq` por la misma regla que explica el bloque de
|
|
27
|
+
// OpenRouter: de aquí salen `getModelsFor`/`getDefaultModel` quitando el
|
|
28
|
+
// prefijo `llm_`, así que lo que quede detrás tiene que ser LITERALMENTE el
|
|
29
|
+
// `LlmProvider`, y ése es `'groq'`.
|
|
30
|
+
//
|
|
31
|
+
// 🔥 Llega TARDE, y el agujero que tapa no era teórico: `groq` es un
|
|
32
|
+
// `LlmProvider` de pleno derecho desde hace tiempo —está en `LLM_PROVIDERS`,
|
|
33
|
+
// con sus cinco modelos en `LLM_MODELS.groq`— pero no tenía tipo de
|
|
34
|
+
// credencial. O sea que el proveedor se podía ELEGIR en el selector y no
|
|
35
|
+
// había dónde guardar su clave: una rama del catálogo inalcanzable, sin un
|
|
36
|
+
// solo error que lo dijera. El resto de la lista se anota antes de que la
|
|
37
|
+
// api exista precisamente para no llegar a esto.
|
|
38
|
+
{ type: 'llm_groq' },
|
|
22
39
|
// La clave de API de OpenRouter (`sk-or-v1-…`). Un secreto pegado por el
|
|
23
40
|
// usuario, igual que los tres de arriba: no hay OAuth de por medio.
|
|
24
41
|
//
|
|
@@ -31,10 +48,10 @@ exports.CREDENTIAL_TYPES = [
|
|
|
31
48
|
// el validador del DTO, y un tipo que falte ahí no rompe al compilar — mata
|
|
32
49
|
// el `create` de la credencial en runtime, con el usuario delante.
|
|
33
50
|
//
|
|
34
|
-
// ⚠️
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
51
|
+
// ⚠️ El vecino que faltaba y que este bloque dejó escrito —`groq` sin su
|
|
52
|
+
// `llm_groq`— ya está arriba. Lo que queda de aquel aviso es la regla que lo
|
|
53
|
+
// hizo posible, y por eso la cubre ahora un test: cada `LlmProvider` de
|
|
54
|
+
// `LLM_PROVIDERS` tiene que tener su `llm_*` en esta lista.
|
|
38
55
|
{ type: 'llm_openrouter' },
|
|
39
56
|
{ type: 'llm_ollama' },
|
|
40
57
|
{ type: 'firecrawl' },
|
|
@@ -158,6 +175,16 @@ exports.CREDENTIAL_TYPES = [
|
|
|
158
175
|
// que cambia es de dónde sale la lista de repositorios del formulario: los
|
|
159
176
|
// del usuario, en vez de los que abarca una instalación.
|
|
160
177
|
{ type: 'github_pat' },
|
|
178
|
+
/* ⚠️ `as const satisfies …` y no `: readonly CredentialTypeRegistration[]`.
|
|
179
|
+
Los dos comprueban lo mismo —que cada entrada tenga la forma del registro—,
|
|
180
|
+
pero la ANOTACIÓN además ENSANCHA lo que se guarda: con ella cada `type` se
|
|
181
|
+
recuerda como `string`, y entonces `CredentialType` de más abajo es
|
|
182
|
+
literalmente `string`. O sea que la promesa de su comentario («un typo al
|
|
183
|
+
asignar falla al compilar») era falsa desde el primer día: `const t:
|
|
184
|
+
CredentialType = 'llm_openroutr'` compilaba sin rechistar.
|
|
185
|
+
|
|
186
|
+
`satisfies` comprueba y NO ensancha, así que los literales sobreviven y la
|
|
187
|
+
unión es de verdad. El control está en `tipos-de-credencial.test.ts`. */
|
|
161
188
|
];
|
|
162
189
|
/**
|
|
163
190
|
* Plain string array — what the Mongoose `enum` field and the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hostwebhook/node-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.69.0",
|
|
4
4
|
"description": "Shared node type definitions, connection rules, and dispatch config for HostWebhook",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc",
|
|
12
|
-
"test": "vitest run",
|
|
12
|
+
"test": "tsc -p tsconfig.tests.json && vitest run",
|
|
13
13
|
"prepublishOnly": "npm run build"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|