smule.js
Version:
A javascript library for Smule's mobile API
1,927 lines (1,920 loc) • 123 kB
text/typescript
import { AxiosResponse } from 'axios';
import EventEmitter from 'events';
import { JID } from '@xmpp/jid';
type campfire_audioFilters = {
audioFXOrder: string[];
defaultFX: string;
/**
* This is empty for me for some reason
*/
fxConfig: object;
vipOnlyFX: string[];
};
type sing_freeform = {
audioFreeformEnabled: boolean;
lyricScrollingEnabledFV1: boolean;
lyricScrollingEnabledFV2: boolean;
lyricsScrollingEnabled: boolean;
lyricsSizeShrinkEnabled: boolean;
lyricsSizeShrinkEnabledFV1: boolean;
videoAddEnabled: boolean;
};
type sing_google_ftuxBlocking = {
block: boolean;
headphonesScreen: boolean;
volumeScreen: boolean;
};
type sing_google_subscriptions = {
dailyPassEnabled: boolean;
definitions: Array<{
sku: string;
trial?: boolean;
period: string;
label_key: string;
description_key: string;
trial_label_key?: string;
trial_description_key?: string;
}>;
paywallScreen: string;
paywallWorkflowEnabled: boolean;
priceTextFormat: number;
showDisclaimer: boolean;
showDisclaimerV2: boolean;
showDisclaimerV2Trial: boolean;
useFlow: string;
};
type sing_appSettings = {
androidUIVersion: number;
decodeCacheSize: number;
existingUserEmailVerificationEnabled: boolean;
groupsBottomSheetEnabled: boolean;
idfaPrompt: boolean;
initialTab: string;
navBarAppearance: string;
network_timeout: number;
newHeaderEnabled: boolean;
notificationBadgeAppearance: string;
showTabLabels: boolean;
toldYaSo: boolean;
};
type sing_videoFX = {
airbrush: {
enabled: boolean;
};
default: string;
order: Array<string>;
vip: Array<string>;
};
type sing_vcs = {
coinsOnboardingMsg: string;
enabled: boolean;
notEnoughCoinsUiVersion: number;
savingEarlyGivesNoCoins: boolean;
showCoinsRecTutorial: boolean;
};
type sing_registration = {
ageGateEnabled: boolean;
buttonLayout: string;
carouselStringIds: Array<string>;
contactsFindFriendsEnabled: boolean;
emailVerificationEnabled: boolean;
fbFindFriendsEnabled: boolean;
lastLoginMethodEnabled: boolean;
layout: string;
loginButtonStringId: string;
loopingImageEnabled: boolean;
newHandleScreenType: string;
onboardingFlow: number;
phoneLoginType: string;
phoneRegistrationEnabled: boolean;
registerButtonStringId: string;
registrationOptions: Array<string>;
version: number;
};
type sing_arr = {
logRecCompletedArr: boolean;
unlockPrice: number;
};
type sing_boost = {
enableBoostFeature: boolean;
sku: string;
};
type sing_templates = {
associations: Array<{
arrKey: string;
templateId: string;
}>;
audioOverrideEnabled: boolean;
audioOverridesPaywallEnabled: boolean;
browsingCategories: Array<string>;
laBrowsingCategories: Array<string>;
singFlowEnabled: boolean;
singingFlowTemplatesEnabled: boolean;
studioPrivacySwitchVisible: boolean;
};
type sing_notifications = {
activityRevampEnabled: boolean;
becomeVipButtonEnabled: boolean;
channelUIEnabled: boolean;
friendIsLiveNotificationEnabled: boolean;
giftsTabEnabled: boolean;
giftsTabEnabledV2: boolean;
newsCenterEnabled: boolean;
newsCenterEnabledV2: boolean;
notificationsFilteringEnabled: boolean;
preserveFilterSelectionEnabled: boolean;
};
type links = {
appsEmbed: string;
cancelSubscriptionAndroid: string;
cancelSubscriptionIOS: string;
cancelSubscriptionLearnMore: string;
cancelSubscriptionWeb: string;
customerSupport: string;
defaultSmuleLogo: string;
domainWhitelist: Array<string>;
emailShare: string;
emailSharePerformance: string;
fbInvite: string;
fbInviteBanner: string;
fbLike: string;
help: string;
itunesSingEmbed: string;
patentsEmbed: string;
privacyEmbed: string;
smuleHomePage: string;
songbookHelp: string;
termOfServiceEmbed: string;
virtualCurrencyInfo: string;
};
type sing_feed = {
becomeVipButtonEnabled: boolean;
socialOnlyEnabled: boolean;
uiVersion: number;
};
type campfire_avStreamQuality = {
audiencePlaybackBuffersMax: number;
audiencePlaybackBuffersMin: number;
duetVideoHeight: number;
duetVideoMaxKbps: number;
duetVideoMinKbps: number;
duetVideoWidth: number;
hostVideoMaxKbps: number;
hostVideoMinKbps: number;
};
type sing_singingFlow = {
audioRequestFailedDialogFix: boolean;
audioVisualizerSwitch: string;
defaultFormType: string;
defaultLength: string;
dynamicClientSegmentationEnabled: boolean;
flowVersion: number;
headsetAlertMode: string;
isGuestFlowEnabled: boolean;
joinersLAPreviewEnabled: boolean;
laBrowsingCategories: Array<string>;
lyricsRecyclerViewEnabled: boolean;
matchAudioOverride: boolean;
momentsFreeSelectionDuration: {
min: number;
max: number;
};
momentsFreeSelectionEnabled: boolean;
momentsFriendlyPreSingFV1: boolean;
momentsFriendlyPreSingFV2: boolean;
momentsFriendlyPreSingFV3: boolean;
presingAndReviewLAEnabled: boolean;
presingVersion: number;
randomJoinEnabled: boolean;
reactivateSeedEnabled: boolean;
separateJoinEnabled: boolean;
separateJoinSeedsListEnabled: boolean;
shortOnboardingEnabled: boolean;
shortOptionEnabled: boolean;
shortPerfLeadInMs: number;
shortPerfLeadOutMs: number;
simpleJoinEnabled: boolean;
simplifiedSingflowEnabled: boolean;
singPauseMenuV2Enabled: boolean;
squareStylesUXEnabled: boolean;
startOverEnabled: boolean;
startSingingButtonStyle: number;
stylesCarouselV2Enabled: boolean;
swiftEnabled: boolean;
};
type sing_google_songbook = {
defaultSectionId: string;
recommendedRemoveSongsEnabled: boolean;
recommendedSectionFree: boolean;
recommendedSectionFreeTitle: string;
};
type sing_tipping = {
tippingProviders: Array<string>;
};
type sing_explore = {
becomeVipButtonEnabled: boolean;
momentsPreviewEnabled: boolean;
momentsPreviewEnabledV2: boolean;
orderedPlaylists: Array<number>;
sections: Array<string>;
seeAllLargeCellsEnabled: boolean;
};
type sing_nowPlaying = {
audioOnlyViewStyle: string;
audioVisualizerEnabled: boolean;
autoJoinFromDuetEnabled: boolean;
autoplayEnabled: boolean;
commentLikingEnabled: boolean;
followButtonEnabled: boolean;
giftingCoachmarkEnabled: boolean;
lyricVideosEnabled: boolean;
nowPlayingGiftVIPDuration: number;
prebufferingEnabled: boolean;
showGroupMentionUI: boolean;
showHeaderUI: boolean;
uiVersion: number;
viewStyleSwitchEnabled: boolean;
};
type dfp = {
groupId: number;
testId: number;
};
type sing_google_ads = {
preload_sdks: Array<string>;
zones: {
launch: {
frequency: number;
timeout: number;
};
cancel: {
frequency: number;
};
postperformance: {
frequency: number;
};
"singing.solo": {
frequency: number;
};
"singing.seed": {
frequency: number;
};
};
};
type sing_findFriendsModule = {
placements: {
feed: {
startingPosition: number;
repeatInterval: number;
};
"songbook.recommended": {
startingPosition: number;
repeatInterval: number;
};
};
};
type sing_share = {
branchEnabled: boolean;
exclusions: Array<string>;
FBDirect: boolean;
flexibleTrimmerEnabled: boolean;
flexibleTrimmerV2Enabled: boolean;
flexibleTrimmerV3Enabled: boolean;
igReelsWithAttributionEnabled: boolean;
igRenderInitialIntervalInSeconds: number;
igRenderPollingIntervalInSeconds: number;
igRenderPollingTimeoutInSeconds: number;
momentsEnabled: boolean;
shareButtonLayout: string;
shareButtonOrder: Array<string>;
shareButtonOrderV2: Array<string>;
showCommentOnFeed: boolean;
showCommentOnPlayerBar: boolean;
snapchatShareOption: string;
uiVersion: number;
};
type sing_google_preSing = {
audioMode: string;
isJoinOnBottom: boolean;
recTypeScreen: string;
seedScreenVersion: string;
};
type sing_avqSurvey = {
rate: number;
};
type sing_shortJoins = {
audioPreSingEnabled: boolean;
enabled: boolean;
inviteListUsesNowPlaying: boolean;
nowPlayingEnabled: boolean;
nowPlayingFullSongByDefault: boolean;
nowPlayingPlaybackMode: string;
nowPlayingSimplifiedEnabled: boolean;
preSingEnabled: boolean;
selectPOIForSinging: boolean;
};
type sing_songbookUsability = {
filterButtonPlacement: string;
freeLabelEnabled: boolean;
searchBarVisible: string;
songCellType: string;
};
type sing_families = {
creationBannerEnabled: boolean;
enabled: boolean;
iosOnlyNotificationEnabled: boolean;
};
type sing_audio = {
aaudioLatencyUpdateFrequency: number;
audioInputMonitorEnabled: boolean;
audioSystemVersion: number;
audioWrapperVersion: number;
autoplayOnReview: boolean;
backgroundUpload: boolean;
bluetoothEnabled: boolean;
defaultSuperpoweredLatency: number;
deviceOverrides: {
settings: {
audioWrapperVersion: number;
wrapperV0: number;
};
deviceMachines: string[];
};
enablePreSingAudioMonitoring: boolean;
fileAllocationEnabled: boolean;
fileWriterBufferSize: number;
ioThreadOptimizationEnabled: boolean;
midiAlignmentEnabled: boolean;
midiAlignmentMinConfidence: number;
mmapWorkaroundEnabled: boolean;
monitoringFXConfigEnabled: boolean;
monitoringParams: {
knee: number;
slope: number;
target: number;
min: number;
max: number;
};
oboeResamplerEnabled: boolean;
offlineDecoding: boolean;
openSLVer: number;
otaBacktrackLevel: number;
otaLatencyMethod: string;
overrides: {
campfireTuning: {
vbrMin: number;
vbrMax: number;
playbackBufferMin: number;
playbackBufferMax: number;
};
};
rtmEnabled: boolean;
seekGlitchProtectionEnabled: boolean;
shouldRestartOnSilenceDetected: boolean;
showMicPermissionsPrompt: boolean;
usePreGain: boolean;
voiceCommWorkaroundEnabled: boolean;
wrapperV0: number;
wrapperVersion: number;
writeBuffers: number;
};
type campfire_config = {
audioOnlyEnabled: boolean;
creationRequiresVIP: boolean;
enabled: boolean;
globalVideoEnabled: boolean;
groupExperienceEnabled: boolean;
invitationDialogsEnabled: boolean;
maxInviteCount: number;
openSeedsEnabled: boolean;
previewCellType: string;
publicExperienceEnabled: boolean;
saveClipsEnabled: boolean;
sessionIdentityEnabled: boolean;
};
type sing_cccp = {
arrVisible: boolean;
defaultSort: string;
minTilOld: number;
showPitchTracks: boolean;
};
type appFamily = {
apps: string[];
};
type sing_search = {
autocompleteDelayMS: number;
categoricalSearchEnabled: boolean;
categoricalSearchOrder: string[];
categoricalSearchV2Enabled: boolean;
instantSearchDelayMS: number;
lyricsSearchEnabled: boolean;
newSearchEnabled: boolean;
numRecsToFetch: number;
searchByCategoriesEnabled: boolean;
searchByCategoriesV2Enabled: boolean;
v2Enabled: boolean;
};
type sing_localization = {
forceLocaleSwitcher: {
enabled: boolean;
langOrder: string[];
};
localeSwitcherEnabled: boolean;
};
type sing_videoEncoding = {
bitrate: number;
bitrate360AVC: number;
bitrate360HEVC: number;
bitrate480AVC: number;
bitrate480HEVC: number;
bitrate720AVC: number;
bitrate720HEVC: number;
format: string;
framerate: number;
gopDuration: number;
hdEnabled: boolean;
resolution: number;
};
type sing_chat = {
activityStatusEnabled: boolean;
connectChatOnLogin: boolean;
enabled: boolean;
entryShortcutsEnabled: boolean;
forceUpgrade: boolean;
maxGroupMembers: number;
richLinksEnabled: boolean;
welcomePerfKey: string;
};
type sing_paywall = {
showV2: boolean;
stringsGroup: string;
trialLayout: string;
trialOfferId: string;
};
type sing_appLaunch = {
cacheSettings: boolean;
resumeSession: boolean;
secureAPI: boolean;
};
type sing_acappella = {
maxDurationSec: number;
minDurationSec: number;
};
type sing_google_buy_msg = {
enough_text: string;
not_enough_text: string;
rate_us_count_limit: number;
};
type sing_google_songUpsell = {
enabled: boolean;
joinNoUpload: {
title: string;
bullets: {
icon: string;
text: string;
}[];
};
joinUpload: {
title: string;
bullets: {
icon: string;
text: string;
}[];
};
seedNoUpload: {
title: string;
bullets: {
icon: string;
text: string;
}[];
};
seedUpload: {
title: string;
bullets: {
icon: string;
text: string;
}[];
};
soloNoUpload: {
title: string;
bullets: {
icon: string;
text: string;
}[];
};
soloUpload: {
title: string;
bullets: {
icon: string;
text: string;
}[];
};
};
type sing_google_stream_values = {
demo_interval: number;
stream_cost: number;
stream_report_time_interval: number;
};
type sing_google_smeaks = {
billingObfuscatedIdsEnabled: boolean;
FTUXSongBookmarkTutorialEnabled: boolean;
landingScreenLocationRequestEnabled: boolean;
manageSubscriptionEnabled: boolean;
ssd: boolean;
};
type sing_audioFilters = {
config: {
[key: string]: {
versionSpec: string;
};
};
ctrEnabled: boolean;
ctrEnabledForDuetJoins: boolean;
default: string;
defaultOTA: string;
order: string[];
otaConfig: {
[key: string]: {
versionSpec: string;
};
};
rnnoiseEnabled: boolean;
vipOnly: string[];
vocalMonitorConfig: {
[key: string]: {
versionSpec: string;
};
};
};
type sing_google_mediaPlayer = {
foregroundServiceEnabled: boolean;
};
type sing_onboarding = {
autoPlayOnCompletionEnabled: boolean;
canDeferFTUX: boolean;
extendedArrPreviewEnabled: boolean;
flow: string;
reboardingEnabled: boolean;
search: boolean;
skipTopicsEnabled: boolean;
topics: boolean;
topicsSource: number;
tutorialVersion: string;
upsellLocation: string;
};
type sing_crm = {
appboyEnabled: boolean;
};
type sing_playlists = {
performancePaginationEnabled: boolean;
};
type sing_seeds = {
castJoinAsSeedEnabled: boolean;
hotListEnabled: boolean;
paidSeedExtensionEnabled: boolean;
removeJoinsEntryPoint: "actionsheet";
reopenSeedsEnabled: boolean;
};
type sing_google_explore = {
playlistId: number;
};
type sing_banners = {
armstrongDynamicBannersEnabled: boolean;
};
type sing_google_cccp = {
arrVisible: boolean;
defaultSort: string;
joinVisible: boolean;
tabNameKey: string;
};
type sing_videoStyles = {
default: string;
defaultParticleIntensity: string;
joinersChoiceEnabled: boolean;
order: string[];
particlesEnabled: boolean;
teaser: string[];
vip: string[];
};
type sing_profile = {
archivedMessageOnTop: boolean;
becomeVipButtonEnabled: boolean;
channelSearchDebounceMS: number;
channelSearchEnabled: boolean;
defaultChannelLayout: string;
familiesEnabled: boolean;
getVerifiedButtonEnabled: boolean;
multiplePerformancePinningEnabled: boolean;
perfSortingEnabled: boolean;
playlistsEnabled: boolean;
profileStatsEnabled: boolean;
profileViewsEnabled: boolean;
storageBannerV2: boolean;
storageLimit: number;
storageLimitV2: number;
uiVersion: number;
verifiedBadgeUnmetCriteria: boolean;
version: number;
vipGiftingCoachmarkEnabled: boolean;
};
type sing_google_tutorial = {
headphoneReminder: boolean;
numberOfFreePlays: number;
showSongbookTips: boolean;
tutorialSongDoMiSo: boolean;
};
type sing_video = {
faceTrackingEnabled: boolean;
groupJoinLimit: number;
nonVIPCreateLimit: number;
numFreeJoins: number;
singleEGLContext: boolean;
singleEGLContextVersion: number;
uploadRequestTimeoutSecs: number;
uploadSliceSizeKB: number;
uploadTimeoutSecs: number;
uploadWifiOnly: {
enabled: boolean;
timeoutSec: number;
reminderDialogThreshold: number;
};
uploadWifiOnlySetting: boolean;
wifiOnlyUploadTimeoutSecs: number;
};
type sing_virtualCurrency = {
coinPackImageVersion: number;
coinWalletDesignVersion: number;
directGiftingEnabled: boolean;
giftFOMOEnabled: boolean;
giftIconBounceIntervalSec: number;
giftingEnabled: boolean;
giftSearchEnabled: boolean;
giftTagsEnabled: boolean;
highlightLiveJamGiftIcon: boolean;
highlightNowPlayingGiftIcon: boolean;
liveJamGiftingEnabled: boolean;
messageCarouselEnabled: boolean;
minibarGiftingEnabled: boolean;
purchasingEnabled: boolean;
seedExtensionCoachmarkEnabled: boolean;
seedExtensionEnabled: boolean;
seedExtensionInfoEnabled: boolean;
showBonusCoinsInPacks: boolean;
vipGiftingBulkLimit: number;
vipGiftingEnabled: boolean;
vipGiftingInGroupsEnabled: boolean;
walletLayout: string;
};
type sing_upload = {
requestTimeoutSec: number;
timeoutSec: number;
usePerformanceUploadManager: boolean;
usePerformanceUploadManager2: boolean;
videoSliceSizeKB: number;
wifiOnly: {
enabled: boolean;
timeoutSec: number;
reminderDialogThreshold: number;
};
};
type sing_topics = {
validationEnabled: boolean;
};
/**
* An instance of a device, required for certain requests.
*/
declare class Device {
carrierCountry: string;
country: string;
deviceId: string;
deviceType: string;
googlePlayServices: string;
hasMail: boolean;
lang: string;
limitAdTrack: boolean;
locale: string;
machine: string;
manufacturer: string;
os: string;
product: string;
screenSize: string;
script: string;
constructor(carrierCountry?: string, country?: string, deviceId?: string, deviceType?: "AND" | "IOS", // untested
googlePlayServices?: string, hasMail?: boolean, lang?: string, limitAdTrack?: boolean, locale?: string, machine?: string, manufacturer?: string, os?: string, product?: string, screenSize?: string, script?: string);
}
declare class LoginCommonData {
advId: string;
device: Device;
automaticLogin: boolean;
playerId: number;
reactivateSubmittedAccount: boolean;
tzOffset: number;
vorgom: boolean;
welcome: boolean;
constructor(device?: Device);
}
declare class LoginAsGuestRequest {
loginCommon: LoginCommonData;
constructor(loginCommon?: LoginCommonData);
toJSON(): {
common: LoginCommonData;
forceNewPlayer: boolean;
lookupAccount: boolean;
settingsIds: string[];
};
}
declare class LoginRequest {
private loginCommon;
private data;
constructor(email: string, password: string, loginCommon?: LoginCommonData);
toJSON(): {
email: string;
password: string;
advId: string;
device: Device;
automaticLogin: boolean;
playerId: number;
reactivateSubmittedAccount: boolean;
tzOffset: number;
vorgom: boolean;
welcome: boolean;
};
}
declare class SearchRequest {
private data;
constructor(cursor?: string, limit?: number, resultType?: SearchResultType, sort?: SearchResultSort, term?: string);
toJSON(): {
cursor: string;
limit: number;
resultType: string;
sort: string;
term: string;
};
}
declare class SearchAutocompleteRequest {
private data;
constructor(term: string, limit: number);
toJSON(): {
limit: number;
term: string;
};
}
declare class PerformancesListRequest {
private data;
constructor(sort?: PerformancesSortOrder, fillStatus?: PerformancesFillStatus, limit?: number, offset?: number);
toJSON(): {
fillStatus: string;
limit: number;
offset: number;
sort: string;
video: boolean;
};
}
declare class PerformancePartsRequest {
private data;
constructor(accountId: number, fillStatus: PerformancesFillStatus, sortMethod: PerformanceSortMethod, limit?: number, offset?: number);
toJSON(): {
accountId: number;
app: string;
collapsed: boolean;
fillStatus: string;
limit: number;
offset: number;
sortMethod: string;
};
}
declare class PreuploadRequest {
private data;
constructor(arrKey: string, compType: "ARR" | string, ensembleType: EnsembleType, uploadType?: string, trackVideo?: boolean, seedKey?: string);
toJSON(): {
arrKey: string;
compType: string;
ensembleType: string;
trackVideo: boolean;
uploadType: string;
seedKey: any;
};
}
declare class PerformanceCreateRequest {
arrKey: string | undefined;
arrVer: number;
audioResourceId: number;
avTemplateId: number;
compType: "ARR" | string;
coverResourceId: number;
ensembleType: EnsembleType;
isPrivate: boolean;
latitude: number;
longitude: number;
message: string;
metadataResourceId: number;
seconds: number;
title: string;
trackAvTemplateId: number;
trackFxMode: string;
trackOptions: string;
trackVideo: boolean;
usedHeadphone: boolean;
vfactor: number;
vscore: number;
trackPartId: number | undefined;
savedEarly: boolean;
performanceKey: string | undefined;
constructor(arrKey: string, arrVer: number, ensembleType: EnsembleType, avTemplateId: number, isPrivate: boolean, message: string, title: string, usedHeadphone?: boolean, compType?: "ARR" | string, seconds?: number, trackPartId?: number, performanceKey?: string | undefined, trackAvTemplateId?: number, //306890,
trackFxMode?: string, trackOptions?: string, trackVideo?: boolean, vfactor?: number, vscore?: number);
}
/**
* Used to request a list of performances for this song key with specific criterias
*/
declare class PerformanceReq {
app: string;
arrKey: string;
fillStatus: PerformancesFillStatus;
limit: number;
offset: number;
sort: PerformancesSortOrder;
video: boolean;
/**
* Used to request a list of performances for this song key with these criterias
*
* @param key - The arr key associated with the song.
* @param sort - The order in which performances should be sorted. Default is RECENT.
* @param fillStatus - The fill status of the performances. Default is ACTIVESEED.
* @param limit - The maximum number of performances to fetch. Default is 25.
* @param offset - The starting point for fetching performances. Default is 0.
* @param video - Whether to retrieve only video performances.
*/
constructor(key: string, sort?: PerformancesSortOrder, fillStatus?: PerformancesFillStatus, limit?: number, offset?: number, video?: boolean);
}
declare class SingUserProfileRequest {
private data;
constructor(accountId: number);
toJSON(): {
accountId: number;
includeActiveState: boolean;
};
}
declare class IsFollowingRequest {
private data;
constructor(accountIds: number[]);
toJSON(): {
accountIds: any[];
apps: string[];
};
}
declare class UpdateFollowingRequest {
private data;
constructor(accountIdsToAdd: number[], accountIdsToRemove: number[]);
toJSON(): {
add: any[];
content: string;
remove: any[];
};
}
declare class SongbookRequest {
private data;
constructor(cursor?: string, limit?: number);
toJSON(): {
cat1SongsCursor: string;
cat1SongsLimit: number;
};
}
declare class CategoryRequest {
private data;
constructor(cursor?: string, limit?: number, categoryId?: number, duetAccountId?: number);
toJSON(): {
cursor: string;
limit: number;
id: number;
duetAccountId: any;
};
}
declare class SettingsRequest {
device: Device;
constructor(device?: Device);
toJSON(): {
device: Device;
settingsIds: string[];
};
}
declare class PreferencesRequest {
toJSON(): {
names: string[];
};
}
declare class AvTemplateCategoryListRequest {
private data;
constructor(category?: string, cursor?: string, limit?: number, avTemplateType?: string);
toJSON(): {
category: string;
cursor: string;
limit: number;
avTemplateType: string;
};
}
type AccountIcon = {
accountId: number;
picUrl: string;
picUrlType: string;
handle: string;
blurb: string;
verifiedUrls: Array<{
type: string;
desc: string;
url: string;
}>;
subApps: Array<string>;
firstName: string;
lastName: string;
jid: string;
verifiedType: string;
latitude?: number;
longitude?: number;
};
type Contact = {
emails: string[];
phoneNumbers: string[];
realName: string;
};
type Profile = {
accountIcon: AccountIcon;
apps: SMULE_APP[];
social: {
numFollowers: number;
numFollowees: number;
};
players: Array<{
app: string;
playerId: number;
}>;
webUrl: string;
sfamCnt: number;
ownPlaylistCnt: number;
wallet: Wallet;
phoneConnected: boolean;
verifiedBadgeEligible: boolean;
verifiedBadgeUnmetCriteria: string[];
tippingProfile: {
tipping: any[];
tippingEnabled: boolean;
withTermsAndConditions: boolean;
};
};
type RecAccount = {
recId: string;
accountIcon: AccountIcon;
reasonType: string;
reasonVars: string[];
};
type SingProfile = {
theme: {
background: number;
foreground: number;
lightText: boolean;
};
coverUrl: string;
displayName: string;
pinPerformanceIcon: PerformanceIcon;
pinPerformanceIcons: Array<PerformanceIcon>;
mentionAccountIcons: Array<AccountIcon>;
displayMentions: boolean;
};
type UserTippingPref = {
provider: UserTippingProvider;
handleType: TippingHandleType;
handle: string;
};
type UserTippingProvider = {
baseUrl: string;
displayName: string;
iconUrl: string;
name: string;
handleTypes: TippingHandleType[];
};
type TippingHandleType = "URL" | "PHONE_NUMBER" | "EMAIL";
type Arr = {
key: string;
ver: number;
appFamily: string;
compTitle: string;
ownerAccountIcon: AccountIcon;
smuleOwned: boolean;
artist: string;
langId: string;
songId: string;
rating: number;
highlyRated: boolean;
totalVotes: number;
perfCount: number;
lyrics: boolean;
multipart: boolean;
coverUrl: string;
webUrl: string;
arrCreatedAt: number;
totalPlays: number;
noPaywall: boolean;
name: string;
price: {
vipOnly: boolean;
price: number;
};
avTmplSegments?: Array<avTmplSegment>;
composition?: {
id: string;
title: string;
artist: string;
};
};
type ArrExtended = {
arr: Arr;
ver: number;
processState: number;
published: boolean;
lyrics: boolean;
lyricAnimationSupport: number;
multipart: boolean;
groupParts: boolean;
length: number;
pitchTrack: boolean;
origResources: {
role: "preview" | "cover_ios" | "cover" | "midi" | "bg" | "cover_google" | "pitch";
url: string;
id: number;
uid: string;
contentType: string;
size: number;
createdAt: number;
}[];
normResources: {
role: "preview" | "cover_art_google" | "background" | "meta" | "mir" | "cover_art_ios" | "main" | "cover_art";
url: string;
id: number;
uid: string;
contentType: string;
size: number;
createdAt: number;
}[];
avTmplSegments: {
id: number;
start: number;
end: number;
type: string;
tags: string[];
}[];
recAvTmplSegment: {
id: number;
origin: string;
};
supportedMode: string;
};
type Song = {
recId: string;
arrVersionLite: Arr;
joinableSeedCount: number;
};
type SongCategory = {
id: number;
displayName: string;
};
type PerformanceIcon = {
performanceKey: string;
playerId: number;
accountIcon: AccountIcon;
app: "sing";
compType: "ARR";
arrKey: string;
title: string;
artist: string;
message: string;
coverUrl: string;
shortTermRenderedUrl: string;
videoRenderedUrl: string;
videoRenderedMp4Url: string;
origTrackUrl: string;
origTrackOptions: string;
origTrackInstrumentId: string;
origTrackPartId: number;
origTrackCity: {
city: string;
country: string;
};
totalPerformers: number;
totalVideoTracks: number;
totalLoves: number;
totalListens: number;
totalComments: number;
giftCnt: number;
createdAt: number;
webUrl: string;
isPrivate: boolean;
ensembleType: EnsembleType;
childCount: number;
lifetimeJoinCount: number;
isJoinable: boolean;
seed: boolean;
liveAt: number;
video: boolean;
videoType: "NONE" | "VISUALIZER" | "VIDEO";
videoResolution: string;
boost: boolean;
formType: string;
isCastableAsSeed: boolean;
arrVersion?: ArrExtended;
visualizerRenderedUrl?: string;
complete: boolean;
avTemplateId: number;
parentPerformanceKey?: string;
recentTracks?: Array<{
accountIcon: AccountIcon;
}>;
};
type PerformanceDetail = {
performance: PerformanceIcon;
restricted: boolean;
lyricVid: boolean;
bookmarked: boolean;
favorited: boolean;
loved: boolean;
avTemplateDetails: AvTemplateLite;
tippingMap: {
[key: number]: UserTippingPref;
};
};
type ParticipationIcon = {
partCreatedAt: Date;
performanceIcon: PerformanceIcon;
};
type RecPerformanceIcon = {
recId: string;
exploreIcon: {
videoLength: number;
};
performanceIcon: PerformanceIcon;
};
/**
* ACTIVESEED -> Ongoing open performance invitations.
*
* SEED -> Expired performance invitations.
*
* FILLED -> Recordings.
*/
type PerformancesFillStatus = "ACTIVESEED" | "SEED" | "FILLED";
type EnsembleType = "SOLO" | "DUET" | "GROUP" | "BACKUP" | "MIX" | "BATTLE";
type PerformanceList = {
performanceIcons: PerformanceIcon[];
next: number;
};
type PerformancesSortOrder = "RECENT" | "HOT" | "LOVE" | "SUGGESTED";
type PerformanceSortMethod = "NEWEST_FIRST" | "MOST_JOINED" | "MOST_LOVED";
type SocialInvite = {
performanceIcon: PerformanceIcon;
invitedAt: Date;
};
type SocialInvite2 = {
performanceKey: string;
invitedAt: Date;
inviter: AccountIcon;
};
type Comment = {
postKey: string;
time: Date;
accountIcon: AccountIcon;
message: string;
messageXml: string;
latitude: number;
longitude: number;
likeCount: number;
};
type GiftIcon = {
id: number;
name: string;
type: "SYSTEM";
animation: {
id: number;
type: "LOTTIE";
speed: number;
repeatCount: number;
autoReverse: boolean;
autoPlay: boolean;
isStatic: boolean;
minAutoPlayDelay: number;
maxAutoPlayDelay: number;
resources: Array<{
id: number;
type: "PREVIEW" | "FULL";
resource: {
id: number;
url: string;
size: number;
contentType: string;
};
}>;
};
};
type CampfireSyncResult = {
campfire: Campfire;
playStream: CampfirePlayStream;
signups: any[];
arrVersionLite: Arr;
sendStats: boolean;
};
type Campfire = {
id: number;
ownerAccountIcon: AccountIcon;
hostAccountIcon: AccountIcon;
guestAccountIcon: AccountIcon;
title: string;
state: "ACTIVE" | string;
giftCnt: number;
roomJid: string;
hidden: boolean;
webUrl: string;
occupantCount: number;
previewArtist: string;
previewName: string;
createdAt: Date;
expireTs: Date;
mode: "AUDIO";
languages: any[];
purposes: any[];
};
type CampfirePlayStream = {
type: "AGORA";
agoraStream: {
appId: string;
userId: number;
channelName: string;
role: "PLAY";
token: string;
expireAt: Date;
hostUserId: number;
};
};
type SFamList = {
sfam: SFam;
sfamStat: {
postCount: number;
memberCount: number;
};
adminIcons: any[];
};
type SFam = {
sfamId: number;
name: string;
desc: string;
loc: string;
lang: string;
picUrl: string;
sfamTag: string;
tags: string[];
enrollStatus: number;
approvalStatus: number;
};
type SFamMembershipType = "UNKNOWN" | "GUEST" | "PENDING_RQST" | "PENDING_INVTN" | "MEMBER" | "ADMIN";
type SearchResultCategory = "NONE" | "TITLE" | "LYRIC" | string;
type SearchResultType = "CFIRE" | "SONG" | "ACTIVESEED" | "SFAM" | "ACCOUNT" | "RECORDING";
type SearchResultSort = "POPULAR" | "RECENT" | "EXPIRE";
type TrendingSearch = {
recId: string;
trendingSearch: string;
};
type AvTemplateLite = {
id: number;
name: string;
accountIcon: AccountIcon;
imageUrl: string;
mainResourceUrl: string;
description?: string;
vip: boolean;
gen: number;
type: "STANDARD" | string;
tags: string[];
hasSnapLens: boolean;
hasMir: boolean;
updatedAt: Date;
};
type avTmplSegment = {
id: number;
start: number;
end: number;
type: string;
tags: Array<any>;
};
type FeedItem = {
recId?: string;
postId?: number;
subject?: AccountIcon;
action?: string | "LOVE" | "FamilyPost";
actionTime?: Date;
count?: number;
source?: string | "MYNW" | "GHPS";
object: {
performance?: PerformanceIcon;
};
};
type PlaylistDetailed = {
playlist: Playlist;
recPerformanceIcons: RecPerformanceIcon[];
next: number;
};
type Playlist = {
id: number;
name: string;
message: string;
extraData: string;
imgUrl: string;
trending: boolean;
};
type PlaylistIcon = {
playlistKey: string;
type: "ACCT";
visibility: PlaylistVisibility;
name: string;
webUrl: string;
tags: string[];
stats: {
itemsCount: number;
};
accountIcon: AccountIcon;
};
type PlaylistVisibility = "PUB" | "PRI";
type PlaylistSortMethod = "OLDEST_FIRST" | "NEWEST_FIRST";
/**
* An ad banner, usually on the home page
*/
type Banner = {
name: string;
destUrl: string;
imgUrl: string;
targetType: string;
positionId: number;
};
type Cursor = {
next: string;
hasNext: boolean;
};
type Wallet = {
credit: number;
earned: number;
dailyLimitResetAt?: Date;
};
/**
* Custom class used to store session data
*/
declare class SmuleSession {
sessionToken: string;
refreshToken: string;
isGuest: boolean;
expired: boolean;
device: Device;
latitude: 37;
longitude: -122;
}
/**
* These are generally used throughout smule's api,
* but certain error codes are reused for other purposes too.
*
* Depending on the context, these error codes might mean different things
*/
declare const SmuleErrorCode: {
61: string;
50: string;
51: string;
69: string;
71: string;
2001: string;
1012: string;
1013: string;
10: string;
1052: string;
2017: string;
2013: string;
1044: string;
};
declare const SmuleRegisterErrorCode: {
13: string;
};
type SMULE_APP = "UNKNOWN" | "MINIPIANO" | "SMULEDOTCOM" | "SING" | "MINIPIANO_ANDROID" | "AUTORAP_IOS" | "AUTORAP_GOOG" | "SING_GOOGLE" | "STUDIO_IOS" | "STUDIO_ANDROID" | "SING_HUAWEI" | "UNRECOGNIZED";
/**
* Base API response
*/
type ApiResult<T> = {
status: {
code: number;
message?: string;
version: number;
};
data?: T;
};
type AccessTokenResult = {
accessToken: string;
};
type AccountExploreResult = {
recAccountIcons: RecAccount[];
cursor: Cursor;
personal: boolean;
};
type AccountLookupResult = {
accountIcons: Array<AccountIcon>;
};
type AccountProfileStatsViewsResult = {
profileViewsStatistics: {
views: number;
viewers: Array<{
accountIcon: AccountIcon;
lastViewedAt: Date;
mutualFollowState: string | "NONE";
}>;
privacyMode: boolean;
};
cursor: Cursor;
};
type AccountWalletResult = {
wallet: Wallet;
};
type ArrResult = {
arrVersion: ArrExtended;
};
type ArrByKeysResult = {
arrVersionLites: Arr[];
};
type ArrBookmarkListResult = {
songs: Arr;
cursor: Cursor;
totalCount: number;
};
type ArrOwnedBy = {
arrVersionLites: Arr[];
arrCount: number;
next: number;
};
type AvTemplateCategoryListResult = {
recAvTemplateLites: Array<{
avtemplateLite: AvTemplateLite;
}>;
};
type BannersResult = {
banners: Array<Banner>;
};
type CampfireListResult = {
campfires: Campfire[];
cursor: Cursor;
};
type CategoryListResult = {
categories: Array<{
id: number;
displayName: string;
}>;
};
type CategorySongsResult = {
songs: Array<Song>;
cursor: Cursor;
};
type ContactFindResult = {
notFollowing: Array<{
realName: string;
accountIcon: AccountIcon;
}>;
hasMatches: boolean;
};
type DeviceSettingsResult = {
over_air_latency_v5: number;
};
type GiftsResult = {
gifts: Array<{
giftIcon: GiftIcon;
count: number;
}>;
giftCount: number;
};
type InviteMeResult = {
invites: SocialInvite[];
cursor: Cursor;
};
type InviteListResult = {
invites: SocialInvite2[];
next: number;
};
type LoginResult = {
sessionToken: string;
sessionTtl: number;
refreshToken: string;
playerId: number;
playerNew: boolean;
playerNewlyRegistered: boolean;
playerNewlyInAppFam: boolean;
policyAccepted: boolean;
policyVersion: string;
policyUrl: string;
termUrl: string;
accountId: number;
/**
* Username
*/
handle: string;
handleNew: boolean;
/**
* Username auto generated from email?
*/
handlePrefill: boolean;
email: string;
emailVerified: boolean;
newsletter: number;
showEmailOpt: boolean;
language: string;
picUrl: string;
picUrlType: string;
loginCount: number;
serverTime: number;
playerStat: {
installDate: number;
};
elControl: {
npt: boolean;
};
standardChat: {
jid: string;
xmppHosts: string[];
};
campfireChat: {
jid: string;
xmppHosts: string[];
};
/**
* this is usually empty
*/
settings: string;
birthDate?: {
year: number;
month: number;
};
};
type LoginInfoResult = {
notificationCount: {
activity: number;
pubInvite: number;
gift: number;
};
feedActivity: boolean;
apiHosts: string[];
performanceCount: number;
splittests: string[];
};
type LoginAsGuestResult = {
loginResult: LoginResult;
settings: SettingsResult;
};
type PerformanceResult = {
performance: PerformanceIcon;
lyricVid: boolean;
};
type PerformanceByKeysResult = {
performanceIcons: Array<PerformanceIcon>;
};
type PerformancePartsResult = {
participationIcons: Array<ParticipationIcon>;
totalPerformances: number;
accountCounters: {
performanceCount: number;
};
storageLimit: number;
next: number;
};
type PerformanceBookmarkSeedResult = {
performanceIcons: Array<PerformanceIcon>;
totalPerformances: number;
next: number;
};
type PerformanceCreateResult = {
performance: PerformanceIcon;
trackKey: string;
};
type PerformanceCommentsResult = {
performanceKey: string;
commentUIViewInfo: {
commenter: boolean;
joiner: boolean;
};
comments: Array<Comment>;
next: number;
};
type PerformanceCreateCommentResult = {
postKey: string;
comment: Comment;
};
type PerformanceDetailsResult = {
performanceDetails: PerformanceDetail[];
};
type PerformancesByAvTemplateResult = {
performanceIcons: Array<PerformanceIcon>;
cursor: Cursor;
totalPerformances: number;
};
type PerformancesByUserResult = {
participationIcons: Array<ParticipationIcon>;
totalPerformances: number;
accountCounters: {
performanceCount: number;
};
storageLimit: number;
next: number;
};
type PlaylistExploreResult = {
primary: PlaylistDetailed[];
secondary: Playlist[];
};
type PlaylistGetResult = {
recPerformanceIcons: RecPerformanceIcon[];
next: number;
};
type PlaylistViewResult = {
items: Array<{
performanceIcon: PerformanceIcon;
}>;
cursor: Cursor;
playlistSortMethod: PlaylistSortMethod;
};
type PreferencesResult = {
prefs: Array<{
name: string;
value: string;
}>;
};
type PreuploadResult = {
resources: Array<{
pop: string;
resourceType: "IMAGE" | "META" | "AUDIO";
resourceId: number;
hostname: string;
}>;
};
type RecAccountsResult = {
recAccountIcons: Array<RecAccount>;
};
type RecTrendingSearchResult = {
recTrendingSearches: TrendingSearch[];
};
type SearchResult = {
resultTypes?: SearchResultType[];
categories?: SearchResultCategory[];
songs?: Array<{
type: "ARR";
arrangementVersionLite: Arr;
}>;
accts?: Array<AccountIcon>;
seeds?: Array<PerformanceIcon>;
recs?: Array<PerformanceIcon>;
cfires?: Array<unknown>;
sfams?: Array<unknown>;
acctSocialMap?: {
[key: string]: {
numFollowers: number;
};
};
cursor?: Cursor;
};
type SearchAutocompleteResult = {
options: Array<{
text: string;
}>;
categories: string[];
};
type SettingsResult = {
"sing_google.subscriptions": sing_google_subscriptions;
"sing_google.stream_values": sing_google_stream_values;
"sing_google.buy_msg": sing_google_buy_msg;
"sing_google.tutorial": sing_google_tutorial;
"sing_google.cccp": sing_google_cccp;
"sing_google.songbook": sing_google_songbook;
"sing_google.preSing": sing_google_preSing;
"sing_google.ftuxBlocking": sing_google_ftuxBlocking;
"sing_google.songUpsell": sing_google_songUpsell;
"sing_google.explore": sing_google_explore;
"sing_google.mediaPlayer": sing_google_mediaPlayer;
"sing_google.ads": sing_google_ads;
"sing_google.smeaks": sing_google_smeaks;
"sing.profile": sing_profile;
"sing.playlists": sing_playlists;
"sing.audio": sing_audio;
"sing.audioFilters": sing_audioFilters;
"sing.arr": sing_arr;
"sing.onboarding": sing_onboarding;
"sing.cccp": sing_cccp;
"sing.acappella": sing_acappella;
"sing.video": sing_video;
"sing.videoEncoding": sing_videoEncoding;
"sing.chat": sing_chat;
"sing.search": sing_search;
"sing.videoFX": sing_videoFX;
"sing.videoStyles": sing_videoStyles;
"sing.avqSurvey": sing_avqSurvey;
"sing.paywall": sing_paywall;
"sing.freeform": sing_freeform;
"dfp": dfp;
"appLaunch": sing_appLaunch;
"sing.crm": sing_crm;
"sing.boost": sing_boost;
"sing.share": sing_share;
"sing.feed": sing_feed;
"sing.findFriendsModule": sing_findFriendsModule;
"sing.localization": sing_localization;
"sing.seeds": sing_seeds;
"sing.nowPlaying": sing_nowPlaying;
"sing.registration": sing_registration;
"sing.upload": sing_upload;
"sing.families": sing_families;
"sing.appSettings": sing_appSettings;
"campfire.avStreamQuality": campfire_avStreamQuality;
"campfire.config": campfire_config;
"sing.virtualCurrency": sing_virtualCurrency;
"campfire.audioFilters": campfire_audioFilters;
"links": links;
"sing.singingFlow": sing_singingFlow;
"sing.explore": sing_explore;
"sing.songbookUsability": sing_songbookUsability;
"sing.templates": sing_templates;
"sing.topics": sing_topics;
"sing.banners": sing_banners;
"sing.shortJoins": sing_shortJoins;
"sing.vcs": sing_vcs;
"sing.notifications": sing_notifications;
"sing.tipping": sing_tipping;
"appFamily": appFamily;
};
type SFamInfoResult = {
sfamInfo: {
sfam: SFam;
membership: "GUEST" | "MEMBER";
sfamStat: {
postCount: number;
memberCount: number;
};
owner: AccountIcon;
adminIcons: AccountIcon[];
webUrl: string;
};
};
type SFamListResult = {
sfamList: SFamList[];
cursor: Cursor;
};
type SFamMemberListResult = {
members: Array<AccountIcon>;
cursor: Cursor;
};
type SingUserProfileResult = {
profile: Profile;
singProfile?: SingProfile;
followerOfViewer: boolean;
};
type SocialBlockListResult = {
accountIds: number[];
};
type SocialCommentLikesResult = {
likes: Array<{
accountIcon: AccountIcon;
}>;
};
type SocialFeedListResult = {
feedItems: FeedItem[];
cursor: Cursor;
};
type SocialFolloweesResult = {
followees: Array<AccountIcon>;
accountApps: Array<{
accountId: number;
apps: SMULE_APP[];
}>;
totalFollowees: number;
};
type SocialFollowersResult = {
followers: Array<AccountIcon>;
accountApps: Array<{
accountId: number;
apps: SMULE_APP[];
}>;
totalFollowers: number;
};
type SocialIsFollowingResult = {
following: number[];
notFollowing: number[];
};
type SongbookResult = {
categories: Array<SongCategory>;
cat1Songs: Array<Song>;
cat1Cursor: Cursor;
disinterestedSongs: Array<Song>;
};
type StoreSubscriptionStatusResult = {
isActive: boolean;
status: string;
skipTrial: boolean;
storeCancellable: boolean;
};
type TopicOptionResult = {
options: Array<{
id: number;
recId: string;
displayName: string;
coverUrls: string[];
}>;
};
type TopicChooseResult = {
freeCompositions: Array<{
recId: string;
compositionLite: {
type: "ARR";
arrangementVersionLite: Arr;
};
}>;
};
type UserUploadPictureResult = {
picUrl: string;
picUrlType: "user";
};
type ListEntitlementsResult = {
/**
* This is empty for a free account, soo...
*/
products: Array<any>;
};
type SmuleMessage = {
content: string;
sender: number;
id?: string;
performanceKey?: string;
};
type SmuleChatContainer = {
messages: Array<SmuleMessage>;
};
type SmuleChatState = "closed" | "closing" | "open" | "opening" | "online" | "offline" | "connected" | "connecting" | "disconnected" | "disconnecting";
type SmulePartnerStatus = "active" | "composing" | "paused" | "inactive" | "gone";
declare namespace Util {
function getParametersFromUrl(url: string): string;
function getHostFromFullUrl(url: string): string;
function getPathFromFullUrl(url: string): string;
function queryToObject(query: string | URLSearchParams): {
[k: string]: string;
};
function objectToQuery(query: {
[key: string]: string;
}): string;
function formatTime(ms: number, showMS?: boolean): string;
function formatValue(value: number, largeCharacter?: boolean): string;
}
declare class CustomFormData {
private data;
set(key: string, value: any, type?: string, filename?: string): void;
get(key: string): any;
serialize(): Buffer<ArrayBuffer>;
}
declare namespace SmuleUtil {
function checkLoggedIn(session: SmuleSession): boolean;
function isVerified(verifiedType: string): boolean;
function isVIP(subApps: string[]): boolean;
function getGroupMembershipType(membership: number): SFamMembershipType;
function getFilesFromArr(arr: ArrExtended): {
preview: string;
cover: string;
cover_android: string;
cover_ios: string;
midi_file: string;
song_file: string;
meta_file: string;
mir_file: string;
preview_original: string;
cover_original: string;
cover_android_original: string;
cover_ios_original: string;
midi_file_original: string;
song_file_original: string;
pitch_file: string;
};
}
declare class SmuleLiveChat {
events: EventEmitter;
state: SmuleChatState;
private client;
private jid;
private ongoingIq;
private iqHasMore;
private lastIqId;
private roomJID;
private roomUsers;
private chat;
constructor(userId: number, session: string, host?: string, roomJID?: string);
/**
* Establish a connection to Smule's XMPP server.
*/
connect(): Promise<void>;
/**
* Disconnects the client from the XMPP server.
* This method will terminate the active connection
* and stop any ongoing communication with the server.
*
* @remarks If called when still transmitting data,
* it might throw an error (socket write after end).
*/
disconnect(): Promise<void>;
/**
* Send a chat state to the server. This is used to
* signal whether you are currently activ