@putkoff/abstract-utilities 0.1.139 → 0.1.141

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.
@@ -5,7 +5,15 @@ export declare function ensureAbstractUrl(endpoint: string, slices?: string[]):
5
5
  */
6
6
  export declare function getResult<T>(obj: unknown): T;
7
7
  export declare function api(endpoint: string): string;
8
- export declare function checkResponse(res: Response): any;
8
+ /**
9
+ * Intercept 401/403 and force a clean redirect to login
10
+ * without ever showing an alert.
11
+ */
12
+ export declare function checkResponse(res: Response): Response;
13
+ /**
14
+ * parseResult no longer needs to worry about JSON vs HTML redirect errors;
15
+ * all 401/403 have already been handled above.
16
+ */
9
17
  export declare function parseResult(res: Response): Promise<unknown>;
10
18
  export declare function getMethod(method?: string | null, body?: unknown): string;
11
19
  export declare function getHeaders(headers?: Record<string, string>, method?: string | null, body?: unknown): Record<string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putkoff/abstract-utilities",
3
- "version": "0.1.139",
3
+ "version": "0.1.141",
4
4
  "type": "module",
5
5
  "description": "A reusable React Login component with JWT authentication",
6
6
  "main": "dist/cjs/index.js",