slonik-interceptor-query-cache 2.4.0 → 2.4.1

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2022, Gajus Kuizinas (http://gajus.com/)
1
+ Copyright (c) 2023, Gajus Kuizinas (https://gajus.com/)
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
@@ -8,14 +8,14 @@ modification, are permitted provided that the following conditions are met:
8
8
  * Redistributions in binary form must reproduce the above copyright
9
9
  notice, this list of conditions and the following disclaimer in the
10
10
  documentation and/or other materials provided with the distribution.
11
- * Neither the name of the Gajus Kuizinas (http://gajus.com/) nor the
11
+ * Neither the name of the Gajus Kuizinas (https://gajus.com/) nor the
12
12
  names of its contributors may be used to endorse or promote products
13
13
  derived from this software without specific prior written permission.
14
14
 
15
15
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
16
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
17
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
- DISCLAIMED. IN NO EVENT SHALL ANUARY BE LIABLE FOR ANY
18
+ DISCLAIMED. IN NO EVENT SHALL GAJUS KUIZINAS BE LIABLE FOR ANY
19
19
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
20
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
21
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -1 +1 @@
1
- export declare const Logger: import("roarr").Logger<import("roarr/dist/src/types").JsonObject>;
1
+ export declare const Logger: import("roarr").Logger<import("roarr/dist/types").JsonObject>;
@@ -1,13 +1,13 @@
1
- import type { Interceptor, Query, QueryResultRow, QueryResult } from 'slonik';
2
- declare type CacheAttributes = {
1
+ import { type Interceptor, type Query, type QueryResult, type QueryResultRow } from 'slonik';
2
+ type CacheAttributes = {
3
3
  key: string;
4
4
  ttl: number;
5
5
  };
6
- declare type Storage = {
6
+ type Storage = {
7
7
  get: (query: Query, cacheAttributes: CacheAttributes) => Promise<QueryResult<QueryResultRow> | null>;
8
8
  set: (query: Query, cacheAttributes: CacheAttributes, queryResult: QueryResult<QueryResultRow>) => Promise<void>;
9
9
  };
10
- declare type ConfigurationInput = {
10
+ type ConfigurationInput = {
11
11
  storage: Storage;
12
12
  };
13
13
  export declare const createQueryCacheInterceptor: (configurationInput: ConfigurationInput) => Interceptor;
@@ -1,4 +1,4 @@
1
- import type { PrimitiveValueExpression } from 'slonik';
1
+ import { type PrimitiveValueExpression } from 'slonik';
2
2
  export declare const extractCacheAttributes: (subject: string, values: readonly PrimitiveValueExpression[]) => {
3
3
  key: string;
4
4
  ttl: number;
package/package.json CHANGED
@@ -18,21 +18,24 @@
18
18
  "description": "Cache Slonik query results.",
19
19
  "devDependencies": {
20
20
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
21
+ "@semantic-release/commit-analyzer": "^9.0.2",
22
+ "@semantic-release/github": "^8.0.7",
23
+ "@semantic-release/npm": "^9.0.2",
21
24
  "ava": "^3.15.0",
22
25
  "coveralls": "^3.1.1",
23
26
  "del-cli": "^4.0.1",
24
- "eslint": "^8.4.1",
25
- "eslint-config-canonical": "^32.46.0",
27
+ "eslint-config-canonical": "^41.0.3",
28
+ "eslint": "^8.39.0",
26
29
  "husky": "^7.0.4",
27
30
  "inline-loops.macro": "^1.2.2",
28
31
  "nyc": "^15.1.0",
29
- "semantic-release": "^18.0.1",
32
+ "semantic-release": "^20.1.3",
30
33
  "sinon": "^12.0.1",
31
- "ts-node": "^10.4.0",
32
- "typescript": "^4.7.4"
34
+ "ts-node": "^10.9.1",
35
+ "typescript": "^5.0.4"
33
36
  },
34
37
  "engines": {
35
- "node": ">=8.0"
38
+ "node": ">=16.0"
36
39
  },
37
40
  "husky": {
38
41
  "hooks": {
@@ -53,11 +56,12 @@
53
56
  },
54
57
  "scripts": {
55
58
  "build": "del-cli ./dist && tsc",
56
- "lint": "eslint ./src ./test && tsc --noEmit",
57
- "test": "NODE_ENV=test nyc ava --verbose --serial"
59
+ "lint:eslint": "eslint ./src ./test",
60
+ "lint:tsc": "tsc --noEmit",
61
+ "test:ava": "nyc ava --verbose --serial"
58
62
  },
59
63
  "typings": "./dist/src/index.d.ts",
60
- "version": "2.4.0",
64
+ "version": "2.4.1",
61
65
  "peerDependencies": {
62
66
  "slonik": ">=27.0.0"
63
67
  },
@@ -1,15 +1,15 @@
1
- import type {
2
- Interceptor,
3
- Query,
4
- QueryResultRow,
5
- QueryResult,
6
- } from 'slonik';
7
1
  import {
8
2
  Logger,
9
3
  } from '../Logger';
10
4
  import {
11
5
  extractCacheAttributes,
12
6
  } from '../utilities';
7
+ import {
8
+ type Interceptor,
9
+ type Query,
10
+ type QueryResult,
11
+ type QueryResultRow,
12
+ } from 'slonik';
13
13
 
14
14
  const log = Logger.child({
15
15
  namespace: 'createQueryCacheInterceptor',
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createHash,
3
3
  } from 'node:crypto';
4
- import type {
5
- PrimitiveValueExpression,
4
+ import {
5
+ type PrimitiveValueExpression,
6
6
  } from 'slonik';
7
7
 
8
8
  export const extractCacheAttributes = (subject: string, values: readonly PrimitiveValueExpression[]) => {