import BaseAPI from "./BaseAPI" ; import Client from "../Client" ; import { UpdateUserPromotionChannelsOptions as AccountInformationUpdateUserPromotionChannelsOptions } from "./AccountInformationAPI" ; export type GetSettingsGroups = { title : string ; url : string ; suffix : string ; } [ ] ; export type GetAppChatPrivacy = { appChatPrivacy : string ; } ; export type UpdateAppChatPrivacyOptions = { appChatPrivacy : string ; } ; export type UpdateAppChatPrivacy = boolean ; export type GetGameChatPrivacy = { gameChatPrivacy : string ; } ; export type UpdateGameChatPrivacyOptions = { gameChatPrivacy : string ; } ; export type UpdateGameChatPrivacy = boolean ; export type GetInventoryPrivacy = { inventoryPrivacy : string ; } ; export type UpdateInventoryPrivacyOptions = { inventoryPrivacy : string ; } ; export type UpdateInventoryPrivacy = { inventoryPrivacy : string ; tradePrivacy : string ; privacySettingResponse : string ; } ; export type GetUserPrivacy = { phoneDiscovery : string ; } ; export type UpdateUserPrivacyOptions = { phoneDiscovery : string ; } ; export type UpdateUserPrivacy = { phoneDiscovery : string ; } ; export type GetUserPrivacySettingsInfo = { isPhoneDiscoveryEnabled : boolean ; } ; export type GetUserPrivateMessagePrivacy = { privateMessagePrivacy : string ; } ; export type UpdateUserPrivateMessagePrivacyOptions = { privateMessagePrivacy : string ; } ; export type UpdateUserPrivateMessagePrivacy = boolean ; export type GetUserEmailStatus = { email : string ; verified : boolean ; } ; export type UpdateUserEmailOptions = { password : string ; emailAddress : string ; } ; export type UpdateUserEmail = boolean ; export type SendEmailVerification = boolean ; export type GetWebsiteTheme = { themeType : string ; } ; export type UpdateWebsiteThemeOptions = { themeType : string ; } ; export type UpdateWebsiteTheme = boolean ; export type GetWebsiteThemes = { data : string [ ] ; } ; export type GetUserTradePrivacy = { tradePrivacy : string ; } ; export type UpdateUserTradePrivacyOptions = { tradePrivacy : string ; } ; export type UpdateUserTradePrivacy = { tradePrivacy : string ; inventoryPrivacy : string ; privacySettingResponse : string ; } ; export type GetUserTradeQualityFilter = { tradeValue : string ; } ; export type UpdateUserTradeQualityFilterOptions = { tradeValue : string ; } ; export type UpdateUserTradeQualityFilter = boolean ; export type UpdateTwoStepStatusOptions = { enabled : boolean ; password : string ; } ; export type UpdateTwoStepStatus = { enabled : boolean ; password : string ; } ; export type GetContactUpsell = { upsellScreenType : string ; } ; export type UpdateContactUpsellSuppressionOptions = { suppress : boolean ; } ; export type UpdateContactUpsellSuppression = boolean ; export type GetIsXboxUsernameValidOptions = { authorization : string ; signature : string ; username : string ; } ; export type GetIsXboxUsernameValid = { isValid : boolean ; errorMessage ? : string ; errorCode ? : string ; } ; export type UpdateUserPromotionChannelsOptions = AccountInformationUpdateUserPromotionChannelsOptions ; export type UpdateUserPromotionChannels = boolean ; export default class AccountSettingsAPI extends BaseAPI { constructor ( client ) { super ( { baseUrl : "https://accountsettings.roblox.com/" , client } ) ; } getSettingsGroups ( ) { return this . request ( { requiresAuth : false , request : { path : "v1/account/settings/settings-groups" } , json : true } ) . then ( response => response . body . map ( ( val ) => ( { title : val . Title , url : val . Url , suffix : val . Suffix } ) ) ) ; } getAppChatPrivacy ( ) { return this . request ( { requiresAuth : true , request : { path : "v1/app-chat-privacy" } , json : true } ) . then ( response => response . body ) ; } updateAppChatPrivacy ( options ) { return this . request ( { requiresAuth : true , request : { path : "v1/app-chat-privacy" , method : "POST" , json : options } , json : true } ) . then ( response => response . body ) ; } getGameChatPrivacy ( ) { return this . request ( { requiresAuth : true , request : { path : "v1/game-chat-privacy" } , json : true } ) . then ( response => response . body ) ; } updateGameChatPrivacy ( options ) { return this . request ( { requiresAuth : true , request : { path : "v1/game-chat-privacy" , method : "POST" , json : options } , json : true } ) . then ( response => response . body ) ; } getInventoryPrivacy ( ) { return this . request ( { requiresAuth : true , request : { path : "v1/inventory-privacy" } , json : true } ) . then ( response => response . body ) ; } updateInventoryPrivacy ( options ) { return this . request ( { requiresAuth : true , request : { path : "v1/inventory-privacy" , method : "POST" , json : options } , json : true } ) . then ( response => response . body ) ; } getUserPrivacy ( ) { return this . request ( { requiresAuth : true , request : { path : "v1/privacy" } , json : true } ) . then ( response => response . body ) ; } updateUserPrivacy ( options ) { return this . request ( { requiresAuth : true , request : { path : "v1/privacy" , method : "PATCH" , json : options } , json : true } ) . then ( response => response . body ) ; } getUserPrivacySettingsInfo ( ) { return this . request ( { requiresAuth : true , request : { path : "v1/privacy/info" } , json : true } ) . then ( response => response . body as GetUserPrivacySettingsInfo ) ; } getUserPrivateMessagePrivacy ( ) { return this . request ( { requiresAuth : true , request : { path : "v1/private-message-privacy" } , json : true } ) . then ( response => response . body as GetUserPrivateMessagePrivacy ) ; } updateUserPrivateMessagePrivacy ( options ) { return this . request ( { requiresAuth : true , request : { path : "v1/private-message-privacy" , method : "POST" , json : options } , json : true } ) . then ( ( ) => true as UpdateUserPrivateMessagePrivacy ) ; } getUserEmailStatus ( ) { return this . request ( { requiresAuth : true , request : { path : "v1/email" } , json : true } ) . then ( response => response . body as GetUserEmailStatus ) ; } updateUserEmail ( options ) { return this . request ( { requiresAuth : true , request : { path : "v1/email" , method : "PATCH" , json : options } , json : true } ) . then ( ( ) => true ) ; } sendEmailVerification ( ) { return this . request ( { requiresAuth : true , request : { path : "v1/email/verify" , method : "POST" } , json : true } ) . then ( ( ) => true ) ; } getWebsiteTheme ( ) { return this . request ( { requiresAuth : true , request : { path : `v1/themes/User/${ this . client . user ! . id }` } , json : true } ) . then ( response => response . body as GetWebsiteTheme ) ; } updateWebsiteTheme ( options ) { return this . request ( { requiresAuth : true , request : { path : `v1/themes/User/${ this . client . user ! . id }` , method : "PATCH" , json : { themeType : options . themeType } } , json : true } ) . then ( ( ) => true ) ; } getWebsiteThemes ( ) { return this . request ( { requiresAuth : true , request : { path : "v1/themes/types" } , json : true } ) . then ( response => response . body as GetWebsiteThemes ) ; } getUserTradePrivacy ( ) { return this . request ( { requiresAuth : true , request : { path : "v1/trade-privacy" } , json : true } ) . then ( response => response . body as GetUserTradePrivacy ) ; } updateUserTradePrivacy ( options ) { return this . request ( { requiresAuth : true , request : { path : "v1/trade-privacy" , method : "POST" , json : options } , json : true } ) . then ( response => response . body as UpdateUserTradePrivacy ) ; } getUserTradeQualityFilter ( ) { return this . request ( { requiresAuth : true , request : { path : "v1/trade-value" } , json : true } ) . then ( response => response . body as GetUserTradeQualityFilter ) ; } updateUserTradeQualityFilter ( options ) { return this . request ( { requiresAuth : true , request : { path : "v1/trade-value" , method : "POST" , json : options } , json : true } ) . then ( ( ) => true ) ; } updateTwoStepStatus ( options ) { return this . request ( { requiresAuth : true , request : { path : "v1/email" , method : "PATCH" , json : options } , json : true } ) . then ( response => response . body as UpdateTwoStepStatus ) ; } getContactUpsell ( ) { return this . request ( { requiresAuth : true , request : { path : "v1/user/screens/contact-upsell" } , json : true } ) . then ( response => response . body as GetContactUpsell ) ; } updateContactUpsellSuppression ( options ) { return this . request ( { requiresAuth : true , request : { method : "POST" , path : "v1/user/screens/contact-upsell/suppress" , json : options } , json : true } ) . then ( ( ) => true as UpdateContactUpsellSuppression ) ; } getIsXboxUsernameValid ( options ) { return this . request ( { requiresAuth : true , request : { path : "v1/xbox/is-username-valid" , qs : { Authorization : options . authorization , signature : options . signature , "request.username" : options . username } } , json : true } ) . then ( response => response . body as GetIsXboxUsernameValid ) ; } updateUserPromotionChannels ( options ) { return this . request ( { requiresAuth : true , request : { path : "v1/promotion-channels" , method : "POST" , json : options } , json : true } ) . then ( ( ) => true ) ; } }