@adtrackify/at-service-common 1.0.35 → 1.0.36
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.d.ts +1 -0
- package/dist/index.js +14 -1
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/src/clients/generic/dynamodb-client.ts +13 -0
package/package.json
CHANGED
|
@@ -50,6 +50,19 @@ export class DynamoDbClient {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
+
static safeQueryByGSI = async (tableName: string, gsiName: string, keyName: string, keyValue: any) => {
|
|
54
|
+
const query = {
|
|
55
|
+
TableName: tableName,
|
|
56
|
+
IndexName: gsiName,
|
|
57
|
+
KeyConditionExpression: `${keyName} = :value`,
|
|
58
|
+
ExpressionAttributeValues: {
|
|
59
|
+
':value': keyValue
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const results = await DynamoDbClient.queryAll(query);
|
|
63
|
+
return results;
|
|
64
|
+
};
|
|
65
|
+
|
|
53
66
|
static safeBatchGet = async (tableName: string, keys: any) => {
|
|
54
67
|
try {
|
|
55
68
|
const params: BatchGetItemInput = {
|