fastapi-rtk 0.0.69 → 0.0.71

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.
@@ -734,45 +734,29 @@ const bd = async (e, t) => {
734
734
  body: t
735
735
  }), i = await fetch(r, n);
736
736
  let o = null;
737
- try {
738
- o = await i.json();
739
- } catch {
740
- o = await i.text();
741
- }
742
- if (!i.ok)
737
+ const a = i.headers.get("content-type");
738
+ if (a && a.includes("application/json") ? o = await i.json() : o = await i.text(), !i.ok)
743
739
  throw typeof o == "object" ? new Error(typeof o.detail == "string" ? o.detail : JSON.stringify(o, null, 2)) : new Error(o);
744
740
  return o;
745
741
  }, xd = async (e, t) => {
746
742
  const { fetchPath: r, options: n } = Ye({ path: je(e, t.toString()), method: "DELETE" }), i = await fetch(r, n);
747
743
  let o = null;
748
- try {
749
- o = await i.json();
750
- } catch {
751
- o = await i.text();
752
- }
753
- if (!i.ok)
744
+ const a = i.headers.get("content-type");
745
+ if (a && a.includes("application/json") ? o = await i.json() : o = await i.text(), !i.ok)
754
746
  throw typeof o == "object" ? new Error(typeof o.detail == "string" ? o.detail : JSON.stringify(o, null, 2)) : new Error(o);
755
747
  return o;
756
748
  }, _d = async (e, t) => {
757
749
  const { fetchPath: r, options: n } = Ye({ path: je(e, t.toString()), method: "GET" }), i = await fetch(r, n);
758
750
  let o = null;
759
- try {
760
- o = await i.json();
761
- } catch {
762
- o = await i.text();
763
- }
764
- if (!i.ok)
751
+ const a = i.headers.get("content-type");
752
+ if (a && a.includes("application/json") ? o = await i.json() : o = await i.text(), !i.ok)
765
753
  throw typeof o == "object" ? new Error(typeof o.detail == "string" ? o.detail : JSON.stringify(o, null, 2)) : new Error(o);
766
754
  return o;
767
755
  }, Td = async (e, t, r) => {
768
756
  const { fetchPath: n, options: i } = Ye({ path: je(e, t.toString()), method: "PUT", body: r }), o = await fetch(n, i);
769
757
  let a = null;
770
- try {
771
- a = await o.json();
772
- } catch {
773
- a = await o.text();
774
- }
775
- if (!o.ok)
758
+ const s = o.headers.get("content-type");
759
+ if (s && s.includes("application/json") ? a = await o.json() : a = await o.text(), !o.ok)
776
760
  throw typeof a == "object" ? new Error(typeof a.detail == "string" ? a.detail : JSON.stringify(a, null, 2)) : new Error(a);
777
761
  return a;
778
762
  }, at = (e) => e && typeof e == "object" ? Array.isArray(e) ? e.join(",") : JSON.stringify(e) : e;
@@ -3057,19 +3041,11 @@ function i2(e) {
3057
3041
  const Sp = async (e, t, r) => {
3058
3042
  const { fetchPath: n, options: i } = Ye({ path: je(t, "/download"), method: "POST" }), o = await fetch(n, { ...i, body: JSON.stringify(r) });
3059
3043
  let a = null;
3060
- try {
3061
- a = await o.blob();
3062
- } catch {
3063
- try {
3064
- a = await o.json();
3065
- } catch {
3066
- a = await o.text();
3067
- }
3068
- }
3069
- if (!o.ok)
3044
+ const s = o.headers.get("content-type");
3045
+ if (s && s.includes("application/json") ? a = await o.json() : s && s.includes("application/octet-stream") ? a = await o.blob() : a = await o.text(), !o.ok)
3070
3046
  throw typeof a == "object" ? new Error(typeof a.detail == "string" ? a.detail : JSON.stringify(a, null, 2)) : new Error(a);
3071
- const s = document.createElement("a"), l = URL.createObjectURL(a);
3072
- s.href = l, s.download = e.toLowerCase() + ".csv", s.click();
3047
+ const l = document.createElement("a"), c = URL.createObjectURL(a);
3048
+ l.href = c, l.download = e.toLowerCase() + ".csv", l.click();
3073
3049
  };
3074
3050
  function wp({
3075
3051
  path: e,
@@ -3233,12 +3209,8 @@ const Cp = async (e, t, r) => {
3233
3209
  body: r
3234
3210
  }), o = await fetch(n, i);
3235
3211
  let a = null;
3236
- try {
3237
- a = await o.json();
3238
- } catch {
3239
- a = await o.text();
3240
- }
3241
- if (!o.ok)
3212
+ const s = o.headers.get("content-type");
3213
+ if (s && s.includes("application/json") ? a = await o.json() : a = await o.text(), !o.ok)
3242
3214
  throw typeof a == "object" ? new Error(typeof a.detail == "string" ? a.detail : JSON.stringify(a, null, 2)) : new Error(a);
3243
3215
  return a;
3244
3216
  }, Ap = ({ Api: e }) => {
@@ -4085,15 +4057,7 @@ function gs(e, t) {
4085
4057
  if (!e)
4086
4058
  return e;
4087
4059
  const r = t.values;
4088
- if (!r || !r.length)
4089
- return e;
4090
- const n = r[0].id;
4091
- if (!(n instanceof Object))
4092
- return e;
4093
- const o = Object.keys(n), a = {};
4094
- return o.forEach((s) => {
4095
- a[s] = e[s];
4096
- }), e.id = a, e;
4060
+ return !r || !r.length || Array.isArray(e.id_) && (e.id = e.id_), e;
4097
4061
  }
4098
4062
  function th(e, t) {
4099
4063
  const r = {};
@@ -10536,7 +10500,7 @@ RA.forEach(function(e) {
10536
10500
  Bo[e] = Bo(e);
10537
10501
  });
10538
10502
  /**
10539
- * @mui/styled-engine v6.1.0
10503
+ * @mui/styled-engine v6.1.1
10540
10504
  *
10541
10505
  * @license MIT
10542
10506
  * This source code is licensed under the MIT license found in the
@@ -10975,7 +10939,7 @@ const Wl = (e, t, r, n = []) => {
10975
10939
  });
10976
10940
  }
10977
10941
  n(e);
10978
- }, QA = (e, t) => typeof t == "number" ? ["lineHeight", "fontWeight", "opacity", "zIndex"].some((n) => e.includes(n)) || e[e.length - 1].toLowerCase().indexOf("opacity") >= 0 ? t : `${t}px` : t;
10942
+ }, QA = (e, t) => typeof t == "number" ? ["lineHeight", "fontWeight", "opacity", "zIndex"].some((n) => e.includes(n)) || e[e.length - 1].toLowerCase().includes("opacity") ? t : `${t}px` : t;
10979
10943
  function fo(e, t) {
10980
10944
  const {
10981
10945
  prefix: r,
@@ -11706,7 +11670,7 @@ function TO(e) {
11706
11670
  }
11707
11671
  const EO = [...Array(25)].map((e, t) => {
11708
11672
  if (t === 0)
11709
- return;
11673
+ return "none";
11710
11674
  const r = TO(t);
11711
11675
  return `linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`;
11712
11676
  });
@@ -11746,7 +11710,7 @@ function wO(e) {
11746
11710
  return !!e[0].match(/(cssVarPrefix|colorSchemeSelector|typography|mixins|breakpoints|direction|transitions)/) || !!e[0].match(/sxConfig$/) || // ends with sxConfig
11747
11711
  e[0] === "palette" && !!((t = e[1]) != null && t.match(/(mode|contrastThreshold|tonalOffset)/));
11748
11712
  }
11749
- const CO = (e) => [...[...Array(24)].map((t, r) => `--${e ? `${e}-` : ""}overlays-${r + 1}`), `--${e ? `${e}-` : ""}palette-AppBar-darkBg`, `--${e ? `${e}-` : ""}palette-AppBar-darkColor`], AO = (e) => (t, r) => {
11713
+ const CO = (e) => [...[...Array(25)].map((t, r) => `--${e ? `${e}-` : ""}overlays-${r}`), `--${e ? `${e}-` : ""}palette-AppBar-darkBg`, `--${e ? `${e}-` : ""}palette-AppBar-darkColor`], AO = (e) => (t, r) => {
11750
11714
  const n = e.colorSchemeSelector;
11751
11715
  let i = n;
11752
11716
  if (n === "class" && (i = ".%s"), n === "data" && (i = "[data-%s]"), n != null && n.startsWith("data-") && !n.includes("%s") && (i = `[${n}="%s"]`), e.defaultColorScheme === t) {