@breadstone/archipel-mcp 0.0.6 → 0.0.8
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/data/packages/index.md +13 -6
- package/data/packages/platform-authentication/api/Class.AppleStrategy.md +1 -1
- package/data/packages/platform-authentication/api/Class.AuthModule.md +3 -3
- package/data/packages/platform-authentication/api/Class.GithubStrategy.md +1 -1
- package/data/packages/platform-authentication/api/Class.GoogleStrategy.md +1 -1
- package/data/packages/platform-authentication/api/Class.MicrosoftStrategy.md +1 -1
- package/data/packages/platform-authentication/api/Interface.IAuthModuleOptions.md +9 -9
- package/data/packages/platform-authentication/api/Variable.APPLE_AUTH_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-authentication/api/Variable.AUTH_APPLE_CALLBACK_URL.md +1 -1
- package/data/packages/platform-authentication/api/Variable.AUTH_APPLE_CLIENT_ID.md +1 -1
- package/data/packages/platform-authentication/api/Variable.AUTH_APPLE_KEY_ID.md +1 -1
- package/data/packages/platform-authentication/api/Variable.AUTH_APPLE_PRIVATE_KEY.md +1 -1
- package/data/packages/platform-authentication/api/Variable.AUTH_APPLE_SCOPE.md +15 -0
- package/data/packages/platform-authentication/api/Variable.AUTH_APPLE_TEAM_ID.md +1 -1
- package/data/packages/platform-authentication/api/Variable.AUTH_GITHUB_CALLBACK_URL.md +1 -1
- package/data/packages/platform-authentication/api/Variable.AUTH_GITHUB_CLIENT_ID.md +1 -1
- package/data/packages/platform-authentication/api/Variable.AUTH_GITHUB_CLIENT_SECRET.md +1 -1
- package/data/packages/platform-authentication/api/Variable.AUTH_GITHUB_SCOPE.md +15 -0
- package/data/packages/platform-authentication/api/Variable.AUTH_GOOGLE_SCOPE.md +15 -0
- package/data/packages/platform-authentication/api/Variable.AUTH_MICROSOFT_CALLBACK_URL.md +1 -1
- package/data/packages/platform-authentication/api/Variable.AUTH_MICROSOFT_CLIENT_ID.md +1 -1
- package/data/packages/platform-authentication/api/Variable.AUTH_MICROSOFT_CLIENT_SECRET.md +1 -1
- package/data/packages/platform-authentication/api/Variable.AUTH_MICROSOFT_SCOPE.md +15 -0
- package/data/packages/platform-authentication/api/Variable.AUTH_MICROSOFT_TENANT.md +1 -1
- package/data/packages/platform-authentication/api/Variable.MICROSOFT_AUTH_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-authentication/api/Variable.PLATFORM_AUTHENTICATION_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-authentication/api/Variable.SEED_ANONYMOUS_USERNAME.md +1 -1
- package/data/packages/platform-authentication/api/index.md +4 -0
- package/data/packages/{platform-core → platform-caching}/api/Class.MemoryLayeredCache.md +41 -33
- package/data/packages/platform-caching/api/Class.NoopCacheMetricsRecorder.md +158 -0
- package/data/packages/platform-caching/api/Class.RedisLayeredCache.md +296 -0
- package/data/packages/platform-caching/api/Interface.ICacheMetricsRecorder.md +122 -0
- package/data/packages/platform-caching/api/Interface.ICacheStats.md +71 -0
- package/data/packages/platform-caching/api/Interface.ILayeredCache.md +199 -0
- package/data/packages/platform-caching/api/Interface.ILayeredCacheOptions.md +76 -0
- package/data/packages/platform-caching/api/Interface.IRedisLayeredCacheOptions.md +122 -0
- package/data/packages/platform-caching/api/index.md +25 -0
- package/data/packages/platform-caching/index.md +116 -0
- package/data/packages/platform-core/api/index.md +104 -150
- package/data/packages/platform-core/index.md +5 -3
- package/data/packages/platform-cryptography/api/Class.BcryptService.md +73 -0
- package/data/packages/platform-cryptography/api/Class.CryptoService.md +52 -0
- package/data/packages/{platform-core → platform-cryptography}/api/Class.OtpService.md +8 -4
- package/data/packages/{platform-core → platform-cryptography}/api/Interface.IOtpService.md +8 -4
- package/data/packages/platform-cryptography/api/Interface.IOtpUriOptions.md +47 -0
- package/data/packages/{platform-core → platform-cryptography}/api/Variable.OTP_SERVICE_TOKEN.md +1 -1
- package/data/packages/{platform-core → platform-cryptography}/api/Variable.TOTP_EPOCH_TOLERANCE.md +1 -1
- package/data/packages/platform-cryptography/api/index.md +29 -0
- package/data/packages/platform-cryptography/index.md +132 -0
- package/data/packages/{platform-core → platform-intelligence}/api/Class.IntelligenceCapabilityRegistrarBase.md +7 -5
- package/data/packages/{platform-core → platform-intelligence}/api/Class.IntelligenceCapabilityRegistry.md +19 -15
- package/data/packages/{platform-core → platform-intelligence}/api/Class.IntelligenceModule.md +1 -1
- package/data/packages/{platform-core → platform-intelligence}/api/Class.IntelligenceTextGenerator.md +7 -7
- package/data/packages/platform-intelligence/api/Function.createProviderOptions.md +27 -0
- package/data/packages/platform-intelligence/api/Function.loadAnthropicLanguageModel.md +27 -0
- package/data/packages/platform-intelligence/api/Function.loadGoogleLanguageModel.md +27 -0
- package/data/packages/platform-intelligence/api/Function.loadGrokLanguageModel.md +27 -0
- package/data/packages/platform-intelligence/api/Function.loadOpenAILanguageModel.md +27 -0
- package/data/packages/platform-intelligence/api/Function.loadProviderFactory.md +32 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceArtifact.md +35 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCapability.md +72 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCapabilityMetadata.md +71 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCapabilityPayload.md +47 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCapabilityRegistry.md +79 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCapabilityResult.md +47 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCompletionUsage.md +47 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceContext.md +73 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceContextBuilder.md +36 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceConversationMessageSnapshot.md +71 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceConversationSnapshot.md +59 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceFollowUpQuestion.md +47 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceIntent.md +47 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceIntentEntity.md +35 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceMessageModel.md +71 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceMessagePayload.md +35 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePrompt.md +35 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptMessage.md +35 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderConfiguration.md +95 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceResponseMessage.md +35 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextCompletion.md +61 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextGenerationOptions.md +47 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextGenerator.md +54 -0
- package/data/packages/{platform-core → platform-intelligence}/api/TypeAlias.IntelligenceConversationMessageRole.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceLanguageModelLoader.md +25 -0
- package/data/packages/{platform-core → platform-intelligence}/api/TypeAlias.IntelligenceProviderName.md +1 -1
- package/data/packages/{platform-core → platform-intelligence}/api/Variable.IntelligenceConversationMessageRoles.md +6 -6
- package/data/packages/platform-intelligence/api/Variable.IntelligenceProviderNames.md +29 -0
- package/data/packages/platform-intelligence/api/index.md +70 -0
- package/data/packages/platform-intelligence/index.md +131 -0
- package/data/packages/platform-telemetry/api/Class.TelemetryCacheMetricsRecorder.md +15 -15
- package/package.json +1 -1
- package/data/packages/platform-core/api/Class.BcryptService.md +0 -69
- package/data/packages/platform-core/api/Class.CryptoService.md +0 -50
- package/data/packages/platform-core/api/Class.NoopCacheMetricsRecorder.md +0 -157
- package/data/packages/platform-core/api/Class.RedisLayeredCache.md +0 -275
- package/data/packages/platform-core/api/Interface.ICacheMetricsRecorder.md +0 -121
- package/data/packages/platform-core/api/Interface.ICacheStats.md +0 -71
- package/data/packages/platform-core/api/Interface.IIntelligenceArtifact.md +0 -31
- package/data/packages/platform-core/api/Interface.IIntelligenceCapability.md +0 -62
- package/data/packages/platform-core/api/Interface.IIntelligenceCapabilityMetadata.md +0 -61
- package/data/packages/platform-core/api/Interface.IIntelligenceCapabilityPayload.md +0 -41
- package/data/packages/platform-core/api/Interface.IIntelligenceCapabilityRegistry.md +0 -69
- package/data/packages/platform-core/api/Interface.IIntelligenceCapabilityResult.md +0 -41
- package/data/packages/platform-core/api/Interface.IIntelligenceCompletionUsage.md +0 -41
- package/data/packages/platform-core/api/Interface.IIntelligenceContext.md +0 -63
- package/data/packages/platform-core/api/Interface.IIntelligenceContextBuilder.md +0 -32
- package/data/packages/platform-core/api/Interface.IIntelligenceConversationMessageSnapshot.md +0 -61
- package/data/packages/platform-core/api/Interface.IIntelligenceConversationSnapshot.md +0 -51
- package/data/packages/platform-core/api/Interface.IIntelligenceFollowUpQuestion.md +0 -41
- package/data/packages/platform-core/api/Interface.IIntelligenceIntent.md +0 -41
- package/data/packages/platform-core/api/Interface.IIntelligenceIntentEntity.md +0 -31
- package/data/packages/platform-core/api/Interface.IIntelligenceMessageModel.md +0 -61
- package/data/packages/platform-core/api/Interface.IIntelligenceMessagePayload.md +0 -31
- package/data/packages/platform-core/api/Interface.IIntelligencePrompt.md +0 -31
- package/data/packages/platform-core/api/Interface.IIntelligencePromptMessage.md +0 -31
- package/data/packages/platform-core/api/Interface.IIntelligenceProviderConfiguration.md +0 -81
- package/data/packages/platform-core/api/Interface.IIntelligenceResponseMessage.md +0 -31
- package/data/packages/platform-core/api/Interface.IIntelligenceTextCompletion.md +0 -53
- package/data/packages/platform-core/api/Interface.IIntelligenceTextGenerationOptions.md +0 -41
- package/data/packages/platform-core/api/Interface.IIntelligenceTextGenerator.md +0 -46
- package/data/packages/platform-core/api/Interface.ILayeredCache.md +0 -194
- package/data/packages/platform-core/api/Interface.ILayeredCacheOptions.md +0 -71
- package/data/packages/platform-core/api/Interface.IOtpUriOptions.md +0 -47
- package/data/packages/platform-core/api/Interface.IRedisLayeredCacheOptions.md +0 -108
- package/data/packages/platform-core/api/Variable.IntelligenceProviderNames.md +0 -29
|
@@ -6,9 +6,11 @@ editUrl: false
|
|
|
6
6
|
|
|
7
7
|
# Class: MemoryLayeredCache\<TKey, TValue\>
|
|
8
8
|
|
|
9
|
-
Defined in: [
|
|
9
|
+
Defined in: [MemoryLayeredCache.ts:73](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/MemoryLayeredCache.ts#L73)
|
|
10
10
|
|
|
11
|
-
In-memory layered cache
|
|
11
|
+
In-memory layered cache with LRU eviction, TTL expiration and
|
|
12
|
+
optional stale-while-revalidate support. Falls back to an
|
|
13
|
+
asynchronous loader function on cache misses.
|
|
12
14
|
|
|
13
15
|
## Type Parameters
|
|
14
16
|
|
|
@@ -29,14 +31,16 @@ In-memory layered cache implementation.
|
|
|
29
31
|
new MemoryLayeredCache<TKey, TValue>(loadFn, options?): MemoryLayeredCache<TKey, TValue>;
|
|
30
32
|
```
|
|
31
33
|
|
|
32
|
-
Defined in: [
|
|
34
|
+
Defined in: [MemoryLayeredCache.ts:100](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/MemoryLayeredCache.ts#L100)
|
|
35
|
+
|
|
36
|
+
Initializes a new instance of the MemoryLayeredCache class.
|
|
33
37
|
|
|
34
38
|
#### Parameters
|
|
35
39
|
|
|
36
|
-
| Parameter | Type |
|
|
37
|
-
| ---------- | -------------------------------------------------------- |
|
|
38
|
-
| `loadFn` | (`key`) => `Promise`\<`TValue` \| `undefined`\> |
|
|
39
|
-
| `options?` | [`ILayeredCacheOptions`](Interface.ILayeredCacheOptions) |
|
|
40
|
+
| Parameter | Type | Description |
|
|
41
|
+
| ---------- | -------------------------------------------------------- | ------------------------------------------------ |
|
|
42
|
+
| `loadFn` | (`key`) => `Promise`\<`TValue` \| `undefined`\> | Async loader invoked on cache misses. |
|
|
43
|
+
| `options?` | [`ILayeredCacheOptions`](Interface.ILayeredCacheOptions) | Optional configuration for TTL, LRU and metrics. |
|
|
40
44
|
|
|
41
45
|
#### Returns
|
|
42
46
|
|
|
@@ -50,9 +54,9 @@ Defined in: [cache/MemoryLayeredCache.ts:87](https://github.com/RueDeRennes/arch
|
|
|
50
54
|
get(key): TValue | undefined;
|
|
51
55
|
```
|
|
52
56
|
|
|
53
|
-
Defined in: [
|
|
57
|
+
Defined in: [MemoryLayeredCache.ts:115](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/MemoryLayeredCache.ts#L115)
|
|
54
58
|
|
|
55
|
-
Retrieves a value from the cache.
|
|
59
|
+
Retrieves a value from the cache synchronously.
|
|
56
60
|
|
|
57
61
|
#### Parameters
|
|
58
62
|
|
|
@@ -64,6 +68,8 @@ Retrieves a value from the cache.
|
|
|
64
68
|
|
|
65
69
|
`TValue` \| `undefined`
|
|
66
70
|
|
|
71
|
+
The cached value or `undefined` on a miss.
|
|
72
|
+
|
|
67
73
|
#### Implementation of
|
|
68
74
|
|
|
69
75
|
[`ILayeredCache`](Interface.ILayeredCache).[`get`](Interface.ILayeredCache#get)
|
|
@@ -76,9 +82,9 @@ Retrieves a value from the cache.
|
|
|
76
82
|
getAsync(key): Promise<TValue | undefined>;
|
|
77
83
|
```
|
|
78
84
|
|
|
79
|
-
Defined in: [
|
|
85
|
+
Defined in: [MemoryLayeredCache.ts:136](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/MemoryLayeredCache.ts#L136)
|
|
80
86
|
|
|
81
|
-
Retrieves a value from the cache
|
|
87
|
+
Retrieves a value from the cache asynchronously.
|
|
82
88
|
|
|
83
89
|
#### Parameters
|
|
84
90
|
|
|
@@ -90,6 +96,8 @@ Retrieves a value from the cache (asynchronous).
|
|
|
90
96
|
|
|
91
97
|
`Promise`\<`TValue` \| `undefined`\>
|
|
92
98
|
|
|
99
|
+
A promise resolving to the cached value or `undefined` on a miss.
|
|
100
|
+
|
|
93
101
|
#### Implementation of
|
|
94
102
|
|
|
95
103
|
[`ILayeredCache`](Interface.ILayeredCache).[`getAsync`](Interface.ILayeredCache#getasync)
|
|
@@ -102,9 +110,9 @@ Retrieves a value from the cache (asynchronous).
|
|
|
102
110
|
invalidate(key): void;
|
|
103
111
|
```
|
|
104
112
|
|
|
105
|
-
Defined in: [
|
|
113
|
+
Defined in: [MemoryLayeredCache.ts:180](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/MemoryLayeredCache.ts#L180)
|
|
106
114
|
|
|
107
|
-
Invalidates a key in the cache.
|
|
115
|
+
Invalidates a key in the cache synchronously.
|
|
108
116
|
|
|
109
117
|
#### Parameters
|
|
110
118
|
|
|
@@ -128,9 +136,9 @@ Invalidates a key in the cache.
|
|
|
128
136
|
invalidateAsync(key): Promise<void>;
|
|
129
137
|
```
|
|
130
138
|
|
|
131
|
-
Defined in: [
|
|
139
|
+
Defined in: [MemoryLayeredCache.ts:185](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/MemoryLayeredCache.ts#L185)
|
|
132
140
|
|
|
133
|
-
Invalidates a key in the cache
|
|
141
|
+
Invalidates a key in the cache asynchronously.
|
|
134
142
|
|
|
135
143
|
#### Parameters
|
|
136
144
|
|
|
@@ -154,16 +162,16 @@ Invalidates a key in the cache (asynchronous).
|
|
|
154
162
|
set(key, value): void;
|
|
155
163
|
```
|
|
156
164
|
|
|
157
|
-
Defined in: [
|
|
165
|
+
Defined in: [MemoryLayeredCache.ts:158](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/MemoryLayeredCache.ts#L158)
|
|
158
166
|
|
|
159
|
-
|
|
167
|
+
Stores a value in the cache synchronously.
|
|
160
168
|
|
|
161
169
|
#### Parameters
|
|
162
170
|
|
|
163
|
-
| Parameter | Type | Description
|
|
164
|
-
| --------- | -------- |
|
|
165
|
-
| `key` | `TKey` | The key to
|
|
166
|
-
| `value` | `TValue` | The value to
|
|
171
|
+
| Parameter | Type | Description |
|
|
172
|
+
| --------- | -------- | ------------------- |
|
|
173
|
+
| `key` | `TKey` | The key to store. |
|
|
174
|
+
| `value` | `TValue` | The value to store. |
|
|
167
175
|
|
|
168
176
|
#### Returns
|
|
169
177
|
|
|
@@ -181,16 +189,16 @@ Sets a value in the cache.
|
|
|
181
189
|
setAsync(key, value): Promise<void>;
|
|
182
190
|
```
|
|
183
191
|
|
|
184
|
-
Defined in: [
|
|
192
|
+
Defined in: [MemoryLayeredCache.ts:166](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/MemoryLayeredCache.ts#L166)
|
|
185
193
|
|
|
186
|
-
|
|
194
|
+
Stores a value in the cache asynchronously.
|
|
187
195
|
|
|
188
196
|
#### Parameters
|
|
189
197
|
|
|
190
|
-
| Parameter | Type | Description
|
|
191
|
-
| --------- | -------- |
|
|
192
|
-
| `key` | `TKey` | The key to
|
|
193
|
-
| `value` | `TValue` | The value to
|
|
198
|
+
| Parameter | Type | Description |
|
|
199
|
+
| --------- | -------- | ------------------- |
|
|
200
|
+
| `key` | `TKey` | The key to store. |
|
|
201
|
+
| `value` | `TValue` | The value to store. |
|
|
194
202
|
|
|
195
203
|
#### Returns
|
|
196
204
|
|
|
@@ -208,15 +216,15 @@ Sets a value in the cache (asynchronous).
|
|
|
208
216
|
stats(): ICacheStats;
|
|
209
217
|
```
|
|
210
218
|
|
|
211
|
-
Defined in: [
|
|
219
|
+
Defined in: [MemoryLayeredCache.ts:190](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/MemoryLayeredCache.ts#L190)
|
|
212
220
|
|
|
213
|
-
|
|
221
|
+
Returns current cache statistics.
|
|
214
222
|
|
|
215
223
|
#### Returns
|
|
216
224
|
|
|
217
225
|
[`ICacheStats`](Interface.ICacheStats)
|
|
218
226
|
|
|
219
|
-
The cache statistics.
|
|
227
|
+
The cache statistics snapshot.
|
|
220
228
|
|
|
221
229
|
#### Implementation of
|
|
222
230
|
|
|
@@ -230,9 +238,9 @@ The cache statistics.
|
|
|
230
238
|
warm(key): Promise<TValue | undefined>;
|
|
231
239
|
```
|
|
232
240
|
|
|
233
|
-
Defined in: [
|
|
241
|
+
Defined in: [MemoryLayeredCache.ts:174](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/MemoryLayeredCache.ts#L174)
|
|
234
242
|
|
|
235
|
-
Proactively warms the cache for a given key
|
|
243
|
+
Proactively warms the cache for a given key.
|
|
236
244
|
|
|
237
245
|
#### Parameters
|
|
238
246
|
|
|
@@ -244,7 +252,7 @@ Proactively warms the cache for a given key (optional).
|
|
|
244
252
|
|
|
245
253
|
`Promise`\<`TValue` \| `undefined`\>
|
|
246
254
|
|
|
247
|
-
The value that was loaded and cached, or undefined if not found.
|
|
255
|
+
The value that was loaded and cached, or `undefined` if not found.
|
|
248
256
|
|
|
249
257
|
#### Implementation of
|
|
250
258
|
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Class: NoopCacheMetricsRecorder'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Class: NoopCacheMetricsRecorder
|
|
8
|
+
|
|
9
|
+
Defined in: [NoopCacheMetricsRecorder.ts:13](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/NoopCacheMetricsRecorder.ts#L13)
|
|
10
|
+
|
|
11
|
+
No-op implementation of [ICacheMetricsRecorder](Interface.ICacheMetricsRecorder) used as the default
|
|
12
|
+
when no external metrics backend is configured.
|
|
13
|
+
|
|
14
|
+
## Implements
|
|
15
|
+
|
|
16
|
+
- [`ICacheMetricsRecorder`](Interface.ICacheMetricsRecorder)
|
|
17
|
+
|
|
18
|
+
## Constructors
|
|
19
|
+
|
|
20
|
+
### Constructor
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
new NoopCacheMetricsRecorder(): NoopCacheMetricsRecorder;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
#### Returns
|
|
27
|
+
|
|
28
|
+
`NoopCacheMetricsRecorder`
|
|
29
|
+
|
|
30
|
+
## Methods
|
|
31
|
+
|
|
32
|
+
### recordEviction()?
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
optional recordEviction(_cache): void;
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Defined in: [NoopCacheMetricsRecorder.ts:38](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/NoopCacheMetricsRecorder.ts#L38)
|
|
39
|
+
|
|
40
|
+
Records a cache eviction.
|
|
41
|
+
|
|
42
|
+
#### Parameters
|
|
43
|
+
|
|
44
|
+
| Parameter | Type | Description |
|
|
45
|
+
| --------- | -------- | ----------------------- |
|
|
46
|
+
| `_cache` | `string` | The cache name / label. |
|
|
47
|
+
|
|
48
|
+
#### Returns
|
|
49
|
+
|
|
50
|
+
`void`
|
|
51
|
+
|
|
52
|
+
#### Implementation of
|
|
53
|
+
|
|
54
|
+
[`ICacheMetricsRecorder`](Interface.ICacheMetricsRecorder).[`recordEviction`](Interface.ICacheMetricsRecorder#recordeviction)
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### recordHit()
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
recordHit(_cache): void;
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Defined in: [NoopCacheMetricsRecorder.ts:18](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/NoopCacheMetricsRecorder.ts#L18)
|
|
65
|
+
|
|
66
|
+
Records a cache hit.
|
|
67
|
+
|
|
68
|
+
#### Parameters
|
|
69
|
+
|
|
70
|
+
| Parameter | Type | Description |
|
|
71
|
+
| --------- | -------- | ----------------------- |
|
|
72
|
+
| `_cache` | `string` | The cache name / label. |
|
|
73
|
+
|
|
74
|
+
#### Returns
|
|
75
|
+
|
|
76
|
+
`void`
|
|
77
|
+
|
|
78
|
+
#### Implementation of
|
|
79
|
+
|
|
80
|
+
[`ICacheMetricsRecorder`](Interface.ICacheMetricsRecorder).[`recordHit`](Interface.ICacheMetricsRecorder#recordhit)
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### recordLoadError()
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
recordLoadError(_cache): void;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Defined in: [NoopCacheMetricsRecorder.ts:33](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/NoopCacheMetricsRecorder.ts#L33)
|
|
91
|
+
|
|
92
|
+
Records a failed cache load.
|
|
93
|
+
|
|
94
|
+
#### Parameters
|
|
95
|
+
|
|
96
|
+
| Parameter | Type | Description |
|
|
97
|
+
| --------- | -------- | ----------------------- |
|
|
98
|
+
| `_cache` | `string` | The cache name / label. |
|
|
99
|
+
|
|
100
|
+
#### Returns
|
|
101
|
+
|
|
102
|
+
`void`
|
|
103
|
+
|
|
104
|
+
#### Implementation of
|
|
105
|
+
|
|
106
|
+
[`ICacheMetricsRecorder`](Interface.ICacheMetricsRecorder).[`recordLoadError`](Interface.ICacheMetricsRecorder#recordloaderror)
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### recordLoadSuccess()
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
recordLoadSuccess(_cache): void;
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Defined in: [NoopCacheMetricsRecorder.ts:28](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/NoopCacheMetricsRecorder.ts#L28)
|
|
117
|
+
|
|
118
|
+
Records a successful cache load.
|
|
119
|
+
|
|
120
|
+
#### Parameters
|
|
121
|
+
|
|
122
|
+
| Parameter | Type | Description |
|
|
123
|
+
| --------- | -------- | ----------------------- |
|
|
124
|
+
| `_cache` | `string` | The cache name / label. |
|
|
125
|
+
|
|
126
|
+
#### Returns
|
|
127
|
+
|
|
128
|
+
`void`
|
|
129
|
+
|
|
130
|
+
#### Implementation of
|
|
131
|
+
|
|
132
|
+
[`ICacheMetricsRecorder`](Interface.ICacheMetricsRecorder).[`recordLoadSuccess`](Interface.ICacheMetricsRecorder#recordloadsuccess)
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### recordMiss()
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
recordMiss(_cache): void;
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Defined in: [NoopCacheMetricsRecorder.ts:23](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/NoopCacheMetricsRecorder.ts#L23)
|
|
143
|
+
|
|
144
|
+
Records a cache miss.
|
|
145
|
+
|
|
146
|
+
#### Parameters
|
|
147
|
+
|
|
148
|
+
| Parameter | Type | Description |
|
|
149
|
+
| --------- | -------- | ----------------------- |
|
|
150
|
+
| `_cache` | `string` | The cache name / label. |
|
|
151
|
+
|
|
152
|
+
#### Returns
|
|
153
|
+
|
|
154
|
+
`void`
|
|
155
|
+
|
|
156
|
+
#### Implementation of
|
|
157
|
+
|
|
158
|
+
[`ICacheMetricsRecorder`](Interface.ICacheMetricsRecorder).[`recordMiss`](Interface.ICacheMetricsRecorder#recordmiss)
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Class: RedisLayeredCache\<TKey, TValue\>'
|
|
3
|
+
generated: true
|
|
4
|
+
editUrl: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Class: RedisLayeredCache\<TKey, TValue\>
|
|
8
|
+
|
|
9
|
+
Defined in: [redis/RedisLayeredCache.ts:84](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/redis/RedisLayeredCache.ts#L84)
|
|
10
|
+
|
|
11
|
+
Redis-backed layered cache implementation. Falls back to an asynchronous
|
|
12
|
+
loader function when the requested key is not present in Redis.
|
|
13
|
+
|
|
14
|
+
## Remarks
|
|
15
|
+
|
|
16
|
+
Synchronous methods (`get`, `set`, `invalidate`) throw because Redis
|
|
17
|
+
is inherently asynchronous. Use the `*Async` variants instead.
|
|
18
|
+
|
|
19
|
+
## Type Parameters
|
|
20
|
+
|
|
21
|
+
| Type Parameter | Description |
|
|
22
|
+
| -------------- | ----------------------------- |
|
|
23
|
+
| `TKey` | The type of the cache keys. |
|
|
24
|
+
| `TValue` | The type of the cache values. |
|
|
25
|
+
|
|
26
|
+
## Implements
|
|
27
|
+
|
|
28
|
+
- [`ILayeredCache`](Interface.ILayeredCache)\<`TKey`, `TValue`\>
|
|
29
|
+
- `OnModuleDestroy`
|
|
30
|
+
|
|
31
|
+
## Constructors
|
|
32
|
+
|
|
33
|
+
### Constructor
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
new RedisLayeredCache<TKey, TValue>(loadFn, options): RedisLayeredCache<TKey, TValue>;
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Defined in: [redis/RedisLayeredCache.ts:109](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/redis/RedisLayeredCache.ts#L109)
|
|
40
|
+
|
|
41
|
+
Initializes a new instance of the RedisLayeredCache class.
|
|
42
|
+
|
|
43
|
+
#### Parameters
|
|
44
|
+
|
|
45
|
+
| Parameter | Type | Description |
|
|
46
|
+
| --------- | ------------------------------------------------------------------------------ | --------------------------------------------------- |
|
|
47
|
+
| `loadFn` | (`key`) => `Promise`\<`TValue` \| `undefined`\> | Async loader invoked on cache misses. |
|
|
48
|
+
| `options` | [`IRedisLayeredCacheOptions`](Interface.IRedisLayeredCacheOptions)\<`TValue`\> | Redis connection and cache behaviour configuration. |
|
|
49
|
+
|
|
50
|
+
#### Returns
|
|
51
|
+
|
|
52
|
+
`RedisLayeredCache`\<`TKey`, `TValue`\>
|
|
53
|
+
|
|
54
|
+
## Methods
|
|
55
|
+
|
|
56
|
+
### get()
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
get(key): TValue | undefined;
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Defined in: [redis/RedisLayeredCache.ts:126](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/redis/RedisLayeredCache.ts#L126)
|
|
63
|
+
|
|
64
|
+
Not supported — Redis is inherently asynchronous.
|
|
65
|
+
|
|
66
|
+
#### Parameters
|
|
67
|
+
|
|
68
|
+
| Parameter | Type |
|
|
69
|
+
| --------- | ------ |
|
|
70
|
+
| `key` | `TKey` |
|
|
71
|
+
|
|
72
|
+
#### Returns
|
|
73
|
+
|
|
74
|
+
`TValue` \| `undefined`
|
|
75
|
+
|
|
76
|
+
#### Throws
|
|
77
|
+
|
|
78
|
+
Always throws. Use [getAsync](#getasync) instead.
|
|
79
|
+
|
|
80
|
+
#### Implementation of
|
|
81
|
+
|
|
82
|
+
[`ILayeredCache`](Interface.ILayeredCache).[`get`](Interface.ILayeredCache#get)
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
### getAsync()
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
getAsync(key): Promise<TValue | undefined>;
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Defined in: [redis/RedisLayeredCache.ts:131](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/redis/RedisLayeredCache.ts#L131)
|
|
93
|
+
|
|
94
|
+
Retrieves a value from the cache asynchronously.
|
|
95
|
+
|
|
96
|
+
#### Parameters
|
|
97
|
+
|
|
98
|
+
| Parameter | Type | Description |
|
|
99
|
+
| --------- | ------ | -------------------- |
|
|
100
|
+
| `key` | `TKey` | The key to retrieve. |
|
|
101
|
+
|
|
102
|
+
#### Returns
|
|
103
|
+
|
|
104
|
+
`Promise`\<`TValue` \| `undefined`\>
|
|
105
|
+
|
|
106
|
+
A promise resolving to the cached value or `undefined` on a miss.
|
|
107
|
+
|
|
108
|
+
#### Implementation of
|
|
109
|
+
|
|
110
|
+
[`ILayeredCache`](Interface.ILayeredCache).[`getAsync`](Interface.ILayeredCache#getasync)
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
### invalidate()
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
invalidate(key): void;
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Defined in: [redis/RedisLayeredCache.ts:188](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/redis/RedisLayeredCache.ts#L188)
|
|
121
|
+
|
|
122
|
+
Not supported — Redis is inherently asynchronous.
|
|
123
|
+
|
|
124
|
+
#### Parameters
|
|
125
|
+
|
|
126
|
+
| Parameter | Type |
|
|
127
|
+
| --------- | ------ |
|
|
128
|
+
| `key` | `TKey` |
|
|
129
|
+
|
|
130
|
+
#### Returns
|
|
131
|
+
|
|
132
|
+
`void`
|
|
133
|
+
|
|
134
|
+
#### Throws
|
|
135
|
+
|
|
136
|
+
Always throws. Use [invalidateAsync](#invalidateasync) instead.
|
|
137
|
+
|
|
138
|
+
#### Implementation of
|
|
139
|
+
|
|
140
|
+
[`ILayeredCache`](Interface.ILayeredCache).[`invalidate`](Interface.ILayeredCache#invalidate)
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
### invalidateAsync()
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
invalidateAsync(key): Promise<void>;
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Defined in: [redis/RedisLayeredCache.ts:193](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/redis/RedisLayeredCache.ts#L193)
|
|
151
|
+
|
|
152
|
+
Invalidates a key in the cache asynchronously.
|
|
153
|
+
|
|
154
|
+
#### Parameters
|
|
155
|
+
|
|
156
|
+
| Parameter | Type | Description |
|
|
157
|
+
| --------- | ------ | ---------------------- |
|
|
158
|
+
| `key` | `TKey` | The key to invalidate. |
|
|
159
|
+
|
|
160
|
+
#### Returns
|
|
161
|
+
|
|
162
|
+
`Promise`\<`void`\>
|
|
163
|
+
|
|
164
|
+
#### Implementation of
|
|
165
|
+
|
|
166
|
+
[`ILayeredCache`](Interface.ILayeredCache).[`invalidateAsync`](Interface.ILayeredCache#invalidateasync)
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### onModuleDestroy()
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
onModuleDestroy(): Promise<void>;
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Defined in: [redis/RedisLayeredCache.ts:214](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/redis/RedisLayeredCache.ts#L214)
|
|
177
|
+
|
|
178
|
+
Gracefully disconnects the Redis client when the NestJS module is destroyed.
|
|
179
|
+
|
|
180
|
+
#### Returns
|
|
181
|
+
|
|
182
|
+
`Promise`\<`void`\>
|
|
183
|
+
|
|
184
|
+
#### Implementation of
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
OnModuleDestroy.onModuleDestroy;
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
### set()
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
set(key, value): void;
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Defined in: [redis/RedisLayeredCache.ts:162](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/redis/RedisLayeredCache.ts#L162)
|
|
199
|
+
|
|
200
|
+
Not supported — Redis is inherently asynchronous.
|
|
201
|
+
|
|
202
|
+
#### Parameters
|
|
203
|
+
|
|
204
|
+
| Parameter | Type |
|
|
205
|
+
| --------- | -------- |
|
|
206
|
+
| `key` | `TKey` |
|
|
207
|
+
| `value` | `TValue` |
|
|
208
|
+
|
|
209
|
+
#### Returns
|
|
210
|
+
|
|
211
|
+
`void`
|
|
212
|
+
|
|
213
|
+
#### Throws
|
|
214
|
+
|
|
215
|
+
Always throws. Use [setAsync](#setasync) instead.
|
|
216
|
+
|
|
217
|
+
#### Implementation of
|
|
218
|
+
|
|
219
|
+
[`ILayeredCache`](Interface.ILayeredCache).[`set`](Interface.ILayeredCache#set)
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
### setAsync()
|
|
224
|
+
|
|
225
|
+
```ts
|
|
226
|
+
setAsync(key, value): Promise<void>;
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Defined in: [redis/RedisLayeredCache.ts:167](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/redis/RedisLayeredCache.ts#L167)
|
|
230
|
+
|
|
231
|
+
Stores a value in the cache asynchronously.
|
|
232
|
+
|
|
233
|
+
#### Parameters
|
|
234
|
+
|
|
235
|
+
| Parameter | Type | Description |
|
|
236
|
+
| --------- | -------- | ------------------- |
|
|
237
|
+
| `key` | `TKey` | The key to store. |
|
|
238
|
+
| `value` | `TValue` | The value to store. |
|
|
239
|
+
|
|
240
|
+
#### Returns
|
|
241
|
+
|
|
242
|
+
`Promise`\<`void`\>
|
|
243
|
+
|
|
244
|
+
#### Implementation of
|
|
245
|
+
|
|
246
|
+
[`ILayeredCache`](Interface.ILayeredCache).[`setAsync`](Interface.ILayeredCache#setasync)
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
### stats()
|
|
251
|
+
|
|
252
|
+
```ts
|
|
253
|
+
stats(): ICacheStats;
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Defined in: [redis/RedisLayeredCache.ts:202](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/redis/RedisLayeredCache.ts#L202)
|
|
257
|
+
|
|
258
|
+
Returns current cache statistics.
|
|
259
|
+
|
|
260
|
+
#### Returns
|
|
261
|
+
|
|
262
|
+
[`ICacheStats`](Interface.ICacheStats)
|
|
263
|
+
|
|
264
|
+
The cache statistics snapshot.
|
|
265
|
+
|
|
266
|
+
#### Implementation of
|
|
267
|
+
|
|
268
|
+
[`ILayeredCache`](Interface.ILayeredCache).[`stats`](Interface.ILayeredCache#stats)
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
### warm()
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
warm(key): Promise<TValue | undefined>;
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Defined in: [redis/RedisLayeredCache.ts:179](https://github.com/RueDeRennes/archipel/blob/main/libs/platform-caching/src/redis/RedisLayeredCache.ts#L179)
|
|
279
|
+
|
|
280
|
+
Proactively warms the cache for a given key.
|
|
281
|
+
|
|
282
|
+
#### Parameters
|
|
283
|
+
|
|
284
|
+
| Parameter | Type | Description |
|
|
285
|
+
| --------- | ------ | ---------------- |
|
|
286
|
+
| `key` | `TKey` | The key to warm. |
|
|
287
|
+
|
|
288
|
+
#### Returns
|
|
289
|
+
|
|
290
|
+
`Promise`\<`TValue` \| `undefined`\>
|
|
291
|
+
|
|
292
|
+
The value that was loaded and cached, or `undefined` if not found.
|
|
293
|
+
|
|
294
|
+
#### Implementation of
|
|
295
|
+
|
|
296
|
+
[`ILayeredCache`](Interface.ILayeredCache).[`warm`](Interface.ILayeredCache#warm)
|