@putkoff/abstract-utilities 0.1.189 → 0.1.190

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,16 +1,2 @@
1
- export declare function secureFetchIt<T>(endpoint: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, noApi?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<T>;
2
- export declare function secureFetchIt(endpoint: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, noApi?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<Blob>;
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 +1 @@
1
- export * from './read_utils';
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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putkoff/abstract-utilities",
3
- "version": "0.1.189",
3
+ "version": "0.1.190",
4
4
  "type": "module",
5
5
  "description": "A reusable React Login component with JWT authentication",
6
6
  "main": "dist/cjs/index.js",