slonik-interceptor-query-cache 46.2.0 → 46.4.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/CHANGELOG.md
CHANGED
|
@@ -4,13 +4,13 @@ export type CacheAttributes = {
|
|
|
4
4
|
key: string;
|
|
5
5
|
ttl: number;
|
|
6
6
|
};
|
|
7
|
+
type ConfigurationInput = {
|
|
8
|
+
storage: Storage;
|
|
9
|
+
};
|
|
7
10
|
type Storage = {
|
|
8
11
|
get: (query: Query, cacheAttributes: CacheAttributes) => Promise<null | QueryResult<QueryResultRow>>;
|
|
9
12
|
set: (query: Query, cacheAttributes: CacheAttributes, queryResult: QueryResult<QueryResultRow>) => Promise<void>;
|
|
10
13
|
};
|
|
11
|
-
type ConfigurationInput = {
|
|
12
|
-
storage: Storage;
|
|
13
|
-
};
|
|
14
14
|
export declare const createQueryCacheInterceptor: (configurationInput: ConfigurationInput) => Interceptor;
|
|
15
15
|
export {};
|
|
16
16
|
//# sourceMappingURL=createQueryCacheInterceptor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createQueryCacheInterceptor.d.ts","sourceRoot":"","sources":["../../src/factories/createQueryCacheInterceptor.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"createQueryCacheInterceptor.d.ts","sourceRoot":"","sources":["../../src/factories/createQueryCacheInterceptor.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,QAAQ,CAAC;AAMhB,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAMF,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAQF,KAAK,OAAO,GAAG;IACb,GAAG,EAAE,CACH,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,KAC7B,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;IACjD,GAAG,EAAE,CACH,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,WAAW,CAAC,cAAc,CAAC,KACrC,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,2BAA2B,uBAClB,kBAAkB,KACrC,WAiFF,CAAC"}
|
package/package.json
CHANGED
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"description": "Logs Slonik queries.",
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"ava": "^6.1.3",
|
|
25
|
-
"eslint": "^9.
|
|
26
|
-
"slonik": "^46.
|
|
25
|
+
"eslint": "^9.16.0",
|
|
26
|
+
"slonik": "^46.4.0",
|
|
27
27
|
"ts-node": "^10.4.0",
|
|
28
28
|
"typescript": "^5.6.3",
|
|
29
|
-
"@slonik/eslint-config": "^46.
|
|
29
|
+
"@slonik/eslint-config": "^46.4.0"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": ">=18"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"url": "https://github.com/gajus/slonik"
|
|
48
48
|
},
|
|
49
49
|
"typings": "./dist/index.d.ts",
|
|
50
|
-
"version": "46.
|
|
50
|
+
"version": "46.4.0",
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "rm -fr ./dist && tsc",
|
|
53
53
|
"lint": "eslint ./src && tsc --noEmit",
|
|
@@ -12,18 +12,26 @@ const log = Logger.child({
|
|
|
12
12
|
namespace: 'createQueryCacheInterceptor',
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
type Sandbox = {
|
|
16
|
-
cache: {
|
|
17
|
-
cacheAttributes: CacheAttributes;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
|
|
21
15
|
export type CacheAttributes = {
|
|
22
16
|
discardEmpty: boolean;
|
|
23
17
|
key: string;
|
|
24
18
|
ttl: number;
|
|
25
19
|
};
|
|
26
20
|
|
|
21
|
+
type Configuration = {
|
|
22
|
+
storage: Storage;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type ConfigurationInput = {
|
|
26
|
+
storage: Storage;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type Sandbox = {
|
|
30
|
+
cache: {
|
|
31
|
+
cacheAttributes: CacheAttributes;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
27
35
|
type Storage = {
|
|
28
36
|
get: (
|
|
29
37
|
query: Query,
|
|
@@ -36,14 +44,6 @@ type Storage = {
|
|
|
36
44
|
) => Promise<void>;
|
|
37
45
|
};
|
|
38
46
|
|
|
39
|
-
type ConfigurationInput = {
|
|
40
|
-
storage: Storage;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
type Configuration = {
|
|
44
|
-
storage: Storage;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
47
|
export const createQueryCacheInterceptor = (
|
|
48
48
|
configurationInput: ConfigurationInput,
|
|
49
49
|
): Interceptor => {
|