entity-server-client 0.3.1 → 0.3.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": "entity-server-client",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -306,7 +306,7 @@ export class EntityServerClientBase {
306
306
  credentials: "include",
307
307
  });
308
308
 
309
- const data = await res.json();
309
+ const data = (await res.json()) as { ok?: boolean; message?: string };
310
310
  if (!data.ok) {
311
311
  const err = new Error(
312
312
  data.message ?? `EntityServer error (HTTP ${res.status})`,
@@ -106,7 +106,7 @@ export async function entityRequest<T>(
106
106
  const res = await fetch(baseUrl + path, {
107
107
  method,
108
108
  headers,
109
- ...(fetchBody != null ? { body: fetchBody as BodyInit } : {}),
109
+ ...(fetchBody != null ? { body: fetchBody as RequestInit["body"] } : {}),
110
110
  credentials: "include",
111
111
  });
112
112
 
@@ -126,7 +126,7 @@ export async function entityRequest<T>(
126
126
  return (await res.text()) as T;
127
127
  }
128
128
 
129
- const data = await res.json();
129
+ const data = (await res.json()) as { ok?: boolean; message?: string };
130
130
  if (requireOkShape && !data.ok) {
131
131
  const err = new Error(
132
132
  data.message ?? `EntityServer error (HTTP ${res.status})`,