@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
package/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Shared utility functions for FrontMCP - string manipulation, URI handling, path utilities, and more",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,12 +23,27 @@
|
|
|
23
23
|
"url": "https://github.com/agentfront/frontmcp/issues"
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://github.com/agentfront/frontmcp/blob/main/libs/utils/README.md",
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=22.0.0"
|
|
28
|
+
},
|
|
26
29
|
"dependencies": {
|
|
27
30
|
"@noble/hashes": "^2.0.1",
|
|
28
31
|
"@noble/ciphers": "^2.1.1",
|
|
29
32
|
"ast-guard": "^2.4.0",
|
|
30
33
|
"zod": "^4.0.0"
|
|
31
34
|
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@vercel/kv": "^2.0.0 || ^3.0.0",
|
|
37
|
+
"ioredis": "^5.0.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependenciesMeta": {
|
|
40
|
+
"@vercel/kv": {
|
|
41
|
+
"optional": true
|
|
42
|
+
},
|
|
43
|
+
"ioredis": {
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
46
|
+
},
|
|
32
47
|
"type": "module",
|
|
33
48
|
"main": "../index.js",
|
|
34
49
|
"module": "./index.mjs",
|
package/fs/fs.d.ts
CHANGED
|
@@ -19,6 +19,22 @@
|
|
|
19
19
|
* const content = await readFile('/path/to/file.txt');
|
|
20
20
|
*/
|
|
21
21
|
export declare function readFile(p: string, encoding?: BufferEncoding): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Read a file's contents as a string synchronously.
|
|
24
|
+
*
|
|
25
|
+
* **Node.js only** - throws an error if called in browser.
|
|
26
|
+
*
|
|
27
|
+
* Use this only when async operations are not possible (e.g., module initialization).
|
|
28
|
+
* Prefer the async `readFile` function in most cases.
|
|
29
|
+
*
|
|
30
|
+
* @param p - Path to file
|
|
31
|
+
* @param encoding - Encoding (default 'utf8')
|
|
32
|
+
* @returns File contents as string
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* const content = readFileSync('/path/to/file.txt');
|
|
36
|
+
*/
|
|
37
|
+
export declare function readFileSync(p: string, encoding?: BufferEncoding): string;
|
|
22
38
|
/**
|
|
23
39
|
* Read a file's contents as a Buffer.
|
|
24
40
|
*
|
package/fs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { readFile, readFileBuffer, writeFile, mkdir, rename, unlink, stat, copyFile, cp, readdir, rm, mkdtemp, access, fileExists, readJSON, writeJSON, ensureDir, isDirEmpty, runCmd, } from './fs';
|
|
1
|
+
export { readFile, readFileSync, readFileBuffer, writeFile, mkdir, rename, unlink, stat, copyFile, cp, readdir, rm, mkdtemp, access, fileExists, readJSON, writeJSON, ensureDir, isDirEmpty, runCmd, } from './fs';
|
package/index.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ export { isValidMcpUri, extractUriScheme, isValidMcpUriTemplate, ParsedUriTempla
|
|
|
10
10
|
export { trimSlashes, joinPath } from './path';
|
|
11
11
|
export { sanitizeToJson, inferMimeType } from './content';
|
|
12
12
|
export { validateBaseUrl } from './http';
|
|
13
|
-
export { readFile, readFileBuffer, writeFile, mkdir, rename, unlink, stat, copyFile, cp, readdir, rm, mkdtemp, access, fileExists, readJSON, writeJSON, ensureDir, isDirEmpty, runCmd, } from './fs';
|
|
13
|
+
export { readFile, readFileSync, readFileBuffer, writeFile, mkdir, rename, unlink, stat, copyFile, cp, readdir, rm, mkdtemp, access, fileExists, readJSON, writeJSON, ensureDir, isDirEmpty, runCmd, } from './fs';
|
|
14
14
|
export { escapeHtml, escapeHtmlAttr, escapeJsString, escapeScriptClose, safeJsonForScript } from './escape';
|
|
15
15
|
export { safeStringify } from './serialization';
|
|
16
|
-
export { getCrypto, rsaVerify, jwtAlgToNodeAlg, isRsaPssAlg, randomUUID, randomBytes, sha256, sha256Hex, sha256Base64url, hmacSha256, hkdfSha256, encryptAesGcm, decryptAesGcm, timingSafeEqual, bytesToHex, base64urlEncode, base64urlDecode, isNode, isBrowser, assertNode, CryptoProvider, EncBlob, EncryptedBlob, EncryptedBlobError, encryptValue, decryptValue, tryDecryptValue, serializeBlob, deserializeBlob, tryDeserializeBlob, isValidEncryptedBlob, encryptAndSerialize, deserializeAndDecrypt, tryDeserializeAndDecrypt, generateCodeVerifier, generateCodeChallenge, verifyCodeChallenge, generatePkcePair, isValidCodeVerifier, isValidCodeChallenge, MIN_CODE_VERIFIER_LENGTH, MAX_CODE_VERIFIER_LENGTH, DEFAULT_CODE_VERIFIER_LENGTH, PkceError, type PkcePair, type SecretData, type SecretPersistenceOptions, type SecretValidationResult, secretDataSchema, validateSecretData, parseSecretData, isSecretPersistenceEnabled, resolveSecretPath, loadSecret, saveSecret, deleteSecret, generateSecret, createSecretData, getOrCreateSecret, clearCachedSecret, isSecretCached, } from './crypto';
|
|
16
|
+
export { getCrypto, rsaVerify, jwtAlgToNodeAlg, isRsaPssAlg, randomUUID, randomBytes, sha256, sha256Hex, sha256Base64url, hmacSha256, hkdfSha256, encryptAesGcm, decryptAesGcm, timingSafeEqual, bytesToHex, base64urlEncode, base64urlDecode, base64Encode, base64Decode, isNode, isBrowser, assertNode, CryptoProvider, EncBlob, EncryptedBlob, EncryptedBlobError, encryptValue, decryptValue, tryDecryptValue, serializeBlob, deserializeBlob, tryDeserializeBlob, isValidEncryptedBlob, encryptAndSerialize, deserializeAndDecrypt, tryDeserializeAndDecrypt, generateCodeVerifier, generateCodeChallenge, verifyCodeChallenge, generatePkcePair, isValidCodeVerifier, isValidCodeChallenge, MIN_CODE_VERIFIER_LENGTH, MAX_CODE_VERIFIER_LENGTH, DEFAULT_CODE_VERIFIER_LENGTH, PkceError, type PkcePair, type SecretData, type SecretPersistenceOptions, type SecretValidationResult, secretDataSchema, validateSecretData, parseSecretData, isSecretPersistenceEnabled, resolveSecretPath, loadSecret, saveSecret, deleteSecret, generateSecret, createSecretData, getOrCreateSecret, clearCachedSecret, isSecretCached, type SignedData, type HmacSigningConfig, signData, verifyData, isSignedData, verifyOrParseData, type BaseKeyData, type SecretKeyData, type AsymmetricKeyData, type AnyKeyData, type KeyPersistenceOptions, type CreateKeyPersistenceOptions, type CreateSecretOptions, type CreateAsymmetricOptions, type KeyValidationResult, asymmetricAlgSchema, secretKeyDataSchema, asymmetricKeyDataSchema, anyKeyDataSchema, validateKeyData, parseKeyData, isSecretKeyData, isAsymmetricKeyData, KeyPersistence, createKeyPersistence, createKeyPersistenceWithStorage, } from './crypto';
|
|
17
17
|
export { analyzePattern, isPatternSafe, createSafeRegExp, safeTest, safeMatch, safeReplace, safeExec, isInputLengthSafe, DEFAULT_MAX_INPUT_LENGTH, REDOS_THRESHOLDS, trimLeading, trimTrailing, trimBoth, trimChars, extractBracedParams, expandTemplate, hasTemplatePlaceholders, collapseChar, collapseWhitespace, type SafeRegexOptions, type PatternAnalysisResult, } from './regex';
|
|
18
|
-
export { createStorage, createMemoryStorage, getDetectedStorageType, StorageAdapter, NamespacedStorage, RootStorage, SetOptions, SetEntry, MessageHandler, Unsubscribe, MemoryAdapterOptions, RedisAdapterOptions, VercelKvAdapterOptions, UpstashAdapterOptions, StorageType, StorageConfig, NamespacedStorageImpl, createRootStorage, createNamespacedStorage, buildPrefix, NAMESPACE_SEPARATOR, StorageError, StorageConnectionError, StorageOperationError, StorageNotSupportedError, StorageConfigError, StorageTTLError, StoragePatternError, StorageNotConnectedError, BaseStorageAdapter, MemoryStorageAdapter, RedisStorageAdapter, VercelKvStorageAdapter, UpstashStorageAdapter, globToRegex, matchesPattern, validatePattern, escapeGlob, MAX_TTL_SECONDS, validateTTL, validateOptionalTTL, ttlToExpiresAt, expiresAtToTTL, isExpired, normalizeTTL, } from './storage';
|
|
18
|
+
export { createStorage, createMemoryStorage, getDetectedStorageType, StorageAdapter, NamespacedStorage, RootStorage, SetOptions, SetEntry, MessageHandler, Unsubscribe, MemoryAdapterOptions, RedisAdapterOptions, VercelKvAdapterOptions, UpstashAdapterOptions, StorageType, StorageConfig, NamespacedStorageImpl, createRootStorage, createNamespacedStorage, buildPrefix, NAMESPACE_SEPARATOR, StorageError, StorageConnectionError, StorageOperationError, StorageNotSupportedError, StorageConfigError, StorageTTLError, StoragePatternError, StorageNotConnectedError, EncryptedStorageError, BaseStorageAdapter, MemoryStorageAdapter, RedisStorageAdapter, VercelKvStorageAdapter, UpstashStorageAdapter, FileSystemStorageAdapter, type FileSystemAdapterOptions, TypedStorage, type TypedStorageOptions, type TypedSetOptions, type TypedSetEntry, EncryptedTypedStorage, type EncryptedTypedStorageOptions, type EncryptedSetOptions, type EncryptedSetEntry, type EncryptionKey, type StoredEncryptedBlob, type ClientKeyBinding, globToRegex, matchesPattern, validatePattern, escapeGlob, MAX_TTL_SECONDS, validateTTL, validateOptionalTTL, ttlToExpiresAt, expiresAtToTTL, isExpired, normalizeTTL, } from './storage';
|