@putkoff/abstract-utilities 0.1.179 → 0.1.181

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,13 +1,15 @@
1
1
  import type { FetchVariables } from './../imports';
2
+ export declare function api(endpoint: string): string;
2
3
  /**
3
4
  * Strip a leading host (http://host) from any URL-like string.
4
5
  */
5
6
  export declare function stripHost(str: string): string;
7
+ export declare function ensureAbstractUrl(endpoint: string, slices?: string[]): string;
6
8
  /**
7
9
  * Given an “endpoint” slug like "api/list", build the full URL
8
10
  * from the BASE_API_URL entry in your JSON config.
9
11
  */
10
- export declare function get_app_config_url(endpoint: string): Promise<any>;
12
+ export declare function get_app_config_url(endpoint: string): Promise<string>;
11
13
  /**
12
14
  * Unwraps nested { result } fields until you hit a non-object or no more "result" keys.
13
15
  */
@@ -22,4 +24,5 @@ export declare function parseResult(res: Response): Promise<unknown>;
22
24
  * without ever showing an alert.
23
25
  */
24
26
  export declare function checkResponse(res: Response): Response;
25
- export declare function fetchIt(url: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, noApi?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<any>;
27
+ export declare function fetchIt<T>(url: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, configUrl?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<T>;
28
+ export declare function fetchIt(url: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, configUrl?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<Blob>;
@@ -1,3 +1,2 @@
1
1
  export * from './fetchIt_utils';
2
- export * from './utils';
3
2
  export * from './fetch_utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putkoff/abstract-utilities",
3
- "version": "0.1.179",
3
+ "version": "0.1.181",
4
4
  "type": "module",
5
5
  "description": "A reusable React Login component with JWT authentication",
6
6
  "main": "dist/cjs/index.js",