text: import uuid from "uuid";
  import * as dynamoDbLib from "./libs/dynamodb-lib";
  import { success, failure } from "./libs/response-lib";
  
  export async function main(event, context, callback) {
      const data = JSON.parse(event.body);
  
      const params = {
          TableName: "notes",
          Item: {
              userId: event.requestContext.identity.cognitoIdentityId,
              noteId: uuid.v1(),
              content: data.content,
              attachment: data.attachment,
              createdAt: Date.now()
          }
      };
  
      try {
          await dynamoDbLib.call("put", params);
          
          callback(null, success(params.Item));
      } catch (error) {
  
          console.log(error);
          
          callback(null, failure({ status: false }));
      }
  }