text: import * as uuid from 'uuid';
  
  import { handler } from './libs/handler';
  import { dynamoDb } from './libs/dynamoDb';
  
  export const main = handler(async (event, context, callback) => {
    const data = JSON.parse(event.body);
    const params = {
      TableName: process.env.tableName,
      Item: {
        userId: event.requestContext.identity.cognitoIdentityId,
        noteId: uuid.v1(),
        content: data.content,
        attachment: data.attachment,
        createdAt: Date.now(),
      },
    };
  
    await dynamoDb.put(params);
  
    return params.Item;
  });
  