cloudstructs 0.4.0 → 0.4.4
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/.jsii +3 -3
- package/assets/codecommit-mirror/docker/mirror.sh +0 -0
- package/changelog.md +2 -0
- package/lib/codecommit-mirror/index.js +2 -2
- package/lib/ecs-service-roller/index.js +2 -2
- package/lib/email-receiver/receiver.js +1 -1
- package/lib/saml-identity-provider/index.js +2 -2
- package/lib/slack-app/manifest.js +1 -1
- package/lib/slack-app/slack-app.js +2 -2
- package/lib/slack-events/index.js +1 -1
- package/lib/slack-textract/index.js +1 -1
- package/lib/state-machine-cr-provider/index.js +1 -1
- package/lib/static-website/index.js +1 -1
- package/lib/url-shortener/index.js +1 -1
- package/node_modules/@sindresorhus/is/dist/index.d.ts +4 -2
- package/node_modules/@sindresorhus/is/dist/index.js +3 -1
- package/node_modules/@sindresorhus/is/package.json +1 -1
- package/node_modules/@sindresorhus/is/readme.md +23 -0
- package/node_modules/@slack/logger/node_modules/@types/node/README.md +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/async_hooks.d.ts +7 -3
- package/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +9 -9
- package/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +12 -10
- package/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +17 -12
- package/node_modules/@slack/logger/node_modules/@types/node/domain.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +2 -2
- package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +5 -5
- package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +62 -11
- package/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +3 -3
- package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +31 -4
- package/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +6 -6
- package/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +1 -2
- package/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +4 -5
- package/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +15 -14
- package/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/package.json +2 -7
- package/node_modules/@slack/logger/node_modules/@types/node/path.d.ts +9 -1
- package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +6 -4
- package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +121 -14
- package/node_modules/@slack/logger/node_modules/@types/node/repl.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +3 -65
- package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +10 -10
- package/node_modules/@slack/logger/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +3 -2
- package/node_modules/@slack/logger/node_modules/@types/node/trace_events.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +58 -18
- package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +3 -3
- package/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +3 -3
- package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +4 -4
- package/node_modules/@slack/logger/node_modules/@types/node/zlib.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/async_hooks.d.ts +7 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/buffer.d.ts +9 -9
- package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/cluster.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/diagnostics_channel.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +12 -10
- package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +17 -12
- package/node_modules/@slack/web-api/node_modules/@types/node/domain.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +5 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +62 -11
- package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +3 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +31 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +6 -6
- package/node_modules/@slack/web-api/node_modules/@types/node/https.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +1 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +4 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +15 -14
- package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -7
- package/node_modules/@slack/web-api/node_modules/@types/node/path.d.ts +9 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +6 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +121 -14
- package/node_modules/@slack/web-api/node_modules/@types/node/repl.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +3 -65
- package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +10 -10
- package/node_modules/@slack/web-api/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/timers.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +3 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/trace_events.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/tty.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +58 -18
- package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +3 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +3 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +4 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/zlib.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +3 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +11 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +3 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +0 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +4 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +2 -7
- package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +8 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +2 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +8 -8
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +2 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/is-stream/node_modules/@types/node/globals.d.ts +3 -3
- package/node_modules/@types/is-stream/node_modules/@types/node/http.d.ts +11 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/http2.d.ts +3 -3
- package/node_modules/@types/is-stream/node_modules/@types/node/index.d.ts +0 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/net.d.ts +4 -3
- package/node_modules/@types/is-stream/node_modules/@types/node/package.json +2 -7
- package/node_modules/@types/is-stream/node_modules/@types/node/path.d.ts +8 -0
- package/node_modules/@types/is-stream/node_modules/@types/node/perf_hooks.d.ts +2 -0
- package/node_modules/@types/is-stream/node_modules/@types/node/process.d.ts +1 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/stream.d.ts +8 -8
- package/node_modules/@types/is-stream/node_modules/@types/node/tls.d.ts +2 -1
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +3 -3
- package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +11 -1
- package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +3 -3
- package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +0 -1
- package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +4 -3
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +2 -7
- package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +8 -0
- package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +2 -0
- package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +8 -8
- package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +2 -1
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +3 -3
- package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +11 -1
- package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +3 -3
- package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +0 -1
- package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +4 -3
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +2 -7
- package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +8 -0
- package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +2 -0
- package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +8 -8
- package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +2 -1
- package/node_modules/follow-redirects/index.js +2 -2
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/keyv/.nyc_output/37411020-4142-4b08-b825-343ba2427bf7.json +1 -0
- package/node_modules/keyv/.nyc_output/cd79f2de-c8b8-4493-bc15-b2bde28efa4b.json +1 -0
- package/node_modules/keyv/.nyc_output/processinfo/37411020-4142-4b08-b825-343ba2427bf7.json +1 -0
- package/node_modules/keyv/.nyc_output/processinfo/cd79f2de-c8b8-4493-bc15-b2bde28efa4b.json +1 -0
- package/node_modules/keyv/.nyc_output/processinfo/index.json +1 -0
- package/node_modules/keyv/README.md +9 -8
- package/node_modules/keyv/package.json +5 -7
- package/node_modules/keyv/test/test.js +132 -0
- package/node_modules/keyv/test/testdb.sqlite +0 -0
- package/package.json +20 -16
- package/releasetag.txt +1 -0
- package/version.txt +1 -0
- package/node_modules/keyv/LICENSE +0 -21
|
@@ -102,13 +102,13 @@ const keyv = new Keyv({ serialize: JSON.stringify, deserialize: JSON.parse });
|
|
|
102
102
|
|
|
103
103
|
The official storage adapters are covered by [over 150 integration tests](https://github.com/jaredwray/keyv/actions/workflows/build.yaml) to guarantee consistent behaviour. They are lightweight, efficient wrappers over the DB clients making use of indexes and native TTLs where available.
|
|
104
104
|
|
|
105
|
-
Database | Adapter | Native TTL
|
|
106
|
-
|
|
107
|
-
Redis | [@keyv/redis](https://github.com/
|
|
108
|
-
MongoDB | [@keyv/mongo](https://github.com/
|
|
109
|
-
SQLite | [@keyv/sqlite](https://github.com/
|
|
110
|
-
PostgreSQL | [@keyv/postgres](https://github.com/
|
|
111
|
-
MySQL | [@keyv/mysql](https://github.com/
|
|
105
|
+
Database | Adapter | Native TTL
|
|
106
|
+
---|---|---
|
|
107
|
+
Redis | [@keyv/redis](https://github.com/jaredwray/keyv/tree/master/packages/redis) | Yes
|
|
108
|
+
MongoDB | [@keyv/mongo](https://github.com/jaredwray/keyv/tree/master/packages/mongo) | Yes
|
|
109
|
+
SQLite | [@keyv/sqlite](https://github.com/jaredwray/keyv/tree/master/packages/sqlite) | No
|
|
110
|
+
PostgreSQL | [@keyv/postgres](https://github.com/jaredwray/keyv/tree/master/packages/postgres) | No
|
|
111
|
+
MySQL | [@keyv/mysql](https://github.com/jaredwray/keyv/tree/master/packages/mysql) | No
|
|
112
112
|
|
|
113
113
|
## Third-party Storage Adapters
|
|
114
114
|
|
|
@@ -146,7 +146,8 @@ The following are third-party storage adapters compatible with Keyv:
|
|
|
146
146
|
- [keyv-null](https://www.npmjs.com/package/keyv-null) - Null storage adapter for Keyv
|
|
147
147
|
- [keyv-firestore ](https://github.com/goto-bus-stop/keyv-firestore) – Firebase Cloud Firestore adapter for Keyv
|
|
148
148
|
- [keyv-mssql](https://github.com/pmorgan3/keyv-mssql) - Microsoft Sql Server adapter for Keyv
|
|
149
|
-
- [keyv-memcache](https://github.com/jaredwray/keyv
|
|
149
|
+
- [keyv-memcache](https://github.com/jaredwray/keyv/tree/master/packages/memcache) - Memcache storage adapter for Keyv
|
|
150
|
+
- [keyv-azuretable](https://github.com/howlowck/keyv-azuretable) - Azure Table Storage/API adapter for Keyv
|
|
150
151
|
|
|
151
152
|
## Add Cache Support to your Module
|
|
152
153
|
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keyv",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "Simple key-value storage with support for multiple backends",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "xo && nyc ava
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"test:services:stop": "docker-compose -f ./test/storage-adapters/services-compose.yaml down -v",
|
|
11
|
-
"coverage": "nyc report --reporter=text-lcov > coverage.lcov"
|
|
7
|
+
"test": "xo && nyc ava --serial",
|
|
8
|
+
"coverage": "nyc report --reporter=text-lcov > coverage.lcov",
|
|
9
|
+
"clean": "rm -rf node_modules && rm -rf .nyc_output && rm -rf coverage.lcov && rm -rf ./test/testdb.sqlite"
|
|
12
10
|
},
|
|
13
11
|
"xo": {
|
|
14
12
|
"extends": "xo-lukechilds",
|
|
@@ -44,8 +42,8 @@
|
|
|
44
42
|
"@keyv/sqlite": "*",
|
|
45
43
|
"@keyv/test-suite": "*",
|
|
46
44
|
"ava": "^3.15.0",
|
|
47
|
-
"codecov": "^3.8.3",
|
|
48
45
|
"eslint-config-xo-lukechilds": "^1.0.0",
|
|
46
|
+
"eslint-plugin-promise": "^5.1.1",
|
|
49
47
|
"nyc": "^15.1.0",
|
|
50
48
|
"this": "^1.0.2",
|
|
51
49
|
"timekeeper": "^2.0.0",
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
const test = require('ava');
|
|
2
|
+
const keyvTestSuite = require('@keyv/test-suite').default;
|
|
3
|
+
const { keyvOfficialTests } = require('@keyv/test-suite');
|
|
4
|
+
const Keyv = require('this');
|
|
5
|
+
const tk = require('timekeeper');
|
|
6
|
+
const KeyvSqlite = require('@keyv/sqlite');
|
|
7
|
+
|
|
8
|
+
keyvOfficialTests(test, Keyv, 'sqlite://test/testdb.sqlite', 'sqlite://non/existent/database.sqlite');
|
|
9
|
+
|
|
10
|
+
const store = () => new KeyvSqlite({ uri: 'sqlite://test/testdb.sqlite', busyTimeout: 3000 });
|
|
11
|
+
keyvTestSuite(test, Keyv, store);
|
|
12
|
+
|
|
13
|
+
test.serial('Keyv is a class', t => {
|
|
14
|
+
t.is(typeof Keyv, 'function');
|
|
15
|
+
t.throws(() => Keyv()); // eslint-disable-line new-cap
|
|
16
|
+
t.notThrows(() => new Keyv());
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test.serial('Keyv accepts storage adapters', async t => {
|
|
20
|
+
const store = new Map();
|
|
21
|
+
const keyv = new Keyv({ store });
|
|
22
|
+
t.is(store.size, 0);
|
|
23
|
+
await keyv.set('foo', 'bar');
|
|
24
|
+
t.is(await keyv.get('foo'), 'bar');
|
|
25
|
+
t.is(store.size, 1);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test.serial('Keyv passes tll info to stores', async t => {
|
|
29
|
+
t.plan(1);
|
|
30
|
+
const store = new Map();
|
|
31
|
+
const storeSet = store.set;
|
|
32
|
+
store.set = (key, value, ttl) => {
|
|
33
|
+
t.is(ttl, 100);
|
|
34
|
+
storeSet.call(store, key, value, ttl);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const keyv = new Keyv({ store });
|
|
38
|
+
await keyv.set('foo', 'bar', 100);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test.serial('Keyv respects default tll option', async t => {
|
|
42
|
+
const store = new Map();
|
|
43
|
+
const keyv = new Keyv({ store, ttl: 100 });
|
|
44
|
+
await keyv.set('foo', 'bar');
|
|
45
|
+
t.is(await keyv.get('foo'), 'bar');
|
|
46
|
+
tk.freeze(Date.now() + 150);
|
|
47
|
+
t.is(await keyv.get('foo'), undefined);
|
|
48
|
+
t.is(store.size, 0);
|
|
49
|
+
tk.reset();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test.serial('.set(key, val, ttl) overwrites default tll option', async t => {
|
|
53
|
+
const startTime = Date.now();
|
|
54
|
+
tk.freeze(startTime);
|
|
55
|
+
const store = new Map();
|
|
56
|
+
const keyv = new Keyv({ store, ttl: 200 });
|
|
57
|
+
await keyv.set('foo', 'bar');
|
|
58
|
+
await keyv.set('fizz', 'buzz', 100);
|
|
59
|
+
await keyv.set('ping', 'pong', 300);
|
|
60
|
+
t.is(await keyv.get('foo'), 'bar');
|
|
61
|
+
t.is(await keyv.get('fizz'), 'buzz');
|
|
62
|
+
t.is(await keyv.get('ping'), 'pong');
|
|
63
|
+
tk.freeze(startTime + 150);
|
|
64
|
+
t.is(await keyv.get('foo'), 'bar');
|
|
65
|
+
t.is(await keyv.get('fizz'), undefined);
|
|
66
|
+
t.is(await keyv.get('ping'), 'pong');
|
|
67
|
+
tk.freeze(startTime + 250);
|
|
68
|
+
t.is(await keyv.get('foo'), undefined);
|
|
69
|
+
t.is(await keyv.get('ping'), 'pong');
|
|
70
|
+
tk.freeze(startTime + 350);
|
|
71
|
+
t.is(await keyv.get('ping'), undefined);
|
|
72
|
+
tk.reset();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test.serial('.set(key, val, ttl) where ttl is "0" overwrites default tll option and sets key to never expire', async t => {
|
|
76
|
+
const startTime = Date.now();
|
|
77
|
+
tk.freeze(startTime);
|
|
78
|
+
const store = new Map();
|
|
79
|
+
const keyv = new Keyv({ store, ttl: 200 });
|
|
80
|
+
await keyv.set('foo', 'bar', 0);
|
|
81
|
+
t.is(await keyv.get('foo'), 'bar');
|
|
82
|
+
tk.freeze(startTime + 250);
|
|
83
|
+
t.is(await keyv.get('foo'), 'bar');
|
|
84
|
+
tk.reset();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test.serial('.get(key, {raw: true}) returns the raw object instead of the value', async t => {
|
|
88
|
+
const store = new Map();
|
|
89
|
+
const keyv = new Keyv({ store });
|
|
90
|
+
await keyv.set('foo', 'bar');
|
|
91
|
+
const value = await keyv.get('foo');
|
|
92
|
+
const rawObject = await keyv.get('foo', { raw: true });
|
|
93
|
+
t.is(value, 'bar');
|
|
94
|
+
t.is(rawObject.value, 'bar');
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test.serial('Keyv uses custom serializer when provided instead of json-buffer', async t => {
|
|
98
|
+
t.plan(3);
|
|
99
|
+
const store = new Map();
|
|
100
|
+
const serialize = data => {
|
|
101
|
+
t.pass();
|
|
102
|
+
return JSON.stringify(data);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const deserialize = data => {
|
|
106
|
+
t.pass();
|
|
107
|
+
return JSON.parse(data);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const keyv = new Keyv({ store, serialize, deserialize });
|
|
111
|
+
await keyv.set('foo', 'bar');
|
|
112
|
+
t.is(await keyv.get('foo'), 'bar');
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test.serial('Keyv supports async serializer/deserializer', async t => {
|
|
116
|
+
t.plan(3);
|
|
117
|
+
const store = new Map();
|
|
118
|
+
|
|
119
|
+
const serialize = async data => {
|
|
120
|
+
t.pass();
|
|
121
|
+
return JSON.stringify(data);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const deserialize = async data => {
|
|
125
|
+
t.pass();
|
|
126
|
+
return JSON.parse(data);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const keyv = new Keyv({ store, serialize, deserialize });
|
|
130
|
+
await keyv.set('foo', 'bar');
|
|
131
|
+
t.is(await keyv.get('foo'), 'bar');
|
|
132
|
+
});
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -19,8 +19,12 @@
|
|
|
19
19
|
"integ:slack-app:destroy": "npx projen integ:slack-app:destroy",
|
|
20
20
|
"integ:slack-app:snapshot": "npx projen integ:slack-app:snapshot",
|
|
21
21
|
"integ:slack-app:watch": "npx projen integ:slack-app:watch",
|
|
22
|
+
"integ:snapshot-all": "npx projen integ:snapshot-all",
|
|
22
23
|
"package": "npx projen package",
|
|
24
|
+
"package-all": "npx projen package-all",
|
|
25
|
+
"package:js": "npx projen package:js",
|
|
23
26
|
"post-compile": "npx projen post-compile",
|
|
27
|
+
"post-upgrade": "npx projen post-upgrade",
|
|
24
28
|
"pre-compile": "npx projen pre-compile",
|
|
25
29
|
"release": "npx projen release",
|
|
26
30
|
"test": "npx projen test",
|
|
@@ -38,34 +42,33 @@
|
|
|
38
42
|
"organization": false
|
|
39
43
|
},
|
|
40
44
|
"devDependencies": {
|
|
41
|
-
"@aws-cdk/aws-apigatewayv2-alpha": "
|
|
42
|
-
"@aws-cdk/aws-apigatewayv2-integrations-alpha": "
|
|
43
|
-
"@types/aws-lambda": "^8.10.
|
|
45
|
+
"@aws-cdk/aws-apigatewayv2-alpha": "2.1.0-alpha.0",
|
|
46
|
+
"@aws-cdk/aws-apigatewayv2-integrations-alpha": "2.1.0-alpha.0",
|
|
47
|
+
"@types/aws-lambda": "^8.10.90",
|
|
44
48
|
"@types/jest": "^26.0.24",
|
|
45
49
|
"@types/node": "^12",
|
|
46
50
|
"@types/tsscmp": "^1.0.0",
|
|
47
51
|
"@typescript-eslint/eslint-plugin": "^5",
|
|
48
52
|
"@typescript-eslint/parser": "^5",
|
|
49
|
-
"aws-cdk": "^2
|
|
53
|
+
"aws-cdk": "^2",
|
|
50
54
|
"aws-cdk-lib": "2.1.0",
|
|
51
|
-
"aws-sdk": "^2.
|
|
52
|
-
"aws-sdk-mock": "^5.5.
|
|
55
|
+
"aws-sdk": "^2.1059.0",
|
|
56
|
+
"aws-sdk-mock": "^5.5.1",
|
|
53
57
|
"constructs": "10.0.5",
|
|
54
|
-
"esbuild": "^0.14.
|
|
58
|
+
"esbuild": "^0.14.11",
|
|
55
59
|
"eslint": "^8",
|
|
56
60
|
"eslint-import-resolver-node": "^0.3.6",
|
|
57
61
|
"eslint-import-resolver-typescript": "^2.5.0",
|
|
58
|
-
"eslint-plugin-import": "^2.25.
|
|
62
|
+
"eslint-plugin-import": "^2.25.4",
|
|
59
63
|
"jest": "^26.6.3",
|
|
60
64
|
"jest-junit": "^13",
|
|
61
|
-
"jsii": "^1.
|
|
62
|
-
"jsii-diff": "^1.
|
|
65
|
+
"jsii": "^1.52.1",
|
|
66
|
+
"jsii-diff": "^1.52.1",
|
|
63
67
|
"jsii-docgen": "^1.8.110",
|
|
64
|
-
"jsii-pacmak": "^1.48.0",
|
|
65
68
|
"json-schema": "^0.4.0",
|
|
66
|
-
"nock": "^13.2.
|
|
69
|
+
"nock": "^13.2.2",
|
|
67
70
|
"npm-check-updates": "^12",
|
|
68
|
-
"projen": "^0.
|
|
71
|
+
"projen": "^0.51.5",
|
|
69
72
|
"standard-version": "^9",
|
|
70
73
|
"ts-jest": "^26.5.6",
|
|
71
74
|
"ts-node": "^10.4.0",
|
|
@@ -90,11 +93,11 @@
|
|
|
90
93
|
],
|
|
91
94
|
"main": "lib/index.js",
|
|
92
95
|
"license": "Apache-2.0",
|
|
93
|
-
"version": "0.4.
|
|
96
|
+
"version": "0.4.4",
|
|
94
97
|
"jest": {
|
|
95
98
|
"testMatch": [
|
|
96
|
-
"
|
|
97
|
-
"
|
|
99
|
+
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
|
|
100
|
+
"<rootDir>/(test|src)/**/?(*.)+(spec|test).ts?(x)"
|
|
98
101
|
],
|
|
99
102
|
"clearMocks": true,
|
|
100
103
|
"collectCoverage": true,
|
|
@@ -102,6 +105,7 @@
|
|
|
102
105
|
"json",
|
|
103
106
|
"lcov",
|
|
104
107
|
"clover",
|
|
108
|
+
"cobertura",
|
|
105
109
|
"text"
|
|
106
110
|
],
|
|
107
111
|
"coverageDirectory": "coverage",
|
package/releasetag.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v0.4.4
|
package/version.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.4.4
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017-2021 Jared Wray & Luke Childs
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|