mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-06 16:03:52 +00:00
6c6f5c2c0f
feat: locked presets refactor: simplify locked param refactor: create share links
23 lines
607 B
TypeScript
23 lines
607 B
TypeScript
import axios from 'axios';
|
|
import { GetInfo, LinkOptions } from 'ontime-types';
|
|
|
|
import { apiEntryUrl } from './constants';
|
|
|
|
const sessionPath = `${apiEntryUrl}/session`;
|
|
|
|
/**
|
|
* HTTP request to retrieve application info
|
|
*/
|
|
export async function getInfo(): Promise<GetInfo> {
|
|
const res = await axios.get(`${sessionPath}/info`);
|
|
return res.data;
|
|
}
|
|
|
|
/**
|
|
* HTTP request to get a pre-authenticated URL
|
|
*/
|
|
export async function generateUrl(options: LinkOptions & { baseUrl: string; path: string }): Promise<string> {
|
|
const res = await axios.post(`${sessionPath}/url`, options);
|
|
return res.data.url;
|
|
}
|