@blizzard-api/client
Advanced tools
Comparing version 0.0.4 to 0.0.5
import * as axios from 'axios'; | ||
import { AxiosResponse } from 'axios'; | ||
import { Origins, Locales, ClientOptions, Resource, ResourceResponse } from '@blizzard-api/core'; | ||
import { Origins, Locales, Resource, ResourceResponse } from '@blizzard-api/core'; | ||
@@ -28,2 +28,9 @@ interface AccessToken { | ||
} | ||
interface ClientOptions { | ||
key: string; | ||
secret: string; | ||
origin: Origins; | ||
locale?: Locales; | ||
token?: string; | ||
} | ||
interface IBlizzardApiClient { | ||
@@ -46,4 +53,4 @@ getAccessToken: (options: AccessTokenRequestArguments) => Promise<AxiosResponse<AccessToken>>; | ||
axios: axios.AxiosInstance; | ||
getRequestUrl<T = unknown>(resource: Resource<T>, options?: Partial<ClientOptions>): string; | ||
getRequestConfig<T = unknown>(resource: Resource<T>, options?: Partial<ClientOptions>, headers?: Record<string, string>): { | ||
getRequestUrl<T, Protected extends boolean = false>(resource: Resource<T, Protected>, options?: Partial<ClientOptions>): string; | ||
getRequestConfig<T, Protected extends boolean = false>(resource: Resource<T, Protected>, options?: Partial<ClientOptions>, headers?: Record<string, string>): { | ||
headers: { | ||
@@ -58,3 +65,3 @@ 'Content-Type': string; | ||
}; | ||
sendRequest<T = void>(resource: Resource<T>, options?: Partial<ClientOptions>, headers?: Record<string, string>): ResourceResponse<AxiosResponse<T>>; | ||
sendRequest<T, Protected extends boolean = false>(resource: Resource<T, Protected>, options?: Partial<ClientOptions>, headers?: Record<string, string>): ResourceResponse<AxiosResponse<T>>; | ||
getAccessToken: (options?: AccessTokenRequestArguments) => Promise<AxiosResponse<AccessToken>>; | ||
@@ -66,2 +73,2 @@ setAccessToken: (token: string) => void; | ||
export { BlizzardApiClient }; | ||
export { type AccessToken, type AccessTokenRequestArguments, BlizzardApiClient, type ClientOptions, type IBlizzardApiClient, type ValidateAccessTokenArguments, type ValidateAccessTokenResponse }; |
{ | ||
"name": "@blizzard-api/client", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"license": "MIT", | ||
@@ -50,7 +50,7 @@ "author": "Putro", | ||
"peerDependencies": { | ||
"@blizzard-api/core": "0.0.4" | ||
"@blizzard-api/core": "0.0.5" | ||
}, | ||
"devDependencies": { | ||
"@blizzard-api/core": "0.0.4", | ||
"@blizzard-api/wow": "0.0.2" | ||
"@blizzard-api/core": "0.0.5", | ||
"@blizzard-api/wow": "0.0.3" | ||
}, | ||
@@ -57,0 +57,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26872
274