simple-strapi 1.0.0-alpha.14 → 1.0.0-alpha.16

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/dist/client.d.ts CHANGED
@@ -128,6 +128,9 @@ declare class Client {
128
128
  /**
129
129
  * Elimina un'entità specifica tramite il suo documentId.
130
130
  */
131
- delete(pluralID: string, documentId: string, options?: EntityRequest): Promise<unknown>;
131
+ delete(pluralID: string, documentId: string, options?: EntityRequest): Promise<{
132
+ data: any;
133
+ meta: any;
134
+ }>;
132
135
  }
133
136
  export default Client;
package/dist/client.js CHANGED
@@ -354,13 +354,17 @@ class Client {
354
354
  },
355
355
  });
356
356
  if (!response.ok) {
357
+ const errorBody = await response.json().catch(() => ({}));
357
358
  throw createSimpleException({
358
359
  code: response.status,
359
- message: response.statusText,
360
+ message: errorBody.error?.message || response.statusText,
360
361
  type: "error",
361
362
  source: "strapi-utils/client.ts",
362
363
  });
363
364
  }
365
+ if (response.status === 204) {
366
+ return { data: { documentId }, meta: {} };
367
+ }
364
368
  const { data, meta } = z
365
369
  .object({ data: z.any(), meta: z.any() })
366
370
  .parse(await response.json());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-strapi",
3
- "version": "1.0.0-alpha.14",
3
+ "version": "1.0.0-alpha.16",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -43,7 +43,7 @@
43
43
  "dependencies": {
44
44
  "node-fetch": "^3.3.2",
45
45
  "qs": "^6.14.0",
46
- "simple-exception": "^1.0.0-alpha.2",
46
+ "simple-exception": "github:hund-studio/simple-exception",
47
47
  "zod": "^4.0.5"
48
48
  },
49
49
  "devDependencies": {