MCPcopy
hub / github.com/FlowiseAI/Flowise / initializeCredentials

Method initializeCredentials

packages/server/src/NodesPool.ts:96–112  ·  view source on GitHub ↗

* Initialize credentials

()

Source from the content-addressed store, hash-verified

94 * Initialize credentials
95 */
96 private async initializeCredentials() {
97 const packagePath = getNodeModulesPackagePath('flowise-components')
98 const nodesPath = path.join(packagePath, 'dist', 'credentials')
99 const nodeFiles = await this.getFiles(nodesPath)
100 return Promise.all(
101 nodeFiles.map(async (file) => {
102 if (file.endsWith('.credential.js')) {
103 const credentialModule = await require(file)
104 if (credentialModule.credClass) {
105 const newCredInstance = new credentialModule.credClass()
106 newCredInstance.icon = this.credentialIconPath[newCredInstance.name] ?? ''
107 this.componentCredentials[newCredInstance.name] = newCredInstance
108 }
109 }
110 })
111 )
112 }
113
114 /**
115 * Recursive function to get node files

Callers 1

initializeMethod · 0.95

Calls 2

getFilesMethod · 0.95

Tested by

no test coverage detected