mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-03-21 18:04:10 -05:00
Fix ZncProxyApi types
This commit is contained in:
parent
163023501d
commit
d3e5a88625
|
|
@ -1,6 +1,6 @@
|
|||
import fetch, { Response } from 'node-fetch';
|
||||
import createDebug from 'debug';
|
||||
import { ActiveEvent, Announcements, CurrentUser, Event, Friend, Presence, PresencePermissions, User, WebService, WebServiceToken, CoralErrorResponse, CoralStatus, CoralSuccessResponse } from './coral-types.js';
|
||||
import { ActiveEvent, Announcements, CurrentUser, Event, Friend, Presence, PresencePermissions, User, WebService, WebServiceToken, CoralErrorResponse, CoralStatus, CoralSuccessResponse, FriendCodeUser, FriendCodeUrl } from './coral-types.js';
|
||||
import { ErrorResponse } from './util.js';
|
||||
import CoralApi from './coral.js';
|
||||
import { NintendoAccountUser } from './na.js';
|
||||
|
|
@ -97,11 +97,23 @@ export default class ZncProxyApi implements CoralApi {
|
|||
return {status: CoralStatus.OK as const, result: response.user, correlationId: ''};
|
||||
}
|
||||
|
||||
async getUserByFriendCode(friend_code: string, hash?: string): Promise<CoralSuccessResponse<FriendCodeUser>> {
|
||||
throw new Error('Not supported in ZncProxyApi');
|
||||
}
|
||||
|
||||
async sendFriendRequest(nsa_id: string): Promise<CoralSuccessResponse<{}>> {
|
||||
throw new Error('Not supported in ZncProxyApi');
|
||||
}
|
||||
|
||||
async getCurrentUser() {
|
||||
const response = await this.fetch<{user: CurrentUser}>('/user');
|
||||
return {status: CoralStatus.OK as const, result: response.user, correlationId: ''};
|
||||
}
|
||||
|
||||
async getFriendCodeUrl(): Promise<CoralSuccessResponse<FriendCodeUrl>> {
|
||||
throw new Error('Not supported in ZncProxyApi');
|
||||
}
|
||||
|
||||
async getCurrentUserPermissions() {
|
||||
const user = await this.getCurrentUser();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user