Update dependencies

This commit is contained in:
Samuel Elliott
2022-11-27 15:15:57 +00:00
parent 890c02e3ef
commit 6d1391929f
8 changed files with 183 additions and 380 deletions

View File

@@ -24,7 +24,7 @@ export default class MoonApi {
readonly znma_useragent = ZNMA_USER_AGENT,
) {}
async fetch<T = unknown>(url: string, method = 'GET', body?: string, headers?: object) {
async fetch<T extends object>(url: string, method = 'GET', body?: string, headers?: object) {
const [signal, cancel] = timeoutSignal();
const response = await fetch(MOON_URL + url, {
method,

View File

@@ -23,7 +23,7 @@ export default class NooklinkApi {
readonly client_version = BLANCO_VERSION,
) {}
async fetch<T = unknown>(url: string, method = 'GET', body?: string | FormData, headers?: object) {
async fetch<T extends object>(url: string, method = 'GET', body?: string | FormData, headers?: object) {
const [signal, cancel] = timeoutSignal();
const response = await fetch(NOOKLINK_URL + url, {
method,
@@ -164,7 +164,7 @@ export class NooklinkUserApi {
readonly client_version = BLANCO_VERSION,
) {}
async fetch<T = unknown>(url: string, method = 'GET', body?: string | FormData, headers?: object) {
async fetch<T extends object>(url: string, method = 'GET', body?: string | FormData, headers?: object) {
const [signal, cancel] = timeoutSignal();
const response = await fetch(NOOKLINK_URL + url, {
method,
@@ -224,7 +224,7 @@ export class NooklinkUserApi {
}
async postMessage(body: string, type: MessageType, destination_user_id?: string) {
return this.fetch<unknown>('/sd/v1/messages', 'POST', JSON.stringify({
return this.fetch('/sd/v1/messages', 'POST', JSON.stringify({
type,
body,
userId: destination_user_id,

View File

@@ -31,7 +31,7 @@ export default class SplatNet2Api {
public useragent: string,
) {}
async fetch<T = unknown>(url: string, method = 'GET', body?: string | FormData, headers?: object) {
async fetch<T extends object>(url: string, method = 'GET', body?: string | FormData, headers?: object) {
const [signal, cancel] = timeoutSignal();
const response = await fetch(SPLATNET2_URL + url, {
method,