@keyv/dynamo 1.2.4 → 6.0.0-alpha.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/dist/index.cjs +7 -2
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +7 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -42,7 +42,6 @@ var import_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
|
|
|
42
42
|
var import_keyv = require("keyv");
|
|
43
43
|
var import_keyv2 = require("keyv");
|
|
44
44
|
var KeyvDynamo = class extends import_node_events.default {
|
|
45
|
-
ttlSupport = true;
|
|
46
45
|
sixHoursInMilliseconds = 6 * 60 * 60 * 1e3;
|
|
47
46
|
namespace;
|
|
48
47
|
opts;
|
|
@@ -158,9 +157,15 @@ var KeyvDynamo = class extends import_node_events.default {
|
|
|
158
157
|
}
|
|
159
158
|
async ensureTable(tableName) {
|
|
160
159
|
try {
|
|
161
|
-
await this.client.send(
|
|
160
|
+
const response = await this.client.send(
|
|
162
161
|
new import_client_dynamodb.DescribeTableCommand({ TableName: tableName })
|
|
163
162
|
);
|
|
163
|
+
if (response.Table?.TableStatus !== "ACTIVE") {
|
|
164
|
+
await (0, import_client_dynamodb.waitUntilTableExists)(
|
|
165
|
+
{ client: this.client, maxWaitTime: 60 },
|
|
166
|
+
{ TableName: tableName }
|
|
167
|
+
);
|
|
168
|
+
}
|
|
164
169
|
} catch (error) {
|
|
165
170
|
if (error instanceof import_client_dynamodb.ResourceNotFoundException) {
|
|
166
171
|
await this.createTable(tableName);
|
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,6 @@ import { KeyvStoreAdapter, StoredData, Keyv } from 'keyv';
|
|
|
5
5
|
export { Keyv } from 'keyv';
|
|
6
6
|
|
|
7
7
|
declare class KeyvDynamo extends EventEmitter implements KeyvStoreAdapter {
|
|
8
|
-
ttlSupport: boolean;
|
|
9
8
|
sixHoursInMilliseconds: number;
|
|
10
9
|
namespace?: string;
|
|
11
10
|
opts: Omit<KeyvDynamoOptions, "tableName"> & {
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { KeyvStoreAdapter, StoredData, Keyv } from 'keyv';
|
|
|
5
5
|
export { Keyv } from 'keyv';
|
|
6
6
|
|
|
7
7
|
declare class KeyvDynamo extends EventEmitter implements KeyvStoreAdapter {
|
|
8
|
-
ttlSupport: boolean;
|
|
9
8
|
sixHoursInMilliseconds: number;
|
|
10
9
|
namespace?: string;
|
|
11
10
|
opts: Omit<KeyvDynamoOptions, "tableName"> & {
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
import { Keyv } from "keyv";
|
|
16
16
|
import { Keyv as Keyv2 } from "keyv";
|
|
17
17
|
var KeyvDynamo = class extends EventEmitter {
|
|
18
|
-
ttlSupport = true;
|
|
19
18
|
sixHoursInMilliseconds = 6 * 60 * 60 * 1e3;
|
|
20
19
|
namespace;
|
|
21
20
|
opts;
|
|
@@ -131,9 +130,15 @@ var KeyvDynamo = class extends EventEmitter {
|
|
|
131
130
|
}
|
|
132
131
|
async ensureTable(tableName) {
|
|
133
132
|
try {
|
|
134
|
-
await this.client.send(
|
|
133
|
+
const response = await this.client.send(
|
|
135
134
|
new DescribeTableCommand({ TableName: tableName })
|
|
136
135
|
);
|
|
136
|
+
if (response.Table?.TableStatus !== "ACTIVE") {
|
|
137
|
+
await waitUntilTableExists(
|
|
138
|
+
{ client: this.client, maxWaitTime: 60 },
|
|
139
|
+
{ TableName: tableName }
|
|
140
|
+
);
|
|
141
|
+
}
|
|
137
142
|
} catch (error) {
|
|
138
143
|
if (error instanceof ResourceNotFoundException) {
|
|
139
144
|
await this.createTable(tableName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keyv/dynamo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-alpha.1",
|
|
4
4
|
"description": "DynamoDB storage adapter for Keyv",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"@biomejs/biome": "^2.3.10",
|
|
49
49
|
"@vitest/coverage-v8": "^4.0.16",
|
|
50
50
|
"vitest": "^4.0.16",
|
|
51
|
-
"@keyv/test-suite": "^
|
|
51
|
+
"@keyv/test-suite": "^6.0.0-alpha.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"keyv": "^
|
|
54
|
+
"keyv": "^6.0.0-alpha.1"
|
|
55
55
|
},
|
|
56
56
|
"tsd": {
|
|
57
57
|
"directory": "test"
|