@stacksjs/cache 0.69.3 → 0.70.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/dist/base.d.ts +77 -0
- package/dist/dynamodb.d.ts +37 -4
- package/dist/filesystem.d.ts +21 -3
- package/dist/index.d.ts +2 -4
- package/dist/index.js +384 -401
- package/dist/memory.d.ts +17 -3
- package/dist/redis.d.ts +31 -3
- package/package.json +6 -6
package/dist/memory.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
export declare class MemoryCacheDriver extends BaseCacheDriver {
|
|
2
|
+
constructor(options: { maxSize?: number, maxItems?: number } = {}) {
|
|
3
|
+
const client = new BentoCache({
|
|
4
|
+
default: 'memory',
|
|
5
|
+
stores: {
|
|
6
|
+
memory: bentostore().useL1Layer(
|
|
7
|
+
memoryDriver({
|
|
8
|
+
maxSize: options.maxSize ?? 10 * 1024 * 1024,
|
|
9
|
+
maxItems: options.maxItems ?? 1000,
|
|
10
|
+
}),
|
|
11
|
+
),
|
|
12
|
+
},
|
|
13
|
+
})
|
|
2
14
|
|
|
3
|
-
|
|
4
|
-
|
|
15
|
+
super(client)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export declare const memory: MemoryCacheDriver;
|
package/dist/redis.d.ts
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
export declare interface RedisOptions {
|
|
2
|
+
host?: string
|
|
3
|
+
port?: number
|
|
4
|
+
username?: string
|
|
5
|
+
password?: string
|
|
6
|
+
db?: number
|
|
7
|
+
tls?: boolean
|
|
8
|
+
}
|
|
9
|
+
export declare class RedisCacheDriver extends BaseCacheDriver {
|
|
10
|
+
constructor(options: RedisOptions = {}) {
|
|
11
|
+
const client = new BentoCache({
|
|
12
|
+
default: 'redis',
|
|
13
|
+
stores: {
|
|
14
|
+
redis: bentostore().useL2Layer(
|
|
15
|
+
redisDriver({
|
|
16
|
+
connection: {
|
|
17
|
+
host: options.host ?? '127.0.0.1',
|
|
18
|
+
port: options.port ?? 6379,
|
|
19
|
+
...(options.username && { username: options.username }),
|
|
20
|
+
...(options.password && { password: options.password }),
|
|
21
|
+
...(options.db !== undefined && { db: options.db }),
|
|
22
|
+
...(options.tls && { tls: {} }),
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
},
|
|
27
|
+
})
|
|
2
28
|
|
|
3
|
-
|
|
4
|
-
|
|
29
|
+
super(client)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export declare const redis: RedisCacheDriver;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/cache",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.70.0",
|
|
5
5
|
"description": "Caching the Stacks way.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"prepublishOnly": "bun run build"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
45
|
-
"@stacksjs/config": "0.
|
|
46
|
-
"@stacksjs/development": "0.
|
|
47
|
-
"bentocache": "^1.2.
|
|
44
|
+
"@aws-sdk/client-dynamodb": "^3.772.0",
|
|
45
|
+
"@stacksjs/config": "0.70.0",
|
|
46
|
+
"@stacksjs/development": "0.70.0",
|
|
47
|
+
"bentocache": "^1.2.1",
|
|
48
48
|
"dynamodb-tooling": "^0.3.2",
|
|
49
|
-
"ioredis": "^5.
|
|
49
|
+
"ioredis": "^5.6.0"
|
|
50
50
|
}
|
|
51
51
|
}
|