twindex-openclaw-plugin 0.7.3 → 0.7.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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/client.ts +12 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twindex-openclaw-plugin",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
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
@@ -219,9 +219,19 @@ export async function tryOn(
219
219
  if (productName) {
220
220
  payload.product_name = productName;
221
221
  }
222
- return request("/api/v1/try-on", {
222
+ const url = `${BASE_URL}/api/v1/try-on`;
223
+ const res = await fetch(url, {
223
224
  method: "POST",
224
- headers: authHeader(apiKey),
225
+ headers: {
226
+ "Content-Type": "application/json",
227
+ ...authHeader(apiKey),
228
+ },
225
229
  body: JSON.stringify(payload),
230
+ signal: AbortSignal.timeout(60_000),
226
231
  });
232
+ if (!res.ok) {
233
+ const body = await res.text().catch(() => "");
234
+ throw new Error(`Twindex API ${res.status}: ${body}`);
235
+ }
236
+ return res.json() as Promise<TryOnResult>;
227
237
  }