-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref #4
- Loading branch information
Showing
2 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { SchemaAfter, SchemaVersion } from "../schema"; | ||
|
||
export type Tokeninfo<Schema extends SchemaVersion = undefined> = | ||
Schema extends undefined ? TokeninfoBase : | ||
Schema extends SchemaAfter<'2019-05-22T00:00:00.000Z'> | 'latest' ? Tokeninfo_2019_05_22 : | ||
TokeninfoBase; | ||
|
||
export type Permission = 'account' | 'builds' | 'characters' | 'guilds' | 'inventories' | 'progression' | 'pvp' | 'tradingpost' | 'unlocks' | 'wallet'; | ||
|
||
interface TokeninfoBase { | ||
/** The toke id */ | ||
id: number | ||
|
||
/** The name of the base API key */ | ||
name: string | ||
|
||
/** List of permissions */ | ||
permissions: Permission[] | ||
} | ||
|
||
type Tokeninfo_2019_05_22 = TokeninfoBase & ({ | ||
/** The type of the token */ | ||
type: 'APIKey' | ||
} | { | ||
/** The type of the token */ | ||
type: 'Subtoken' | ||
|
||
/** Expiration date (ISO8601) of the subtoken. */ | ||
expires_at: string | ||
|
||
/** The issue date (ISO8601) of the subtoken */ | ||
issued_at: string | ||
|
||
/** The URLs included in this subtoken */ | ||
urls?: string[] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters