2021-11-03 16:40:31 +00:00
|
|
|
import { User } from '~/lib/api/types';
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
interface Window {
|
|
|
|
WOODPECKER_USER: User | undefined;
|
|
|
|
WOODPECKER_VERSION: string | undefined;
|
2023-12-27 21:16:15 +00:00
|
|
|
WOODPECKER_SKIP_VERSION_CHECK: boolean | undefined;
|
2021-11-03 16:40:31 +00:00
|
|
|
WOODPECKER_CSRF: string | undefined;
|
2023-08-08 10:22:39 +00:00
|
|
|
WOODPECKER_FORGE: 'github' | 'gitlab' | 'gitea' | 'bitbucket' | undefined;
|
2023-08-07 14:05:18 +00:00
|
|
|
WOODPECKER_ROOT_PATH: string | undefined;
|
2023-08-03 00:42:30 +00:00
|
|
|
WOODPECKER_ENABLE_SWAGGER: boolean | undefined;
|
2021-11-03 16:40:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default () => ({
|
|
|
|
user: window.WOODPECKER_USER || null,
|
|
|
|
version: window.WOODPECKER_VERSION,
|
2023-12-27 21:16:15 +00:00
|
|
|
skipVersionCheck: window.WOODPECKER_SKIP_VERSION_CHECK || false,
|
2021-11-03 16:40:31 +00:00
|
|
|
csrf: window.WOODPECKER_CSRF || null,
|
2022-06-17 18:14:01 +00:00
|
|
|
forge: window.WOODPECKER_FORGE || null,
|
2023-08-07 14:05:18 +00:00
|
|
|
rootPath: window.WOODPECKER_ROOT_PATH || '',
|
2023-08-03 00:42:30 +00:00
|
|
|
enableSwagger: window.WOODPECKER_ENABLE_SWAGGER || false,
|
2021-11-03 16:40:31 +00:00
|
|
|
});
|