MCPcopy Create free account
hub / github.com/chieapp/chie / removeCredentialById

Method removeCredentialById

src/controller/api-manager.ts:102–113  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

100 }
101
102 removeCredentialById(id: string) {
103 if (!(id in this.#credentials))
104 throw new Error(`Removing unknown API id: ${id}.`);
105 const assistant = assistantManager.getAssistants().find(a => a.service.api.credential.id == id);
106 if (assistant)
107 throw new Error(`Can not remove API credential because assistant "${assistant.service.name}" is using it.`);
108 const credential = this.#credentials[id];
109 delete this.#credentials[id];
110 this.onRemoveCredential.emit(credential);
111 this.saveConfig();
112 credential.id = null;
113 }
114
115 getCredentials() {
116 return Object.values(this.#credentials);

Callers 2

#createAPISettingMethod · 0.80

Calls 1

getAssistantsMethod · 0.80

Tested by

no test coverage detected