@lafken/dynamo 0.12.10 → 0.12.12
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.
|
@@ -16,6 +16,9 @@ class InMemoryCache {
|
|
|
16
16
|
set(key, value, ttlSeconds) {
|
|
17
17
|
this.store.set(key, { value, expiry: Date.now() + ttlSeconds * 1000 });
|
|
18
18
|
}
|
|
19
|
+
clear() {
|
|
20
|
+
this.store.clear();
|
|
21
|
+
}
|
|
19
22
|
async getOrSet(key, fetcher, ttlSeconds) {
|
|
20
23
|
const cached = this.get(key);
|
|
21
24
|
if (cached !== undefined)
|
|
@@ -69,9 +69,6 @@ class QueryBuilderBase {
|
|
|
69
69
|
const filterExpression = [];
|
|
70
70
|
let index = 0;
|
|
71
71
|
for (const key in filter) {
|
|
72
|
-
if (filter[key] === undefined) {
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
72
|
switch (key) {
|
|
76
73
|
case 'OR': {
|
|
77
74
|
const orFilter = filter;
|
|
@@ -97,10 +94,13 @@ class QueryBuilderBase {
|
|
|
97
94
|
break;
|
|
98
95
|
}
|
|
99
96
|
default: {
|
|
97
|
+
const keyFilter = filter[key];
|
|
98
|
+
if (keyFilter === undefined) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
100
101
|
const currentKeyNames = [...names, key];
|
|
101
102
|
const keyName = currentKeyNames.join('.#');
|
|
102
103
|
const keyValue = `${currentKeyNames.join('_')}_${counter}_${index}`;
|
|
103
|
-
const keyFilter = filter[key];
|
|
104
104
|
if (typeof keyFilter === 'object') {
|
|
105
105
|
const keys = Object.keys(keyFilter || {});
|
|
106
106
|
const filterResolver = keys.find((key) => base_utils_1.filterKeys.has(key));
|
|
@@ -30,4 +30,5 @@ export type RepositoryReturn<E extends ClassResource> = {
|
|
|
30
30
|
bulkCreate(items: Item<E>[]): BulkCreateBuilder<E>;
|
|
31
31
|
bulkDelete(keys: TablePartition<Item<E>>[]): BulkDeleteBuilder<E>;
|
|
32
32
|
sendRawCommand<T = unknown>(command: Parameters<DynamoDBClient['send']>[0]): Promise<T>;
|
|
33
|
+
clearCache(): void;
|
|
33
34
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lafken/dynamo",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Define DynamoDB tables using TypeScript decorators - type-safe, declarative infrastructure with Lafken",
|
|
6
6
|
"keywords": [
|
|
@@ -56,31 +56,31 @@
|
|
|
56
56
|
"lib"
|
|
57
57
|
],
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
59
|
+
"@aws-sdk/client-dynamodb": "^3.1056.0",
|
|
60
60
|
"@aws-sdk/util-dynamodb": "^3.996.2",
|
|
61
61
|
"aws-xray-sdk": "^3.12.0",
|
|
62
62
|
"reflect-metadata": "^0.2.2",
|
|
63
|
-
"@lafken/resolver": "0.12.
|
|
63
|
+
"@lafken/resolver": "0.12.12"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@cdktn/provider-aws": "^24.
|
|
67
|
-
"@swc/core": "^1.15.
|
|
68
|
-
"@swc/helpers": "^0.5.
|
|
69
|
-
"@vitest/runner": "^4.1.
|
|
66
|
+
"@cdktn/provider-aws": "^24.3.0",
|
|
67
|
+
"@swc/core": "^1.15.40",
|
|
68
|
+
"@swc/helpers": "^0.5.23",
|
|
69
|
+
"@vitest/runner": "^4.1.7",
|
|
70
70
|
"aws-sdk-client-mock": "^4.1.0",
|
|
71
|
-
"cdktn": "^0.23.
|
|
71
|
+
"cdktn": "^0.23.2",
|
|
72
72
|
"cdktn-vitest": "^1.0.0",
|
|
73
73
|
"constructs": "^10.6.0",
|
|
74
74
|
"typescript": "6.0.3",
|
|
75
75
|
"unplugin-swc": "^1.5.9",
|
|
76
|
-
"vitest": "^4.1.
|
|
77
|
-
"@lafken/common": "0.12.
|
|
76
|
+
"vitest": "^4.1.7",
|
|
77
|
+
"@lafken/common": "0.12.12"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"@cdktn/provider-aws": ">=23.0.0",
|
|
81
81
|
"cdktn": ">=0.22.0",
|
|
82
82
|
"constructs": "^10.4.5",
|
|
83
|
-
"@lafken/common": "0.12.
|
|
83
|
+
"@lafken/common": "0.12.12"
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
86
86
|
"node": ">=20.19"
|