feat: Add Ask AI to HTTP Request Node (#8917)

This commit is contained in:
Alex Grozav
2024-05-02 13:52:15 +03:00
committed by GitHub
parent 7ff24f134b
commit cd9bc44bdd
40 changed files with 3945 additions and 371 deletions

View File

@@ -35,4 +35,21 @@ export class AIController {
);
}
}
/**
* Generate CURL request and additional HTTP Node metadata for given service and request
*/
@Post('/generate-curl')
async generateCurl(req: AIRequest.GenerateCurl): Promise<{ curl: string; metadata?: object }> {
const { service, request } = req.body;
try {
return await this.aiService.generateCurl(service, request);
} catch (aiServiceError) {
throw new FailedDependencyError(
(aiServiceError as Error).message ||
'Failed to generate HTTP Request Node parameters due to an issue with an external dependency. Please try again later.',
);
}
}
}

View File

@@ -81,7 +81,7 @@ export class PasswordResetController {
if (
isSamlCurrentAuthenticationMethod() &&
!(
(user && user.hasGlobalScope('user:resetPassword')) === true ||
user?.hasGlobalScope('user:resetPassword') === true ||
user?.settings?.allowSSOManualLogin === true
)
) {