MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / resolve

Method resolve

src/schedule/store.ts:143–153  ·  view source on GitHub ↗

Find by exact id, id prefix (>=4 chars), or exact name.

(idOrName: string)

Source from the content-addressed store, hash-verified

141
142 /** Find by exact id, id prefix (>=4 chars), or exact name. */
143 resolve(idOrName: string): ScheduleEntry | undefined {
144 const exact = this.get(idOrName);
145 if (exact) return exact;
146 const byName = this.db.prepare(`SELECT * FROM schedules WHERE name = ?`).get(idOrName) as ScheduleEntry | undefined;
147 if (byName) return byName;
148 if (idOrName.length >= 4) {
149 const matches = this.db.prepare(`SELECT * FROM schedules WHERE id LIKE ?`).all(`${idOrName}%`) as ScheduleEntry[];
150 if (matches.length === 1) return matches[0];
151 }
152 return undefined;
153 }
154
155 list(): ScheduleEntry[] {
156 return this.db.prepare(`SELECT * FROM schedules ORDER BY created_at ASC`).all() as ScheduleEntry[];

Callers 15

removeMethod · 0.95
setEnabledMethod · 0.95
run.mjsFile · 0.80
schedule.test.tsFile · 0.80
index.tsFile · 0.80
executeMethod · 0.80

Calls 1

getMethod · 0.95

Tested by

no test coverage detected