migu-api-enhanced 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -51,7 +51,8 @@ declare const getSceneRecommend: (scene?: string, size?: number) => Promise<any>
51
51
  */
52
52
  declare const getRadioRecommend: (type?: number) => Promise<any>;
53
53
 
54
- declare const getComment: (resourceId: string, resourceType?: number, size?: number, hotCommentStart?: number) => Promise<any>;
54
+ declare const getComment: (resourceId: string, resourceType?: number, // 2: 歌曲 D: MV
55
+ size?: number, hotCommentStart?: number) => Promise<any>;
55
56
 
56
57
  declare const getResourceInfo: (resourceId: string, resourceType?: number) => Promise<any>;
57
58
 
@@ -67,14 +68,20 @@ declare const getUrlH5V24: (contentId: string, copyrightId: string, resourceType
67
68
 
68
69
  declare const getVersion: (channel?: string, version?: string, ua?: string) => Promise<any>;
69
70
 
70
- declare const getMvInfo: (mvIds: string, { needAbsoluteUrl, }: {
71
- needAbsoluteUrl?: boolean | undefined;
72
- }) => Promise<any>;
71
+ declare const getMvInfo: (mvIds: string) => Promise<any>;
73
72
 
74
73
  declare const getMvHls: (mvContentId: string, mvCopyrightId: string, url: string, size: number, format?: string, needHttps?: boolean) => Promise<any>;
75
74
 
76
75
  declare const loginNP: {
77
- authn(username: string, password: string): Promise<any>;
76
+ /**
77
+ * 账号密码登录
78
+ * @param username 用户名
79
+ * @param password 密码
80
+ * @returns 登录成功后的 pacmtoken
81
+ */
82
+ authn(username: string, password: string): Promise<object | {
83
+ error: string;
84
+ }>;
78
85
  };
79
86
 
80
87
  declare const checkToken: (token?: string) => Promise<any>;
@@ -155,11 +162,71 @@ declare const getSingerSimilar: (singerId: string) => Promise<any>;
155
162
  */
156
163
  declare const getSimilarSongRecommend: (contentId?: string) => Promise<any>;
157
164
 
165
+ type LoginOneClickData = {
166
+ version: string;
167
+ appId: string;
168
+ openType: string;
169
+ expandParams: string;
170
+ isTest: boolean;
171
+ sign: string;
172
+ getNetworkType: string;
173
+ getMsisdnMask: string;
174
+ traceId: string;
175
+ msgId: string;
176
+ timestamp: string;
177
+ uuid: string;
178
+ businessType: string;
179
+ userInformations: string;
180
+ };
181
+ /**
182
+ * 调用方实际只需提供这些字段;其余字段由 getTokenInfo 内部补齐。
183
+ */
184
+ type GetTokenInfoInput = Pick<LoginOneClickData, 'version' | 'appId' | 'openType' | 'expandParams' | 'isTest' | 'sign' | 'getNetworkType' | 'getMsisdnMask'>;
185
+ declare const YDRZ: {
186
+ optparams: {
187
+ uuid: string;
188
+ msgId: string;
189
+ traceId: string;
190
+ businessType: string;
191
+ appId: string;
192
+ timestamp: string;
193
+ isimge: boolean;
194
+ expandParams: string;
195
+ userInformations: string;
196
+ CMRequestApi: string;
197
+ };
198
+ randomString(len: number, range?: number): string;
199
+ randomRange(min: number, max: number): number;
200
+ getUA(): string;
201
+ uaE(str: string): string;
202
+ getUserInfo(): string;
203
+ getSign(appID: string, version: string): string;
204
+ getTokenInfo(data: GetTokenInfoInput): Promise<string | undefined>;
205
+ };
206
+ declare const loginOneClick: {
207
+ genInternetSign: () => Promise<string | undefined>;
208
+ getSTToken: (uniToken: string) => Promise<{
209
+ token: string;
210
+ msisdn: string;
211
+ status: string;
212
+ } | {
213
+ error: string;
214
+ }>;
215
+ authn: () => Promise<{
216
+ token: string;
217
+ msisdn: string;
218
+ status: string;
219
+ } | {
220
+ error: string;
221
+ }>;
222
+ };
223
+
158
224
  /**
159
225
  * modules 子目录统一入口
160
226
  * 汇总导出所有 API 函数
161
227
  */
162
228
 
229
+ declare const api_YDRZ: typeof YDRZ;
163
230
  declare const api_checkCanListen: typeof checkCanListen;
164
231
  declare const api_checkToken: typeof checkToken;
165
232
  declare const api_getAlbumInfo: typeof getAlbumInfo;
@@ -197,6 +264,7 @@ declare const api_getUserHomePage: typeof getUserHomePage;
197
264
  declare const api_getUserMyList: typeof getUserMyList;
198
265
  declare const api_getVersion: typeof getVersion;
199
266
  declare const api_loginNP: typeof loginNP;
267
+ declare const api_loginOneClick: typeof loginOneClick;
200
268
  declare const api_loginSim: typeof loginSim;
201
269
  declare const api_queryUserInfo: typeof queryUserInfo;
202
270
  declare const api_searchAlbum: typeof searchAlbum;
@@ -208,7 +276,7 @@ declare const api_searchSuggest: typeof searchSuggest;
208
276
  declare const api_searchTicket: typeof searchTicket;
209
277
  declare const api_searchVideo: typeof searchVideo;
210
278
  declare namespace api {
211
- export { api_checkCanListen as checkCanListen, api_checkToken as checkToken, api_getAlbumInfo as getAlbumInfo, api_getAlbumSong as getAlbumSong, api_getComment as getComment, api_getMvHls as getMvHls, api_getMvInfo as getMvInfo, api_getOpNum as getOpNum, api_getPacmToken as getPacmToken, api_getPlaylistInfo as getPlaylistInfo, api_getPlaylistSong as getPlaylistSong, api_getRadioRecommend as getRadioRecommend, api_getRankIndex as getRankIndex, api_getRankInfo as getRankInfo, api_getRecommendPlaylist as getRecommendPlaylist, api_getResourceInfo as getResourceInfo, api_getSceneRecommend as getSceneRecommend, api_getSearchDefault as getSearchDefault, api_getSearchHot as getSearchHot, api_getSearchSingerTab as getSearchSingerTab, api_getSearchSingerTabList as getSearchSingerTabList, api_getSimilarSongRecommend as getSimilarSongRecommend, api_getSingerAlbum as getSingerAlbum, api_getSingerIndex as getSingerIndex, api_getSingerSimilar as getSingerSimilar, api_getSingerSong as getSingerSong, api_getTicketInfo as getTicketInfo, api_getTodayRecommend as getTodayRecommend, api_getUrlH5V24 as getUrlH5V24, api_getUrlV1 as getUrlV1, api_getUrlV2 as getUrlV2, api_getUserBadge as getUserBadge, api_getUserCollect as getUserCollect, api_getUserHomePage as getUserHomePage, api_getUserMyList as getUserMyList, api_getVersion as getVersion, api_loginNP as loginNP, api_loginSim as loginSim, api_queryUserInfo as queryUserInfo, api_searchAlbum as searchAlbum, api_searchConcert as searchConcert, api_searchRbt as searchRbt, api_searchSinger as searchSinger, api_searchSong as searchSong, api_searchSuggest as searchSuggest, api_searchTicket as searchTicket, api_searchVideo as searchVideo };
279
+ export { api_YDRZ as YDRZ, api_checkCanListen as checkCanListen, api_checkToken as checkToken, api_getAlbumInfo as getAlbumInfo, api_getAlbumSong as getAlbumSong, api_getComment as getComment, api_getMvHls as getMvHls, api_getMvInfo as getMvInfo, api_getOpNum as getOpNum, api_getPacmToken as getPacmToken, api_getPlaylistInfo as getPlaylistInfo, api_getPlaylistSong as getPlaylistSong, api_getRadioRecommend as getRadioRecommend, api_getRankIndex as getRankIndex, api_getRankInfo as getRankInfo, api_getRecommendPlaylist as getRecommendPlaylist, api_getResourceInfo as getResourceInfo, api_getSceneRecommend as getSceneRecommend, api_getSearchDefault as getSearchDefault, api_getSearchHot as getSearchHot, api_getSearchSingerTab as getSearchSingerTab, api_getSearchSingerTabList as getSearchSingerTabList, api_getSimilarSongRecommend as getSimilarSongRecommend, api_getSingerAlbum as getSingerAlbum, api_getSingerIndex as getSingerIndex, api_getSingerSimilar as getSingerSimilar, api_getSingerSong as getSingerSong, api_getTicketInfo as getTicketInfo, api_getTodayRecommend as getTodayRecommend, api_getUrlH5V24 as getUrlH5V24, api_getUrlV1 as getUrlV1, api_getUrlV2 as getUrlV2, api_getUserBadge as getUserBadge, api_getUserCollect as getUserCollect, api_getUserHomePage as getUserHomePage, api_getUserMyList as getUserMyList, api_getVersion as getVersion, api_loginNP as loginNP, api_loginOneClick as loginOneClick, api_loginSim as loginSim, api_queryUserInfo as queryUserInfo, api_searchAlbum as searchAlbum, api_searchConcert as searchConcert, api_searchRbt as searchRbt, api_searchSinger as searchSinger, api_searchSong as searchSong, api_searchSuggest as searchSuggest, api_searchTicket as searchTicket, api_searchVideo as searchVideo };
212
280
  }
213
281
 
214
282
  /**
@@ -225,4 +293,4 @@ declare function createClient(): typeof api;
225
293
  /** 客户端类型 */
226
294
  type MiguClient = ReturnType<typeof createClient>;
227
295
 
228
- export { type MiguClient, checkCanListen, checkToken, createClient, getAlbumInfo, getAlbumSong, getComment, getMvHls, getMvInfo, getOpNum, getPacmToken, getPlaylistInfo, getPlaylistSong, getRadioRecommend, getRankIndex, getRankInfo, getRecommendPlaylist, getResourceInfo, getSceneRecommend, getSearchDefault, getSearchHot, getSearchSingerTab, getSearchSingerTabList, getSimilarSongRecommend, getSingerAlbum, getSingerIndex, getSingerSimilar, getSingerSong, getTicketInfo, getTodayRecommend, getUrlH5V24, getUrlV1, getUrlV2, getUserBadge, getUserCollect, getUserHomePage, getUserMyList, getVersion, loginNP, loginSim, api as modules, queryUserInfo, searchAlbum, searchConcert, searchRbt, searchSinger, searchSong, searchSuggest, searchTicket, searchVideo };
296
+ export { type MiguClient, YDRZ, checkCanListen, checkToken, createClient, getAlbumInfo, getAlbumSong, getComment, getMvHls, getMvInfo, getOpNum, getPacmToken, getPlaylistInfo, getPlaylistSong, getRadioRecommend, getRankIndex, getRankInfo, getRecommendPlaylist, getResourceInfo, getSceneRecommend, getSearchDefault, getSearchHot, getSearchSingerTab, getSearchSingerTabList, getSimilarSongRecommend, getSingerAlbum, getSingerIndex, getSingerSimilar, getSingerSong, getTicketInfo, getTodayRecommend, getUrlH5V24, getUrlV1, getUrlV2, getUserBadge, getUserCollect, getUserHomePage, getUserMyList, getVersion, loginNP, loginOneClick, loginSim, api as modules, queryUserInfo, searchAlbum, searchConcert, searchRbt, searchSinger, searchSong, searchSuggest, searchTicket, searchVideo };