Skip to content

Commit

Permalink
fix: dynamo type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MXPOL committed Oct 29, 2023
1 parent 2bc2c9d commit 6977336
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions libs/external-db-dynamodb/src/dynamo_schema_requests_utils.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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' }],
Expand Down

0 comments on commit 6977336

Please sign in to comment.