@trunkrs/common 1.5.14 → 1.6.2
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/package.json +4 -2
- package/providers/aws.d.ts +1 -0
- package/providers/aws.js +4 -1
- package/providers/aws.js.map +1 -1
- package/services/aws/SecretsClient.d.ts +2 -2
- package/services/aws/SecretsClient.js +13 -7
- package/services/aws/SecretsClient.js.map +1 -1
- package/services/redis/RedisClient.d.ts +12 -0
- package/services/redis/RedisClient.js +49 -0
- package/services/redis/RedisClient.js.map +1 -0
- package/services/redis/index.d.ts +3 -0
- package/services/redis/index.js +11 -0
- package/services/redis/index.js.map +1 -0
- package/services/redis/types/SetCondition.d.ts +5 -0
- package/services/redis/types/SetCondition.js +9 -0
- package/services/redis/types/SetCondition.js.map +1 -0
- package/services/redis/types/SetOptions.d.ts +6 -0
- package/services/redis/types/SetOptions.js +3 -0
- package/services/redis/types/SetOptions.js.map +1 -0
- package/utils/caching/RedisCache.d.ts +15 -0
- package/utils/caching/RedisCache.js +48 -0
- package/utils/caching/RedisCache.js.map +1 -0
- package/utils/caching/index.d.ts +1 -0
- package/utils/caching/index.js +3 -1
- package/utils/caching/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trunkrs/common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "Common standards library for development in Trunkrs",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"repository": "https://github.com/Trunkrs/common.git",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"jest": "^27.0.5",
|
|
34
34
|
"prettier": "^2.1.2",
|
|
35
35
|
"ts-jest": "^27.0.5",
|
|
36
|
-
"typescript": "^4.2.4"
|
|
36
|
+
"typescript": "^4.2.4",
|
|
37
|
+
"redis": "^4.0.4"
|
|
37
38
|
},
|
|
38
39
|
"publishConfig": {
|
|
39
40
|
"access": "public"
|
|
@@ -47,6 +48,7 @@
|
|
|
47
48
|
"peerDependencies": {
|
|
48
49
|
"@typescript-eslint/eslint-plugin": ">=4 || <5",
|
|
49
50
|
"@typescript-eslint/parser": ">=4 || <5",
|
|
51
|
+
"redis": "^4.0.4",
|
|
50
52
|
"aws-sdk": ">2.1000.0 || <3",
|
|
51
53
|
"date-fns": ">=2 || <3",
|
|
52
54
|
"eslint": ">=7.2.0",
|
package/providers/aws.d.ts
CHANGED
package/providers/aws.js
CHANGED
|
@@ -22,11 +22,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.SecretsClientWithoutCache = void 0;
|
|
25
26
|
const service_provider_1 = __importStar(require("../utils/service-provider"));
|
|
26
|
-
const SecretsClient_1 = __importDefault(require("../services/aws/SecretsClient"));
|
|
27
27
|
const caching_1 = require("../utils/caching");
|
|
28
|
+
const SecretsClient_1 = __importDefault(require("../services/aws/SecretsClient"));
|
|
28
29
|
const utils_1 = __importDefault(require("./utils"));
|
|
29
30
|
const awsProvider = new service_provider_1.default();
|
|
31
|
+
exports.SecretsClientWithoutCache = service_provider_1.default.createSymbol('SecretsClientWithoutCache');
|
|
30
32
|
awsProvider.register(SecretsClient_1.default, service_provider_1.Lifecycle.Singleton, () => new SecretsClient_1.default(utils_1.default.provide(caching_1.MemoryCache)));
|
|
33
|
+
awsProvider.register(exports.SecretsClientWithoutCache, service_provider_1.Lifecycle.Singleton);
|
|
31
34
|
exports.default = awsProvider;
|
|
32
35
|
//# sourceMappingURL=aws.js.map
|
package/providers/aws.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aws.js","sourceRoot":"","sources":["../../providers/aws.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aws.js","sourceRoot":"","sources":["../../providers/aws.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAAsE;AACtE,8CAA8C;AAC9C,kFAAyD;AAEzD,oDAAmC;AAEnC,MAAM,WAAW,GAAG,IAAI,0BAAe,EAAE,CAAA;AAE5B,QAAA,yBAAyB,GACpC,0BAAe,CAAC,YAAY,CAAgB,2BAA2B,CAAC,CAAA;AAE1E,WAAW,CAAC,QAAQ,CAClB,uBAAa,EACb,4BAAS,CAAC,SAAS,EACnB,GAAG,EAAE,CAAC,IAAI,uBAAa,CAAC,eAAa,CAAC,OAAO,CAAC,qBAAW,CAAC,CAAC,CAC5D,CAAA;AAED,WAAW,CAAC,QAAQ,CAAC,iCAAyB,EAAE,4BAAS,CAAC,SAAS,CAAC,CAAA;AAEpE,kBAAe,WAAW,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Cache from '../../utils/caching/Cache';
|
|
2
2
|
declare class SecretsClient {
|
|
3
|
-
private readonly cache
|
|
3
|
+
private readonly cache?;
|
|
4
4
|
private readonly secretsManager;
|
|
5
|
-
constructor(cache
|
|
5
|
+
constructor(cache?: Cache | undefined);
|
|
6
6
|
getSecretValue(secretName: string): Promise<string | undefined>;
|
|
7
7
|
updateSecretValue(secretName: string, secretValue: string): Promise<void>;
|
|
8
8
|
}
|
|
@@ -7,13 +7,17 @@ class SecretsClient {
|
|
|
7
7
|
this.secretsManager = new aws_sdk_1.SecretsManager();
|
|
8
8
|
}
|
|
9
9
|
async getSecretValue(secretName) {
|
|
10
|
-
const
|
|
10
|
+
const getSecret = async () => {
|
|
11
11
|
const secret = await this.secretsManager
|
|
12
12
|
.getSecretValue({ SecretId: secretName })
|
|
13
13
|
.promise();
|
|
14
14
|
return secret.SecretString;
|
|
15
|
-
}
|
|
16
|
-
|
|
15
|
+
};
|
|
16
|
+
if (this.cache) {
|
|
17
|
+
const secretValue = await this.cache.getOrAdd(secretName, getSecret);
|
|
18
|
+
return secretValue;
|
|
19
|
+
}
|
|
20
|
+
return getSecret();
|
|
17
21
|
}
|
|
18
22
|
async updateSecretValue(secretName, secretValue) {
|
|
19
23
|
await this.secretsManager
|
|
@@ -22,11 +26,13 @@ class SecretsClient {
|
|
|
22
26
|
SecretString: secretValue,
|
|
23
27
|
})
|
|
24
28
|
.promise();
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
if (this.cache) {
|
|
30
|
+
const isCacheNotEmpty = await this.cache.hasKey(secretName);
|
|
31
|
+
if (isCacheNotEmpty) {
|
|
32
|
+
await this.cache.remove(secretName);
|
|
33
|
+
}
|
|
34
|
+
await this.cache.add(secretName, secretValue);
|
|
28
35
|
}
|
|
29
|
-
await this.cache.add(secretName, secretValue);
|
|
30
36
|
}
|
|
31
37
|
}
|
|
32
38
|
exports.default = SecretsClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretsClient.js","sourceRoot":"","sources":["../../../services/aws/SecretsClient.ts"],"names":[],"mappings":";;AAAA,qCAAwC;AAIxC,MAAM,aAAa;IAGjB,YAAoC,
|
|
1
|
+
{"version":3,"file":"SecretsClient.js","sourceRoot":"","sources":["../../../services/aws/SecretsClient.ts"],"names":[],"mappings":";;AAAA,qCAAwC;AAIxC,MAAM,aAAa;IAGjB,YAAoC,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;QAFhC,mBAAc,GAAG,IAAI,wBAAc,EAAE,CAAA;IAEF,CAAC;IAE9C,KAAK,CAAC,cAAc,CAAC,UAAkB;QAC5C,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;YAC3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc;iBACrC,cAAc,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;iBACxC,OAAO,EAAE,CAAA;YAEZ,OAAO,MAAM,CAAC,YAAY,CAAA;QAC5B,CAAC,CAAA;QAED,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAC3C,UAAU,EACV,SAAS,CACV,CAAA;YAED,OAAO,WAAW,CAAA;SACnB;QAED,OAAO,SAAS,EAAE,CAAA;IACpB,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAC5B,UAAkB,EAClB,WAAmB;QAEnB,MAAM,IAAI,CAAC,cAAc;aACtB,cAAc,CAAC;YACd,QAAQ,EAAE,UAAU;YACpB,YAAY,EAAE,WAAW;SAC1B,CAAC;aACD,OAAO,EAAE,CAAA;QAEZ,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;YAC3D,IAAI,eAAe,EAAE;gBACnB,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;aACpC;YAED,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,CAAC,CAAA;SAC9C;IACH,CAAC;CACF;AAED,kBAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RedisClientType } from 'redis';
|
|
2
|
+
import SetOptions from './types/SetOptions';
|
|
3
|
+
declare class RedisClient {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: RedisClientType);
|
|
6
|
+
set(key: string, value: string, options?: SetOptions): Promise<void>;
|
|
7
|
+
get(key: string): Promise<string | null>;
|
|
8
|
+
getOrSet(key: string, factory: () => Promise<string>, setOptions?: SetOptions): Promise<string>;
|
|
9
|
+
delete(...keys: string[]): Promise<void>;
|
|
10
|
+
clear(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export default RedisClient;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class RedisClient {
|
|
4
|
+
constructor(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
}
|
|
7
|
+
async set(key, value, options) {
|
|
8
|
+
const commandOptions = {};
|
|
9
|
+
if (options === null || options === void 0 ? void 0 : options.expiresAt) {
|
|
10
|
+
Object.assign(commandOptions, {
|
|
11
|
+
PXAT: options.expiresAt.getTime(),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
if (options === null || options === void 0 ? void 0 : options.setCondition) {
|
|
15
|
+
Object.assign(commandOptions, {
|
|
16
|
+
[options.setCondition]: true,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
await this.client.connect();
|
|
20
|
+
await this.client.set(key, value, commandOptions);
|
|
21
|
+
await this.client.disconnect();
|
|
22
|
+
}
|
|
23
|
+
async get(key) {
|
|
24
|
+
await this.client.connect();
|
|
25
|
+
const item = await this.client.get(key);
|
|
26
|
+
await this.client.disconnect();
|
|
27
|
+
return item;
|
|
28
|
+
}
|
|
29
|
+
async getOrSet(key, factory, setOptions) {
|
|
30
|
+
let value = await this.get(key);
|
|
31
|
+
if (!value) {
|
|
32
|
+
value = await factory();
|
|
33
|
+
await this.set(key, value, setOptions);
|
|
34
|
+
}
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
async delete(...keys) {
|
|
38
|
+
await this.client.connect();
|
|
39
|
+
await this.client.del(keys);
|
|
40
|
+
await this.client.disconnect();
|
|
41
|
+
}
|
|
42
|
+
async clear() {
|
|
43
|
+
await this.client.connect();
|
|
44
|
+
await this.client.FLUSHALL();
|
|
45
|
+
await this.client.disconnect();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.default = RedisClient;
|
|
49
|
+
//# sourceMappingURL=RedisClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RedisClient.js","sourceRoot":"","sources":["../../../services/redis/RedisClient.ts"],"names":[],"mappings":";;AAIA,MAAM,WAAW;IACf,YAA6B,MAAuB;QAAvB,WAAM,GAAN,MAAM,CAAiB;IAAG,CAAC;IASjD,KAAK,CAAC,GAAG,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,CAAC;IAOM,KAAK,CAAC,MAAM,CAAC,GAAG,IAAc;QACnC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAA;QAC3B,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC3B,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAA;IAChC,CAAC;IAMM,KAAK,CAAC,KAAK;QAChB,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAA;QAC3B,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAA;QAC5B,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAA;IAChC,CAAC;CACF;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SetCondition = exports.RedisClient = void 0;
|
|
7
|
+
var RedisClient_1 = require("./RedisClient");
|
|
8
|
+
Object.defineProperty(exports, "RedisClient", { enumerable: true, get: function () { return __importDefault(RedisClient_1).default; } });
|
|
9
|
+
var SetCondition_1 = require("./types/SetCondition");
|
|
10
|
+
Object.defineProperty(exports, "SetCondition", { enumerable: true, get: function () { return __importDefault(SetCondition_1).default; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../services/redis/index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAsD;AAA7C,2HAAA,OAAO,OAAe;AAC/B,qDAA8D;AAArD,6HAAA,OAAO,OAAgB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var SetCondition;
|
|
4
|
+
(function (SetCondition) {
|
|
5
|
+
SetCondition["IfNotExists"] = "NX";
|
|
6
|
+
SetCondition["IfExists"] = "XX";
|
|
7
|
+
})(SetCondition || (SetCondition = {}));
|
|
8
|
+
exports.default = SetCondition;
|
|
9
|
+
//# sourceMappingURL=SetCondition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetCondition.js","sourceRoot":"","sources":["../../../../services/redis/types/SetCondition.ts"],"names":[],"mappings":";;AAAA,IAAK,YAGJ;AAHD,WAAK,YAAY;IACf,kCAAkB,CAAA;IAClB,+BAAe,CAAA;AACjB,CAAC,EAHI,YAAY,KAAZ,YAAY,QAGhB;AAED,kBAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetOptions.js","sourceRoot":"","sources":["../../../../services/redis/types/SetOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Cache from './Cache';
|
|
2
|
+
import RedisClient from '../../services/redis/RedisClient';
|
|
3
|
+
import { Serializer } from '../serialization';
|
|
4
|
+
declare class RedisCache extends Cache {
|
|
5
|
+
private readonly client;
|
|
6
|
+
private readonly serializer;
|
|
7
|
+
constructor(stalenessTimeout: number, client: RedisClient, serializer: Serializer);
|
|
8
|
+
add<TValue>(key: string, value: TValue): Promise<void>;
|
|
9
|
+
clear(): Promise<void>;
|
|
10
|
+
get<TValue>(key: string): Promise<TValue | null>;
|
|
11
|
+
getOrAdd<TValue>(key: string, factory: () => Promise<TValue>): Promise<TValue>;
|
|
12
|
+
hasKey(key: string): Promise<boolean>;
|
|
13
|
+
remove(key: string): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export default RedisCache;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Cache_1 = __importDefault(require("./Cache"));
|
|
7
|
+
class RedisCache extends Cache_1.default {
|
|
8
|
+
constructor(stalenessTimeout, client, serializer) {
|
|
9
|
+
super(stalenessTimeout);
|
|
10
|
+
this.client = client;
|
|
11
|
+
this.serializer = serializer;
|
|
12
|
+
}
|
|
13
|
+
async add(key, value) {
|
|
14
|
+
const item = this.createItem(value);
|
|
15
|
+
const serializedItem = this.serializer.serialize(item, 'string');
|
|
16
|
+
await this.client.set(key, serializedItem, { expiresAt: item.expiration });
|
|
17
|
+
}
|
|
18
|
+
async clear() {
|
|
19
|
+
await this.client.clear();
|
|
20
|
+
}
|
|
21
|
+
async get(key) {
|
|
22
|
+
const item = await this.client.get(key);
|
|
23
|
+
if (!item) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const deserializedItem = this.serializer.deserialize(item);
|
|
27
|
+
return deserializedItem.value;
|
|
28
|
+
}
|
|
29
|
+
async getOrAdd(key, factory) {
|
|
30
|
+
const item = await this.client.get(key);
|
|
31
|
+
if (!item) {
|
|
32
|
+
const newValue = await factory();
|
|
33
|
+
await this.add(key, newValue);
|
|
34
|
+
return newValue;
|
|
35
|
+
}
|
|
36
|
+
const deserializedItem = this.serializer.deserialize(item);
|
|
37
|
+
return deserializedItem.value;
|
|
38
|
+
}
|
|
39
|
+
async hasKey(key) {
|
|
40
|
+
const item = await this.client.get(key);
|
|
41
|
+
return !!item;
|
|
42
|
+
}
|
|
43
|
+
async remove(key) {
|
|
44
|
+
await this.client.delete(key);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.default = RedisCache;
|
|
48
|
+
//# sourceMappingURL=RedisCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RedisCache.js","sourceRoot":"","sources":["../../../utils/caching/RedisCache.ts"],"names":[],"mappings":";;;;;AAAA,oD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B,OAAO,QAAQ,CAAA;SAChB;QAED,MAAM,gBAAgB,GAAc,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QACrE,OAAO,gBAAgB,CAAC,KAAe,CAAA;IACzC,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,GAAW;QAC7B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAEvC,OAAO,CAAC,CAAC,IAAI,CAAA;IACf,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,GAAW;QAC7B,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC/B,CAAC;CACF;AAED,kBAAe,UAAU,CAAA"}
|
package/utils/caching/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export { default as GlobalAtomicCache } from './GlobalAtomicCache';
|
|
|
4
4
|
export { default as MemoryCache } from './MemoryCache';
|
|
5
5
|
export { default as SecretCache } from './SecretCache';
|
|
6
6
|
export { default as S3Cache } from './S3Cache';
|
|
7
|
+
export { default as RedisCache } from './RedisCache';
|
package/utils/caching/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.S3Cache = exports.SecretCache = exports.MemoryCache = exports.GlobalAtomicCache = exports.FileCache = exports.Cache = void 0;
|
|
6
|
+
exports.RedisCache = exports.S3Cache = exports.SecretCache = exports.MemoryCache = exports.GlobalAtomicCache = exports.FileCache = exports.Cache = void 0;
|
|
7
7
|
var Cache_1 = require("./Cache");
|
|
8
8
|
Object.defineProperty(exports, "Cache", { enumerable: true, get: function () { return __importDefault(Cache_1).default; } });
|
|
9
9
|
var FileCache_1 = require("./FileCache");
|
|
@@ -16,4 +16,6 @@ var SecretCache_1 = require("./SecretCache");
|
|
|
16
16
|
Object.defineProperty(exports, "SecretCache", { enumerable: true, get: function () { return __importDefault(SecretCache_1).default; } });
|
|
17
17
|
var S3Cache_1 = require("./S3Cache");
|
|
18
18
|
Object.defineProperty(exports, "S3Cache", { enumerable: true, get: function () { return __importDefault(S3Cache_1).default; } });
|
|
19
|
+
var RedisCache_1 = require("./RedisCache");
|
|
20
|
+
Object.defineProperty(exports, "RedisCache", { enumerable: true, get: function () { return __importDefault(RedisCache_1).default; } });
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../utils/caching/index.ts"],"names":[],"mappings":";;;;;;AAAA,iCAA0C;AAAjC,+GAAA,OAAO,OAAS;AAEzB,yCAAkD;AAAzC,uHAAA,OAAO,OAAa;AAC7B,yDAAkE;AAAzD,uIAAA,OAAO,OAAqB;AACrC,6CAAsD;AAA7C,2HAAA,OAAO,OAAe;AAC/B,6CAAsD;AAA7C,2HAAA,OAAO,OAAe;AAC/B,qCAA8C;AAArC,mHAAA,OAAO,OAAW"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../utils/caching/index.ts"],"names":[],"mappings":";;;;;;AAAA,iCAA0C;AAAjC,+GAAA,OAAO,OAAS;AAEzB,yCAAkD;AAAzC,uHAAA,OAAO,OAAa;AAC7B,yDAAkE;AAAzD,uIAAA,OAAO,OAAqB;AACrC,6CAAsD;AAA7C,2HAAA,OAAO,OAAe;AAC/B,6CAAsD;AAA7C,2HAAA,OAAO,OAAe;AAC/B,qCAA8C;AAArC,mHAAA,OAAO,OAAW;AAC3B,2CAAoD;AAA3C,yHAAA,OAAO,OAAc"}
|