Coral 3.5.0

This commit is contained in:
Ellie
2026-09-09 12:41:37 +01:00
parent 1d1e86908c
commit 47c9d35d9d
2 changed files with 29 additions and 1 deletions

View File

@@ -82,12 +82,27 @@ export type AccountToken = AccountLogin;
/** /v4/Account/Login */
export interface AccountLogin_4 {
user: CurrentUser<false>;
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" */

View File

@@ -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<ListMedia>('/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<ListHashtag, ListHashtagParameter>('/v5/Hashtag/List', {
applications: [
@@ -360,6 +367,7 @@ export abstract class AbstractCoralApi {
});
}
/** @deprecated removed in 3.5.0 */
async getUserLoginFactor() {
return this.call<ShowUserLogin>('/v4/NA/User/LoginFactor/Show');
}