migu-api-enhanced 2.27.1 → 2.27.4

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.
Files changed (89) hide show
  1. package/README.md +14 -8
  2. package/dist/YDRZ-HSTSW5FC.mjs +11 -0
  3. package/dist/YDRZ-HSTSW5FC.mjs.map +1 -0
  4. package/dist/YDRZ-KF4GXM2T.cjs +11 -0
  5. package/dist/YDRZ-KF4GXM2T.cjs.map +1 -0
  6. package/dist/activity/index.cjs +85 -0
  7. package/dist/activity/index.cjs.map +1 -0
  8. package/dist/activity/index.d.cts +70 -0
  9. package/dist/activity/index.d.ts +70 -0
  10. package/dist/activity/index.mjs +85 -0
  11. package/dist/activity/index.mjs.map +1 -0
  12. package/dist/chunk-4ZNJQZKT.mjs +95 -0
  13. package/dist/chunk-4ZNJQZKT.mjs.map +1 -0
  14. package/dist/chunk-AJYZYXNE.mjs +18 -0
  15. package/dist/chunk-AJYZYXNE.mjs.map +1 -0
  16. package/dist/chunk-C56WQXBU.cjs +13 -0
  17. package/dist/chunk-C56WQXBU.cjs.map +1 -0
  18. package/dist/chunk-EIM46AX6.mjs +144 -0
  19. package/dist/chunk-EIM46AX6.mjs.map +1 -0
  20. package/dist/chunk-HDGZY5R6.mjs +13 -0
  21. package/dist/chunk-HDGZY5R6.mjs.map +1 -0
  22. package/dist/chunk-ILRMRBMK.cjs +71 -0
  23. package/dist/chunk-ILRMRBMK.cjs.map +1 -0
  24. package/dist/chunk-JRQEIAY5.mjs +21 -0
  25. package/dist/chunk-JRQEIAY5.mjs.map +1 -0
  26. package/dist/chunk-KGXC32BN.cjs +185 -0
  27. package/dist/chunk-KGXC32BN.cjs.map +1 -0
  28. package/dist/chunk-QEH62Z4S.cjs +18 -0
  29. package/dist/chunk-QEH62Z4S.cjs.map +1 -0
  30. package/dist/chunk-QMBC3CRQ.mjs +51 -0
  31. package/dist/chunk-QMBC3CRQ.mjs.map +1 -0
  32. package/dist/chunk-QTK2O5KQ.mjs +71 -0
  33. package/dist/chunk-QTK2O5KQ.mjs.map +1 -0
  34. package/dist/chunk-RI7PQIHG.cjs +144 -0
  35. package/dist/chunk-RI7PQIHG.cjs.map +1 -0
  36. package/dist/chunk-TIKOSETY.cjs +51 -0
  37. package/dist/chunk-TIKOSETY.cjs.map +1 -0
  38. package/dist/chunk-TOFOR57V.cjs +21 -0
  39. package/dist/chunk-TOFOR57V.cjs.map +1 -0
  40. package/dist/chunk-VE3TRZRD.mjs +185 -0
  41. package/dist/chunk-VE3TRZRD.mjs.map +1 -0
  42. package/dist/chunk-ZEGJU5LW.cjs +95 -0
  43. package/dist/chunk-ZEGJU5LW.cjs.map +1 -0
  44. package/dist/decryptMrc-EGKXYBTB.mjs +11 -0
  45. package/dist/decryptMrc-EGKXYBTB.mjs.map +1 -0
  46. package/dist/decryptMrc-OOH5UIFN.cjs +11 -0
  47. package/dist/decryptMrc-OOH5UIFN.cjs.map +1 -0
  48. package/dist/index.cjs +1606 -26
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.cts +1004 -2
  51. package/dist/index.d.ts +1004 -2
  52. package/dist/{modules/index.js → index.mjs} +85 -971
  53. package/dist/index.mjs.map +1 -0
  54. package/dist/login/index.cjs +315 -0
  55. package/dist/login/index.cjs.map +1 -0
  56. package/dist/login/index.d.cts +57 -0
  57. package/dist/login/index.d.ts +57 -0
  58. package/dist/login/index.mjs +315 -0
  59. package/dist/login/index.mjs.map +1 -0
  60. package/dist/mrc/index.cjs +39 -0
  61. package/dist/mrc/index.cjs.map +1 -0
  62. package/dist/mrc/index.d.cts +37 -0
  63. package/dist/mrc/index.d.ts +37 -0
  64. package/dist/mrc/index.mjs +39 -0
  65. package/dist/mrc/index.mjs.map +1 -0
  66. package/dist/publicKey-EHY5LDOP.cjs +8 -0
  67. package/dist/publicKey-EHY5LDOP.cjs.map +1 -0
  68. package/dist/publicKey-LX6G3T7L.mjs +8 -0
  69. package/dist/publicKey-LX6G3T7L.mjs.map +1 -0
  70. package/dist/rsalib-GGMEGQT2.cjs +9 -0
  71. package/dist/rsalib-GGMEGQT2.cjs.map +1 -0
  72. package/dist/rsalib-HO4SSCTO.mjs +9 -0
  73. package/dist/rsalib-HO4SSCTO.mjs.map +1 -0
  74. package/dist/utils/index.cjs +46 -421
  75. package/dist/utils/index.cjs.map +1 -1
  76. package/dist/utils/index.d.cts +46 -2
  77. package/dist/utils/index.d.ts +46 -2
  78. package/dist/utils/index.mjs +81 -0
  79. package/dist/utils/index.mjs.map +1 -0
  80. package/package.json +21 -11
  81. package/dist/index.js +0 -4
  82. package/dist/index.js.map +0 -1
  83. package/dist/modules/index.cjs +0 -2666
  84. package/dist/modules/index.cjs.map +0 -1
  85. package/dist/modules/index.d.cts +0 -1156
  86. package/dist/modules/index.d.ts +0 -1156
  87. package/dist/modules/index.js.map +0 -1
  88. package/dist/utils/index.js +0 -406
  89. package/dist/utils/index.js.map +0 -1
@@ -39,7 +39,7 @@ declare function isQuality(quality: string | undefined): quality is Quality;
39
39
  declare function getQuality(url: string): Quality | '';
40
40
  declare function changeQuality(url: string, quality: string, originalQuality?: string, splitQuery?: boolean): string;
41
41
 
42
- declare const getResourceId: (name: string) => "" | "2" | "2021" | "3002" | "2003" | "5" | "2002" | "2016" | "6000" | "D" | "M";
42
+ declare const getResourceId: (name: string) => "" | "2" | "2003" | "2002" | "2021" | "2016" | "3002" | "6000" | "D" | "5" | "M";
43
43
 
44
44
  /**
45
45
  * MRC 解密入口:将十六进制密文解密为明文字符串
@@ -53,4 +53,48 @@ declare function toWordTime(times: string): string;
53
53
  */
54
54
  declare function formatMrc(data: string): string;
55
55
 
56
- export { type Quality, RSAKey, URLParams, changeQuality, decryptMrc, formatMrc, getDeviceId, getPublicKey, getQuality, getResourceId, isQuality, qualityList, toWordTime, toneFormat, toneUrl };
56
+ type LoginOneClickData = {
57
+ version: string;
58
+ appId: string;
59
+ openType: string;
60
+ expandParams: string;
61
+ isTest: boolean;
62
+ sign: string;
63
+ getNetworkType: string;
64
+ getMsisdnMask: string;
65
+ traceId: string;
66
+ msgId: string;
67
+ timestamp: string;
68
+ uuid: string;
69
+ businessType: string;
70
+ userInformations: string;
71
+ };
72
+ /**
73
+ * 调用方实际只需提供这些字段;其余字段由 getTokenInfo 内部补齐。
74
+ */
75
+ type GetTokenInfoInput = Pick<LoginOneClickData, 'version' | 'appId' | 'openType' | 'expandParams' | 'isTest' | 'sign' | 'getNetworkType' | 'getMsisdnMask'>;
76
+ declare function md5(s: string): string;
77
+ declare function yTime(): string;
78
+ declare const YDRZ: {
79
+ optparams: {
80
+ uuid: string;
81
+ msgId: string;
82
+ traceId: string;
83
+ businessType: string;
84
+ appId: string;
85
+ timestamp: string;
86
+ isimge: boolean;
87
+ expandParams: string;
88
+ userInformations: string;
89
+ CMRequestApi: string;
90
+ };
91
+ randomString(len: number, range?: number): string;
92
+ randomRange(min: number, max: number): number;
93
+ getUA(): string;
94
+ uaE(str: string): string;
95
+ getUserInfo(): string;
96
+ getSign(appID: string, version: string): string;
97
+ getTokenInfo(data: GetTokenInfoInput): Promise<string | undefined>;
98
+ };
99
+
100
+ export { type GetTokenInfoInput, type LoginOneClickData, type Quality, RSAKey, URLParams, YDRZ, changeQuality, decryptMrc, formatMrc, getDeviceId, getPublicKey, getQuality, getResourceId, isQuality, md5, qualityList, toWordTime, toneFormat, toneUrl, yTime };
@@ -0,0 +1,81 @@
1
+ import {
2
+ decryptMrc,
3
+ formatMrc,
4
+ toWordTime
5
+ } from "../chunk-VE3TRZRD.mjs";
6
+ import {
7
+ changeQuality,
8
+ getQuality,
9
+ isQuality,
10
+ qualityList,
11
+ toneFormat,
12
+ toneUrl
13
+ } from "../chunk-QTK2O5KQ.mjs";
14
+ import {
15
+ URLParams
16
+ } from "../chunk-HDGZY5R6.mjs";
17
+ import {
18
+ getDeviceId
19
+ } from "../chunk-AJYZYXNE.mjs";
20
+ import {
21
+ RSAKey
22
+ } from "../chunk-QMBC3CRQ.mjs";
23
+ import {
24
+ getPublicKey
25
+ } from "../chunk-JRQEIAY5.mjs";
26
+ import "../chunk-4ZNJQZKT.mjs";
27
+ import {
28
+ YDRZ,
29
+ md5,
30
+ yTime
31
+ } from "../chunk-EIM46AX6.mjs";
32
+
33
+ // src/utils/resourceType.ts
34
+ var getResourceId = (name) => {
35
+ name = name.toLowerCase().trim();
36
+ switch (name) {
37
+ case "song":
38
+ return "2";
39
+ case "album":
40
+ return "2003";
41
+ case "singer":
42
+ case "artist":
43
+ return "2002";
44
+ case "playlist":
45
+ return "2021";
46
+ case "radio":
47
+ return "2016";
48
+ case "comment":
49
+ return "3002";
50
+ case "svideo":
51
+ return "6000";
52
+ case "mv":
53
+ return "D";
54
+ case "dalbum":
55
+ return "5";
56
+ case "vrbt":
57
+ return "M";
58
+ default:
59
+ return "";
60
+ }
61
+ };
62
+ export {
63
+ RSAKey,
64
+ URLParams,
65
+ YDRZ,
66
+ changeQuality,
67
+ decryptMrc,
68
+ formatMrc,
69
+ getDeviceId,
70
+ getPublicKey,
71
+ getQuality,
72
+ getResourceId,
73
+ isQuality,
74
+ md5,
75
+ qualityList,
76
+ toWordTime,
77
+ toneFormat,
78
+ toneUrl,
79
+ yTime
80
+ };
81
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/resourceType.ts"],"sourcesContent":["export const getResourceId = (name: string) => {\r\n name = name.toLowerCase().trim();\r\n switch (name) {\r\n case 'song':\r\n return '2';\r\n case 'album':\r\n return '2003';\r\n case 'singer':\r\n case 'artist':\r\n return '2002';\r\n case 'playlist':\r\n return '2021';\r\n case 'radio':\r\n return '2016';\r\n case 'comment':\r\n return '3002';\r\n case 'svideo':\r\n return '6000';\r\n case 'mv':\r\n return 'D';\r\n case 'dalbum':\r\n return '5';\r\n case 'vrbt':\r\n return 'M';\r\n default:\r\n return '';\r\n }\r\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAM,gBAAgB,CAAC,SAAiB;AAC3C,SAAO,KAAK,YAAY,EAAE,KAAK;AAC/B,UAAQ,MAAM;AAAA,IACV,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AAAA,IACL,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX;AACI,aAAO;AAAA,EACf;AACJ;","names":[]}
package/package.json CHANGED
@@ -1,28 +1,38 @@
1
1
  {
2
2
  "name": "migu-api-enhanced",
3
- "version": "2.27.1",
3
+ "version": "2.27.4",
4
4
  "license": "MIT",
5
5
  "author": "Domdkw",
6
6
  "description": "咪咕音乐 API 增强 SDK(多平台部署 + NPM 包)",
7
7
  "type": "module",
8
- "main": "./dist/index.cjs",
9
- "module": "./dist/index.js",
8
+ "main": "./dist/index.mjs",
9
+ "module": "./dist/index.mjs",
10
10
  "types": "./dist/index.d.ts",
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./dist/index.d.ts",
14
- "import": "./dist/index.js",
14
+ "import": "./dist/index.mjs",
15
15
  "require": "./dist/index.cjs"
16
16
  },
17
- "./modules": {
18
- "types": "./dist/modules/index.d.ts",
19
- "import": "./dist/modules/index.js",
20
- "require": "./dist/modules/index.cjs"
21
- },
22
17
  "./utils": {
23
18
  "types": "./dist/utils/index.d.ts",
24
- "import": "./dist/utils/index.js",
19
+ "import": "./dist/utils/index.mjs",
25
20
  "require": "./dist/utils/index.cjs"
21
+ },
22
+ "./mrc": {
23
+ "types": "./dist/mrc/index.d.ts",
24
+ "import": "./dist/mrc/index.mjs",
25
+ "require": "./dist/mrc/index.cjs"
26
+ },
27
+ "./login": {
28
+ "types": "./dist/login/index.d.ts",
29
+ "import": "./dist/login/index.mjs",
30
+ "require": "./dist/login/index.cjs"
31
+ },
32
+ "./activity": {
33
+ "types": "./dist/activity/index.d.ts",
34
+ "import": "./dist/activity/index.mjs",
35
+ "require": "./dist/activity/index.cjs"
26
36
  }
27
37
  },
28
38
  "files": [
@@ -84,7 +94,7 @@
84
94
  "tsx": "^4.19.2",
85
95
  "typescript": "^5.9.3",
86
96
  "unstorage": "^1.17.5",
87
- "wrangler": "^4.112.0"
97
+ "wrangler": "^4.125.0"
88
98
  },
89
99
  "dependencies": {
90
100
  "axios": "^1.18.0"
package/dist/index.js DELETED
@@ -1,4 +0,0 @@
1
- // src/index.ts
2
- export * from "./modules/index";
3
- export * from "./utils/index";
4
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\r\n * migu-api-enhanced 包入口\r\n * 仅使用具名导出,确保 ESBuild 可以正确 tree-shaking\r\n */\r\n\r\n// ============================================================\r\n// 直接导出 modules, utils 所有函数\r\n// ============================================================\r\nexport * from './modules/index';\r\nexport * from './utils/index';\r\n"],"mappings":";AAQA,cAAc;AACd,cAAc;","names":[]}