twindex-openclaw-plugin 0.5.0 → 0.5.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twindex-openclaw-plugin",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Music intelligence for AI agents. Tours, merch drops, releases, presales.",
5
5
  "type": "module",
6
6
  "license": "MIT",
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
- return request("/api/v1/subscriptions", {
101
- headers: authHeader(apiKey),
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
- return request("/api/v1/notifications", {
121
- headers: authHeader(apiKey),
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
- return request(
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
- return request("/api/v1/artists");
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). */
@@ -92,7 +92,12 @@ export function createNotificationService(api: any) {
92
92
  id: "twindex-notifications",
93
93
 
94
94
  start() {
95
- if (running) return;
95
+ // Clear any stale timer from a previous gateway reload
96
+ if (timer) {
97
+ clearInterval(timer);
98
+ timer = null;
99
+ }
100
+
96
101
  const apiKey = getApiKey();
97
102
  if (!apiKey) {
98
103
  logger?.info?.("Twindex: no API key — poll service waiting for setup");