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

Method serialize

src/controller/assistant-manager.ts:75–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73 }
74
75 serialize() {
76 const data: AssistantManagerData = {};
77 for (const assistant of this.#assistants) {
78 const item: AssistantManagerDataItem = {
79 serviceName: assistant.service.constructor.name,
80 service: assistant.service.serialize(),
81 view: assistant.viewClass.name,
82 };
83 if (assistant.shortcut)
84 item.shortcut = assistant.shortcut;
85 if (assistant.tray) {
86 item.hasTray = true;
87 if (assistant.trayIcon != assistant.service.icon)
88 item.trayIcon = assistant.trayIcon.getChieURL();
89 }
90 data[assistant.id] = item;
91 }
92 return data;
93 }
94
95 createAssistant(name: string, serviceName: string, credential: APICredential, viewClass: BaseViewType, options?: Partial<WebServiceOptions>) {
96 const service = serviceManager.createService(name, serviceName, credential, options);

Callers

nothing calls this directly

Calls 2

getChieURLMethod · 0.80
serializeMethod · 0.65

Tested by

no test coverage detected