fix(n8n): set credential domains access to all
This commit is contained in:
parent
f700b40995
commit
6dbf431cf7
3 changed files with 24 additions and 25 deletions
|
|
@ -54,8 +54,8 @@ async function getOrCreateCredential(name: string, type: string, data: any) {
|
|||
const credsList = await n8nRequest("/api/v1/credentials");
|
||||
const existingCred = credsList.data.find((c: any) => c.name === name && c.type === type);
|
||||
if (existingCred) {
|
||||
console.log(`Reusing existing credential: ${name} (ID: ${existingCred.id})...`);
|
||||
return existingCred.id;
|
||||
console.log(`Deleting existing credential to recreate: ${name} (ID: ${existingCred.id})...`);
|
||||
await n8nRequest(`/api/v1/credentials/${existingCred.id}`, "DELETE");
|
||||
}
|
||||
|
||||
const newCred = await n8nRequest("/api/v1/credentials", "POST", {
|
||||
|
|
@ -98,7 +98,7 @@ async function main() {
|
|||
const supabaseCredId = await getOrCreateCredential("Semillero2_Supabase", "supabaseApi", {
|
||||
host: SUPABASE_URL,
|
||||
serviceRole: SUPABASE_SECRET_KEY,
|
||||
allowedHttpRequestDomains: "none",
|
||||
allowedHttpRequestDomains: "all",
|
||||
});
|
||||
|
||||
// 4. Fetch Candidate Evaluation Workflow ID
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ async function getOrCreateCredential(name: string, type: string, data: any) {
|
|||
const credsList = await n8nRequest("/api/v1/credentials");
|
||||
const existingCred = credsList.data.find((c: any) => c.name === name && c.type === type);
|
||||
if (existingCred) {
|
||||
console.log(`Reusing existing credential: ${name} (ID: ${existingCred.id})...`);
|
||||
return existingCred.id;
|
||||
console.log(`Deleting existing credential to recreate: ${name} (ID: ${existingCred.id})...`);
|
||||
await n8nRequest(`/api/v1/credentials/${existingCred.id}`, "DELETE");
|
||||
}
|
||||
|
||||
const newCred = await n8nRequest("/api/v1/credentials", "POST", {
|
||||
|
|
@ -85,7 +85,7 @@ function getProviderConfig(provider: string, apiKey: string, modelName: string):
|
|||
credentialType: "deepSeekApi",
|
||||
credentialData: {
|
||||
apiKey,
|
||||
allowedHttpRequestDomains: "none",
|
||||
allowedHttpRequestDomains: "all",
|
||||
},
|
||||
nodeParameters: {
|
||||
model: modelName || "deepseek-chat",
|
||||
|
|
@ -99,7 +99,7 @@ function getProviderConfig(provider: string, apiKey: string, modelName: string):
|
|||
credentialData: {
|
||||
apiKey,
|
||||
header: false,
|
||||
allowedHttpRequestDomains: "none",
|
||||
allowedHttpRequestDomains: "all",
|
||||
},
|
||||
nodeParameters: {
|
||||
model: modelName || "gpt-4o-mini",
|
||||
|
|
@ -113,7 +113,7 @@ function getProviderConfig(provider: string, apiKey: string, modelName: string):
|
|||
credentialData: {
|
||||
apiKey,
|
||||
host: "https://generativelanguage.googleapis.com",
|
||||
allowedHttpRequestDomains: "none",
|
||||
allowedHttpRequestDomains: "all",
|
||||
},
|
||||
nodeParameters: {
|
||||
model: modelName || "gemini-1.5-flash",
|
||||
|
|
@ -126,7 +126,7 @@ function getProviderConfig(provider: string, apiKey: string, modelName: string):
|
|||
credentialType: "anthropicApi",
|
||||
credentialData: {
|
||||
apiKey,
|
||||
allowedHttpRequestDomains: "none",
|
||||
allowedHttpRequestDomains: "all",
|
||||
},
|
||||
nodeParameters: {
|
||||
model: modelName || "claude-3-5-sonnet-latest",
|
||||
|
|
@ -253,7 +253,7 @@ async function main() {
|
|||
const supabaseCredId = await getOrCreateCredential("Semillero2_Supabase_V3", "supabaseApi", {
|
||||
host: SUPABASE_URL,
|
||||
serviceRole: SUPABASE_SECRET_KEY,
|
||||
allowedHttpRequestDomains: "none",
|
||||
allowedHttpRequestDomains: "all",
|
||||
});
|
||||
|
||||
const primaryConfig = getProviderConfig(primaryProviderChoice, primaryApiKey, primaryModelName);
|
||||
|
|
|
|||
|
|
@ -75,9 +75,9 @@ async function getOrCreateCredential(name: string, type: string, data: any) {
|
|||
const credsList = await n8nRequest("/api/v1/credentials");
|
||||
const existingCred = credsList.data.find((c: any) => c.name === name && c.type === type);
|
||||
if (existingCred) {
|
||||
console.log(`Reusing existing credential: ${name} (ID: ${existingCred.id})`);
|
||||
return existingCred.id;
|
||||
} else {
|
||||
console.log(`Deleting existing credential to recreate: ${name} (ID: ${existingCred.id})...`);
|
||||
await n8nRequest(`/api/v1/credentials/${existingCred.id}`, "DELETE");
|
||||
}
|
||||
const newCred = await n8nRequest("/api/v1/credentials", "POST", {
|
||||
name,
|
||||
type,
|
||||
|
|
@ -85,7 +85,6 @@ async function getOrCreateCredential(name: string, type: string, data: any) {
|
|||
});
|
||||
console.log(`Created new credential: ${name} (ID: ${newCred.id})`);
|
||||
return newCred.id;
|
||||
}
|
||||
} catch (err: any) {
|
||||
console.error(`Error setting up credential ${name}:`, err.message);
|
||||
process.exit(1);
|
||||
|
|
@ -108,7 +107,7 @@ function getProviderConfig(provider: string, apiKey: string, modelName: string):
|
|||
credentialType: "deepSeekApi",
|
||||
credentialData: {
|
||||
apiKey,
|
||||
allowedHttpRequestDomains: "none",
|
||||
allowedHttpRequestDomains: "all",
|
||||
},
|
||||
nodeParameters: {
|
||||
model: modelName || "deepseek-chat",
|
||||
|
|
@ -122,7 +121,7 @@ function getProviderConfig(provider: string, apiKey: string, modelName: string):
|
|||
credentialData: {
|
||||
apiKey,
|
||||
header: false,
|
||||
allowedHttpRequestDomains: "none",
|
||||
allowedHttpRequestDomains: "all",
|
||||
},
|
||||
nodeParameters: {
|
||||
model: modelName || "gpt-4o-mini",
|
||||
|
|
@ -136,7 +135,7 @@ function getProviderConfig(provider: string, apiKey: string, modelName: string):
|
|||
credentialData: {
|
||||
apiKey,
|
||||
host: "https://generativelanguage.googleapis.com",
|
||||
allowedHttpRequestDomains: "none",
|
||||
allowedHttpRequestDomains: "all",
|
||||
},
|
||||
nodeParameters: {
|
||||
model: modelName || "gemini-1.5-flash",
|
||||
|
|
@ -149,7 +148,7 @@ function getProviderConfig(provider: string, apiKey: string, modelName: string):
|
|||
credentialType: "anthropicApi",
|
||||
credentialData: {
|
||||
apiKey,
|
||||
allowedHttpRequestDomains: "none",
|
||||
allowedHttpRequestDomains: "all",
|
||||
},
|
||||
nodeParameters: {
|
||||
model: modelName || "claude-3-5-sonnet-latest",
|
||||
|
|
@ -240,7 +239,7 @@ async function main() {
|
|||
const supabaseCredId = await getOrCreateCredential("Semillero2_Supabase", "supabaseApi", {
|
||||
host: SUPABASE_URL,
|
||||
serviceRole: SUPABASE_SECRET_KEY,
|
||||
allowedHttpRequestDomains: "none",
|
||||
allowedHttpRequestDomains: "all",
|
||||
});
|
||||
|
||||
// 3. Manage Primary Model Credentials
|
||||
|
|
|
|||
Loading…
Reference in a new issue