add prettier config
This commit is contained in:
@ -7,7 +7,7 @@ const CLIENT_ID = "u0swxz56n4iumc634at1osoqdk31qt";
|
||||
const TWITCH_AUTH_URL = "https://id.twitch.tv/oauth2";
|
||||
const AUTHORIZATION_URL =
|
||||
`${TWITCH_AUTH_URL}/authorize?client_id=${CLIENT_ID}&redirect_uri=${encodeURIComponent(
|
||||
ssrConfig.domain + "/twitch",
|
||||
ssrConfig.domain + "/twitch"
|
||||
)}&response_type=token` + "&scope=${scopes}&state=${state}";
|
||||
const VALIDATE_URL = `${TWITCH_AUTH_URL}/validate`;
|
||||
|
||||
@ -26,7 +26,7 @@ export default (options = {}) => {
|
||||
url,
|
||||
accessToken,
|
||||
priority = PRIORITY.FG_LOW,
|
||||
options = {},
|
||||
options = {}
|
||||
) =>
|
||||
fetchJson(
|
||||
url,
|
||||
@ -37,7 +37,7 @@ export default (options = {}) => {
|
||||
Authorization: `Bearer ${accessToken}`,
|
||||
},
|
||||
},
|
||||
priority,
|
||||
priority
|
||||
);
|
||||
|
||||
const getAuthUrl = (state = "", scopes = "") =>
|
||||
@ -49,25 +49,25 @@ export default (options = {}) => {
|
||||
const validateToken = async (
|
||||
accessToken,
|
||||
priority = PRIORITY.FG_LOW,
|
||||
options = {},
|
||||
options = {}
|
||||
) =>
|
||||
fetchJson(
|
||||
VALIDATE_URL,
|
||||
{ ...options, headers: { Authorization: `OAuth ${accessToken}` } },
|
||||
priority,
|
||||
priority
|
||||
);
|
||||
|
||||
const profile = async (
|
||||
accessToken,
|
||||
login,
|
||||
priority = PRIORITY.FG_LOW,
|
||||
options = {},
|
||||
options = {}
|
||||
) =>
|
||||
fetchApi(
|
||||
substituteVars(PROFILE_URL, { login: encodeURIComponent(login) }),
|
||||
accessToken,
|
||||
priority,
|
||||
options,
|
||||
options
|
||||
);
|
||||
|
||||
const videos = async (
|
||||
@ -75,7 +75,7 @@ export default (options = {}) => {
|
||||
userId,
|
||||
type = "archive",
|
||||
priority = PRIORITY.FG_LOW,
|
||||
options = {},
|
||||
options = {}
|
||||
) =>
|
||||
fetchApi(
|
||||
substituteVars(VIDEOS_URL, {
|
||||
@ -84,20 +84,20 @@ export default (options = {}) => {
|
||||
}),
|
||||
accessToken,
|
||||
priority,
|
||||
options,
|
||||
options
|
||||
);
|
||||
|
||||
const streams = async (
|
||||
accessToken,
|
||||
userId,
|
||||
priority = PRIORITY.FG_LOW,
|
||||
options = {},
|
||||
options = {}
|
||||
) =>
|
||||
fetchApi(
|
||||
substituteVars(STREAMS_URL, { userId: encodeURIComponent(userId) }),
|
||||
accessToken,
|
||||
priority,
|
||||
options,
|
||||
options
|
||||
);
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user