mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-06-03 09:20:10 +00:00
feat(Routes): add missing OAuth2 routes (#218)
This commit is contained in:
committed by
GitHub
parent
24f658de38
commit
9dd3446b64
@@ -569,6 +569,30 @@ export const Routes = {
|
||||
return `/oauth2/@me` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/authorize`
|
||||
*/
|
||||
oauth2Authorization() {
|
||||
return `/oauth2/authorize` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token`
|
||||
*/
|
||||
oauth2TokenExchange() {
|
||||
return `/oauth2/token` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token/revoke`
|
||||
*/
|
||||
oauth2TokenRevocation() {
|
||||
return `/oauth2/token/revoke` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/commands`
|
||||
@@ -728,12 +752,12 @@ export const RouteBases = {
|
||||
Object.freeze(RouteBases);
|
||||
|
||||
export const OAuth2Routes = {
|
||||
authorizationURL: `https://discord.com/api/v${APIVersion}/oauth2/authorize`,
|
||||
tokenURL: `https://discord.com/api/v${APIVersion}/oauth2/token`,
|
||||
authorizationURL: `${RouteBases.api}${Routes.oauth2Authorization()}`,
|
||||
tokenURL: `${RouteBases.api}${Routes.oauth2TokenExchange()}`,
|
||||
/**
|
||||
* See https://tools.ietf.org/html/rfc7009
|
||||
*/
|
||||
tokenRevocationURL: `https://discord.com/api/v${APIVersion}/oauth2/token/revoke`,
|
||||
tokenRevocationURL: `${RouteBases.api}${Routes.oauth2TokenRevocation()}`,
|
||||
} as const;
|
||||
|
||||
// Freeze OAuth2 route object
|
||||
|
||||
@@ -637,6 +637,30 @@ export const Routes = {
|
||||
return `/oauth2/@me` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/authorize`
|
||||
*/
|
||||
oauth2Authorization() {
|
||||
return `/oauth2/authorize` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token`
|
||||
*/
|
||||
oauth2TokenExchange() {
|
||||
return `/oauth2/token` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token/revoke`
|
||||
*/
|
||||
oauth2TokenRevocation() {
|
||||
return `/oauth2/token/revoke` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/commands`
|
||||
@@ -796,12 +820,12 @@ export const RouteBases = {
|
||||
Object.freeze(RouteBases);
|
||||
|
||||
export const OAuth2Routes = {
|
||||
authorizationURL: `https://discord.com/api/v${APIVersion}/oauth2/authorize`,
|
||||
tokenURL: `https://discord.com/api/v${APIVersion}/oauth2/token`,
|
||||
authorizationURL: `${RouteBases.api}${Routes.oauth2Authorization()}`,
|
||||
tokenURL: `${RouteBases.api}${Routes.oauth2TokenExchange()}`,
|
||||
/**
|
||||
* See https://tools.ietf.org/html/rfc7009
|
||||
*/
|
||||
tokenRevocationURL: `https://discord.com/api/v${APIVersion}/oauth2/token/revoke`,
|
||||
tokenRevocationURL: `${RouteBases.api}${Routes.oauth2TokenRevocation()}`,
|
||||
} as const;
|
||||
|
||||
// Freeze OAuth2 route object
|
||||
|
||||
@@ -569,6 +569,30 @@ export const Routes = {
|
||||
return `/oauth2/@me` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/authorize`
|
||||
*/
|
||||
oauth2Authorization() {
|
||||
return `/oauth2/authorize` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token`
|
||||
*/
|
||||
oauth2TokenExchange() {
|
||||
return `/oauth2/token` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token/revoke`
|
||||
*/
|
||||
oauth2TokenRevocation() {
|
||||
return `/oauth2/token/revoke` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/commands`
|
||||
@@ -728,12 +752,12 @@ export const RouteBases = {
|
||||
Object.freeze(RouteBases);
|
||||
|
||||
export const OAuth2Routes = {
|
||||
authorizationURL: `https://discord.com/api/v${APIVersion}/oauth2/authorize`,
|
||||
tokenURL: `https://discord.com/api/v${APIVersion}/oauth2/token`,
|
||||
authorizationURL: `${RouteBases.api}${Routes.oauth2Authorization()}`,
|
||||
tokenURL: `${RouteBases.api}${Routes.oauth2TokenExchange()}`,
|
||||
/**
|
||||
* See https://tools.ietf.org/html/rfc7009
|
||||
*/
|
||||
tokenRevocationURL: `https://discord.com/api/v${APIVersion}/oauth2/token/revoke`,
|
||||
tokenRevocationURL: `${RouteBases.api}${Routes.oauth2TokenRevocation()}`,
|
||||
} as const;
|
||||
|
||||
// Freeze OAuth2 route object
|
||||
|
||||
@@ -637,6 +637,30 @@ export const Routes = {
|
||||
return `/oauth2/@me` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/authorize`
|
||||
*/
|
||||
oauth2Authorization() {
|
||||
return `/oauth2/authorize` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token`
|
||||
*/
|
||||
oauth2TokenExchange() {
|
||||
return `/oauth2/token` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token/revoke`
|
||||
*/
|
||||
oauth2TokenRevocation() {
|
||||
return `/oauth2/token/revoke` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/commands`
|
||||
@@ -796,12 +820,12 @@ export const RouteBases = {
|
||||
Object.freeze(RouteBases);
|
||||
|
||||
export const OAuth2Routes = {
|
||||
authorizationURL: `https://discord.com/api/v${APIVersion}/oauth2/authorize`,
|
||||
tokenURL: `https://discord.com/api/v${APIVersion}/oauth2/token`,
|
||||
authorizationURL: `${RouteBases.api}${Routes.oauth2Authorization()}`,
|
||||
tokenURL: `${RouteBases.api}${Routes.oauth2TokenExchange()}`,
|
||||
/**
|
||||
* See https://tools.ietf.org/html/rfc7009
|
||||
*/
|
||||
tokenRevocationURL: `https://discord.com/api/v${APIVersion}/oauth2/token/revoke`,
|
||||
tokenRevocationURL: `${RouteBases.api}${Routes.oauth2TokenRevocation()}`,
|
||||
} as const;
|
||||
|
||||
// Freeze OAuth2 route object
|
||||
|
||||
Reference in New Issue
Block a user