MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / getCredentialData

Function getCredentialData

packages/components/src/utils.ts:651–673  ·  view source on GitHub ↗
(selectedCredentialId: string, options: ICommonObject)

Source from the content-addressed store, hash-verified

649 * @returns {Promise<ICommonObject>}
650 */
651export const getCredentialData = async (selectedCredentialId: string, options: ICommonObject): Promise<ICommonObject> => {
652 const appDataSource = options.appDataSource as DataSource
653 const databaseEntities = options.databaseEntities as IDatabaseEntity
654
655 try {
656 if (!selectedCredentialId) {
657 return {}
658 }
659
660 const credential = await appDataSource.getRepository(databaseEntities['Credential']).findOneBy({
661 id: selectedCredentialId
662 })
663
664 if (!credential) return {}
665
666 // Decrypt credentialData
667 const decryptedCredentialData = await decryptCredentialData(credential.encryptedData)
668
669 return decryptedCredentialData
670 } catch (e) {
671 throw new Error(e)
672 }
673}
674
675/**
676 * Get first non falsy value

Callers 15

initMethod · 0.90
initMethod · 0.90
getRedisClientFunction · 0.90
initMethod · 0.90
initMethod · 0.90
initMethod · 0.90
initMethod · 0.90
initMethod · 0.90
Composio_ToolsClass · 0.90
initMethod · 0.90
initMethod · 0.90
initMethod · 0.90

Calls 1

decryptCredentialDataFunction · 0.70

Tested by

no test coverage detected