11
22import { InputField } from '@wix-velo/velo-external-db-types'
33import { SystemTable } from './dynamo_utils'
4+ import { UpdateCommandInput } from '@aws-sdk/lib-dynamodb/dist-types/commands/UpdateCommand'
5+ import { CreateTableCommandInput } from '@aws-sdk/client-dynamodb/dist-types/commands/CreateTableCommand'
46
5- export const updateColumnsExpression = ( collectionName : any , columns : any ) => ( {
7+
8+
9+ export const updateColumnsExpression = ( collectionName : any , columns : any ) : UpdateCommandInput => ( {
610 TableName : SystemTable ,
711 Key : {
812 tableName : collectionName
@@ -17,7 +21,7 @@ export const updateColumnsExpression = (collectionName: any, columns: any) => ({
1721 ReturnValues : 'UPDATED_NEW'
1822} )
1923
20- export const addColumnExpression = ( collectionName : any , column : any ) => ( {
24+ export const addColumnExpression = ( collectionName : any , column : any ) : UpdateCommandInput => ( {
2125 TableName : SystemTable ,
2226 Key : {
2327 tableName : collectionName
@@ -48,14 +52,14 @@ export const changeColumnTypeExpression = (collectionName: string, column: Input
4852 } ,
4953} )
5054
51- export const createTableExpression = ( collectionName : any ) => ( {
55+ export const createTableExpression = ( collectionName : string ) : CreateTableCommandInput => ( {
5256 TableName : collectionName ,
5357 KeySchema : [ { AttributeName : '_id' , KeyType : 'HASH' } ] ,
5458 AttributeDefinitions : [ { AttributeName : '_id' , AttributeType : 'S' } ] ,
5559 BillingMode : 'PAY_PER_REQUEST'
5660} )
5761
58- export const createSystemTableExpression = ( ) => ( {
62+ export const createSystemTableExpression = ( ) : CreateTableCommandInput => ( {
5963 TableName : SystemTable ,
6064 KeySchema : [ { AttributeName : 'tableName' , KeyType : 'HASH' } ] ,
6165 AttributeDefinitions : [ { AttributeName : 'tableName' , AttributeType : 'S' } ] ,
0 commit comments