@opentabs-dev/opentabs-plugin-twitch 0.0.83 → 0.0.84

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.
@@ -414,21 +414,23 @@
414
414
  if (!auth) throw ToolError.auth("Not authenticated \u2014 please log in to Twitch.");
415
415
  const body = { query };
416
416
  if (variables) body.variables = variables;
417
- const response = await fetchFromPage(GQL_URL, {
418
- method: "POST",
419
- credentials: "omit",
420
- headers: {
421
- "Client-Id": CLIENT_ID,
422
- Authorization: `OAuth ${auth.token}`,
423
- "Content-Type": "application/json"
424
- },
425
- body: JSON.stringify(body)
426
- });
427
- if (!response.ok) {
428
- if (response.status === 401 || response.status === 403) {
417
+ let response;
418
+ try {
419
+ response = await fetchFromPage(GQL_URL, {
420
+ method: "POST",
421
+ credentials: "omit",
422
+ headers: {
423
+ "Client-Id": CLIENT_ID,
424
+ Authorization: `OAuth ${auth.token}`,
425
+ "Content-Type": "application/json"
426
+ },
427
+ body: JSON.stringify(body)
428
+ });
429
+ } catch (error48) {
430
+ if (error48 instanceof ToolError && error48.category === "auth") {
429
431
  clearAuthCache("twitch");
430
432
  }
431
- throw httpStatusToToolError(response, "Twitch GQL request failed");
433
+ throw error48;
432
434
  }
433
435
  const result = await response.json();
434
436
  if (result.errors?.length && !result.data) {
@@ -14885,7 +14887,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14885
14887
  };
14886
14888
  var src_default = new TwitchPlugin();
14887
14889
 
14888
- // dist/_adapter_entry_d56e49de-17d7-431a-982c-691e1cd47cd4.ts
14890
+ // dist/_adapter_entry_ca5cc22b-9109-4aa2-858d-35a90f67f2d7.ts
14889
14891
  if (!globalThis.__openTabs) {
14890
14892
  globalThis.__openTabs = {};
14891
14893
  } else {
@@ -15101,5 +15103,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15101
15103
  };
15102
15104
  delete src_default.onDeactivate;
15103
15105
  }
15104
- })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["twitch"]){var a=o.adapters["twitch"];a.__adapterHash="84b44624702c84d0a4509dfd1f924aa5e2fa54cc93b36defdb1b79068f480c3b";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"twitch",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
15106
+ })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["twitch"]){var a=o.adapters["twitch"];a.__adapterHash="8af1d4a903ae6f13ad52968b061af7acb37ff87120d6a65e54f1e25c72b4ebfa";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"twitch",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
15105
15107
  //# sourceMappingURL=adapter.iife.js.map