diff --git a/src/api/coral-types.ts b/src/api/coral-types.ts index 98e9c97..c70827f 100644 --- a/src/api/coral-types.ts +++ b/src/api/coral-types.ts @@ -82,12 +82,27 @@ export type AccountToken = AccountLogin; /** /v4/Account/Login */ export interface AccountLogin_4 { user: CurrentUser; + naUser: NaUser; webApiServerCredential: { accessToken: string; expiresIn: number; }; } +export interface NaUser { + region: string | null; + /** obfuscated sign in id and/or email */ + screenName: string; + country: string; + birthday: string; + language: string; + loginId: string | null; + id: string; + iconUri: string | null; + nickname: string; + email: string | null; +} + /** /v4/Account/GetToken, /v4/Extension/Account/GetToken */ export type AccountToken_4 = AccountLogin_4; @@ -517,6 +532,7 @@ export interface MediaBase { capturedAt: number; expiresAt: number; uploadedAt: number; + hashtags: string; } export type Media = MediaImage | MediaVideo; @@ -542,6 +558,10 @@ export interface ListMediaParameter { count: 100; } +export interface DeleteMediaParameter { + mediaIds: string[]; +} + /** /v5/Hashtag/List */ export interface ListHashtag { /** Plain text to prefill share dialog text, e.g. "#NintendoSwitch2 #MarioKartWorld" */ diff --git a/src/api/coral.ts b/src/api/coral.ts index ca82d93..775dfc9 100644 --- a/src/api/coral.ts +++ b/src/api/coral.ts @@ -5,7 +5,7 @@ import { JwtPayload } from '../util/jwt.js'; import { timeoutSignal } from '../util/misc.js'; import { getAdditionalUserAgents } from '../util/useragent.js'; import type { CoralRemoteConfig } from '../common/remote-config.js'; -import { AccountLogin, AccountLogin_4, AccountLoginParameter, AccountToken_4, AccountTokenParameter, Announcements_4, BlockingUsers, CoralError, CoralResponse, CoralStatus, CoralSuccessResponse, CreateFriendRequestChannel, CurrentUser, CurrentUserPermissions, Event, Friend_4, FriendCodeUrl, FriendCodeUser, FriendRouteChannel, Friends_4, GetActiveEventResult, ListChat, ListHashtag, ListHashtagParameter, ListMedia, ListPushNotificationSettings, Media, PlayLogPermissions, PresencePermissions, PushNotificationPlayInvitationScope, ReceivedFriendRequest, ReceivedFriendRequests, SentFriendRequests, ShowUserLogin, UpdatePushNotificationSettingsParameter, UpdatePushNotificationSettingsParameterItem, User, UserPlayLog, WebServices_4, WebServiceToken, WebServiceTokenParameter } from './coral-types.js'; +import { AccountLogin, AccountLogin_4, AccountLoginParameter, AccountToken_4, AccountTokenParameter, Announcements_4, BlockingUsers, CoralError, CoralResponse, CoralStatus, CoralSuccessResponse, CreateFriendRequestChannel, CurrentUser, CurrentUserPermissions, DeleteMediaParameter, Event, Friend_4, FriendCodeUrl, FriendCodeUser, FriendRouteChannel, Friends_4, GetActiveEventResult, ListChat, ListHashtag, ListHashtagParameter, ListMedia, ListPushNotificationSettings, Media, PlayLogPermissions, PresencePermissions, PushNotificationPlayInvitationScope, ReceivedFriendRequest, ReceivedFriendRequests, SentFriendRequests, ShowUserLogin, UpdatePushNotificationSettingsParameter, UpdatePushNotificationSettingsParameterItem, User, UserPlayLog, WebServices_4, WebServiceToken, WebServiceTokenParameter } from './coral-types.js'; import { createZncaApi, DecryptResponseResult, FResult, HashMethod, RequestEncryptionProvider, ZncaApi, ZncaApiNxapi } from './f.js'; import { generateAuthData, getNintendoAccountToken, getNintendoAccountUser, NintendoAccountScope, NintendoAccountSessionAuthorisation, NintendoAccountToken, NintendoAccountUser } from './na.js'; import { ErrorResponse, ResponseSymbol } from './util.js'; @@ -99,6 +99,13 @@ export abstract class AbstractCoralApi { return this.call('/v4/Media/List'); } + async deleteMedia(ids: string | string[]) { + return this.call<{}, DeleteMediaParameter>('/v4/Media/Delete', { + mediaIds: typeof ids === 'string' ? [ids] : ids, + }); + } + + /** @deprecated removed in ?? */ async getHashtags(media: Media) { return this.call('/v5/Hashtag/List', { applications: [ @@ -360,6 +367,7 @@ export abstract class AbstractCoralApi { }); } + /** @deprecated removed in 3.5.0 */ async getUserLoginFactor() { return this.call('/v4/NA/User/LoginFactor/Show'); }