twindex-openclaw-plugin 0.5.0 → 0.5.1
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/package.json +1 -1
- package/src/client.ts +16 -8
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -97,9 +97,11 @@ export async function subscribe(
|
|
|
97
97
|
export async function listSubscriptions(
|
|
98
98
|
apiKey: string,
|
|
99
99
|
): Promise<Subscription[]> {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
const res = await request<{ subscriptions: Subscription[] }>(
|
|
101
|
+
"/api/v1/subscriptions",
|
|
102
|
+
{ headers: authHeader(apiKey) },
|
|
103
|
+
);
|
|
104
|
+
return res.subscriptions ?? [];
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
/** Unsubscribe from an artist. */
|
|
@@ -117,9 +119,11 @@ export async function unsubscribe(
|
|
|
117
119
|
export async function getNotifications(
|
|
118
120
|
apiKey: string,
|
|
119
121
|
): Promise<Notification[]> {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
const res = await request<{ notifications: Notification[] }>(
|
|
123
|
+
"/api/v1/notifications",
|
|
124
|
+
{ headers: authHeader(apiKey) },
|
|
125
|
+
);
|
|
126
|
+
return res.notifications ?? [];
|
|
123
127
|
}
|
|
124
128
|
|
|
125
129
|
/** Mark notifications as read. */
|
|
@@ -136,14 +140,18 @@ export async function markRead(
|
|
|
136
140
|
|
|
137
141
|
/** Search the music index (no auth). */
|
|
138
142
|
export async function search(query: string): Promise<SearchResult[]> {
|
|
139
|
-
|
|
143
|
+
const res = await request<{ results: SearchResult[] }>(
|
|
140
144
|
`/api/v1/search?q=${encodeURIComponent(query)}`,
|
|
141
145
|
);
|
|
146
|
+
return res.results ?? [];
|
|
142
147
|
}
|
|
143
148
|
|
|
144
149
|
/** List all indexed artists (no auth). */
|
|
145
150
|
export async function listArtists(): Promise<Artist[]> {
|
|
146
|
-
|
|
151
|
+
const res = await request<{ artists: Artist[] }>(
|
|
152
|
+
"/api/v1/artists",
|
|
153
|
+
);
|
|
154
|
+
return res.artists ?? [];
|
|
147
155
|
}
|
|
148
156
|
|
|
149
157
|
/** Get a single artist page as markdown (no auth). */
|