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

Method unregisterAPI

src/controller/api-manager.ts:62–69  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

60 }
61
62 unregisterAPI(name: string) {
63 if (!(name in this.#apis))
64 throw new Error(`There is no API named "${name}".`);
65 if (this.getCredentials().find(e => e.type == name))
66 throw new Error(`Can not unregister API "${name}" because there is an API credential using it.`);
67 delete this.#apis[name];
68 this.saveConfig();
69 }
70
71 getAPISelections(): Selection[] {
72 return Object.keys(this.#apis).map(k => ({name: k, value: this.#apis[k]})).sort(sortByPriority);

Callers

nothing calls this directly

Calls 1

getCredentialsMethod · 0.95

Tested by

no test coverage detected