@frontmcp/utils 0.7.2 → 0.8.0
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/crypto/hmac-signing.d.ts +96 -0
- package/crypto/index.d.ts +11 -0
- package/crypto/key-persistence/factory.d.ts +58 -0
- package/crypto/key-persistence/index.d.ts +35 -0
- package/crypto/key-persistence/key-persistence.d.ts +143 -0
- package/crypto/key-persistence/schemas.d.ts +180 -0
- package/crypto/key-persistence/types.d.ts +120 -0
- package/esm/index.mjs +1777 -582
- package/esm/package.json +16 -1
- package/fs/fs.d.ts +16 -0
- package/fs/index.d.ts +1 -1
- package/index.d.ts +3 -3
- package/index.js +1799 -582
- package/package.json +16 -1
- package/storage/adapters/filesystem.d.ts +144 -0
- package/storage/adapters/index.d.ts +2 -0
- package/storage/encrypted-typed-storage.d.ts +196 -0
- package/storage/encrypted-typed-storage.types.d.ts +139 -0
- package/storage/errors.d.ts +11 -0
- package/storage/index.d.ts +7 -2
- package/storage/typed-storage.d.ts +129 -0
- package/storage/typed-storage.types.d.ts +47 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypedStorage Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the TypedStorage wrapper that provides
|
|
5
|
+
* type-safe JSON serialization on top of StorageAdapter.
|
|
6
|
+
*/
|
|
7
|
+
import type { SetOptions } from './types';
|
|
8
|
+
import type { z } from 'zod';
|
|
9
|
+
/**
|
|
10
|
+
* Options for TypedStorage wrapper
|
|
11
|
+
*/
|
|
12
|
+
export interface TypedStorageOptions<T> {
|
|
13
|
+
/**
|
|
14
|
+
* Optional Zod schema for validation on read.
|
|
15
|
+
* If provided, values will be validated after deserialization.
|
|
16
|
+
*/
|
|
17
|
+
schema?: z.ZodType<T>;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to throw an error when data fails validation.
|
|
20
|
+
* If false (default), returns null for invalid data.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
throwOnInvalid?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Custom serialization function.
|
|
26
|
+
* @default JSON.stringify
|
|
27
|
+
*/
|
|
28
|
+
serialize?: (value: T) => string;
|
|
29
|
+
/**
|
|
30
|
+
* Custom deserialization function.
|
|
31
|
+
* @default JSON.parse
|
|
32
|
+
*/
|
|
33
|
+
deserialize?: (raw: string) => unknown;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Options for typed set operations.
|
|
37
|
+
* Re-export for convenience.
|
|
38
|
+
*/
|
|
39
|
+
export type TypedSetOptions = SetOptions;
|
|
40
|
+
/**
|
|
41
|
+
* Entry for batch set operations with typed values.
|
|
42
|
+
*/
|
|
43
|
+
export interface TypedSetEntry<T> {
|
|
44
|
+
key: string;
|
|
45
|
+
value: T;
|
|
46
|
+
options?: TypedSetOptions;
|
|
47
|
+
}
|