@putkoff/abstract-utilities 0.1.189 → 0.1.191
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/cjs/index.js +267 -267
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +267 -267
- package/dist/esm/index.js.map +1 -1
- package/dist/functions/config_utils/src/config_utils.d.ts +0 -2
- package/dist/functions/fetch_utils/imports.d.ts +1 -9
- package/dist/functions/fetch_utils/src/fetchIt_utils.d.ts +2 -16
- package/dist/functions/fetch_utils/src/fetch_utils.d.ts +0 -15
- package/dist/functions/fetch_utils/src/index.d.ts +1 -0
- package/dist/functions/fetch_utils/src/utils.d.ts +15 -5
- package/dist/functions/read_utils/src/index.d.ts +1 -1
- package/dist/functions/read_utils/src/read_utils.d.ts +2 -0
- package/dist/functions/read_utils/src/utils.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function requestPatch(url: string, body?: unknown): Promise<Response>;
|
|
4
|
-
export declare function fetchSharePatch(file: unknown, appKey?: any): Promise<void>;
|
|
5
|
-
export declare function getHtmlDirectory(directory: string, filename: string): string;
|
|
6
|
-
export declare function fetchIndexHtml(filename: string, directory?: string, base?: string): Promise<string>;
|
|
7
|
-
export declare function fetchIndexHtmlContainer(filename: string, doc?: Document, directory?: string): Promise<void>;
|
|
8
|
-
export declare function getBaseUrl<T = any>(key?: any): Promise<T | undefined>;
|
|
9
|
-
export declare function getEndpoints(base_url?: any): Promise<[string, string][]>;
|
|
10
|
-
export declare function getUrl(base_url?: any): Promise<any>;
|
|
11
|
-
/**
|
|
12
|
-
* Find the most specific endpoint matching the given keyword.
|
|
13
|
-
* @param keyword A fragment to search for, e.g. 'list'
|
|
14
|
-
* @returns The full path string, or null if nothing matches
|
|
15
|
-
*/
|
|
16
|
-
export declare function getEndpoint(keyword: string, base_url?: any): Promise<string | null>;
|
|
1
|
+
export declare function getConfigContent<T = Record<string, any>>(): Promise<T | null>;
|
|
2
|
+
export declare function getConfigVar<T = any>(key?: any): Promise<T | undefined>;
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
import type { FetchVariables } from './../imports';
|
|
2
|
-
/**
|
|
3
|
-
* Unwraps nested { result } fields until you hit a non-object or no more "result" keys.
|
|
4
|
-
*/
|
|
5
|
-
export declare function getResult<T>(obj: unknown): T;
|
|
6
|
-
export declare function getMethod(method?: string | null, body?: unknown): string;
|
|
7
|
-
export declare function getHeaders(headers?: Record<string, string>, method?: string | null, body?: unknown): Record<string, string>;
|
|
8
|
-
export declare function getBody(body?: unknown, method?: string | null): string | undefined;
|
|
9
|
-
export declare function getFetchVars(headers?: Record<string, string> | null, method?: string | null, body?: any): FetchVariables;
|
|
10
|
-
export declare function parseResult(res: Response): Promise<unknown>;
|
|
11
|
-
/**
|
|
12
|
-
* Intercept 401/403 and force a clean redirect to login
|
|
13
|
-
* without ever showing an alert.
|
|
14
|
-
*/
|
|
15
|
-
export declare function checkResponse(res: Response): Response;
|
|
16
1
|
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>;
|
|
17
2
|
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>;
|
|
18
3
|
export declare function getHtmlDirectory(directory: string, filename: string): string;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare function
|
|
1
|
+
import { FetchVariables } from './../imports';
|
|
2
|
+
/**
|
|
3
|
+
* Unwraps nested { result } fields until you hit a non-object or no more "result" keys.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getResult<T>(obj: unknown): T;
|
|
6
|
+
export declare function getMethod(method?: string | null, body?: unknown): string;
|
|
7
|
+
export declare function getHeaders(headers?: Record<string, string>, method?: string | null, body?: unknown): Record<string, string>;
|
|
8
|
+
export declare function getBody(body?: unknown, method?: string | null): string | undefined;
|
|
9
|
+
export declare function getFetchVars(headers?: Record<string, string> | null, method?: string | null, body?: any): FetchVariables;
|
|
10
|
+
export declare function parseResult(res: Response): Promise<unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* Intercept 401/403 and force a clean redirect to login
|
|
13
|
+
* without ever showing an alert.
|
|
14
|
+
*/
|
|
15
|
+
export declare function checkResponse(res: Response): Response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './utils';
|
|
@@ -4,3 +4,5 @@
|
|
|
4
4
|
* the parsed object or null on any error.
|
|
5
5
|
*/
|
|
6
6
|
export declare function readJsonFile<T = any>(relativeOrAbsolutePath: string): Promise<T | null>;
|
|
7
|
+
export declare function getConfigContent<T = Record<string, any>>(): Promise<T | null>;
|
|
8
|
+
export declare function getConfigVar<T = any>(key?: any): Promise<T | undefined>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads a JSON file, either via Node’s fs (if available)
|
|
3
|
+
* or via window.fetch in the browser. Never throws — returns
|
|
4
|
+
* the parsed object or null on any error.
|
|
5
|
+
*/
|
|
6
|
+
export declare function readJsonFile<T = any>(relativeOrAbsolutePath: string): Promise<T | null>;
|
|
7
|
+
export declare function getConfigContent<T = Record<string, any>>(): Promise<T | null>;
|
|
8
|
+
export declare function getConfigVar<T = any>(key?: any): Promise<T | undefined>;
|