@shiqianjiang/ceru-plugin-sdk 0.3.15 → 0.3.16
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/legacy-http.d.ts +1 -0
- package/dist/legacy-http.js +3 -0
- package/dist/music.d.ts +1 -0
- package/dist/music.js +8 -0
- package/package.json +1 -1
package/dist/legacy-http.d.ts
CHANGED
package/dist/legacy-http.js
CHANGED
|
@@ -105,6 +105,9 @@ export function createLegacyHttpBridge(host) {
|
|
|
105
105
|
headers: { ...response.headers, ...(firstLocation ? { location: url.href } : {}) },
|
|
106
106
|
raw: response.body,
|
|
107
107
|
url: url.href,
|
|
108
|
+
// 重定向由 Host 内部跟随,Location 头不会回传;用最终地址补上,
|
|
109
|
+
// 让需要还原短链的适配器(如 QQ 音乐 ?__= 短链)拿到真实目标。
|
|
110
|
+
finalUrl: typeof response.url === 'string' ? response.url : url.href,
|
|
108
111
|
};
|
|
109
112
|
})();
|
|
110
113
|
return {
|
package/dist/music.d.ts
CHANGED
|
@@ -87,4 +87,5 @@ export declare function assertResourceRef(value: unknown): asserts value is Reso
|
|
|
87
87
|
export declare function retargetTrackRef(ref: ResourceRef, pluginId: string): ResourceRef;
|
|
88
88
|
export declare function assertContentPage(value: unknown): void;
|
|
89
89
|
export declare function assertResolveResult(value: unknown): asserts value is ResolveResult;
|
|
90
|
+
export declare function normalizeLegacyLyrics(value: unknown): unknown;
|
|
90
91
|
export declare function assertLyricsDocument(value: unknown): asserts value is LyricsDocument;
|
package/dist/music.js
CHANGED
|
@@ -146,6 +146,14 @@ export function assertResolveResult(value) {
|
|
|
146
146
|
if (!record(value.error) || !text(value.error.code, 128) || !text(value.error.message, 65536))
|
|
147
147
|
throw new Error('Invalid music fault');
|
|
148
148
|
}
|
|
149
|
+
export function normalizeLegacyLyrics(value) {
|
|
150
|
+
if (record(value) &&
|
|
151
|
+
value.format === undefined &&
|
|
152
|
+
value.version === 1 &&
|
|
153
|
+
Array.isArray(value.lines))
|
|
154
|
+
return { ...value, format: 'crlyric' };
|
|
155
|
+
return value;
|
|
156
|
+
}
|
|
149
157
|
export function assertLyricsDocument(value) {
|
|
150
158
|
if (!record(value) ||
|
|
151
159
|
value.format !== 'crlyric' ||
|