diff --git a/libs/external-db-dynamodb/src/dynamo_schema_requests_utils.ts b/libs/external-db-dynamodb/src/dynamo_schema_requests_utils.ts index c8ed62a54..e0f357511 100644 --- a/libs/external-db-dynamodb/src/dynamo_schema_requests_utils.ts +++ b/libs/external-db-dynamodb/src/dynamo_schema_requests_utils.ts @@ -1,8 +1,12 @@ import { InputField } from '@wix-velo/velo-external-db-types' import { SystemTable } from './dynamo_utils' +import { UpdateCommandInput } from '@aws-sdk/lib-dynamodb/dist-types/commands/UpdateCommand' +import { CreateTableCommandInput } from '@aws-sdk/client-dynamodb/dist-types/commands/CreateTableCommand' -export const updateColumnsExpression = (collectionName: any, columns: any) => ({ + + +export const updateColumnsExpression = (collectionName: any, columns: any): UpdateCommandInput => ({ TableName: SystemTable, Key: { tableName: collectionName @@ -17,7 +21,7 @@ export const updateColumnsExpression = (collectionName: any, columns: any) => ({ ReturnValues: 'UPDATED_NEW' }) -export const addColumnExpression = (collectionName: any, column: any) => ({ +export const addColumnExpression = (collectionName: any, column: any): UpdateCommandInput => ({ TableName: SystemTable, Key: { tableName: collectionName @@ -48,14 +52,14 @@ export const changeColumnTypeExpression = (collectionName: string, column: Input }, }) -export const createTableExpression = (collectionName: any) => ({ +export const createTableExpression = (collectionName: string): CreateTableCommandInput => ({ TableName: collectionName, KeySchema: [{ AttributeName: '_id', KeyType: 'HASH' }], AttributeDefinitions: [{ AttributeName: '_id', AttributeType: 'S' }], BillingMode: 'PAY_PER_REQUEST' }) -export const createSystemTableExpression = () => ({ +export const createSystemTableExpression = (): CreateTableCommandInput => ({ TableName: SystemTable, KeySchema: [{ AttributeName: 'tableName', KeyType: 'HASH' }], AttributeDefinitions: [{ AttributeName: 'tableName', AttributeType: 'S' }],