MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / installByUrl

Method installByUrl

src/app/service/service_worker/script.ts:380–391  ·  view source on GitHub ↗
(url: string, source: InstallSource, subscribeUrl?: string)

Source from the content-addressed store, hash-verified

378
379 // 直接通过url静默安装脚本
380 async installByUrl(url: string, source: InstallSource, subscribeUrl?: string) {
381 const uuid = uuidv4();
382 const code = await fetchScriptBody(url);
383 const { script } = await prepareScriptByCode(code, url, uuid);
384 script.subscribeUrl = subscribeUrl;
385 await this.installScript({
386 script,
387 code,
388 upsertBy: source,
389 });
390 return script;
391 }
392
393 // 直接通过code静默安装脚本
394 async installByCode(param: { uuid: string; code: string; upsertBy: InstallSource }) {

Callers 1

upsertScriptMethod · 0.80

Calls 3

installScriptMethod · 0.95
fetchScriptBodyFunction · 0.90
prepareScriptByCodeFunction · 0.90

Tested by

no test coverage detected