44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import { ABC } from "../deps.ts";
|
|
|
|
import config from "../config.ts";
|
|
|
|
export default function raw(g: ABC.Group) {
|
|
g.get("/deno-import-intellisense.json", (ctx) => {
|
|
return {
|
|
version: 1,
|
|
registries: [
|
|
{
|
|
schema: "/raw/:module([@]*[a-z0-9\\-\\_]*)@:version?/:path*",
|
|
variables: [
|
|
{
|
|
key: "module",
|
|
url: `${config.web.url}/api/module`,
|
|
},
|
|
{
|
|
key: "version",
|
|
url: `${config.web.url}/api/module/\${module}`,
|
|
},
|
|
{
|
|
key: "path",
|
|
url: `${config.web.url}/api/module/\${module}/v/\${{version}}`,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
schema: "/raw/:module([@]*[a-z0-9\\-\\_]*)/:path*",
|
|
variables: [
|
|
{
|
|
key: "module",
|
|
url: `${config.web.url}/api/module`,
|
|
},
|
|
{
|
|
key: "path",
|
|
url: `${config.web.url}/api/module/\${module}/v/latest`,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
};
|
|
});
|
|
}
|