diff --git a/package-lock.json b/package-lock.json index 4e3dd65..d5dc3da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "adapcon-utils-js", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "adapcon-utils-js", - "version": "1.1.0", + "version": "1.1.1", "dependencies": { "@aws-sdk/client-dynamodb": "^3.496.0", "@aws-sdk/client-lambda": "^3.496.0", diff --git a/package.json b/package.json index 73b7b7e..5804786 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "adapcon-utils-js", - "version": "1.1.0", + "version": "1.1.1", "description": "Utils library for Javascript", "keywords": [], "author": { diff --git a/src/dao/dynamo/dao.ts b/src/dao/dynamo/dao.ts index 3660576..825ce00 100644 --- a/src/dao/dynamo/dao.ts +++ b/src/dao/dynamo/dao.ts @@ -20,7 +20,7 @@ import type { BatchWriteCommandInput, BatchWriteCommandOutput } from '@aws-sdk/lib-dynamodb' -import { DynamoDB } from '@aws-sdk/client-dynamodb' +import { DynamoDB, ScanCommand } from '@aws-sdk/client-dynamodb' const getOptions = () => { if (process.env.IS_OFFLINE) return { region: 'localhost', endpoint: 'http://localhost:8000' } @@ -59,6 +59,11 @@ const query = async ({ return items } +const scan = async (params) => { + const command = new ScanCommand(params) + return documentInstance.send(command) +} + const getAll = async ({ params, list, fields = [] }: { params: DynamodbParams, list: object[], fields?: string[] }) => { let idx = 0 @@ -338,6 +343,7 @@ const mountProjectionExpression = ({ fields = [], options }: { fields?: string[] export const dynamoDBGenericDao = { get, query, + scan, getAll, put, update,