create-request 0.0.1-beta.22 → 0.0.1-beta.24
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/README.md +366 -216
- package/dist/library/BaseRequest.d.ts +207 -51
- package/dist/library/BodyRequest.d.ts +25 -2
- package/dist/library/RequestError.d.ts +5 -2
- package/dist/library/ResponseWrapper.d.ts +17 -24
- package/dist/library/enums.d.ts +0 -11
- package/dist/library/index.cjs +2109 -0
- package/dist/library/index.cjs.map +1 -0
- package/dist/library/index.d.ts +2 -6
- package/dist/library/index.esm.js +2097 -1
- package/dist/library/index.esm.js.map +1 -1
- package/dist/library/index.esm.min.js +1 -0
- package/dist/library/index.esm.min.js.map +1 -0
- package/dist/library/index.min.cjs +1 -0
- package/dist/library/index.min.cjs.map +1 -0
- package/dist/library/requestFactories.d.ts +32 -30
- package/dist/library/requestMethods.d.ts +25 -18
- package/dist/library/types.d.ts +43 -4
- package/dist/library/utils/Config.d.ts +96 -0
- package/package.json +35 -12
- package/dist/library/index.js +0 -1
- package/dist/library/index.js.map +0 -1
- package/dist/library/types/cache.d.ts +0 -62
- package/dist/library/utils/CacheManager.d.ts +0 -82
- package/dist/library/utils/CacheStorage.d.ts +0 -49
- package/dist/library/utils/StorageProvider.d.ts +0 -33
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { CacheOptions } from "../types/cache.js";
|
|
2
|
-
import type { StorageProvider } from "./StorageProvider.js";
|
|
3
|
-
/**
|
|
4
|
-
* Create a memory storage provider using Map
|
|
5
|
-
* This provider stores data in memory and is cleared when the application restarts.
|
|
6
|
-
*
|
|
7
|
-
* @returns A storage provider using an in-memory Map
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* const storage = createMemoryStorage();
|
|
11
|
-
* storage.set("key", "value");
|
|
12
|
-
*/
|
|
13
|
-
export declare function createMemoryStorage(): StorageProvider;
|
|
14
|
-
/**
|
|
15
|
-
* Create a localStorage-based storage provider
|
|
16
|
-
* This provider persists data between browser sessions.
|
|
17
|
-
*
|
|
18
|
-
* @returns A storage provider using localStorage
|
|
19
|
-
* @throws Console warnings if localStorage is not available or storage quota is exceeded
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* const storage = createLocalStorageStorage();
|
|
23
|
-
* storage.set("key", "value");
|
|
24
|
-
*/
|
|
25
|
-
export declare function createLocalStorageStorage(): StorageProvider;
|
|
26
|
-
/**
|
|
27
|
-
* Create a sessionStorage-based storage provider
|
|
28
|
-
* This provider persists data only for the current browser session.
|
|
29
|
-
*
|
|
30
|
-
* @returns A storage provider using sessionStorage
|
|
31
|
-
* @throws Console warnings if sessionStorage is not available or storage quota is exceeded
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* const storage = createSessionStorageStorage();
|
|
35
|
-
* storage.set("key", "value");
|
|
36
|
-
*/
|
|
37
|
-
export declare function createSessionStorageStorage(): StorageProvider;
|
|
38
|
-
/**
|
|
39
|
-
* Create a storage provider from cache options
|
|
40
|
-
* Selects the appropriate storage implementation based on the provided options.
|
|
41
|
-
* Falls back to memory storage if no suitable storage is found.
|
|
42
|
-
*
|
|
43
|
-
* @param options - Cache configuration options
|
|
44
|
-
* @returns A storage provider based on the options
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* const storage = createStorageProvider({ storage: localStorage });
|
|
48
|
-
*/
|
|
49
|
-
export declare function createStorageProvider(options?: CacheOptions): StorageProvider;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interface for storage providers used by the cache system
|
|
3
|
-
*/
|
|
4
|
-
export interface StorageProvider {
|
|
5
|
-
/**
|
|
6
|
-
* Get a value from storage
|
|
7
|
-
* @param key The key to retrieve
|
|
8
|
-
* @returns The stored value or null if not found
|
|
9
|
-
*/
|
|
10
|
-
get(key: string): Promise<string | null> | string | null;
|
|
11
|
-
/**
|
|
12
|
-
* Set a value in storage
|
|
13
|
-
* @param key The key to store
|
|
14
|
-
* @param value The value to store
|
|
15
|
-
* @param ttl Optional TTL in milliseconds
|
|
16
|
-
* @returns Promise or void
|
|
17
|
-
*/
|
|
18
|
-
set(key: string, value: string, ttl?: number): Promise<void> | void;
|
|
19
|
-
/**
|
|
20
|
-
* Check if a key exists in storage
|
|
21
|
-
* @param key The key to check
|
|
22
|
-
*/
|
|
23
|
-
has(key: string): Promise<boolean> | boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Delete a value from storage
|
|
26
|
-
* @param key The key to delete
|
|
27
|
-
*/
|
|
28
|
-
delete(key: string): Promise<void> | void;
|
|
29
|
-
/**
|
|
30
|
-
* Clear all values from storage
|
|
31
|
-
*/
|
|
32
|
-
clear(): Promise<void> | void;
|
|
33
|
-
}
|