@unito/integration-sdk 1.0.2 → 1.0.3

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.
@@ -212,7 +212,7 @@ class Cache {
212
212
  * @returns A cache instance.
213
213
  */
214
214
  static create(redisUrl) {
215
- const cacheInstance = redisUrl ? new cachette.WriteThroughCache(redisUrl) : new cachette.LocalCache();
215
+ const cacheInstance = redisUrl ? new cachette.RedisCache(redisUrl) : new cachette.LocalCache();
216
216
  // Intended: the correlation id will be the same for all logs of Cachette.
217
217
  const correlationId = uuid__namespace.v4();
218
218
  const logger = new Logger({ correlation_id: correlationId });
@@ -1,4 +1,4 @@
1
- import { WriteThroughCache, LocalCache } from 'cachette';
1
+ import { LocalCache, RedisCache } from 'cachette';
2
2
  import * as uuid from 'uuid';
3
3
  import Logger from './logger.js';
4
4
  /**
@@ -78,7 +78,7 @@ export class Cache {
78
78
  * @returns A cache instance.
79
79
  */
80
80
  static create(redisUrl) {
81
- const cacheInstance = redisUrl ? new WriteThroughCache(redisUrl) : new LocalCache();
81
+ const cacheInstance = redisUrl ? new RedisCache(redisUrl) : new LocalCache();
82
82
  // Intended: the correlation id will be the same for all logs of Cachette.
83
83
  const correlationId = uuid.v4();
84
84
  const logger = new Logger({ correlation_id: correlationId });
@@ -10,7 +10,7 @@ describe('Cache', () => {
10
10
  assert.ok(cache['cacheInstance'] instanceof LocalCache);
11
11
  await cache['cacheInstance'].quit();
12
12
  });
13
- it('redis url returns (tries) WriteThroughCache', () => {
13
+ it('redis url tries to return a RedisCache', () => {
14
14
  assert.throws(() => Cache.create('fakeredis'), Error, 'Invalid redis url fakereis.');
15
15
  });
16
16
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unito/integration-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Integration SDK",
5
5
  "type": "module",
6
6
  "types": "dist/src/index.d.ts",
@@ -1,4 +1,4 @@
1
- import { WriteThroughCache, LocalCache, CacheInstance, FetchingFunction, CachableValue } from 'cachette';
1
+ import { LocalCache, CacheInstance, FetchingFunction, CachableValue, RedisCache } from 'cachette';
2
2
  import * as uuid from 'uuid';
3
3
  import Logger from './logger.js';
4
4
 
@@ -92,7 +92,7 @@ export class Cache {
92
92
  * @returns A cache instance.
93
93
  */
94
94
  public static create(redisUrl?: string): Cache {
95
- const cacheInstance: CacheInstance = redisUrl ? new WriteThroughCache(redisUrl) : new LocalCache();
95
+ const cacheInstance: CacheInstance = redisUrl ? new RedisCache(redisUrl) : new LocalCache();
96
96
 
97
97
  // Intended: the correlation id will be the same for all logs of Cachette.
98
98
  const correlationId = uuid.v4();
@@ -14,7 +14,7 @@ describe('Cache', () => {
14
14
  await cache['cacheInstance'].quit();
15
15
  });
16
16
 
17
- it('redis url returns (tries) WriteThroughCache', () => {
17
+ it('redis url tries to return a RedisCache', () => {
18
18
  assert.throws(() => Cache.create('fakeredis'), Error, 'Invalid redis url fakereis.');
19
19
  });
20
20
  });