@dskripchenko/laravel-admin 1.44.1 → 1.45.1

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.
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "resources/ts/app.ts": {
3
- "file": "assets/app-BSLBKVsR.js",
3
+ "file": "assets/app-B4vfwKxh.js",
4
4
  "name": "app",
5
5
  "src": "resources/ts/app.ts",
6
6
  "isEntry": true,
7
7
  "css": [
8
- "assets/app-D8xmSFFQ.css"
8
+ "assets/app-D1N69Xpm.css"
9
9
  ]
10
10
  }
11
11
  }
@@ -38,3 +38,17 @@ export declare class NetworkError extends Error {
38
38
  * Turns an HTTP status and an envelope into the right ApiError subclass.
39
39
  */
40
40
  export declare function toApiError(status: number, payload: ErrorEnvelope['payload']): ApiError;
41
+ /**
42
+ * The reason the server gave for refusing a request, or `fallback` when it
43
+ * gave none.
44
+ *
45
+ * A validation error answers with its first field message (the envelope's own
46
+ * message is usually a generic "The given data was invalid"), then the
47
+ * envelope's message — which is what an `action_failed` 422 carries. Any
48
+ * other ApiError answers with the envelope's message: a 403 says which
49
+ * permission is missing. A response with no envelope at all (see the
50
+ * client's `transport` marker) and the synthetic "API error 500" the ApiError
51
+ * constructor falls back to are not reasons, so they yield `fallback`. Plain
52
+ * errors (a network failure, a client-side check) answer with their message.
53
+ */
54
+ export declare function apiErrorMessage(err: unknown, fallback: string): string;