/**
* raw script by path with a token (mostly used by lsp to be used with import maps to resolve scripts)
*
*/
export async function main(workspace: string, token: string, path: string) {
const url = new URL(
`${BASE_URL}/api/scripts_u/tokened_raw/${workspace}/${token}/${path}`
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + WM_TOKEN,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 370 days ago
/**
* raw script by path with a token (mostly used by lsp to be used with import maps to resolve scripts)
*
*/
export async function main(workspace: string, token: string, path: string) {
const url = new URL(
`${BASE_URL}/api/scripts_u/tokened_raw/${workspace}/${token}/${path}`
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + WM_TOKEN,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 931 days ago
/**
* raw script by path with a token (mostly used by lsp to be used with import maps to resolve scripts)
*
*/
export async function main(workspace: string, token: string, path: string) {
const url = new URL(
`${BASE_URL}/api/scripts_u/tokened_raw/${workspace}/${token}/${path}`
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + WM_TOKEN,
},
body: undefined,
});
return await response.text();
}
Submitted by rubenfiszel 933 days ago
/**
* raw script by path with a token (mostly used by lsp to be used with import maps to resolve scripts)
*
*/
export async function main(workspace: string, token: string, path: string) {
const url = new URL(
`${BASE_URL}/api/scripts_u/tokened_raw/${workspace}/${token}/${path}`,
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + WM_TOKEN,
},
body: undefined,
});
return await response.text();
}
Submitted by admin 1003 days ago