@shiqianjiang/ceru-plugin-sdk 0.3.14 → 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/CHANGELOG.md +8 -0
- 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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# SDK 变更记录
|
|
2
2
|
|
|
3
|
+
## 0.3.15
|
|
4
|
+
|
|
5
|
+
- 同步 CLI 内嵌模板快照:脚手架生成的项目依赖指向 `^0.3.15`(0.3.14 发版时遗漏)。SDK 公共 API 无变化。
|
|
6
|
+
|
|
7
|
+
## 0.3.14
|
|
8
|
+
|
|
9
|
+
- 曲目新增可选的高清封面协议 `tracks.artworkHires`,插件可在保留低清 `artwork` 的同时声明更大尺寸封面。
|
|
10
|
+
|
|
3
11
|
## 0.3.13
|
|
4
12
|
|
|
5
13
|
- `ctx.library.playlists` 新增 `removeTracks({ target, items, permissionKey, operation })`,返回 `{ removed, notFound }`,不会创建或移动歌单。
|
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' ||
|