diff --git a/README.md b/README.md index 037e77d..70384ef 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # FocusFlow: Pomodoro & To-Do List Application + https://focusflow-zeta.vercel.app/ -Banner +Banner

Phone Preview Desktop Preview

- ## Overview **FocusFlow** is a productivity application developed using React and Tailwind CSS during a pair programming session with my college. The application combines a **Pomodoro timer** and a **To-Do list** to help users manage their time efficiently and keep track of their tasks. @@ -19,16 +19,19 @@ Check out the live demo of the application [here](https://focusflow-zeta.vercel. ### Features #### To-Do List: + - Add, edit, and delete tasks. - Mark tasks as completed. - Filter tasks by status (All, Completed, Incomplete). #### Pomodoro Timer: + - Simple and intuitive Pomodoro timer. - Customizable session and break lengths. - Visual and audio cues to start and stop sessions. #### Beautiful Design: + - Modern and clean user interface. - Cozy and calming background theme to enhance focus. - **Lo-Fi Music**: Built-in lo-fi music player to create a soothing environment for productivity. @@ -47,26 +50,23 @@ Follow these steps to set up the project on your local machine. 1. **Clone the Repository**: - ```bash - git clone https://github.com/dedakup/focusflow.git - cd focusflow - ``` - + ```bash + git clone https://github.com/dedakup/focusflow.git + cd focusflow + ``` 2. **Install Dependencies**: - ```bash - npm install - ``` - + ```bash + npm install + ``` 3. **Start the Development Server**: - ```bash - npm run dev - ``` - + ```bash + npm run dev + ``` 4. **Open the Application**: - Visit `http://localhost:5173` in your browser to view the application. + Visit `http://localhost:5173` in your browser to view the application. ## Usage @@ -86,6 +86,7 @@ Follow these steps to set up the project on your local machine. We welcome contributions! If you'd like to contribute to the project, please fork the repository and use a feature branch. Pull requests are warmly welcome. # Branch Naming Conventions + - `main`: Production-ready code. - `develop`: Latest integrated development work. - `feature/`: For new features. diff --git a/backend/.serverless/cloudformation-template-update-stack.json b/backend/.serverless/cloudformation-template-update-stack.json index 8075b80..9ceaaf3 100644 --- a/backend/.serverless/cloudformation-template-update-stack.json +++ b/backend/.serverless/cloudformation-template-update-stack.json @@ -50,6 +50,30 @@ "LogGroupName": "/aws/lambda/backend-dev-updateBackground" } }, + "InitializeBackgroundsLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-initializeBackgrounds" + } + }, + "GetBackgroundsLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getBackgrounds" + } + }, + "AddBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-addBackground" + } + }, + "DeleteBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-deleteBackground" + } + }, "Auth0AuthorizerLogGroup": { "Type": "AWS::Logs::LogGroup", "Properties": { @@ -117,17 +141,14 @@ { "Effect": "Allow", "Action": [ - "dynamodb:Query", - "dynamodb:Scan", - "dynamodb:GetItem", "dynamodb:PutItem", + "dynamodb:GetItem", "dynamodb:UpdateItem", - "dynamodb:DeleteItem" + "dynamodb:DeleteItem", + "dynamodb:Scan", + "dynamodb:Query" ], - "Resource": [ - "arn:aws:dynamodb:us-east-1:274552760074:table/dev-focusflow-tasks", - "arn:aws:dynamodb:us-east-1:274552760074:table/dev-focusflow-users" - ] + "Resource": "*" }, { "Effect": "Allow", @@ -136,13 +157,6 @@ "s3:GetObject", "s3:DeleteObject" ], - "Resource": "arn:aws:cloudformation:us-east-1:274552760074:stack/backend-dev/80499180-a60f-11ef-b8d5-124d3fdcb0b3" - }, - { - "Effect": "Allow", - "Action": [ - "cognito-idp:SignUp" - ], "Resource": "*" }, { @@ -151,12 +165,6 @@ "lambda:InvokeFunction" ], "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" - }, - { - "Effect": "Allow", - "Action": [ - "sts:AssumeRole" - ] } ] } @@ -183,7 +191,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/task/createTask.createTask", "Runtime": "nodejs20.x", @@ -216,7 +224,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/task/getTask.getTasks", "Runtime": "nodejs20.x", @@ -249,7 +257,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/task/updateTask.updateTask", "Runtime": "nodejs20.x", @@ -282,7 +290,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/task/deleteTask.deleteTask", "Runtime": "nodejs20.x", @@ -315,7 +323,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/timer/manageTimer.manageTimer", "Runtime": "nodejs20.x", @@ -348,7 +356,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/preferences/updatePreferences.updatePreferences", "Runtime": "nodejs20.x", @@ -381,7 +389,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/music/getMusic.getMusic", "Runtime": "nodejs20.x", @@ -414,7 +422,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/background/updateBackground.updateBackground", "Runtime": "nodejs20.x", @@ -442,12 +450,144 @@ "UpdateBackgroundLogGroup" ] }, + "InitializeBackgroundsLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.initializeBackgrounds", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-initializeBackgrounds", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "InitializeBackgroundsLogGroup" + ] + }, + "GetBackgroundsLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.getBackgrounds", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getBackgrounds", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "GetBackgroundsLogGroup" + ] + }, + "AddBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.addBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-addBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "AddBackgroundLogGroup" + ] + }, + "DeleteBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.deleteBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-deleteBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "DeleteBackgroundLogGroup" + ] + }, "Auth0AuthorizerLambdaFunction": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/auth/index.handler", "Runtime": "nodejs20.x", @@ -475,94 +615,134 @@ "Auth0AuthorizerLogGroup" ] }, - "CreateTaskLambdaVersionk30cu9y50e5sOq8XtrIxMTWLhghYgNRK8RgZoEYIGYw": { + "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "CreateTaskLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "GetTaskLambdaVersiongXM56yZkGsQlnDb6WDCtOEDbduxrzUj1n6drT1Ds": { + "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "GetTaskLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "UpdateTaskLambdaVersionLVQNXG4ycaaTjNA87jUZHr5KUky8EK3SL1Nnqxf8": { + "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "UpdateTaskLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "DeleteTaskLambdaVersionbIxEVCZEfnNfNmF7C6APqdnRa2qGfa8uJbDu8LgXW0": { + "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "DeleteTaskLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "ManageTimerLambdaVersionC6S83E8qe3dWiTU9VbMMgG77ou962v41HGAoSgzghOg": { + "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "ManageTimerLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "UpdatePreferencesLambdaVersioni5HctCd5bCmzGE75DP4AXMDIxXfWqWLY5HnJgMGU": { + "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "UpdatePreferencesLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "GetMusicLambdaVersionAGbhi19HVk79KS2hVYQLrY4HuhO4As6VfyVaUlrk": { + "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "GetMusicLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "UpdateBackgroundLambdaVersiongFcVopCo5kYCSelYvEKVfGn4pxaLVIjYrPviLUTM": { + "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "UpdateBackgroundLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "InitializeBackgroundsLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetBackgroundsLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "AddBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DeleteBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "Auth0AuthorizerLambdaVersionUMEDyDFlyLIyWSsK6xWjoOLLkQNiEtvaBzHSTree2Xw": { + "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "Auth0AuthorizerLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, "ApiGatewayRestApi": { @@ -664,6 +844,30 @@ } } }, + "ApiGatewayResourceBackgroundsUseridVar": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "PathPart": "{userId}", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgroundsUseridVarInitialize": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "PathPart": "initialize", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, "ApiGatewayResourceAuth": { "Type": "AWS::ApiGateway::Resource", "Properties": { @@ -719,8 +923,8 @@ { "StatusCode": "200", "ResponseParameters": { - "method.response.header.Access-Control-Allow-Origin": "'http://localhost:5173'", - "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent,X-Amzn-Trace-Id,X-Requested-With'", "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET,POST'", "method.response.header.Access-Control-Allow-Credentials": "'true'" }, @@ -1397,13 +1601,13 @@ "Auth0AuthorizerApiGatewayAuthorizer" ] }, - "ApiGatewayMethodAuthValidatePost": { + "ApiGatewayMethodBackgroundsUseridVarInitializePost": { "Type": "AWS::ApiGateway::Method", "Properties": { "HttpMethod": "POST", "RequestParameters": {}, "ResourceId": { - "Ref": "ApiGatewayResourceAuthValidate" + "Ref": "ApiGatewayResourceBackgroundsUseridVarInitialize" }, "RestApiId": { "Ref": "ApiGatewayRestApi" @@ -1428,7 +1632,7 @@ ":lambda:path/2015-03-31/functions/", { "Fn::GetAtt": [ - "Auth0AuthorizerLambdaFunction", + "InitializeBackgroundsLambdaFunction", "Arn" ] }, @@ -1440,45 +1644,229 @@ "MethodResponses": [] }, "DependsOn": [ - "Auth0AuthorizerLambdaPermissionApiGateway" + "InitializeBackgroundsLambdaPermissionApiGateway" ] }, - "Auth0AuthorizerApiGatewayAuthorizer": { - "Type": "AWS::ApiGateway::Authorizer", + "ApiGatewayMethodBackgroundsUseridVarGet": { + "Type": "AWS::ApiGateway::Method", "Properties": { - "AuthorizerResultTtlInSeconds": 300, - "IdentitySource": "method.request.header.Authorization", - "Name": "auth0Authorizer", + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, "RestApiId": { "Ref": "ApiGatewayRestApi" }, - "AuthorizerUri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:", - { - "Ref": "AWS::Region" - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "Auth0AuthorizerLambdaFunction", - "Arn" - ] - }, - "/invocations" + "ApiKeyRequired": false, + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetBackgroundsLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] ] - ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "GetBackgroundsLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": false, + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "AddBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "AddBackgroundLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarDelete": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "DELETE", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": false, + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "DeleteBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "DeleteBackgroundLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodAuthValidatePost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceAuthValidate" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": false, + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerLambdaPermissionApiGateway" + ] + }, + "Auth0AuthorizerApiGatewayAuthorizer": { + "Type": "AWS::ApiGateway::Authorizer", + "Properties": { + "AuthorizerResultTtlInSeconds": 300, + "IdentitySource": "method.request.header.Authorization", + "Name": "auth0Authorizer", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "AuthorizerUri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] }, "Type": "REQUEST" } }, - "ApiGatewayDeployment1732392175738": { + "ApiGatewayDeployment1732598895104": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { @@ -1502,6 +1890,10 @@ "ApiGatewayMethodPreferencesPut", "ApiGatewayMethodMusicGet", "ApiGatewayMethodBackgroundsPut", + "ApiGatewayMethodBackgroundsUseridVarInitializePost", + "ApiGatewayMethodBackgroundsUseridVarGet", + "ApiGatewayMethodBackgroundsUseridVarPost", + "ApiGatewayMethodBackgroundsUseridVarDelete", "ApiGatewayMethodAuthValidatePost" ] }, @@ -1838,6 +2230,154 @@ } } }, + "InitializeBackgroundsLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "InitializeBackgroundsLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "GetBackgroundsLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetBackgroundsLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "AddBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "AddBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "DeleteBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "DeleteBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, "TasksTable": { "Type": "AWS::DynamoDB::Table", "Properties": { @@ -1884,10 +2424,29 @@ ] } }, + "UserBackgroundsTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-user-backgrounds", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, "AssetsBucket": { "Type": "AWS::S3::Bucket", "Properties": { - "BucketName": "dev-focusflow-assets", + "BucketName": "dev-focusflow-assets-274552760074", "CorsConfiguration": { "CorsRules": [ { @@ -1921,7 +2480,7 @@ "CreateTaskLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "CreateTaskLambdaVersionk30cu9y50e5sOq8XtrIxMTWLhghYgNRK8RgZoEYIGYw" + "Ref": "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM" }, "Export": { "Name": "sls-backend-dev-CreateTaskLambdaFunctionQualifiedArn" @@ -1930,7 +2489,7 @@ "GetTaskLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "GetTaskLambdaVersiongXM56yZkGsQlnDb6WDCtOEDbduxrzUj1n6drT1Ds" + "Ref": "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M" }, "Export": { "Name": "sls-backend-dev-GetTaskLambdaFunctionQualifiedArn" @@ -1939,7 +2498,7 @@ "UpdateTaskLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "UpdateTaskLambdaVersionLVQNXG4ycaaTjNA87jUZHr5KUky8EK3SL1Nnqxf8" + "Ref": "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE" }, "Export": { "Name": "sls-backend-dev-UpdateTaskLambdaFunctionQualifiedArn" @@ -1948,7 +2507,7 @@ "DeleteTaskLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "DeleteTaskLambdaVersionbIxEVCZEfnNfNmF7C6APqdnRa2qGfa8uJbDu8LgXW0" + "Ref": "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg" }, "Export": { "Name": "sls-backend-dev-DeleteTaskLambdaFunctionQualifiedArn" @@ -1957,7 +2516,7 @@ "ManageTimerLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "ManageTimerLambdaVersionC6S83E8qe3dWiTU9VbMMgG77ou962v41HGAoSgzghOg" + "Ref": "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw" }, "Export": { "Name": "sls-backend-dev-ManageTimerLambdaFunctionQualifiedArn" @@ -1966,7 +2525,7 @@ "UpdatePreferencesLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "UpdatePreferencesLambdaVersioni5HctCd5bCmzGE75DP4AXMDIxXfWqWLY5HnJgMGU" + "Ref": "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ" }, "Export": { "Name": "sls-backend-dev-UpdatePreferencesLambdaFunctionQualifiedArn" @@ -1975,7 +2534,7 @@ "GetMusicLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "GetMusicLambdaVersionAGbhi19HVk79KS2hVYQLrY4HuhO4As6VfyVaUlrk" + "Ref": "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU" }, "Export": { "Name": "sls-backend-dev-GetMusicLambdaFunctionQualifiedArn" @@ -1984,16 +2543,52 @@ "UpdateBackgroundLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "UpdateBackgroundLambdaVersiongFcVopCo5kYCSelYvEKVfGn4pxaLVIjYrPviLUTM" + "Ref": "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs" }, "Export": { "Name": "sls-backend-dev-UpdateBackgroundLambdaFunctionQualifiedArn" } }, + "InitializeBackgroundsLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw" + }, + "Export": { + "Name": "sls-backend-dev-InitializeBackgroundsLambdaFunctionQualifiedArn" + } + }, + "GetBackgroundsLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg" + }, + "Export": { + "Name": "sls-backend-dev-GetBackgroundsLambdaFunctionQualifiedArn" + } + }, + "AddBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw" + }, + "Export": { + "Name": "sls-backend-dev-AddBackgroundLambdaFunctionQualifiedArn" + } + }, + "DeleteBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc" + }, + "Export": { + "Name": "sls-backend-dev-DeleteBackgroundLambdaFunctionQualifiedArn" + } + }, "Auth0AuthorizerLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "Auth0AuthorizerLambdaVersionUMEDyDFlyLIyWSsK6xWjoOLLkQNiEtvaBzHSTree2Xw" + "Ref": "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg" }, "Export": { "Name": "sls-backend-dev-Auth0AuthorizerLambdaFunctionQualifiedArn" diff --git a/backend/.serverless/meta.json b/backend/.serverless/meta.json index 148b5ef..859ef0e 100644 --- a/backend/.serverless/meta.json +++ b/backend/.serverless/meta.json @@ -1,7 +1,7 @@ { "D:\\Projects\\Portfolio_Projects\\focusflow\\FocusFlow\\backend": { "versionSfCore": null, - "versionFramework": "4.4.11", + "versionFramework": "4.4.12", "isWithinCompose": false, "isCompose": false, "composeOrgName": null, @@ -54,1406 +54,12594 @@ ], "Resource": "*" }, - { - "Effect": "Allow", - "Action": [ - "cognito-idp:SignUp" - ], - "Resource": "*" - }, { "Effect": "Allow", "Action": [ "lambda:InvokeFunction" ], "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" - }, - { - "Effect": "Allow", - "Action": [ - "sts:AssumeRole" - ] } ] } }, - "cors": { - "allowedOrigins": [ - "http://localhost:5173" - ], - "allowedMethods": [ - "GET", - "POST", - "PUT", - "DELETE", - "OPTIONS" - ], - "allowedHeaders": [ - "Authorization", - "Content-Type", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ], - "allowCredentials": "" - }, "versionFunctions": true, - "AwshttpApi": null - }, - "custom": { - "tableName": "dev-focusflow-tasks", - "usersTableName": "dev-focusflow-users", - "bucketName": "dev-focusflow-assets" - }, - "resources": { - "Resources": { - "TasksTable": { - "Type": "AWS::DynamoDB::Table", - "Properties": { - "TableName": "dev-focusflow-tasks", - "BillingMode": "PAY_PER_REQUEST", - "AttributeDefinitions": [ - { - "AttributeName": "userId", - "AttributeType": "S" + "compiledCloudFormationTemplate": { + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "The AWS CloudFormation template for this Serverless application", + "Resources": { + "CreateTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-createTask" + } + }, + "GetTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getTask" + } + }, + "UpdateTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-updateTask" + } + }, + "DeleteTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-deleteTask" + } + }, + "ManageTimerLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-manageTimer" + } + }, + "UpdatePreferencesLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-updatePreferences" + } + }, + "GetMusicLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getMusic" + } + }, + "UpdateBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-updateBackground" + } + }, + "InitializeBackgroundsLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-initializeBackgrounds" + } + }, + "GetBackgroundsLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getBackgrounds" + } + }, + "AddBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-addBackground" + } + }, + "DeleteBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-deleteBackground" + } + }, + "Auth0AuthorizerLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-auth0Authorizer" + } + }, + "IamRoleLambdaExecution": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] }, - { - "AttributeName": "taskId", - "AttributeType": "S" + "Policies": [ + { + "PolicyName": { + "Fn::Join": [ + "-", + [ + "backend", + "dev", + "lambda" + ] + ] + }, + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogStream", + "logs:CreateLogGroup", + "logs:TagResource" + ], + "Resource": [ + { + "Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/backend-dev*:*" + } + ] + }, + { + "Effect": "Allow", + "Action": [ + "logs:PutLogEvents" + ], + "Resource": [ + { + "Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/backend-dev*:*:*" + } + ] + }, + { + "Effect": "Allow", + "Action": [ + "dynamodb:PutItem", + "dynamodb:GetItem", + "dynamodb:UpdateItem", + "dynamodb:DeleteItem", + "dynamodb:Scan", + "dynamodb:Query" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObject", + "s3:DeleteObject" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "lambda:InvokeFunction" + ], + "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" + } + ] + } + } + ], + "Path": "/", + "RoleName": { + "Fn::Join": [ + "-", + [ + "backend", + "dev", + { + "Ref": "AWS::Region" + }, + "lambdaRole" + ] + ] } - ], - "KeySchema": [ - { - "AttributeName": "userId", - "KeyType": "HASH" + } + }, + "CreateTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, - { - "AttributeName": "taskId", - "KeyType": "RANGE" + "Handler": "src/handlers/task/createTask.createTask", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-createTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] } + }, + "DependsOn": [ + "CreateTaskLogGroup" ] - } - }, - "UsersTable": { - "Type": "AWS::DynamoDB::Table", - "Properties": { - "TableName": "dev-focusflow-users", - "BillingMode": "PAY_PER_REQUEST", - "AttributeDefinitions": [ - { - "AttributeName": "userId", - "AttributeType": "S" - } - ], - "KeySchema": [ - { - "AttributeName": "userId", - "KeyType": "HASH" + }, + "GetTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/getTask.getTasks", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] } + }, + "DependsOn": [ + "GetTaskLogGroup" ] - } - }, - "AssetsBucket": { - "Type": "AWS::S3::Bucket", - "Properties": { - "BucketName": "dev-focusflow-assets", - "CorsConfiguration": { - "CorsRules": [ - { - "AllowedHeaders": [ - "*" - ], - "AllowedMethods": [ - "GET", - "PUT", - "POST", - "DELETE", - "HEAD" - ], - "AllowedOrigins": [ - "*" - ], - "MaxAge": 3000 + }, + "UpdateTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/updateTask.updateTask", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-updateTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" } - ] - } - } - } - } - }, - "functions": { - "createTask": { - "handler": "src/handlers/task/createTask.createTask", - "events": [ - { - "http": { - "path": "tasks", - "method": "post", - "cors": { - "origin": "http://localhost:5173", - "allowCredentials": "", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } - } - } - ], - "name": "backend-dev-createTask" - }, - "getTask": { - "handler": "src/handlers/task/getTask.getTasks", - "events": [ - { - "http": { - "path": "tasks", - "method": "get", - "cors": { - "origin": "http://localhost:5173", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" ] + } + }, + "DependsOn": [ + "UpdateTaskLogGroup" + ] + }, + "DeleteTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + "Handler": "src/handlers/task/deleteTask.deleteTask", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-deleteTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } }, - "allowCredentials": "" - } - } - ], - "name": "backend-dev-getTask" - }, - "updateTask": { - "handler": "src/handlers/task/updateTask.updateTask", - "events": [ - { - "http": { - "path": "tasks/{taskId}", - "method": "put", - "cors": { - "origin": "http://localhost:5173", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" ] + } + }, + "DependsOn": [ + "DeleteTaskLogGroup" + ] + }, + "ManageTimerLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + "Handler": "src/handlers/timer/manageTimer.manageTimer", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-manageTimer", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } }, - "allowCredentials": "" - } - } - ], - "name": "backend-dev-updateTask" - }, - "deleteTask": { - "handler": "src/handlers/task/deleteTask.deleteTask", - "events": [ - { - "http": { - "path": "tasks/{taskId}", - "method": "delete", - "cors": { - "origin": "http://localhost:5173", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" ] + } + }, + "DependsOn": [ + "ManageTimerLogGroup" + ] + }, + "UpdatePreferencesLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + "Handler": "src/handlers/preferences/updatePreferences.updatePreferences", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-updatePreferences", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } }, - "allowCredentials": "" - } - } - ], - "name": "backend-dev-deleteTask" - }, - "manageTimer": { - "handler": "src/handlers/timer/manageTimer.manageTimer", - "events": [ - { - "http": { - "path": "timer", - "method": "post", - "cors": { - "origin": "*", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" ] + } + }, + "DependsOn": [ + "UpdatePreferencesLogGroup" + ] + }, + "GetMusicLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + "Handler": "src/handlers/music/getMusic.getMusic", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getMusic", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] } - } - } + }, + "DependsOn": [ + "GetMusicLogGroup" + ] + }, + "UpdateBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/background/updateBackground.updateBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-updateBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "UpdateBackgroundLogGroup" + ] + }, + "InitializeBackgroundsLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.initializeBackgrounds", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-initializeBackgrounds", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "InitializeBackgroundsLogGroup" + ] + }, + "GetBackgroundsLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.getBackgrounds", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getBackgrounds", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "GetBackgroundsLogGroup" + ] + }, + "AddBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.addBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-addBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "AddBackgroundLogGroup" + ] + }, + "DeleteBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.deleteBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-deleteBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "DeleteBackgroundLogGroup" + ] + }, + "Auth0AuthorizerLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/auth/index.handler", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-auth0Authorizer", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "Auth0AuthorizerLogGroup" + ] + }, + "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "CreateTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "UpdateTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DeleteTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "ManageTimerLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "UpdatePreferencesLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetMusicLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "UpdateBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "InitializeBackgroundsLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetBackgroundsLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "AddBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DeleteBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "Auth0AuthorizerLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "ApiGatewayRestApi": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Name": "dev-backend", + "EndpointConfiguration": { + "Types": [ + "EDGE" + ] + }, + "Policy": "" + } + }, + "ApiGatewayResourceTasks": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "tasks", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceTasksTaskidVar": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceTasks" + }, + "PathPart": "{taskId}", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceTimer": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "timer", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourcePreferences": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "preferences", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceMusic": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "music", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgrounds": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "backgrounds", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgroundsUseridVar": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "PathPart": "{userId}", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgroundsUseridVarInitialize": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "PathPart": "initialize", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceAuth": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "auth", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceAuthValidate": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceAuth" + }, + "PathPart": "validate", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTasksOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true, + "method.response.header.Access-Control-Allow-Credentials": "" + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent,X-Amzn-Trace-Id,X-Requested-With'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET,POST'", + "method.response.header.Access-Control-Allow-Credentials": "" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceTasks" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTasksTaskidVarOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'http://localhost:5173'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,DELETE,PUT'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceTasksTaskidVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTimerOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,POST'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceTimer" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodPreferencesOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,PUT'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourcePreferences" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodMusicOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceMusic" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodBackgroundsOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,PUT'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodAuthValidateOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent,X-Amzn-Trace-Id'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,POST'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceAuthValidate" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTasksPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasks" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "CreateTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTasksGet": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasks" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTasksTaskidVarPut": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "PUT", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasksTaskidVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "UpdateTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTasksTaskidVarDelete": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "DELETE", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasksTaskidVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "DeleteTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTimerPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTimer" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "ManageTimerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodPreferencesPut": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "PUT", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourcePreferences" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "UpdatePreferencesLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodMusicGet": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceMusic" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetMusicLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "GetMusicLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsPut": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "PUT", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "UpdateBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarInitializePost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVarInitialize" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "InitializeBackgroundsLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "InitializeBackgroundsLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarGet": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetBackgroundsLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "GetBackgroundsLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "AddBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "AddBackgroundLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarDelete": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "DELETE", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "DeleteBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "DeleteBackgroundLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodAuthValidatePost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceAuthValidate" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerLambdaPermissionApiGateway" + ] + }, + "Auth0AuthorizerApiGatewayAuthorizer": { + "Type": "AWS::ApiGateway::Authorizer", + "Properties": { + "AuthorizerResultTtlInSeconds": 300, + "IdentitySource": "method.request.header.Authorization", + "Name": "auth0Authorizer", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "AuthorizerUri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + }, + "Type": "REQUEST" + } + }, + "ApiGatewayDeployment1732598895104": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "StageName": "dev" + }, + "DependsOn": [ + "ApiGatewayMethodTasksOptions", + "ApiGatewayMethodTasksTaskidVarOptions", + "ApiGatewayMethodTimerOptions", + "ApiGatewayMethodPreferencesOptions", + "ApiGatewayMethodMusicOptions", + "ApiGatewayMethodBackgroundsOptions", + "ApiGatewayMethodAuthValidateOptions", + "ApiGatewayMethodTasksPost", + "ApiGatewayMethodTasksGet", + "ApiGatewayMethodTasksTaskidVarPut", + "ApiGatewayMethodTasksTaskidVarDelete", + "ApiGatewayMethodTimerPost", + "ApiGatewayMethodPreferencesPut", + "ApiGatewayMethodMusicGet", + "ApiGatewayMethodBackgroundsPut", + "ApiGatewayMethodBackgroundsUseridVarInitializePost", + "ApiGatewayMethodBackgroundsUseridVarGet", + "ApiGatewayMethodBackgroundsUseridVarPost", + "ApiGatewayMethodBackgroundsUseridVarDelete", + "ApiGatewayMethodAuthValidatePost" + ] + }, + "CreateTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "CreateTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "Auth0AuthorizerLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "GetTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "UpdateTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "UpdateTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "DeleteTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "DeleteTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "ManageTimerLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "ManageTimerLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "UpdatePreferencesLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "UpdatePreferencesLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "GetMusicLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetMusicLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "UpdateBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "UpdateBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "InitializeBackgroundsLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "InitializeBackgroundsLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "GetBackgroundsLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetBackgroundsLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "AddBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "AddBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "DeleteBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "DeleteBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "TasksTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-tasks", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + }, + { + "AttributeName": "taskId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + }, + { + "AttributeName": "taskId", + "KeyType": "RANGE" + } + ] + } + }, + "UsersTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-users", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, + "UserBackgroundsTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-user-backgrounds", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, + "AssetsBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "dev-focusflow-assets-274552760074", + "CorsConfiguration": { + "CorsRules": [ + { + "AllowedHeaders": [ + "*" + ], + "AllowedMethods": [ + "GET", + "PUT", + "POST", + "DELETE", + "HEAD" + ], + "AllowedOrigins": [ + "*" + ], + "MaxAge": 3000 + } + ] + } + } + } + }, + "Outputs": { + "ServerlessDeploymentBucketName": { + "Value": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "Export": { + "Name": "sls-backend-dev-ServerlessDeploymentBucketName" + } + }, + "CreateTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM" + }, + "Export": { + "Name": "sls-backend-dev-CreateTaskLambdaFunctionQualifiedArn" + } + }, + "GetTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M" + }, + "Export": { + "Name": "sls-backend-dev-GetTaskLambdaFunctionQualifiedArn" + } + }, + "UpdateTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE" + }, + "Export": { + "Name": "sls-backend-dev-UpdateTaskLambdaFunctionQualifiedArn" + } + }, + "DeleteTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg" + }, + "Export": { + "Name": "sls-backend-dev-DeleteTaskLambdaFunctionQualifiedArn" + } + }, + "ManageTimerLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw" + }, + "Export": { + "Name": "sls-backend-dev-ManageTimerLambdaFunctionQualifiedArn" + } + }, + "UpdatePreferencesLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ" + }, + "Export": { + "Name": "sls-backend-dev-UpdatePreferencesLambdaFunctionQualifiedArn" + } + }, + "GetMusicLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU" + }, + "Export": { + "Name": "sls-backend-dev-GetMusicLambdaFunctionQualifiedArn" + } + }, + "UpdateBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs" + }, + "Export": { + "Name": "sls-backend-dev-UpdateBackgroundLambdaFunctionQualifiedArn" + } + }, + "InitializeBackgroundsLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw" + }, + "Export": { + "Name": "sls-backend-dev-InitializeBackgroundsLambdaFunctionQualifiedArn" + } + }, + "GetBackgroundsLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg" + }, + "Export": { + "Name": "sls-backend-dev-GetBackgroundsLambdaFunctionQualifiedArn" + } + }, + "AddBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw" + }, + "Export": { + "Name": "sls-backend-dev-AddBackgroundLambdaFunctionQualifiedArn" + } + }, + "DeleteBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc" + }, + "Export": { + "Name": "sls-backend-dev-DeleteBackgroundLambdaFunctionQualifiedArn" + } + }, + "Auth0AuthorizerLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg" + }, + "Export": { + "Name": "sls-backend-dev-Auth0AuthorizerLambdaFunctionQualifiedArn" + } + }, + "ServiceEndpoint": { + "Description": "URL of the service endpoint", + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "ApiGatewayRestApi" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/dev" + ] + ] + }, + "Export": { + "Name": "sls-backend-dev-ServiceEndpoint" + } + } + } + }, + "vpc": {} + }, + "custom": { + "tableName": "dev-focusflow-tasks", + "usersTableName": "dev-focusflow-users", + "bucketName": "dev-focusflow-assets-274552760074" + }, + "resources": { + "Resources": { + "TasksTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-tasks", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + }, + { + "AttributeName": "taskId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + }, + { + "AttributeName": "taskId", + "KeyType": "RANGE" + } + ] + } + }, + "UsersTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-users", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, + "UserBackgroundsTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-user-backgrounds", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, + "AssetsBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "dev-focusflow-assets-274552760074", + "CorsConfiguration": { + "CorsRules": [ + { + "AllowedHeaders": [ + "*" + ], + "AllowedMethods": [ + "GET", + "PUT", + "POST", + "DELETE", + "HEAD" + ], + "AllowedOrigins": [ + "*" + ], + "MaxAge": 3000 + } + ] + } + } + } + }, + "Outputs": {} + }, + "functions": { + "createTask": { + "handler": "src/handlers/task/createTask.createTask", + "events": [ + { + "http": { + "path": "tasks", + "method": "post", + "cors": { + "origin": "http://localhost:5173", + "methods": [ + "OPTIONS", + "POST" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-createTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM" + }, + "getTask": { + "handler": "src/handlers/task/getTask.getTasks", + "events": [ + { + "http": { + "path": "tasks", + "method": "get", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "GET" + ], + "headers": [ + "Content-Type", + "X-Amz-Date", + "Authorization", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent", + "X-Amzn-Trace-Id" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-getTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M" + }, + "updateTask": { + "handler": "src/handlers/task/updateTask.updateTask", + "events": [ + { + "http": { + "path": "tasks/{taskId}", + "method": "put", + "cors": { + "origin": "http://localhost:5173", + "methods": [ + "OPTIONS", + "PUT" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "allowCredentials": "", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-updateTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE" + }, + "deleteTask": { + "handler": "src/handlers/task/deleteTask.deleteTask", + "events": [ + { + "http": { + "path": "tasks/{taskId}", + "method": "delete", + "cors": { + "origin": "http://localhost:5173", + "methods": [ + "OPTIONS", + "DELETE" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "allowCredentials": "", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-deleteTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg" + }, + "manageTimer": { + "handler": "src/handlers/timer/manageTimer.manageTimer", + "events": [ + { + "http": { + "path": "timer", + "method": "post", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "POST" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-manageTimer", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw" + }, + "updatePreferences": { + "handler": "src/handlers/preferences/updatePreferences.updatePreferences", + "events": [ + { + "http": { + "path": "preferences", + "method": "put", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "PUT" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-updatePreferences", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ" + }, + "getMusic": { + "handler": "src/handlers/music/getMusic.getMusic", + "events": [ + { + "http": { + "path": "music", + "method": "get", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "GET" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-getMusic", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU" + }, + "updateBackground": { + "handler": "src/handlers/background/updateBackground.updateBackground", + "events": [ + { + "http": { + "path": "backgrounds", + "method": "put", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "PUT" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-updateBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs" + }, + "initializeBackgrounds": { + "handler": "src/handlers/backgrounds.initializeBackgrounds", + "events": [ + { + "http": { + "path": "backgrounds/{userId}/initialize", + "method": "post", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-initializeBackgrounds", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw" + }, + "getBackgrounds": { + "handler": "src/handlers/backgrounds.getBackgrounds", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "get", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-getBackgrounds", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg" + }, + "addBackground": { + "handler": "src/handlers/backgrounds.addBackground", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "post", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-addBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw" + }, + "deleteBackground": { + "handler": "src/handlers/backgrounds.deleteBackground", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "delete", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-deleteBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc" + }, + "auth0Authorizer": { + "handler": "src/handlers/auth/index.handler", + "events": [ + { + "http": { + "path": "auth/validate", + "method": "post", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "POST" + ], + "headers": [ + "Content-Type", + "X-Amz-Date", + "Authorization", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent", + "X-Amzn-Trace-Id" + ], + "allowCredentials": "" + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-auth0Authorizer", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg" + } + } + }, + "configFileDirPath": "D:\\Projects\\Portfolio_Projects\\focusflow\\FocusFlow\\backend", + "config": { + "type": "self" + }, + "options": {}, + "stage": "dev", + "dashboard": { + "aws": { + "accessKeyId": "", + "secretAccessKey": "", + "sessionToken": "", + "$source": { + "CREDENTIALS_CODE": "" + } + }, + "params": null, + "accessKey": "" + }, + "logger": { + "namespace": "s:core:resolver:self", + "prefix": null, + "prefixColor": null + }, + "_credentialsPromise": "" + }, + "resolvers": {} + }, + "aws": { + "instance": { + "credentials": "", + "serviceConfigFile": { + "org": "devquesting", + "app": "focusflow", + "service": "backend", + "plugins": [ + "serverless-offline" + ], + "provider": { + "name": "aws", + "runtime": "nodejs20.x", + "region": "us-east-1", + "stage": "dev", + "environment": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + }, + "iam": { + "role": { + "statements": [ + { + "Effect": "Allow", + "Action": [ + "dynamodb:PutItem", + "dynamodb:GetItem", + "dynamodb:UpdateItem", + "dynamodb:DeleteItem", + "dynamodb:Scan", + "dynamodb:Query" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObject", + "s3:DeleteObject" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "lambda:InvokeFunction" + ], + "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" + } + ] + } + }, + "versionFunctions": true, + "compiledCloudFormationTemplate": { + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "The AWS CloudFormation template for this Serverless application", + "Resources": { + "CreateTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-createTask" + } + }, + "GetTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getTask" + } + }, + "UpdateTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-updateTask" + } + }, + "DeleteTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-deleteTask" + } + }, + "ManageTimerLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-manageTimer" + } + }, + "UpdatePreferencesLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-updatePreferences" + } + }, + "GetMusicLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getMusic" + } + }, + "UpdateBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-updateBackground" + } + }, + "InitializeBackgroundsLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-initializeBackgrounds" + } + }, + "GetBackgroundsLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getBackgrounds" + } + }, + "AddBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-addBackground" + } + }, + "DeleteBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-deleteBackground" + } + }, + "Auth0AuthorizerLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-auth0Authorizer" + } + }, + "IamRoleLambdaExecution": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + }, + "Policies": [ + { + "PolicyName": { + "Fn::Join": [ + "-", + [ + "backend", + "dev", + "lambda" + ] + ] + }, + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogStream", + "logs:CreateLogGroup", + "logs:TagResource" + ], + "Resource": [ + { + "Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/backend-dev*:*" + } + ] + }, + { + "Effect": "Allow", + "Action": [ + "logs:PutLogEvents" + ], + "Resource": [ + { + "Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/backend-dev*:*:*" + } + ] + }, + { + "Effect": "Allow", + "Action": [ + "dynamodb:PutItem", + "dynamodb:GetItem", + "dynamodb:UpdateItem", + "dynamodb:DeleteItem", + "dynamodb:Scan", + "dynamodb:Query" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObject", + "s3:DeleteObject" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "lambda:InvokeFunction" + ], + "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" + } + ] + } + } + ], + "Path": "/", + "RoleName": { + "Fn::Join": [ + "-", + [ + "backend", + "dev", + { + "Ref": "AWS::Region" + }, + "lambdaRole" + ] + ] + } + } + }, + "CreateTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/createTask.createTask", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-createTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "CreateTaskLogGroup" + ] + }, + "GetTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/getTask.getTasks", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "GetTaskLogGroup" + ] + }, + "UpdateTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/updateTask.updateTask", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-updateTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "UpdateTaskLogGroup" + ] + }, + "DeleteTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/deleteTask.deleteTask", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-deleteTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "DeleteTaskLogGroup" + ] + }, + "ManageTimerLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/timer/manageTimer.manageTimer", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-manageTimer", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "ManageTimerLogGroup" + ] + }, + "UpdatePreferencesLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/preferences/updatePreferences.updatePreferences", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-updatePreferences", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "UpdatePreferencesLogGroup" + ] + }, + "GetMusicLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/music/getMusic.getMusic", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getMusic", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "GetMusicLogGroup" + ] + }, + "UpdateBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/background/updateBackground.updateBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-updateBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "UpdateBackgroundLogGroup" + ] + }, + "InitializeBackgroundsLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.initializeBackgrounds", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-initializeBackgrounds", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "InitializeBackgroundsLogGroup" + ] + }, + "GetBackgroundsLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.getBackgrounds", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getBackgrounds", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "GetBackgroundsLogGroup" + ] + }, + "AddBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.addBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-addBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "AddBackgroundLogGroup" + ] + }, + "DeleteBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.deleteBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-deleteBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "DeleteBackgroundLogGroup" + ] + }, + "Auth0AuthorizerLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/auth/index.handler", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-auth0Authorizer", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "Auth0AuthorizerLogGroup" + ] + }, + "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "CreateTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "UpdateTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DeleteTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "ManageTimerLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "UpdatePreferencesLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetMusicLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "UpdateBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "InitializeBackgroundsLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetBackgroundsLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "AddBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DeleteBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "Auth0AuthorizerLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "ApiGatewayRestApi": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Name": "dev-backend", + "EndpointConfiguration": { + "Types": [ + "EDGE" + ] + }, + "Policy": "" + } + }, + "ApiGatewayResourceTasks": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "tasks", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceTasksTaskidVar": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceTasks" + }, + "PathPart": "{taskId}", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceTimer": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "timer", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourcePreferences": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "preferences", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceMusic": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "music", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgrounds": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "backgrounds", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgroundsUseridVar": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "PathPart": "{userId}", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgroundsUseridVarInitialize": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "PathPart": "initialize", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceAuth": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "auth", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceAuthValidate": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceAuth" + }, + "PathPart": "validate", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTasksOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true, + "method.response.header.Access-Control-Allow-Credentials": "" + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent,X-Amzn-Trace-Id,X-Requested-With'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET,POST'", + "method.response.header.Access-Control-Allow-Credentials": "" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceTasks" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTasksTaskidVarOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'http://localhost:5173'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,DELETE,PUT'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceTasksTaskidVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTimerOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,POST'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceTimer" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodPreferencesOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,PUT'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourcePreferences" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodMusicOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceMusic" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodBackgroundsOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,PUT'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodAuthValidateOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent,X-Amzn-Trace-Id'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,POST'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceAuthValidate" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTasksPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasks" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "CreateTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTasksGet": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasks" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTasksTaskidVarPut": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "PUT", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasksTaskidVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "UpdateTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTasksTaskidVarDelete": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "DELETE", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasksTaskidVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "DeleteTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTimerPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTimer" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "ManageTimerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodPreferencesPut": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "PUT", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourcePreferences" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "UpdatePreferencesLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodMusicGet": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceMusic" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetMusicLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "GetMusicLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsPut": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "PUT", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "UpdateBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarInitializePost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVarInitialize" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "InitializeBackgroundsLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "InitializeBackgroundsLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarGet": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetBackgroundsLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "GetBackgroundsLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "AddBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "AddBackgroundLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarDelete": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "DELETE", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "DeleteBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "DeleteBackgroundLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodAuthValidatePost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceAuthValidate" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerLambdaPermissionApiGateway" + ] + }, + "Auth0AuthorizerApiGatewayAuthorizer": { + "Type": "AWS::ApiGateway::Authorizer", + "Properties": { + "AuthorizerResultTtlInSeconds": 300, + "IdentitySource": "method.request.header.Authorization", + "Name": "auth0Authorizer", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "AuthorizerUri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + }, + "Type": "REQUEST" + } + }, + "ApiGatewayDeployment1732598895104": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "StageName": "dev" + }, + "DependsOn": [ + "ApiGatewayMethodTasksOptions", + "ApiGatewayMethodTasksTaskidVarOptions", + "ApiGatewayMethodTimerOptions", + "ApiGatewayMethodPreferencesOptions", + "ApiGatewayMethodMusicOptions", + "ApiGatewayMethodBackgroundsOptions", + "ApiGatewayMethodAuthValidateOptions", + "ApiGatewayMethodTasksPost", + "ApiGatewayMethodTasksGet", + "ApiGatewayMethodTasksTaskidVarPut", + "ApiGatewayMethodTasksTaskidVarDelete", + "ApiGatewayMethodTimerPost", + "ApiGatewayMethodPreferencesPut", + "ApiGatewayMethodMusicGet", + "ApiGatewayMethodBackgroundsPut", + "ApiGatewayMethodBackgroundsUseridVarInitializePost", + "ApiGatewayMethodBackgroundsUseridVarGet", + "ApiGatewayMethodBackgroundsUseridVarPost", + "ApiGatewayMethodBackgroundsUseridVarDelete", + "ApiGatewayMethodAuthValidatePost" + ] + }, + "CreateTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "CreateTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "Auth0AuthorizerLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "GetTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "UpdateTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "UpdateTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "DeleteTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "DeleteTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "ManageTimerLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "ManageTimerLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "UpdatePreferencesLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "UpdatePreferencesLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "GetMusicLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetMusicLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "UpdateBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "UpdateBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "InitializeBackgroundsLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "InitializeBackgroundsLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "GetBackgroundsLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetBackgroundsLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "AddBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "AddBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "DeleteBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "DeleteBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "TasksTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-tasks", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + }, + { + "AttributeName": "taskId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + }, + { + "AttributeName": "taskId", + "KeyType": "RANGE" + } + ] + } + }, + "UsersTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-users", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, + "UserBackgroundsTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-user-backgrounds", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, + "AssetsBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "dev-focusflow-assets-274552760074", + "CorsConfiguration": { + "CorsRules": [ + { + "AllowedHeaders": [ + "*" + ], + "AllowedMethods": [ + "GET", + "PUT", + "POST", + "DELETE", + "HEAD" + ], + "AllowedOrigins": [ + "*" + ], + "MaxAge": 3000 + } + ] + } + } + } + }, + "Outputs": { + "ServerlessDeploymentBucketName": { + "Value": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "Export": { + "Name": "sls-backend-dev-ServerlessDeploymentBucketName" + } + }, + "CreateTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM" + }, + "Export": { + "Name": "sls-backend-dev-CreateTaskLambdaFunctionQualifiedArn" + } + }, + "GetTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M" + }, + "Export": { + "Name": "sls-backend-dev-GetTaskLambdaFunctionQualifiedArn" + } + }, + "UpdateTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE" + }, + "Export": { + "Name": "sls-backend-dev-UpdateTaskLambdaFunctionQualifiedArn" + } + }, + "DeleteTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg" + }, + "Export": { + "Name": "sls-backend-dev-DeleteTaskLambdaFunctionQualifiedArn" + } + }, + "ManageTimerLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw" + }, + "Export": { + "Name": "sls-backend-dev-ManageTimerLambdaFunctionQualifiedArn" + } + }, + "UpdatePreferencesLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ" + }, + "Export": { + "Name": "sls-backend-dev-UpdatePreferencesLambdaFunctionQualifiedArn" + } + }, + "GetMusicLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU" + }, + "Export": { + "Name": "sls-backend-dev-GetMusicLambdaFunctionQualifiedArn" + } + }, + "UpdateBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs" + }, + "Export": { + "Name": "sls-backend-dev-UpdateBackgroundLambdaFunctionQualifiedArn" + } + }, + "InitializeBackgroundsLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw" + }, + "Export": { + "Name": "sls-backend-dev-InitializeBackgroundsLambdaFunctionQualifiedArn" + } + }, + "GetBackgroundsLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg" + }, + "Export": { + "Name": "sls-backend-dev-GetBackgroundsLambdaFunctionQualifiedArn" + } + }, + "AddBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw" + }, + "Export": { + "Name": "sls-backend-dev-AddBackgroundLambdaFunctionQualifiedArn" + } + }, + "DeleteBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc" + }, + "Export": { + "Name": "sls-backend-dev-DeleteBackgroundLambdaFunctionQualifiedArn" + } + }, + "Auth0AuthorizerLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg" + }, + "Export": { + "Name": "sls-backend-dev-Auth0AuthorizerLambdaFunctionQualifiedArn" + } + }, + "ServiceEndpoint": { + "Description": "URL of the service endpoint", + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "ApiGatewayRestApi" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/dev" + ] + ] + }, + "Export": { + "Name": "sls-backend-dev-ServiceEndpoint" + } + } + } + }, + "vpc": {} + }, + "custom": { + "tableName": "dev-focusflow-tasks", + "usersTableName": "dev-focusflow-users", + "bucketName": "dev-focusflow-assets-274552760074" + }, + "resources": { + "Resources": { + "TasksTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-tasks", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + }, + { + "AttributeName": "taskId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + }, + { + "AttributeName": "taskId", + "KeyType": "RANGE" + } + ] + } + }, + "UsersTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-users", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, + "UserBackgroundsTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-user-backgrounds", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, + "AssetsBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "dev-focusflow-assets-274552760074", + "CorsConfiguration": { + "CorsRules": [ + { + "AllowedHeaders": [ + "*" + ], + "AllowedMethods": [ + "GET", + "PUT", + "POST", + "DELETE", + "HEAD" + ], + "AllowedOrigins": [ + "*" + ], + "MaxAge": 3000 + } + ] + } + } + } + }, + "Outputs": {} + }, + "functions": { + "createTask": { + "handler": "src/handlers/task/createTask.createTask", + "events": [ + { + "http": { + "path": "tasks", + "method": "post", + "cors": { + "origin": "http://localhost:5173", + "methods": [ + "OPTIONS", + "POST" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-createTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM" + }, + "getTask": { + "handler": "src/handlers/task/getTask.getTasks", + "events": [ + { + "http": { + "path": "tasks", + "method": "get", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "GET" + ], + "headers": [ + "Content-Type", + "X-Amz-Date", + "Authorization", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent", + "X-Amzn-Trace-Id" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-getTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M" + }, + "updateTask": { + "handler": "src/handlers/task/updateTask.updateTask", + "events": [ + { + "http": { + "path": "tasks/{taskId}", + "method": "put", + "cors": { + "origin": "http://localhost:5173", + "methods": [ + "OPTIONS", + "PUT" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "allowCredentials": "", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-updateTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE" + }, + "deleteTask": { + "handler": "src/handlers/task/deleteTask.deleteTask", + "events": [ + { + "http": { + "path": "tasks/{taskId}", + "method": "delete", + "cors": { + "origin": "http://localhost:5173", + "methods": [ + "OPTIONS", + "DELETE" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "allowCredentials": "", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-deleteTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg" + }, + "manageTimer": { + "handler": "src/handlers/timer/manageTimer.manageTimer", + "events": [ + { + "http": { + "path": "timer", + "method": "post", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "POST" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-manageTimer", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw" + }, + "updatePreferences": { + "handler": "src/handlers/preferences/updatePreferences.updatePreferences", + "events": [ + { + "http": { + "path": "preferences", + "method": "put", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "PUT" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-updatePreferences", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ" + }, + "getMusic": { + "handler": "src/handlers/music/getMusic.getMusic", + "events": [ + { + "http": { + "path": "music", + "method": "get", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "GET" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-getMusic", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU" + }, + "updateBackground": { + "handler": "src/handlers/background/updateBackground.updateBackground", + "events": [ + { + "http": { + "path": "backgrounds", + "method": "put", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "PUT" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-updateBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs" + }, + "initializeBackgrounds": { + "handler": "src/handlers/backgrounds.initializeBackgrounds", + "events": [ + { + "http": { + "path": "backgrounds/{userId}/initialize", + "method": "post", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-initializeBackgrounds", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw" + }, + "getBackgrounds": { + "handler": "src/handlers/backgrounds.getBackgrounds", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "get", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-getBackgrounds", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg" + }, + "addBackground": { + "handler": "src/handlers/backgrounds.addBackground", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "post", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-addBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw" + }, + "deleteBackground": { + "handler": "src/handlers/backgrounds.deleteBackground", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "delete", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-deleteBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc" + }, + "auth0Authorizer": { + "handler": "src/handlers/auth/index.handler", + "events": [ + { + "http": { + "path": "auth/validate", + "method": "post", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "POST" + ], + "headers": [ + "Content-Type", + "X-Amz-Date", + "Authorization", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent", + "X-Amzn-Trace-Id" + ], + "allowCredentials": "" + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-auth0Authorizer", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg" + } + } + }, + "configFileDirPath": "D:\\Projects\\Portfolio_Projects\\focusflow\\FocusFlow\\backend", + "config": { + "type": "aws" + }, + "options": {}, + "stage": "dev", + "dashboard": { + "aws": { + "accessKeyId": "", + "secretAccessKey": "", + "sessionToken": "", + "$source": { + "CREDENTIALS_CODE": "" + } + }, + "params": null, + "accessKey": "" + }, + "logger": { + "namespace": "s:core:resolver:aws", + "prefix": null, + "prefixColor": null + }, + "_credentialsPromise": "", + "isDefaultConfig": true + }, + "resolvers": {} + }, + "sls": { + "instance": { + "credentials": "", + "serviceConfigFile": { + "org": "devquesting", + "app": "focusflow", + "service": "backend", + "plugins": [ + "serverless-offline" + ], + "provider": { + "name": "aws", + "runtime": "nodejs20.x", + "region": "us-east-1", + "stage": "dev", + "environment": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + }, + "iam": { + "role": { + "statements": [ + { + "Effect": "Allow", + "Action": [ + "dynamodb:PutItem", + "dynamodb:GetItem", + "dynamodb:UpdateItem", + "dynamodb:DeleteItem", + "dynamodb:Scan", + "dynamodb:Query" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObject", + "s3:DeleteObject" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "lambda:InvokeFunction" + ], + "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" + } + ] + } + }, + "versionFunctions": true, + "compiledCloudFormationTemplate": { + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "The AWS CloudFormation template for this Serverless application", + "Resources": { + "CreateTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-createTask" + } + }, + "GetTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getTask" + } + }, + "UpdateTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-updateTask" + } + }, + "DeleteTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-deleteTask" + } + }, + "ManageTimerLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-manageTimer" + } + }, + "UpdatePreferencesLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-updatePreferences" + } + }, + "GetMusicLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getMusic" + } + }, + "UpdateBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-updateBackground" + } + }, + "InitializeBackgroundsLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-initializeBackgrounds" + } + }, + "GetBackgroundsLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getBackgrounds" + } + }, + "AddBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-addBackground" + } + }, + "DeleteBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-deleteBackground" + } + }, + "Auth0AuthorizerLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-auth0Authorizer" + } + }, + "IamRoleLambdaExecution": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + }, + "Policies": [ + { + "PolicyName": { + "Fn::Join": [ + "-", + [ + "backend", + "dev", + "lambda" + ] + ] + }, + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogStream", + "logs:CreateLogGroup", + "logs:TagResource" + ], + "Resource": [ + { + "Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/backend-dev*:*" + } + ] + }, + { + "Effect": "Allow", + "Action": [ + "logs:PutLogEvents" + ], + "Resource": [ + { + "Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/backend-dev*:*:*" + } + ] + }, + { + "Effect": "Allow", + "Action": [ + "dynamodb:PutItem", + "dynamodb:GetItem", + "dynamodb:UpdateItem", + "dynamodb:DeleteItem", + "dynamodb:Scan", + "dynamodb:Query" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObject", + "s3:DeleteObject" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "lambda:InvokeFunction" + ], + "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" + } + ] + } + } + ], + "Path": "/", + "RoleName": { + "Fn::Join": [ + "-", + [ + "backend", + "dev", + { + "Ref": "AWS::Region" + }, + "lambdaRole" + ] + ] + } + } + }, + "CreateTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/createTask.createTask", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-createTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "CreateTaskLogGroup" + ] + }, + "GetTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/getTask.getTasks", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "GetTaskLogGroup" + ] + }, + "UpdateTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/updateTask.updateTask", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-updateTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "UpdateTaskLogGroup" + ] + }, + "DeleteTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/deleteTask.deleteTask", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-deleteTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "DeleteTaskLogGroup" + ] + }, + "ManageTimerLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/timer/manageTimer.manageTimer", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-manageTimer", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "ManageTimerLogGroup" + ] + }, + "UpdatePreferencesLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/preferences/updatePreferences.updatePreferences", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-updatePreferences", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "UpdatePreferencesLogGroup" + ] + }, + "GetMusicLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/music/getMusic.getMusic", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getMusic", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "GetMusicLogGroup" + ] + }, + "UpdateBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/background/updateBackground.updateBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-updateBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "UpdateBackgroundLogGroup" + ] + }, + "InitializeBackgroundsLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.initializeBackgrounds", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-initializeBackgrounds", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "InitializeBackgroundsLogGroup" + ] + }, + "GetBackgroundsLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.getBackgrounds", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getBackgrounds", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "GetBackgroundsLogGroup" + ] + }, + "AddBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.addBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-addBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "AddBackgroundLogGroup" + ] + }, + "DeleteBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.deleteBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-deleteBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "DeleteBackgroundLogGroup" + ] + }, + "Auth0AuthorizerLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/auth/index.handler", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-auth0Authorizer", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "Auth0AuthorizerLogGroup" + ] + }, + "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "CreateTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "UpdateTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DeleteTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "ManageTimerLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "UpdatePreferencesLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetMusicLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "UpdateBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "InitializeBackgroundsLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetBackgroundsLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "AddBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DeleteBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "Auth0AuthorizerLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "ApiGatewayRestApi": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Name": "dev-backend", + "EndpointConfiguration": { + "Types": [ + "EDGE" + ] + }, + "Policy": "" + } + }, + "ApiGatewayResourceTasks": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "tasks", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceTasksTaskidVar": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceTasks" + }, + "PathPart": "{taskId}", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceTimer": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "timer", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourcePreferences": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "preferences", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceMusic": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "music", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgrounds": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "backgrounds", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgroundsUseridVar": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "PathPart": "{userId}", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgroundsUseridVarInitialize": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "PathPart": "initialize", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceAuth": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "auth", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceAuthValidate": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceAuth" + }, + "PathPart": "validate", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTasksOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true, + "method.response.header.Access-Control-Allow-Credentials": "" + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent,X-Amzn-Trace-Id,X-Requested-With'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET,POST'", + "method.response.header.Access-Control-Allow-Credentials": "" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceTasks" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTasksTaskidVarOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'http://localhost:5173'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,DELETE,PUT'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceTasksTaskidVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTimerOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,POST'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceTimer" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodPreferencesOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,PUT'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourcePreferences" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodMusicOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceMusic" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodBackgroundsOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,PUT'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodAuthValidateOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent,X-Amzn-Trace-Id'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,POST'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceAuthValidate" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTasksPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasks" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "CreateTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTasksGet": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasks" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTasksTaskidVarPut": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "PUT", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasksTaskidVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "UpdateTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTasksTaskidVarDelete": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "DELETE", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasksTaskidVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "DeleteTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTimerPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTimer" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "ManageTimerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodPreferencesPut": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "PUT", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourcePreferences" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "UpdatePreferencesLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodMusicGet": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceMusic" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetMusicLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "GetMusicLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsPut": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "PUT", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "UpdateBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarInitializePost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVarInitialize" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "InitializeBackgroundsLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "InitializeBackgroundsLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarGet": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetBackgroundsLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "GetBackgroundsLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "AddBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "AddBackgroundLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarDelete": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "DELETE", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "DeleteBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "DeleteBackgroundLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodAuthValidatePost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceAuthValidate" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerLambdaPermissionApiGateway" + ] + }, + "Auth0AuthorizerApiGatewayAuthorizer": { + "Type": "AWS::ApiGateway::Authorizer", + "Properties": { + "AuthorizerResultTtlInSeconds": 300, + "IdentitySource": "method.request.header.Authorization", + "Name": "auth0Authorizer", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "AuthorizerUri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + }, + "Type": "REQUEST" + } + }, + "ApiGatewayDeployment1732598895104": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "StageName": "dev" + }, + "DependsOn": [ + "ApiGatewayMethodTasksOptions", + "ApiGatewayMethodTasksTaskidVarOptions", + "ApiGatewayMethodTimerOptions", + "ApiGatewayMethodPreferencesOptions", + "ApiGatewayMethodMusicOptions", + "ApiGatewayMethodBackgroundsOptions", + "ApiGatewayMethodAuthValidateOptions", + "ApiGatewayMethodTasksPost", + "ApiGatewayMethodTasksGet", + "ApiGatewayMethodTasksTaskidVarPut", + "ApiGatewayMethodTasksTaskidVarDelete", + "ApiGatewayMethodTimerPost", + "ApiGatewayMethodPreferencesPut", + "ApiGatewayMethodMusicGet", + "ApiGatewayMethodBackgroundsPut", + "ApiGatewayMethodBackgroundsUseridVarInitializePost", + "ApiGatewayMethodBackgroundsUseridVarGet", + "ApiGatewayMethodBackgroundsUseridVarPost", + "ApiGatewayMethodBackgroundsUseridVarDelete", + "ApiGatewayMethodAuthValidatePost" + ] + }, + "CreateTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "CreateTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "Auth0AuthorizerLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "GetTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "UpdateTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "UpdateTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "DeleteTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "DeleteTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "ManageTimerLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "ManageTimerLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "UpdatePreferencesLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "UpdatePreferencesLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "GetMusicLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetMusicLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "UpdateBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "UpdateBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "InitializeBackgroundsLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "InitializeBackgroundsLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "GetBackgroundsLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetBackgroundsLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "AddBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "AddBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "DeleteBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "DeleteBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "TasksTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-tasks", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + }, + { + "AttributeName": "taskId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + }, + { + "AttributeName": "taskId", + "KeyType": "RANGE" + } + ] + } + }, + "UsersTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-users", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, + "UserBackgroundsTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-user-backgrounds", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, + "AssetsBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "dev-focusflow-assets-274552760074", + "CorsConfiguration": { + "CorsRules": [ + { + "AllowedHeaders": [ + "*" + ], + "AllowedMethods": [ + "GET", + "PUT", + "POST", + "DELETE", + "HEAD" + ], + "AllowedOrigins": [ + "*" + ], + "MaxAge": 3000 + } + ] + } + } + } + }, + "Outputs": { + "ServerlessDeploymentBucketName": { + "Value": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "Export": { + "Name": "sls-backend-dev-ServerlessDeploymentBucketName" + } + }, + "CreateTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM" + }, + "Export": { + "Name": "sls-backend-dev-CreateTaskLambdaFunctionQualifiedArn" + } + }, + "GetTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M" + }, + "Export": { + "Name": "sls-backend-dev-GetTaskLambdaFunctionQualifiedArn" + } + }, + "UpdateTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE" + }, + "Export": { + "Name": "sls-backend-dev-UpdateTaskLambdaFunctionQualifiedArn" + } + }, + "DeleteTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg" + }, + "Export": { + "Name": "sls-backend-dev-DeleteTaskLambdaFunctionQualifiedArn" + } + }, + "ManageTimerLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw" + }, + "Export": { + "Name": "sls-backend-dev-ManageTimerLambdaFunctionQualifiedArn" + } + }, + "UpdatePreferencesLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ" + }, + "Export": { + "Name": "sls-backend-dev-UpdatePreferencesLambdaFunctionQualifiedArn" + } + }, + "GetMusicLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU" + }, + "Export": { + "Name": "sls-backend-dev-GetMusicLambdaFunctionQualifiedArn" + } + }, + "UpdateBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs" + }, + "Export": { + "Name": "sls-backend-dev-UpdateBackgroundLambdaFunctionQualifiedArn" + } + }, + "InitializeBackgroundsLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw" + }, + "Export": { + "Name": "sls-backend-dev-InitializeBackgroundsLambdaFunctionQualifiedArn" + } + }, + "GetBackgroundsLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg" + }, + "Export": { + "Name": "sls-backend-dev-GetBackgroundsLambdaFunctionQualifiedArn" + } + }, + "AddBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw" + }, + "Export": { + "Name": "sls-backend-dev-AddBackgroundLambdaFunctionQualifiedArn" + } + }, + "DeleteBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc" + }, + "Export": { + "Name": "sls-backend-dev-DeleteBackgroundLambdaFunctionQualifiedArn" + } + }, + "Auth0AuthorizerLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg" + }, + "Export": { + "Name": "sls-backend-dev-Auth0AuthorizerLambdaFunctionQualifiedArn" + } + }, + "ServiceEndpoint": { + "Description": "URL of the service endpoint", + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "ApiGatewayRestApi" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/dev" + ] + ] + }, + "Export": { + "Name": "sls-backend-dev-ServiceEndpoint" + } + } + } + }, + "vpc": {} + }, + "custom": { + "tableName": "dev-focusflow-tasks", + "usersTableName": "dev-focusflow-users", + "bucketName": "dev-focusflow-assets-274552760074" + }, + "resources": { + "Resources": { + "TasksTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-tasks", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + }, + { + "AttributeName": "taskId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + }, + { + "AttributeName": "taskId", + "KeyType": "RANGE" + } + ] + } + }, + "UsersTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-users", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, + "UserBackgroundsTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-user-backgrounds", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, + "AssetsBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "dev-focusflow-assets-274552760074", + "CorsConfiguration": { + "CorsRules": [ + { + "AllowedHeaders": [ + "*" + ], + "AllowedMethods": [ + "GET", + "PUT", + "POST", + "DELETE", + "HEAD" + ], + "AllowedOrigins": [ + "*" + ], + "MaxAge": 3000 + } + ] + } + } + } + }, + "Outputs": {} + }, + "functions": { + "createTask": { + "handler": "src/handlers/task/createTask.createTask", + "events": [ + { + "http": { + "path": "tasks", + "method": "post", + "cors": { + "origin": "http://localhost:5173", + "methods": [ + "OPTIONS", + "POST" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-createTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM" + }, + "getTask": { + "handler": "src/handlers/task/getTask.getTasks", + "events": [ + { + "http": { + "path": "tasks", + "method": "get", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "GET" + ], + "headers": [ + "Content-Type", + "X-Amz-Date", + "Authorization", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent", + "X-Amzn-Trace-Id" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-getTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M" + }, + "updateTask": { + "handler": "src/handlers/task/updateTask.updateTask", + "events": [ + { + "http": { + "path": "tasks/{taskId}", + "method": "put", + "cors": { + "origin": "http://localhost:5173", + "methods": [ + "OPTIONS", + "PUT" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "allowCredentials": "", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-updateTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE" + }, + "deleteTask": { + "handler": "src/handlers/task/deleteTask.deleteTask", + "events": [ + { + "http": { + "path": "tasks/{taskId}", + "method": "delete", + "cors": { + "origin": "http://localhost:5173", + "methods": [ + "OPTIONS", + "DELETE" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "allowCredentials": "", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-deleteTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg" + }, + "manageTimer": { + "handler": "src/handlers/timer/manageTimer.manageTimer", + "events": [ + { + "http": { + "path": "timer", + "method": "post", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "POST" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-manageTimer", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw" + }, + "updatePreferences": { + "handler": "src/handlers/preferences/updatePreferences.updatePreferences", + "events": [ + { + "http": { + "path": "preferences", + "method": "put", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "PUT" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-updatePreferences", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ" + }, + "getMusic": { + "handler": "src/handlers/music/getMusic.getMusic", + "events": [ + { + "http": { + "path": "music", + "method": "get", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "GET" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-getMusic", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU" + }, + "updateBackground": { + "handler": "src/handlers/background/updateBackground.updateBackground", + "events": [ + { + "http": { + "path": "backgrounds", + "method": "put", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "PUT" + ], + "headers": [ + "Content-Type", + "Authorization", + "X-Requested-With", + "X-Amz-Date", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent" + ], + "allowCredentials": "" + }, + "authorizer": { + "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, + "identitySource": "method.request.header.Authorization", + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-updateBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs" + }, + "initializeBackgrounds": { + "handler": "src/handlers/backgrounds.initializeBackgrounds", + "events": [ + { + "http": { + "path": "backgrounds/{userId}/initialize", + "method": "post", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-initializeBackgrounds", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw" + }, + "getBackgrounds": { + "handler": "src/handlers/backgrounds.getBackgrounds", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "get", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-getBackgrounds", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg" + }, + "addBackground": { + "handler": "src/handlers/backgrounds.addBackground", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "post", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-addBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw" + }, + "deleteBackground": { + "handler": "src/handlers/backgrounds.deleteBackground", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "delete", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-deleteBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc" + }, + "auth0Authorizer": { + "handler": "src/handlers/auth/index.handler", + "events": [ + { + "http": { + "path": "auth/validate", + "method": "post", + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "POST" + ], + "headers": [ + "Content-Type", + "X-Amz-Date", + "Authorization", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent", + "X-Amzn-Trace-Id" + ], + "allowCredentials": "" + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-auth0Authorizer", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg" + } + } + }, + "configFileDirPath": "D:\\Projects\\Portfolio_Projects\\focusflow\\FocusFlow\\backend", + "config": { + "type": "sls" + }, + "options": {}, + "stage": "dev", + "dashboard": { + "aws": { + "accessKeyId": "", + "secretAccessKey": "", + "sessionToken": "", + "$source": { + "CREDENTIALS_CODE": "" + } + }, + "params": null, + "accessKey": "" + }, + "logger": { + "namespace": "s:core:resolver:sls", + "prefix": null, + "prefixColor": null + }, + "_credentialsPromise": "" + }, + "resolvers": {} + } + }, + "composeServiceName": null, + "servicePath": "D:\\Projects\\Portfolio_Projects\\focusflow\\FocusFlow\\backend", + "serviceConfigFileName": "serverless.yml", + "service": { + "org": "devquesting", + "app": "focusflow", + "service": "backend", + "plugins": [ + "serverless-offline" + ], + "provider": { + "name": "aws", + "runtime": "nodejs20.x", + "region": "us-east-1", + "stage": "dev", + "environment": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + }, + "iam": { + "role": { + "statements": [ + { + "Effect": "Allow", + "Action": [ + "dynamodb:PutItem", + "dynamodb:GetItem", + "dynamodb:UpdateItem", + "dynamodb:DeleteItem", + "dynamodb:Scan", + "dynamodb:Query" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObject", + "s3:DeleteObject" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "lambda:InvokeFunction" + ], + "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" + } + ] + } + }, + "versionFunctions": true, + "compiledCloudFormationTemplate": { + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "The AWS CloudFormation template for this Serverless application", + "Resources": { + "CreateTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-createTask" + } + }, + "GetTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getTask" + } + }, + "UpdateTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-updateTask" + } + }, + "DeleteTaskLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-deleteTask" + } + }, + "ManageTimerLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-manageTimer" + } + }, + "UpdatePreferencesLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-updatePreferences" + } + }, + "GetMusicLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getMusic" + } + }, + "UpdateBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-updateBackground" + } + }, + "InitializeBackgroundsLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-initializeBackgrounds" + } + }, + "GetBackgroundsLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getBackgrounds" + } + }, + "AddBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-addBackground" + } + }, + "DeleteBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-deleteBackground" + } + }, + "Auth0AuthorizerLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-auth0Authorizer" + } + }, + "IamRoleLambdaExecution": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + }, + "Action": [ + "sts:AssumeRole" + ] + } + ] + }, + "Policies": [ + { + "PolicyName": { + "Fn::Join": [ + "-", + [ + "backend", + "dev", + "lambda" + ] + ] + }, + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogStream", + "logs:CreateLogGroup", + "logs:TagResource" + ], + "Resource": [ + { + "Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/backend-dev*:*" + } + ] + }, + { + "Effect": "Allow", + "Action": [ + "logs:PutLogEvents" + ], + "Resource": [ + { + "Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/backend-dev*:*:*" + } + ] + }, + { + "Effect": "Allow", + "Action": [ + "dynamodb:PutItem", + "dynamodb:GetItem", + "dynamodb:UpdateItem", + "dynamodb:DeleteItem", + "dynamodb:Scan", + "dynamodb:Query" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObject", + "s3:DeleteObject" + ], + "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "lambda:InvokeFunction" + ], + "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" + } + ] + } + } + ], + "Path": "/", + "RoleName": { + "Fn::Join": [ + "-", + [ + "backend", + "dev", + { + "Ref": "AWS::Region" + }, + "lambdaRole" + ] + ] + } + } + }, + "CreateTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/createTask.createTask", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-createTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "CreateTaskLogGroup" + ] + }, + "GetTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/getTask.getTasks", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "GetTaskLogGroup" + ] + }, + "UpdateTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/updateTask.updateTask", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-updateTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "UpdateTaskLogGroup" + ] + }, + "DeleteTaskLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/task/deleteTask.deleteTask", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-deleteTask", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "DeleteTaskLogGroup" + ] + }, + "ManageTimerLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/timer/manageTimer.manageTimer", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-manageTimer", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "ManageTimerLogGroup" + ] + }, + "UpdatePreferencesLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/preferences/updatePreferences.updatePreferences", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-updatePreferences", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "UpdatePreferencesLogGroup" + ] + }, + "GetMusicLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/music/getMusic.getMusic", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getMusic", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "GetMusicLogGroup" + ] + }, + "UpdateBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/background/updateBackground.updateBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-updateBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "UpdateBackgroundLogGroup" + ] + }, + "InitializeBackgroundsLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.initializeBackgrounds", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-initializeBackgrounds", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "InitializeBackgroundsLogGroup" + ] + }, + "GetBackgroundsLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.getBackgrounds", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getBackgrounds", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "GetBackgroundsLogGroup" + ] + }, + "AddBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.addBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-addBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "AddBackgroundLogGroup" + ] + }, + "DeleteBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.deleteBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-deleteBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "DeleteBackgroundLogGroup" + ] + }, + "Auth0AuthorizerLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/auth/index.handler", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-auth0Authorizer", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "Auth0AuthorizerLogGroup" + ] + }, + "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "CreateTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "UpdateTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DeleteTaskLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "ManageTimerLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "UpdatePreferencesLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetMusicLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "UpdateBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "InitializeBackgroundsLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetBackgroundsLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "AddBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DeleteBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "Auth0AuthorizerLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "ApiGatewayRestApi": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "Name": "dev-backend", + "EndpointConfiguration": { + "Types": [ + "EDGE" + ] + }, + "Policy": "" + } + }, + "ApiGatewayResourceTasks": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "tasks", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceTasksTaskidVar": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceTasks" + }, + "PathPart": "{taskId}", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceTimer": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "timer", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourcePreferences": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "preferences", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceMusic": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "music", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgrounds": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "backgrounds", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgroundsUseridVar": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "PathPart": "{userId}", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgroundsUseridVarInitialize": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "PathPart": "initialize", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceAuth": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "ApiGatewayRestApi", + "RootResourceId" + ] + }, + "PathPart": "auth", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceAuthValidate": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceAuth" + }, + "PathPart": "validate", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTasksOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true, + "method.response.header.Access-Control-Allow-Credentials": "" + }, + "ResponseModels": {} + } ], - "name": "backend-dev-manageTimer" - }, - "updatePreferences": { - "handler": "src/handlers/preferences/updatePreferences.updatePreferences", - "events": [ + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent,X-Amzn-Trace-Id,X-Requested-With'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET,POST'", + "method.response.header.Access-Control-Allow-Credentials": "" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceTasks" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTasksTaskidVarOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ { - "http": { - "path": "preferences", - "method": "put", - "cors": { - "origin": "*", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'http://localhost:5173'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,DELETE,PUT'" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceTasksTaskidVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTimerOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,POST'" + }, + "ResponseTemplates": { + "application/json": "" } } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceTimer" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodPreferencesOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} } ], - "name": "backend-dev-updatePreferences" - }, - "getMusic": { - "handler": "src/handlers/music/getMusic.getMusic", - "events": [ + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,PUT'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourcePreferences" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodMusicOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ { - "http": { - "path": "music", - "method": "get", - "cors": { - "origin": "*", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceMusic" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodBackgroundsOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,PUT'" + }, + "ResponseTemplates": { + "application/json": "" + } + } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodAuthValidateOptions": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "NONE", + "HttpMethod": "OPTIONS", + "MethodResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": true, + "method.response.header.Access-Control-Allow-Headers": true, + "method.response.header.Access-Control-Allow-Methods": true + }, + "ResponseModels": {} + } + ], + "RequestParameters": {}, + "Integration": { + "Type": "MOCK", + "RequestTemplates": { + "application/json": "{statusCode:200}" + }, + "ContentHandling": "CONVERT_TO_TEXT", + "IntegrationResponses": [ + { + "StatusCode": "200", + "ResponseParameters": { + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent,X-Amzn-Trace-Id'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,POST'" + }, + "ResponseTemplates": { + "application/json": "" } } + ] + }, + "ResourceId": { + "Ref": "ApiGatewayResourceAuthValidate" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayMethodTasksPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasks" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "CreateTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTasksGet": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasks" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTasksTaskidVarPut": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "PUT", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasksTaskidVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "UpdateTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTasksTaskidVarDelete": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "DELETE", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTasksTaskidVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "DeleteTaskLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodTimerPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceTimer" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "ManageTimerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodPreferencesPut": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "PUT", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourcePreferences" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "UpdatePreferencesLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodMusicGet": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceMusic" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetMusicLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "GetMusicLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsPut": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "PUT", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "CUSTOM", + "AuthorizerId": { + "Ref": "Auth0AuthorizerApiGatewayAuthorizer" + }, + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "UpdateBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerApiGatewayAuthorizer" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarInitializePost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVarInitialize" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "InitializeBackgroundsLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] } - ], - "name": "backend-dev-getMusic" + }, + "MethodResponses": [] }, - "updateBackground": { - "handler": "src/handlers/background/updateBackground.updateBackground", - "events": [ - { - "http": { - "path": "backgrounds", - "method": "put", - "cors": { - "origin": "*", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] - }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } - } + "DependsOn": [ + "InitializeBackgroundsLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarGet": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetBackgroundsLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] } - ], - "name": "backend-dev-updateBackground" + }, + "MethodResponses": [] }, - "auth0Authorizer": { - "handler": "src/handlers/auth/index.handler", - "events": [ - { - "http": { - "path": "auth/validate", - "method": "post", - "cors": true - } + "DependsOn": [ + "GetBackgroundsLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "AddBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] } - ], - "name": "backend-dev-auth0Authorizer" - } - } - }, - "configFileDirPath": "D:\\Projects\\Portfolio_Projects\\focusflow\\FocusFlow\\backend", - "config": { - "type": "self" - }, - "options": {}, - "stage": "dev", - "dashboard": { - "aws": { - "accessKeyId": "", - "secretAccessKey": "", - "sessionToken": "", - "$source": { - "CREDENTIALS_CODE": "" - } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "AddBackgroundLambdaPermissionApiGateway" + ] }, - "params": null, - "accessKey": "" - }, - "logger": { - "namespace": "s:core:resolver:self", - "prefix": null, - "prefixColor": null - }, - "_credentialsPromise": "" - }, - "resolvers": {} - }, - "aws": { - "instance": { - "credentials": "", - "serviceConfigFile": { - "org": "devquesting", - "app": "focusflow", - "service": "backend", - "plugins": [ - "serverless-offline" - ], - "provider": { - "name": "aws", - "runtime": "nodejs20.x", - "region": "us-east-1", - "stage": "dev", - "environment": { - "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", - "AUTH0_AUDIENCE": "focusflow-audience", - "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", - "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", - "DYNAMODB_USERS_TABLE": "dev-focusflow-users", - "S3_ASSETS_BUCKET": "dev-focusflow-assets" + "ApiGatewayMethodBackgroundsUseridVarDelete": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "DELETE", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "DeleteBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] }, - "iam": { - "role": { - "statements": [ - { - "Effect": "Allow", - "Action": [ - "dynamodb:PutItem", - "dynamodb:GetItem", - "dynamodb:UpdateItem", - "dynamodb:DeleteItem", - "dynamodb:Scan", - "dynamodb:Query" - ], - "Resource": "*" - }, - { - "Effect": "Allow", - "Action": [ - "s3:PutObject", - "s3:GetObject", - "s3:DeleteObject" - ], - "Resource": "*" - }, - { - "Effect": "Allow", - "Action": [ - "cognito-idp:SignUp" - ], - "Resource": "*" - }, - { - "Effect": "Allow", - "Action": [ - "lambda:InvokeFunction" - ], - "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" - }, - { - "Effect": "Allow", - "Action": [ - "sts:AssumeRole" + "DependsOn": [ + "DeleteBackgroundLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodAuthValidatePost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceAuthValidate" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": "", + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "/invocations" ] - } - ] - } + ] + } + }, + "MethodResponses": [] }, - "cors": { - "allowedOrigins": [ - "http://localhost:5173" - ], - "allowedMethods": [ - "GET", - "POST", - "PUT", - "DELETE", - "OPTIONS" - ], - "allowedHeaders": [ - "Authorization", - "Content-Type", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ], - "allowCredentials": "" + "DependsOn": [ + "Auth0AuthorizerLambdaPermissionApiGateway" + ] + }, + "Auth0AuthorizerApiGatewayAuthorizer": { + "Type": "AWS::ApiGateway::Authorizer", + "Properties": { + "AuthorizerResultTtlInSeconds": 300, + "IdentitySource": "method.request.header.Authorization", + "Name": "auth0Authorizer", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "AuthorizerUri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + }, + "Type": "REQUEST" + } + }, + "ApiGatewayDeployment1732598895104": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "StageName": "dev" }, - "versionFunctions": true, - "AwshttpApi": null + "DependsOn": [ + "ApiGatewayMethodTasksOptions", + "ApiGatewayMethodTasksTaskidVarOptions", + "ApiGatewayMethodTimerOptions", + "ApiGatewayMethodPreferencesOptions", + "ApiGatewayMethodMusicOptions", + "ApiGatewayMethodBackgroundsOptions", + "ApiGatewayMethodAuthValidateOptions", + "ApiGatewayMethodTasksPost", + "ApiGatewayMethodTasksGet", + "ApiGatewayMethodTasksTaskidVarPut", + "ApiGatewayMethodTasksTaskidVarDelete", + "ApiGatewayMethodTimerPost", + "ApiGatewayMethodPreferencesPut", + "ApiGatewayMethodMusicGet", + "ApiGatewayMethodBackgroundsPut", + "ApiGatewayMethodBackgroundsUseridVarInitializePost", + "ApiGatewayMethodBackgroundsUseridVarGet", + "ApiGatewayMethodBackgroundsUseridVarPost", + "ApiGatewayMethodBackgroundsUseridVarDelete", + "ApiGatewayMethodAuthValidatePost" + ] }, - "custom": { - "tableName": "dev-focusflow-tasks", - "usersTableName": "dev-focusflow-users", - "bucketName": "dev-focusflow-assets" + "CreateTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "CreateTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } }, - "resources": { - "Resources": { - "TasksTable": { - "Type": "AWS::DynamoDB::Table", - "Properties": { - "TableName": "dev-focusflow-tasks", - "BillingMode": "PAY_PER_REQUEST", - "AttributeDefinitions": [ + "Auth0AuthorizerLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", { - "AttributeName": "userId", - "AttributeType": "S" + "Ref": "AWS::Partition" }, + ":execute-api:", { - "AttributeName": "taskId", - "AttributeType": "S" - } - ], - "KeySchema": [ + "Ref": "AWS::Region" + }, + ":", { - "AttributeName": "userId", - "KeyType": "HASH" + "Ref": "AWS::AccountId" }, + ":", { - "AttributeName": "taskId", - "KeyType": "RANGE" - } + "Ref": "ApiGatewayRestApi" + }, + "/*/*" ] - } + ] + } + } + }, + "GetTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetTaskLambdaFunction", + "Arn" + ] }, - "UsersTable": { - "Type": "AWS::DynamoDB::Table", - "Properties": { - "TableName": "dev-focusflow-users", - "BillingMode": "PAY_PER_REQUEST", - "AttributeDefinitions": [ + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", { - "AttributeName": "userId", - "AttributeType": "S" - } - ], - "KeySchema": [ + "Ref": "AWS::Partition" + }, + ":execute-api:", { - "AttributeName": "userId", - "KeyType": "HASH" - } + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" ] - } - }, - "AssetsBucket": { - "Type": "AWS::S3::Bucket", - "Properties": { - "BucketName": "dev-focusflow-assets", - "CorsConfiguration": { - "CorsRules": [ - { - "AllowedHeaders": [ - "*" - ], - "AllowedMethods": [ - "GET", - "PUT", - "POST", - "DELETE", - "HEAD" - ], - "AllowedOrigins": [ - "*" - ], - "MaxAge": 3000 - } - ] - } - } + ] } } }, - "functions": { - "createTask": { - "handler": "src/handlers/task/createTask.createTask", - "events": [ - { - "http": { - "path": "tasks", - "method": "post", - "cors": { - "origin": "http://localhost:5173", - "allowCredentials": "", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] + "UpdateTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "UpdateTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } - } - } - ], - "name": "backend-dev-createTask" - }, - "getTask": { - "handler": "src/handlers/task/getTask.getTasks", - "events": [ - { - "http": { - "path": "tasks", - "method": "get", - "cors": { - "origin": "http://localhost:5173", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] + ":execute-api:", + { + "Ref": "AWS::Region" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + ":", + { + "Ref": "AWS::AccountId" }, - "allowCredentials": "" - } - } - ], - "name": "backend-dev-getTask" - }, - "updateTask": { - "handler": "src/handlers/task/updateTask.updateTask", - "events": [ - { - "http": { - "path": "tasks/{taskId}", - "method": "put", - "cors": { - "origin": "http://localhost:5173", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] + ":", + { + "Ref": "ApiGatewayRestApi" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + "/*/*" + ] + ] + } + } + }, + "DeleteTaskLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "DeleteTaskLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" }, - "allowCredentials": "" - } - } - ], - "name": "backend-dev-updateTask" - }, - "deleteTask": { - "handler": "src/handlers/task/deleteTask.deleteTask", - "events": [ - { - "http": { - "path": "tasks/{taskId}", - "method": "delete", - "cors": { - "origin": "http://localhost:5173", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] + ":execute-api:", + { + "Ref": "AWS::Region" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + ":", + { + "Ref": "AWS::AccountId" }, - "allowCredentials": "" - } - } - ], - "name": "backend-dev-deleteTask" - }, - "manageTimer": { - "handler": "src/handlers/timer/manageTimer.manageTimer", - "events": [ - { - "http": { - "path": "timer", - "method": "post", - "cors": { - "origin": "*", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] + ":", + { + "Ref": "ApiGatewayRestApi" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } - } - } - ], - "name": "backend-dev-manageTimer" - }, - "updatePreferences": { - "handler": "src/handlers/preferences/updatePreferences.updatePreferences", - "events": [ - { - "http": { - "path": "preferences", - "method": "put", - "cors": { - "origin": "*", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] + "/*/*" + ] + ] + } + } + }, + "ManageTimerLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "ManageTimerLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } - } - } - ], - "name": "backend-dev-updatePreferences" - }, - "getMusic": { - "handler": "src/handlers/music/getMusic.getMusic", - "events": [ - { - "http": { - "path": "music", - "method": "get", - "cors": { - "origin": "*", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] - } - } - } - ], - "name": "backend-dev-getMusic" - }, - "updateBackground": { - "handler": "src/handlers/background/updateBackground.updateBackground", - "events": [ - { - "http": { - "path": "backgrounds", - "method": "put", - "cors": { - "origin": "*", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] + ":execute-api:", + { + "Ref": "AWS::Region" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } - } - } - ], - "name": "backend-dev-updateBackground" - }, - "auth0Authorizer": { - "handler": "src/handlers/auth/index.handler", - "events": [ - { - "http": { - "path": "auth/validate", - "method": "post", - "cors": true - } - } - ], - "name": "backend-dev-auth0Authorizer" + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } } - } - }, - "configFileDirPath": "D:\\Projects\\Portfolio_Projects\\focusflow\\FocusFlow\\backend", - "config": { - "type": "aws" - }, - "options": {}, - "stage": "dev", - "dashboard": { - "aws": { - "accessKeyId": "", - "secretAccessKey": "", - "sessionToken": "", - "$source": { - "CREDENTIALS_CODE": "" + }, + "UpdatePreferencesLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "UpdatePreferencesLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } } }, - "params": null, - "accessKey": "" - }, - "logger": { - "namespace": "s:core:resolver:aws", - "prefix": null, - "prefixColor": null - }, - "_credentialsPromise": "", - "isDefaultConfig": true - }, - "resolvers": {} - }, - "sls": { - "instance": { - "credentials": "", - "serviceConfigFile": { - "org": "devquesting", - "app": "focusflow", - "service": "backend", - "plugins": [ - "serverless-offline" - ], - "provider": { - "name": "aws", - "runtime": "nodejs20.x", - "region": "us-east-1", - "stage": "dev", - "environment": { - "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", - "AUTH0_AUDIENCE": "focusflow-audience", - "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", - "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", - "DYNAMODB_USERS_TABLE": "dev-focusflow-users", - "S3_ASSETS_BUCKET": "dev-focusflow-assets" - }, - "iam": { - "role": { - "statements": [ - { - "Effect": "Allow", - "Action": [ - "dynamodb:PutItem", - "dynamodb:GetItem", - "dynamodb:UpdateItem", - "dynamodb:DeleteItem", - "dynamodb:Scan", - "dynamodb:Query" - ], - "Resource": "*" - }, - { - "Effect": "Allow", - "Action": [ - "s3:PutObject", - "s3:GetObject", - "s3:DeleteObject" - ], - "Resource": "*" - }, - { - "Effect": "Allow", - "Action": [ - "cognito-idp:SignUp" - ], - "Resource": "*" - }, - { - "Effect": "Allow", - "Action": [ - "lambda:InvokeFunction" - ], - "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" - }, - { - "Effect": "Allow", - "Action": [ - "sts:AssumeRole" - ] - } + "GetMusicLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetMusicLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] ] } - }, - "cors": { - "allowedOrigins": [ - "http://localhost:5173" - ], - "allowedMethods": [ - "GET", - "POST", - "PUT", - "DELETE", - "OPTIONS" - ], - "allowedHeaders": [ - "Authorization", - "Content-Type", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ], - "allowCredentials": "" - }, - "versionFunctions": true, - "AwshttpApi": null + } }, - "custom": { - "tableName": "dev-focusflow-tasks", - "usersTableName": "dev-focusflow-users", - "bucketName": "dev-focusflow-assets" + "UpdateBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "UpdateBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } }, - "resources": { - "Resources": { - "TasksTable": { - "Type": "AWS::DynamoDB::Table", - "Properties": { - "TableName": "dev-focusflow-tasks", - "BillingMode": "PAY_PER_REQUEST", - "AttributeDefinitions": [ + "InitializeBackgroundsLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "InitializeBackgroundsLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", { - "AttributeName": "userId", - "AttributeType": "S" + "Ref": "AWS::Partition" }, + ":execute-api:", { - "AttributeName": "taskId", - "AttributeType": "S" - } - ], - "KeySchema": [ + "Ref": "AWS::Region" + }, + ":", { - "AttributeName": "userId", - "KeyType": "HASH" + "Ref": "AWS::AccountId" }, + ":", { - "AttributeName": "taskId", - "KeyType": "RANGE" - } + "Ref": "ApiGatewayRestApi" + }, + "/*/*" ] - } + ] + } + } + }, + "GetBackgroundsLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetBackgroundsLambdaFunction", + "Arn" + ] }, - "UsersTable": { - "Type": "AWS::DynamoDB::Table", - "Properties": { - "TableName": "dev-focusflow-users", - "BillingMode": "PAY_PER_REQUEST", - "AttributeDefinitions": [ + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", { - "AttributeName": "userId", - "AttributeType": "S" - } - ], - "KeySchema": [ + "Ref": "AWS::Partition" + }, + ":execute-api:", { - "AttributeName": "userId", - "KeyType": "HASH" - } + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" ] - } + ] + } + } + }, + "AddBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "AddBackgroundLambdaFunction", + "Arn" + ] }, - "AssetsBucket": { - "Type": "AWS::S3::Bucket", - "Properties": { - "BucketName": "dev-focusflow-assets", - "CorsConfiguration": { - "CorsRules": [ - { - "AllowedHeaders": [ - "*" - ], - "AllowedMethods": [ - "GET", - "PUT", - "POST", - "DELETE", - "HEAD" - ], - "AllowedOrigins": [ - "*" - ], - "MaxAge": 3000 - } - ] - } - } + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] } } }, - "functions": { - "createTask": { - "handler": "src/handlers/task/createTask.createTask", - "events": [ - { - "http": { - "path": "tasks", - "method": "post", - "cors": { - "origin": "http://localhost:5173", - "allowCredentials": "", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] - }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } - } - } - ], - "name": "backend-dev-createTask" - }, - "getTask": { - "handler": "src/handlers/task/getTask.getTasks", - "events": [ - { - "http": { - "path": "tasks", - "method": "get", - "cors": { - "origin": "http://localhost:5173", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] + "DeleteBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "DeleteBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + ":execute-api:", + { + "Ref": "AWS::Region" }, - "allowCredentials": "" - } - } - ], - "name": "backend-dev-getTask" - }, - "updateTask": { - "handler": "src/handlers/task/updateTask.updateTask", - "events": [ - { - "http": { - "path": "tasks/{taskId}", - "method": "put", - "cors": { - "origin": "http://localhost:5173", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] + ":", + { + "Ref": "AWS::AccountId" }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + ":", + { + "Ref": "ApiGatewayRestApi" }, - "allowCredentials": "" - } - } - ], - "name": "backend-dev-updateTask" - }, - "deleteTask": { - "handler": "src/handlers/task/deleteTask.deleteTask", - "events": [ + "/*/*" + ] + ] + } + } + }, + "TasksTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-tasks", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ { - "http": { - "path": "tasks/{taskId}", - "method": "delete", - "cors": { - "origin": "http://localhost:5173", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] - }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - }, - "allowCredentials": "" - } + "AttributeName": "userId", + "AttributeType": "S" + }, + { + "AttributeName": "taskId", + "AttributeType": "S" } ], - "name": "backend-dev-deleteTask" - }, - "manageTimer": { - "handler": "src/handlers/timer/manageTimer.manageTimer", - "events": [ + "KeySchema": [ { - "http": { - "path": "timer", - "method": "post", - "cors": { - "origin": "*", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] - }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } - } + "AttributeName": "userId", + "KeyType": "HASH" + }, + { + "AttributeName": "taskId", + "KeyType": "RANGE" } - ], - "name": "backend-dev-manageTimer" - }, - "updatePreferences": { - "handler": "src/handlers/preferences/updatePreferences.updatePreferences", - "events": [ + ] + } + }, + "UsersTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-focusflow-users", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ { - "http": { - "path": "preferences", - "method": "put", - "cors": { - "origin": "*", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] - }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } - } + "AttributeName": "userId", + "AttributeType": "S" } ], - "name": "backend-dev-updatePreferences" - }, - "getMusic": { - "handler": "src/handlers/music/getMusic.getMusic", - "events": [ + "KeySchema": [ { - "http": { - "path": "music", - "method": "get", - "cors": { - "origin": "*", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] - } - } + "AttributeName": "userId", + "KeyType": "HASH" } - ], - "name": "backend-dev-getMusic" - }, - "updateBackground": { - "handler": "src/handlers/background/updateBackground.updateBackground", - "events": [ + ] + } + }, + "UserBackgroundsTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-user-backgrounds", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ { - "http": { - "path": "backgrounds", - "method": "put", - "cors": { - "origin": "*", - "headers": [ - "Content-Type", - "Authorization", - "X-Requested-With", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] - }, - "authorizer": { - "type": "REQUEST", - "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } - } + "AttributeName": "userId", + "AttributeType": "S" } ], - "name": "backend-dev-updateBackground" - }, - "auth0Authorizer": { - "handler": "src/handlers/auth/index.handler", - "events": [ + "KeySchema": [ { - "http": { - "path": "auth/validate", - "method": "post", - "cors": true - } + "AttributeName": "userId", + "KeyType": "HASH" } - ], - "name": "backend-dev-auth0Authorizer" + ] + } + }, + "AssetsBucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": "dev-focusflow-assets-274552760074", + "CorsConfiguration": { + "CorsRules": [ + { + "AllowedHeaders": [ + "*" + ], + "AllowedMethods": [ + "GET", + "PUT", + "POST", + "DELETE", + "HEAD" + ], + "AllowedOrigins": [ + "*" + ], + "MaxAge": 3000 + } + ] + } + } + } + }, + "Outputs": { + "ServerlessDeploymentBucketName": { + "Value": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "Export": { + "Name": "sls-backend-dev-ServerlessDeploymentBucketName" + } + }, + "CreateTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM" + }, + "Export": { + "Name": "sls-backend-dev-CreateTaskLambdaFunctionQualifiedArn" + } + }, + "GetTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M" + }, + "Export": { + "Name": "sls-backend-dev-GetTaskLambdaFunctionQualifiedArn" + } + }, + "UpdateTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE" + }, + "Export": { + "Name": "sls-backend-dev-UpdateTaskLambdaFunctionQualifiedArn" + } + }, + "DeleteTaskLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg" + }, + "Export": { + "Name": "sls-backend-dev-DeleteTaskLambdaFunctionQualifiedArn" + } + }, + "ManageTimerLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw" + }, + "Export": { + "Name": "sls-backend-dev-ManageTimerLambdaFunctionQualifiedArn" + } + }, + "UpdatePreferencesLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ" + }, + "Export": { + "Name": "sls-backend-dev-UpdatePreferencesLambdaFunctionQualifiedArn" } - } - }, - "configFileDirPath": "D:\\Projects\\Portfolio_Projects\\focusflow\\FocusFlow\\backend", - "config": { - "type": "sls" - }, - "options": {}, - "stage": "dev", - "dashboard": { - "aws": { - "accessKeyId": "", - "secretAccessKey": "", - "sessionToken": "", - "$source": { - "CREDENTIALS_CODE": "" + }, + "GetMusicLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU" + }, + "Export": { + "Name": "sls-backend-dev-GetMusicLambdaFunctionQualifiedArn" } }, - "params": null, - "accessKey": "" - }, - "logger": { - "namespace": "s:core:resolver:sls", - "prefix": null, - "prefixColor": null - }, - "_credentialsPromise": "" - }, - "resolvers": {} - } - }, - "composeServiceName": null, - "servicePath": "D:\\Projects\\Portfolio_Projects\\focusflow\\FocusFlow\\backend", - "serviceConfigFileName": "serverless.yml", - "service": { - "org": "devquesting", - "app": "focusflow", - "service": "backend", - "plugins": [ - "serverless-offline" - ], - "provider": { - "name": "aws", - "runtime": "nodejs20.x", - "region": "us-east-1", - "stage": "dev", - "environment": { - "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", - "AUTH0_AUDIENCE": "focusflow-audience", - "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", - "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", - "DYNAMODB_USERS_TABLE": "dev-focusflow-users", - "S3_ASSETS_BUCKET": "dev-focusflow-assets" - }, - "iam": { - "role": { - "statements": [ - { - "Effect": "Allow", - "Action": [ - "dynamodb:PutItem", - "dynamodb:GetItem", - "dynamodb:UpdateItem", - "dynamodb:DeleteItem", - "dynamodb:Scan", - "dynamodb:Query" - ], - "Resource": "*" + "UpdateBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs" }, - { - "Effect": "Allow", - "Action": [ - "s3:PutObject", - "s3:GetObject", - "s3:DeleteObject" - ], - "Resource": "*" + "Export": { + "Name": "sls-backend-dev-UpdateBackgroundLambdaFunctionQualifiedArn" + } + }, + "InitializeBackgroundsLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw" }, - { - "Effect": "Allow", - "Action": [ - "cognito-idp:SignUp" - ], - "Resource": "*" + "Export": { + "Name": "sls-backend-dev-InitializeBackgroundsLambdaFunctionQualifiedArn" + } + }, + "GetBackgroundsLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg" }, - { - "Effect": "Allow", - "Action": [ - "lambda:InvokeFunction" - ], - "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" + "Export": { + "Name": "sls-backend-dev-GetBackgroundsLambdaFunctionQualifiedArn" + } + }, + "AddBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw" }, - { - "Effect": "Allow", - "Action": [ - "sts:AssumeRole" + "Export": { + "Name": "sls-backend-dev-AddBackgroundLambdaFunctionQualifiedArn" + } + }, + "DeleteBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc" + }, + "Export": { + "Name": "sls-backend-dev-DeleteBackgroundLambdaFunctionQualifiedArn" + } + }, + "Auth0AuthorizerLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg" + }, + "Export": { + "Name": "sls-backend-dev-Auth0AuthorizerLambdaFunctionQualifiedArn" + } + }, + "ServiceEndpoint": { + "Description": "URL of the service endpoint", + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "ApiGatewayRestApi" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/dev" + ] ] + }, + "Export": { + "Name": "sls-backend-dev-ServiceEndpoint" } - ] + } } }, - "cors": { - "allowedOrigins": [ - "http://localhost:5173" - ], - "allowedMethods": [ - "GET", - "POST", - "PUT", - "DELETE", - "OPTIONS" - ], - "allowedHeaders": [ - "Authorization", - "Content-Type", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ], - "allowCredentials": "" - }, - "versionFunctions": true, - "AwshttpApi": null + "vpc": {} }, "custom": { "tableName": "dev-focusflow-tasks", "usersTableName": "dev-focusflow-users", - "bucketName": "dev-focusflow-assets" + "bucketName": "dev-focusflow-assets-274552760074" }, "resources": { "Resources": { @@ -1503,10 +12691,29 @@ ] } }, + "UserBackgroundsTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-user-backgrounds", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, "AssetsBucket": { "Type": "AWS::S3::Bucket", "Properties": { - "BucketName": "dev-focusflow-assets", + "BucketName": "dev-focusflow-assets-274552760074", "CorsConfiguration": { "CorsRules": [ { @@ -1529,7 +12736,8 @@ } } } - } + }, + "Outputs": {} }, "functions": { "createTask": { @@ -1541,7 +12749,10 @@ "method": "post", "cors": { "origin": "http://localhost:5173", - "allowCredentials": "", + "methods": [ + "OPTIONS", + "POST" + ], "headers": [ "Content-Type", "Authorization", @@ -1550,17 +12761,34 @@ "X-Api-Key", "X-Amz-Security-Token", "X-Amz-User-Agent" - ] + ], + "allowCredentials": "" }, "authorizer": { "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } + "claims": [] + }, + "integration": "AWS_PROXY" } } ], - "name": "backend-dev-createTask" + "name": "backend-dev-createTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM" }, "getTask": { "handler": "src/handlers/task/getTask.getTasks", @@ -1570,27 +12798,47 @@ "path": "tasks", "method": "get", "cors": { - "origin": "http://localhost:5173", + "origin": "*", + "methods": [ + "OPTIONS", + "GET" + ], "headers": [ "Content-Type", - "Authorization", - "X-Requested-With", "X-Amz-Date", + "Authorization", "X-Api-Key", "X-Amz-Security-Token", - "X-Amz-User-Agent" - ] + "X-Amz-User-Agent", + "X-Amzn-Trace-Id" + ], + "allowCredentials": "" }, "authorizer": { "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + "claims": [] }, - "allowCredentials": "" + "integration": "AWS_PROXY" } } ], - "name": "backend-dev-getTask" + "name": "backend-dev-getTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M" }, "updateTask": { "handler": "src/handlers/task/updateTask.updateTask", @@ -1601,6 +12849,10 @@ "method": "put", "cors": { "origin": "http://localhost:5173", + "methods": [ + "OPTIONS", + "PUT" + ], "headers": [ "Content-Type", "Authorization", @@ -1609,18 +12861,35 @@ "X-Api-Key", "X-Amz-Security-Token", "X-Amz-User-Agent" - ] + ], + "allowCredentials": "" }, "authorizer": { "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + "claims": [] }, - "allowCredentials": "" + "allowCredentials": "", + "integration": "AWS_PROXY" } } ], - "name": "backend-dev-updateTask" + "name": "backend-dev-updateTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE" }, "deleteTask": { "handler": "src/handlers/task/deleteTask.deleteTask", @@ -1631,6 +12900,10 @@ "method": "delete", "cors": { "origin": "http://localhost:5173", + "methods": [ + "OPTIONS", + "DELETE" + ], "headers": [ "Content-Type", "Authorization", @@ -1639,18 +12912,35 @@ "X-Api-Key", "X-Amz-Security-Token", "X-Amz-User-Agent" - ] + ], + "allowCredentials": "" }, "authorizer": { "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" + "claims": [] }, - "allowCredentials": "" + "allowCredentials": "", + "integration": "AWS_PROXY" } } ], - "name": "backend-dev-deleteTask" + "name": "backend-dev-deleteTask", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg" }, "manageTimer": { "handler": "src/handlers/timer/manageTimer.manageTimer", @@ -1661,6 +12951,10 @@ "method": "post", "cors": { "origin": "*", + "methods": [ + "OPTIONS", + "POST" + ], "headers": [ "Content-Type", "Authorization", @@ -1669,17 +12963,34 @@ "X-Api-Key", "X-Amz-Security-Token", "X-Amz-User-Agent" - ] + ], + "allowCredentials": "" }, "authorizer": { "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } + "claims": [] + }, + "integration": "AWS_PROXY" } } ], - "name": "backend-dev-manageTimer" + "name": "backend-dev-manageTimer", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw" }, "updatePreferences": { "handler": "src/handlers/preferences/updatePreferences.updatePreferences", @@ -1690,6 +13001,10 @@ "method": "put", "cors": { "origin": "*", + "methods": [ + "OPTIONS", + "PUT" + ], "headers": [ "Content-Type", "Authorization", @@ -1698,17 +13013,34 @@ "X-Api-Key", "X-Amz-Security-Token", "X-Amz-User-Agent" - ] + ], + "allowCredentials": "" }, "authorizer": { "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } + "claims": [] + }, + "integration": "AWS_PROXY" } } ], - "name": "backend-dev-updatePreferences" + "name": "backend-dev-updatePreferences", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ" }, "getMusic": { "handler": "src/handlers/music/getMusic.getMusic", @@ -1719,6 +13051,10 @@ "method": "get", "cors": { "origin": "*", + "methods": [ + "OPTIONS", + "GET" + ], "headers": [ "Content-Type", "Authorization", @@ -1727,12 +13063,20 @@ "X-Api-Key", "X-Amz-Security-Token", "X-Amz-User-Agent" - ] - } + ], + "allowCredentials": "" + }, + "integration": "AWS_PROXY" } } ], - "name": "backend-dev-getMusic" + "name": "backend-dev-getMusic", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU" }, "updateBackground": { "handler": "src/handlers/background/updateBackground.updateBackground", @@ -1743,6 +13087,10 @@ "method": "put", "cors": { "origin": "*", + "methods": [ + "OPTIONS", + "PUT" + ], "headers": [ "Content-Type", "Authorization", @@ -1751,17 +13099,110 @@ "X-Api-Key", "X-Amz-Security-Token", "X-Amz-User-Agent" - ] + ], + "allowCredentials": "" }, "authorizer": { "type": "REQUEST", + "name": "auth0Authorizer", + "arn": { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "managedExternally": false, + "resultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", - "name": "auth0Authorizer" - } + "claims": [] + }, + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-updateBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs" + }, + "initializeBackgrounds": { + "handler": "src/handlers/backgrounds.initializeBackgrounds", + "events": [ + { + "http": { + "path": "backgrounds/{userId}/initialize", + "method": "post", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-initializeBackgrounds", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw" + }, + "getBackgrounds": { + "handler": "src/handlers/backgrounds.getBackgrounds", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "get", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-getBackgrounds", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg" + }, + "addBackground": { + "handler": "src/handlers/backgrounds.addBackground", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "post", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-addBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw" + }, + "deleteBackground": { + "handler": "src/handlers/backgrounds.deleteBackground", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "delete", + "integration": "AWS_PROXY" } } ], - "name": "backend-dev-updateBackground" + "name": "backend-dev-deleteBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc" }, "auth0Authorizer": { "handler": "src/handlers/auth/index.handler", @@ -1770,17 +13211,40 @@ "http": { "path": "auth/validate", "method": "post", - "cors": true + "cors": { + "origin": "*", + "methods": [ + "OPTIONS", + "POST" + ], + "headers": [ + "Content-Type", + "X-Amz-Date", + "Authorization", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent", + "X-Amzn-Trace-Id" + ], + "allowCredentials": "" + }, + "integration": "AWS_PROXY" } } ], - "name": "backend-dev-auth0Authorizer" + "name": "backend-dev-auth0Authorizer", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg" } } }, - "serviceRawFile": "# FocusFlow Serverless Configuration\n\norg: devquesting\napp: focusflow\nservice: backend\n\nplugins:\n - serverless-offline\n\nprovider:\n name: aws\n runtime: nodejs20.x\n region: us-east-1\n stage: dev\n environment:\n AUTH0_DOMAIN: dev-6zeb418i7xs8g1lc.us.auth0.com\n AUTH0_AUDIENCE: focusflow-audience\n AUTH0_ISSUER: https://dev-6zeb418i7xs8g1lc.us.auth0.com/\n DYNAMODB_TASKS_TABLE: dev-focusflow-tasks\n DYNAMODB_USERS_TABLE: dev-focusflow-users\n S3_ASSETS_BUCKET: dev-focusflow-assets \n iam:\n role:\n statements:\n - Effect: Allow\n Action:\n - dynamodb:PutItem\n - dynamodb:GetItem\n - dynamodb:UpdateItem\n - dynamodb:DeleteItem\n - dynamodb:Scan\n - dynamodb:Query\n Resource: \"*\"\n - Effect: Allow\n Action:\n - s3:PutObject\n - s3:GetObject\n - s3:DeleteObject\n Resource: \"*\"\n - Effect: Allow\n Action:\n - cognito-idp:SignUp\n Resource: \"*\"\n - Effect: Allow\n Action:\n - lambda:InvokeFunction\n Resource:\n - arn:aws:lambda:${self:provider.region}:${aws:accountId}:function:${self:service}-${self:provider.stage}-auth0Authenticator\n - Effect: Allow\n Action:\n - sts:AssumeRole\n AwshttpApi:\n cors:\n allowedOrigins:\n - http://localhost:5173\n allowedMethods:\n - GET\n - POST\n - PUT\n - DELETE\n - OPTIONS\n allowedHeaders:\n - Authorization\n - Content-Type\n - X-Amz-Date\n - X-Api-Key\n - X-Amz-Security-Token\n - X-Amz-User-Agent\n allowCredentials: true\n\ncustom:\n tableName: ${sls:stage}-focusflow-tasks\n usersTableName: ${sls:stage}-focusflow-users\n bucketName: ${sls:stage}-focusflow-assets\n\nresources:\n Resources:\n # DynamoDB Table for Tasks\n TasksTable:\n Type: AWS::DynamoDB::Table\n Properties:\n TableName: ${self:custom.tableName}\n BillingMode: PAY_PER_REQUEST\n AttributeDefinitions:\n - AttributeName: userId\n AttributeType: S\n - AttributeName: taskId\n AttributeType: S\n KeySchema:\n - AttributeName: userId\n KeyType: HASH\n - AttributeName: taskId\n KeyType: RANGE\n\n # DynamoDB Table for Users\n UsersTable:\n Type: AWS::DynamoDB::Table\n Properties:\n TableName: ${self:custom.usersTableName}\n BillingMode: PAY_PER_REQUEST\n AttributeDefinitions:\n - AttributeName: userId\n AttributeType: S\n KeySchema:\n - AttributeName: userId\n KeyType: HASH\n\n # S3 Bucket for Assets\n AssetsBucket:\n Type: AWS::S3::Bucket\n Properties:\n BucketName: ${self:custom.bucketName}\n CorsConfiguration:\n CorsRules:\n - AllowedHeaders: [\"*\"]\n AllowedMethods: [GET, PUT, POST, DELETE, HEAD]\n AllowedOrigins: [\"*\"]\n MaxAge: 3000\n\nfunctions:\n # Task Management\n createTask:\n handler: src/handlers/task/createTask.createTask\n events:\n - http:\n path: tasks\n method: post\n cors:\n origin: \"http://localhost:5173\"\n allowCredentials: true\n headers:\n - Content-Type\n - Authorization\n - X-Requested-With\n - X-Amz-Date\n - X-Api-Key\n - X-Amz-Security-Token\n - X-Amz-User-Agent\n authorizer:\n type: REQUEST\n identitySource: method.request.header.Authorization\n name: auth0Authorizer\n getTask:\n handler: src/handlers/task/getTask.getTasks\n events:\n - http:\n path: tasks\n method: get\n cors:\n origin: \"http://localhost:5173\" # Use '*' for all origins or specify 'http://localhost:5173' for development\n headers:\n - Content-Type\n - Authorization\n - X-Requested-With\n - X-Amz-Date\n - X-Api-Key\n - X-Amz-Security-Token\n - X-Amz-User-Agent\n authorizer:\n type: REQUEST\n identitySource: method.request.header.Authorization\n name: auth0Authorizer\n allowCredentials: true\n updateTask:\n handler: src/handlers/task/updateTask.updateTask\n events:\n - http:\n path: tasks/{taskId}\n method: put\n cors:\n origin: \"http://localhost:5173\" # Use '*' for all origins or specify 'http://localhost:5173' for development\n headers:\n - Content-Type\n - Authorization\n - X-Requested-With\n - X-Amz-Date\n - X-Api-Key\n - X-Amz-Security-Token\n - X-Amz-User-Agent\n authorizer:\n type: REQUEST\n identitySource: method.request.header.Authorization\n name: auth0Authorizer\n allowCredentials: true\n deleteTask:\n handler: src/handlers/task/deleteTask.deleteTask\n events:\n - http:\n path: tasks/{taskId}\n method: delete\n cors:\n origin: \"http://localhost:5173\" # Use '*' for all origins or specify 'http://localhost:5173' for development\n headers:\n - Content-Type\n - Authorization\n - X-Requested-With\n - X-Amz-Date\n - X-Api-Key\n - X-Amz-Security-Token\n - X-Amz-User-Agent\n authorizer:\n type: REQUEST\n identitySource: method.request.header.Authorization\n name: auth0Authorizer\n allowCredentials: true\n # Pomodoro Timer\n manageTimer:\n handler: src/handlers/timer/manageTimer.manageTimer\n events:\n - http:\n path: timer\n method: post\n cors:\n origin: \"*\" # Use '*' for all origins or specify 'http://localhost:5173' for development\n headers:\n - Content-Type\n - Authorization\n - X-Requested-With\n - X-Amz-Date\n - X-Api-Key\n - X-Amz-Security-Token\n - X-Amz-User-Agent\n authorizer:\n type: REQUEST\n identitySource: method.request.header.Authorization\n name: auth0Authorizer\n\n # User Preferences\n updatePreferences:\n handler: src/handlers/preferences/updatePreferences.updatePreferences\n events:\n - http:\n path: preferences\n method: put\n cors:\n origin: \"*\" # Use '*' for all origins or specify 'http://localhost:5173' for development\n headers:\n - Content-Type\n - Authorization\n - X-Requested-With\n - X-Amz-Date\n - X-Api-Key\n - X-Amz-Security-Token\n - X-Amz-User-Agent\n authorizer:\n type: REQUEST\n identitySource: method.request.header.Authorization\n name: auth0Authorizer\n\n # Music Player\n getMusic:\n handler: src/handlers/music/getMusic.getMusic\n events:\n - http:\n path: music\n method: get\n cors:\n origin: \"*\" # Use '*' for all origins or specify 'http://localhost:5173' for development\n headers:\n - Content-Type\n - Authorization\n - X-Requested-With\n - X-Amz-Date\n - X-Api-Key\n - X-Amz-Security-Token\n - X-Amz-User-Agent\n\n # Background Management\n updateBackground:\n handler: src/handlers/background/updateBackground.updateBackground\n events:\n - http:\n path: backgrounds\n method: put\n cors:\n origin: \"*\" # Use '*' for all origins or specify 'http://localhost:5173' for development\n headers:\n - Content-Type\n - Authorization\n - X-Requested-With\n - X-Amz-Date\n - X-Api-Key\n - X-Amz-Security-Token\n - X-Amz-User-Agent\n authorizer:\n type: REQUEST\n identitySource: method.request.header.Authorization\n name: auth0Authorizer\n\n auth0Authorizer:\n handler: src/handlers/auth/index.handler\n events:\n - http:\n path: auth/validate\n method: post\n cors: true\n", + "serviceRawFile": "# FocusFlow Serverless Configuration\r\n\r\norg: devquesting\r\napp: focusflow\r\nservice: backend\r\n\r\nplugins:\r\n - serverless-offline\r\n\r\nprovider:\r\n name: aws\r\n runtime: nodejs20.x\r\n region: us-east-1\r\n stage: dev\r\n environment:\r\n AUTH0_DOMAIN: dev-6zeb418i7xs8g1lc.us.auth0.com\r\n AUTH0_AUDIENCE: focusflow-audience\r\n AUTH0_ISSUER: https://dev-6zeb418i7xs8g1lc.us.auth0.com/\r\n DYNAMODB_TASKS_TABLE: dev-focusflow-tasks\r\n DYNAMODB_USERS_TABLE: dev-focusflow-users\r\n S3_ASSETS_BUCKET: dev-focusflow-assets \r\n iam:\r\n role:\r\n statements:\r\n - Effect: Allow\r\n Action:\r\n - dynamodb:PutItem\r\n - dynamodb:GetItem\r\n - dynamodb:UpdateItem\r\n - dynamodb:DeleteItem\r\n - dynamodb:Scan\r\n - dynamodb:Query\r\n Resource: \"*\"\r\n - Effect: Allow\r\n Action:\r\n - s3:PutObject\r\n - s3:GetObject\r\n - s3:DeleteObject\r\n Resource: \"*\"\r\n - Effect: Allow\r\n Action:\r\n - lambda:InvokeFunction\r\n Resource:\r\n - arn:aws:lambda:${self:provider.region}:${aws:accountId}:function:${self:service}-${self:provider.stage}-auth0Authenticator\r\n\r\ncustom:\r\n tableName: ${sls:stage}-focusflow-tasks\r\n usersTableName: ${sls:stage}-focusflow-users\r\n bucketName: ${sls:stage}-focusflow-assets-${aws:accountId}\r\n\r\nresources:\r\n Resources:\r\n # DynamoDB Table for Tasks\r\n TasksTable:\r\n Type: AWS::DynamoDB::Table\r\n Properties:\r\n TableName: ${self:custom.tableName}\r\n BillingMode: PAY_PER_REQUEST\r\n AttributeDefinitions:\r\n - AttributeName: userId\r\n AttributeType: S\r\n - AttributeName: taskId\r\n AttributeType: S\r\n KeySchema:\r\n - AttributeName: userId\r\n KeyType: HASH\r\n - AttributeName: taskId\r\n KeyType: RANGE\r\n\r\n # DynamoDB Table for Users\r\n UsersTable:\r\n Type: AWS::DynamoDB::Table\r\n Properties:\r\n TableName: ${self:custom.usersTableName}\r\n BillingMode: PAY_PER_REQUEST\r\n AttributeDefinitions:\r\n - AttributeName: userId\r\n AttributeType: S\r\n KeySchema:\r\n - AttributeName: userId\r\n KeyType: HASH\r\n\r\n UserBackgroundsTable:\r\n Type: AWS::DynamoDB::Table\r\n Properties:\r\n TableName: dev-user-backgrounds\r\n BillingMode: PAY_PER_REQUEST\r\n AttributeDefinitions:\r\n - AttributeName: userId\r\n AttributeType: S\r\n KeySchema:\r\n - AttributeName: userId\r\n KeyType: HASH\r\n\r\n # S3 Bucket for Assets\r\n AssetsBucket:\r\n Type: AWS::S3::Bucket\r\n Properties:\r\n BucketName: ${self:custom.bucketName}\r\n CorsConfiguration:\r\n CorsRules:\r\n - AllowedHeaders: [\"*\"]\r\n AllowedMethods: [GET, PUT, POST, DELETE, HEAD]\r\n AllowedOrigins: [\"*\"]\r\n MaxAge: 3000\r\n\r\nfunctions:\r\n # Task Management\r\n createTask:\r\n handler: src/handlers/task/createTask.createTask\r\n events:\r\n - http:\r\n path: tasks\r\n method: post\r\n cors:\r\n origin: \"http://localhost:5173\"\r\n allowCredentials: true\r\n headers:\r\n - Content-Type\r\n - Authorization\r\n - X-Requested-With\r\n - X-Amz-Date\r\n - X-Api-Key\r\n - X-Amz-Security-Token\r\n - X-Amz-User-Agent\r\n authorizer:\r\n type: REQUEST\r\n identitySource: method.request.header.Authorization\r\n name: auth0Authorizer\r\n getTask:\r\n handler: src/handlers/task/getTask.getTasks\r\n events:\r\n - http:\r\n path: tasks\r\n method: get\r\n cors: true\r\n authorizer:\r\n type: REQUEST\r\n identitySource: method.request.header.Authorization\r\n name: auth0Authorizer\r\n updateTask:\r\n handler: src/handlers/task/updateTask.updateTask\r\n events:\r\n - http:\r\n path: tasks/{taskId}\r\n method: put\r\n cors:\r\n origin: \"http://localhost:5173\" # Use '*' for all origins or specify 'http://localhost:5173' for development\r\n headers:\r\n - Content-Type\r\n - Authorization\r\n - X-Requested-With\r\n - X-Amz-Date\r\n - X-Api-Key\r\n - X-Amz-Security-Token\r\n - X-Amz-User-Agent\r\n authorizer:\r\n type: REQUEST\r\n identitySource: method.request.header.Authorization\r\n name: auth0Authorizer\r\n allowCredentials: true\r\n deleteTask:\r\n handler: src/handlers/task/deleteTask.deleteTask\r\n events:\r\n - http:\r\n path: tasks/{taskId}\r\n method: delete\r\n cors:\r\n origin: \"http://localhost:5173\" # Use '*' for all origins or specify 'http://localhost:5173' for development\r\n headers:\r\n - Content-Type\r\n - Authorization\r\n - X-Requested-With\r\n - X-Amz-Date\r\n - X-Api-Key\r\n - X-Amz-Security-Token\r\n - X-Amz-User-Agent\r\n authorizer:\r\n type: REQUEST\r\n identitySource: method.request.header.Authorization\r\n name: auth0Authorizer\r\n allowCredentials: true\r\n # Pomodoro Timer\r\n manageTimer:\r\n handler: src/handlers/timer/manageTimer.manageTimer\r\n events:\r\n - http:\r\n path: timer\r\n method: post\r\n cors:\r\n origin: \"*\" # Use '*' for all origins or specify 'http://localhost:5173' for development\r\n headers:\r\n - Content-Type\r\n - Authorization\r\n - X-Requested-With\r\n - X-Amz-Date\r\n - X-Api-Key\r\n - X-Amz-Security-Token\r\n - X-Amz-User-Agent\r\n authorizer:\r\n type: REQUEST\r\n identitySource: method.request.header.Authorization\r\n name: auth0Authorizer\r\n\r\n # User Preferences\r\n updatePreferences:\r\n handler: src/handlers/preferences/updatePreferences.updatePreferences\r\n events:\r\n - http:\r\n path: preferences\r\n method: put\r\n cors:\r\n origin: \"*\" # Use '*' for all origins or specify 'http://localhost:5173' for development\r\n headers:\r\n - Content-Type\r\n - Authorization\r\n - X-Requested-With\r\n - X-Amz-Date\r\n - X-Api-Key\r\n - X-Amz-Security-Token\r\n - X-Amz-User-Agent\r\n authorizer:\r\n type: REQUEST\r\n identitySource: method.request.header.Authorization\r\n name: auth0Authorizer\r\n\r\n # Music Player\r\n getMusic:\r\n handler: src/handlers/music/getMusic.getMusic\r\n events:\r\n - http:\r\n path: music\r\n method: get\r\n cors:\r\n origin: \"*\" # Use '*' for all origins or specify 'http://localhost:5173' for development\r\n headers:\r\n - Content-Type\r\n - Authorization\r\n - X-Requested-With\r\n - X-Amz-Date\r\n - X-Api-Key\r\n - X-Amz-Security-Token\r\n - X-Amz-User-Agent\r\n\r\n # Background Management\r\n updateBackground:\r\n handler: src/handlers/background/updateBackground.updateBackground\r\n events:\r\n - http:\r\n path: backgrounds\r\n method: put\r\n cors:\r\n origin: \"*\" # Use '*' for all origins or specify 'http://localhost:5173' for development\r\n headers:\r\n - Content-Type\r\n - Authorization\r\n - X-Requested-With\r\n - X-Amz-Date\r\n - X-Api-Key\r\n - X-Amz-Security-Token\r\n - X-Amz-User-Agent\r\n authorizer:\r\n type: REQUEST\r\n identitySource: method.request.header.Authorization\r\n name: auth0Authorizer\r\n\r\n initializeBackgrounds:\r\n handler: src/handlers/backgrounds.initializeBackgrounds\r\n events:\r\n - http:\r\n path: backgrounds/{userId}/initialize\r\n method: post\r\n\r\n getBackgrounds:\r\n handler: src/handlers/backgrounds.getBackgrounds\r\n events:\r\n - http:\r\n path: backgrounds/{userId}\r\n method: get\r\n\r\n addBackground:\r\n handler: src/handlers/backgrounds.addBackground\r\n events:\r\n - http:\r\n path: backgrounds/{userId}\r\n method: post\r\n\r\n deleteBackground:\r\n handler: src/handlers/backgrounds.deleteBackground\r\n events:\r\n - http:\r\n path: backgrounds/{userId}\r\n method: delete\r\n\r\n auth0Authorizer:\r\n handler: src/handlers/auth/index.handler\r\n events:\r\n - http:\r\n path: auth/validate\r\n method: post\r\n cors: true\r\n", "command": [ - "print" + "deploy" ], "options": {}, "error": null, @@ -1818,79 +13282,103 @@ "serviceProviderAwsCredentials": "", "serviceProviderAwsAccountId": "274552760074", "projectType": "traditional", - "versionSf": "4.4.11", + "versionSf": "4.4.12", "serviceProviderAwsCfStackName": "backend-dev", "integrations": {}, "serviceUniqueId": "arn:aws:cloudformation:us-east-1:274552760074:stack/backend-dev/80499180-a60f-11ef-b8d5-124d3fdcb0b3", "serviceProviderAwsCfStackId": "arn:aws:cloudformation:us-east-1:274552760074:stack/backend-dev/80499180-a60f-11ef-b8d5-124d3fdcb0b3", "serviceProviderAwsCfStackCreated": "2024-11-19T00:44:57.988Z", - "serviceProviderAwsCfStackUpdated": "2024-11-23T20:03:51.449Z", - "serviceProviderAwsCfStackStatus": "UPDATE_ROLLBACK_COMPLETE", + "serviceProviderAwsCfStackUpdated": "2024-11-26T05:29:09.461Z", + "serviceProviderAwsCfStackStatus": "UPDATE_COMPLETE", "serviceProviderAwsCfStackOutputs": [ { "OutputKey": "ManageTimerLambdaFunctionQualifiedArn", - "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-manageTimer:11", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-manageTimer:12", "Description": "Current Lambda function version", "ExportName": "sls-backend-dev-ManageTimerLambdaFunctionQualifiedArn" }, { - "OutputKey": "GetTasksLambdaFunctionQualifiedArn", - "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-getTasks:11", - "Description": "Current Lambda function version", - "ExportName": "sls-backend-dev-GetTasksLambdaFunctionQualifiedArn" - }, - { - "OutputKey": "DeleteTaskLambdaFunctionQualifiedArn", - "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-deleteTask:11", + "OutputKey": "AddBackgroundLambdaFunctionQualifiedArn", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-addBackground:1", "Description": "Current Lambda function version", - "ExportName": "sls-backend-dev-DeleteTaskLambdaFunctionQualifiedArn" + "ExportName": "sls-backend-dev-AddBackgroundLambdaFunctionQualifiedArn" }, { "OutputKey": "UpdateTaskLambdaFunctionQualifiedArn", - "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-updateTask:11", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-updateTask:12", "Description": "Current Lambda function version", "ExportName": "sls-backend-dev-UpdateTaskLambdaFunctionQualifiedArn" }, { "OutputKey": "UpdatePreferencesLambdaFunctionQualifiedArn", - "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-updatePreferences:11", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-updatePreferences:12", "Description": "Current Lambda function version", "ExportName": "sls-backend-dev-UpdatePreferencesLambdaFunctionQualifiedArn" }, { - "OutputKey": "GetMusicLambdaFunctionQualifiedArn", - "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-getMusic:11", + "OutputKey": "CreateTaskLambdaFunctionQualifiedArn", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-createTask:12", "Description": "Current Lambda function version", - "ExportName": "sls-backend-dev-GetMusicLambdaFunctionQualifiedArn" + "ExportName": "sls-backend-dev-CreateTaskLambdaFunctionQualifiedArn" }, { - "OutputKey": "CreateTaskLambdaFunctionQualifiedArn", - "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-createTask:11", + "OutputKey": "UpdateBackgroundLambdaFunctionQualifiedArn", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-updateBackground:12", "Description": "Current Lambda function version", - "ExportName": "sls-backend-dev-CreateTaskLambdaFunctionQualifiedArn" + "ExportName": "sls-backend-dev-UpdateBackgroundLambdaFunctionQualifiedArn" }, { - "OutputKey": "Auth0AuthorizerLambdaFunctionQualifiedArn", - "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authorizer:7", + "OutputKey": "GetTaskLambdaFunctionQualifiedArn", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-getTask:1", "Description": "Current Lambda function version", - "ExportName": "sls-backend-dev-Auth0AuthorizerLambdaFunctionQualifiedArn" + "ExportName": "sls-backend-dev-GetTaskLambdaFunctionQualifiedArn" }, { - "OutputKey": "UpdateBackgroundLambdaFunctionQualifiedArn", - "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-updateBackground:11", + "OutputKey": "DeleteBackgroundLambdaFunctionQualifiedArn", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-deleteBackground:1", "Description": "Current Lambda function version", - "ExportName": "sls-backend-dev-UpdateBackgroundLambdaFunctionQualifiedArn" + "ExportName": "sls-backend-dev-DeleteBackgroundLambdaFunctionQualifiedArn" }, { - "OutputKey": "ServiceEndpoint", - "OutputValue": "https://b94obf2k3g.execute-api.us-east-1.amazonaws.com/dev", - "Description": "URL of the service endpoint", - "ExportName": "sls-backend-dev-ServiceEndpoint" + "OutputKey": "InitializeBackgroundsLambdaFunctionQualifiedArn", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-initializeBackgrounds:1", + "Description": "Current Lambda function version", + "ExportName": "sls-backend-dev-InitializeBackgroundsLambdaFunctionQualifiedArn" }, { "OutputKey": "ServerlessDeploymentBucketName", "OutputValue": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", "ExportName": "sls-backend-dev-ServerlessDeploymentBucketName" + }, + { + "OutputKey": "GetBackgroundsLambdaFunctionQualifiedArn", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-getBackgrounds:1", + "Description": "Current Lambda function version", + "ExportName": "sls-backend-dev-GetBackgroundsLambdaFunctionQualifiedArn" + }, + { + "OutputKey": "DeleteTaskLambdaFunctionQualifiedArn", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-deleteTask:12", + "Description": "Current Lambda function version", + "ExportName": "sls-backend-dev-DeleteTaskLambdaFunctionQualifiedArn" + }, + { + "OutputKey": "GetMusicLambdaFunctionQualifiedArn", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-getMusic:12", + "Description": "Current Lambda function version", + "ExportName": "sls-backend-dev-GetMusicLambdaFunctionQualifiedArn" + }, + { + "OutputKey": "Auth0AuthorizerLambdaFunctionQualifiedArn", + "OutputValue": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authorizer:8", + "Description": "Current Lambda function version", + "ExportName": "sls-backend-dev-Auth0AuthorizerLambdaFunctionQualifiedArn" + }, + { + "OutputKey": "ServiceEndpoint", + "OutputValue": "https://b94obf2k3g.execute-api.us-east-1.amazonaws.com/dev", + "Description": "URL of the service endpoint", + "ExportName": "sls-backend-dev-ServiceEndpoint" } ] } diff --git a/backend/.serverless/serverless-state.json b/backend/.serverless/serverless-state.json index 7e0b065..eb66482 100644 --- a/backend/.serverless/serverless-state.json +++ b/backend/.serverless/serverless-state.json @@ -23,17 +23,14 @@ { "Effect": "Allow", "Action": [ - "dynamodb:Query", - "dynamodb:Scan", - "dynamodb:GetItem", "dynamodb:PutItem", + "dynamodb:GetItem", "dynamodb:UpdateItem", - "dynamodb:DeleteItem" + "dynamodb:DeleteItem", + "dynamodb:Scan", + "dynamodb:Query" ], - "Resource": [ - "arn:aws:dynamodb:us-east-1:274552760074:table/dev-focusflow-tasks", - "arn:aws:dynamodb:us-east-1:274552760074:table/dev-focusflow-users" - ] + "Resource": "*" }, { "Effect": "Allow", @@ -42,13 +39,6 @@ "s3:GetObject", "s3:DeleteObject" ], - "Resource": "arn:aws:cloudformation:us-east-1:274552760074:stack/backend-dev/80499180-a60f-11ef-b8d5-124d3fdcb0b3" - }, - { - "Effect": "Allow", - "Action": [ - "cognito-idp:SignUp" - ], "Resource": "*" }, { @@ -57,39 +47,11 @@ "lambda:InvokeFunction" ], "Resource": "arn:aws:lambda:us-east-1:274552760074:function:backend-dev-auth0Authenticator" - }, - { - "Effect": "Allow", - "Action": [ - "sts:AssumeRole" - ] } ] } }, - "cors": { - "allowedOrigins": [ - "http://localhost:5173" - ], - "allowedMethods": [ - "GET", - "POST", - "PUT", - "DELETE", - "OPTIONS" - ], - "allowedHeaders": [ - "Authorization", - "Content-Type", - "X-Amz-Date", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent" - ], - "allowCredentials": true - }, "versionFunctions": true, - "AwshttpApi": null, "compiledCloudFormationTemplate": { "AWSTemplateFormatVersion": "2010-09-09", "Description": "The AWS CloudFormation template for this Serverless application", @@ -142,6 +104,30 @@ "LogGroupName": "/aws/lambda/backend-dev-updateBackground" } }, + "InitializeBackgroundsLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-initializeBackgrounds" + } + }, + "GetBackgroundsLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-getBackgrounds" + } + }, + "AddBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-addBackground" + } + }, + "DeleteBackgroundLogGroup": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": "/aws/lambda/backend-dev-deleteBackground" + } + }, "Auth0AuthorizerLogGroup": { "Type": "AWS::Logs::LogGroup", "Properties": { @@ -214,12 +200,6 @@ }, { "$ref": "$[\"service\"][\"provider\"][\"iam\"][\"role\"][\"statements\"][2]" - }, - { - "$ref": "$[\"service\"][\"provider\"][\"iam\"][\"role\"][\"statements\"][3]" - }, - { - "$ref": "$[\"service\"][\"provider\"][\"iam\"][\"role\"][\"statements\"][4]" } ] } @@ -246,7 +226,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/task/createTask.createTask", "Runtime": "nodejs20.x", @@ -279,7 +259,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/task/getTask.getTasks", "Runtime": "nodejs20.x", @@ -312,7 +292,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/task/updateTask.updateTask", "Runtime": "nodejs20.x", @@ -345,7 +325,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/task/deleteTask.deleteTask", "Runtime": "nodejs20.x", @@ -378,7 +358,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/timer/manageTimer.manageTimer", "Runtime": "nodejs20.x", @@ -411,7 +391,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/preferences/updatePreferences.updatePreferences", "Runtime": "nodejs20.x", @@ -444,7 +424,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/music/getMusic.getMusic", "Runtime": "nodejs20.x", @@ -477,7 +457,7 @@ "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/background/updateBackground.updateBackground", "Runtime": "nodejs20.x", @@ -505,12 +485,144 @@ "UpdateBackgroundLogGroup" ] }, + "InitializeBackgroundsLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.initializeBackgrounds", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-initializeBackgrounds", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "InitializeBackgroundsLogGroup" + ] + }, + "GetBackgroundsLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.getBackgrounds", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-getBackgrounds", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "GetBackgroundsLogGroup" + ] + }, + "AddBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.addBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-addBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "AddBackgroundLogGroup" + ] + }, + "DeleteBackgroundLambdaFunction": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" + }, + "Handler": "src/handlers/backgrounds.deleteBackground", + "Runtime": "nodejs20.x", + "FunctionName": "backend-dev-deleteBackground", + "MemorySize": 1024, + "Timeout": 6, + "Environment": { + "Variables": { + "AUTH0_DOMAIN": "dev-6zeb418i7xs8g1lc.us.auth0.com", + "AUTH0_AUDIENCE": "focusflow-audience", + "AUTH0_ISSUER": "https://dev-6zeb418i7xs8g1lc.us.auth0.com/", + "DYNAMODB_TASKS_TABLE": "dev-focusflow-tasks", + "DYNAMODB_USERS_TABLE": "dev-focusflow-users", + "S3_ASSETS_BUCKET": "dev-focusflow-assets" + } + }, + "Role": { + "Fn::GetAtt": [ + "IamRoleLambdaExecution", + "Arn" + ] + } + }, + "DependsOn": [ + "DeleteBackgroundLogGroup" + ] + }, "Auth0AuthorizerLambdaFunction": { "Type": "AWS::Lambda::Function", "Properties": { "Code": { "S3Bucket": "serverless-framework-deployments-us-east-1-be0e5fd9-feac", - "S3Key": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z/backend.zip" + "S3Key": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z/backend.zip" }, "Handler": "src/handlers/auth/index.handler", "Runtime": "nodejs20.x", @@ -538,94 +650,134 @@ "Auth0AuthorizerLogGroup" ] }, - "CreateTaskLambdaVersionk30cu9y50e5sOq8XtrIxMTWLhghYgNRK8RgZoEYIGYw": { + "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "CreateTaskLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "GetTaskLambdaVersiongXM56yZkGsQlnDb6WDCtOEDbduxrzUj1n6drT1Ds": { + "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "GetTaskLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "UpdateTaskLambdaVersionLVQNXG4ycaaTjNA87jUZHr5KUky8EK3SL1Nnqxf8": { + "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "UpdateTaskLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "DeleteTaskLambdaVersionbIxEVCZEfnNfNmF7C6APqdnRa2qGfa8uJbDu8LgXW0": { + "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "DeleteTaskLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "ManageTimerLambdaVersionC6S83E8qe3dWiTU9VbMMgG77ou962v41HGAoSgzghOg": { + "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "ManageTimerLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "UpdatePreferencesLambdaVersioni5HctCd5bCmzGE75DP4AXMDIxXfWqWLY5HnJgMGU": { + "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "UpdatePreferencesLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "GetMusicLambdaVersionAGbhi19HVk79KS2hVYQLrY4HuhO4As6VfyVaUlrk": { + "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "GetMusicLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "UpdateBackgroundLambdaVersiongFcVopCo5kYCSelYvEKVfGn4pxaLVIjYrPviLUTM": { + "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "UpdateBackgroundLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "InitializeBackgroundsLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "GetBackgroundsLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "AddBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" + } + }, + "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc": { + "Type": "AWS::Lambda::Version", + "DeletionPolicy": "Retain", + "Properties": { + "FunctionName": { + "Ref": "DeleteBackgroundLambdaFunction" + }, + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, - "Auth0AuthorizerLambdaVersionUMEDyDFlyLIyWSsK6xWjoOLLkQNiEtvaBzHSTree2Xw": { + "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg": { "Type": "AWS::Lambda::Version", "DeletionPolicy": "Retain", "Properties": { "FunctionName": { "Ref": "Auth0AuthorizerLambdaFunction" }, - "CodeSha256": "Jcet10Z89nGzu6mC/UrlkPreS1d8bEjBJqk3tXxQijQ=" + "CodeSha256": "NlY+S2DRHebo1Y0ejr395Jzcwbr9l3uILbwAhXcQ/uE=" } }, "ApiGatewayRestApi": { @@ -727,6 +879,30 @@ } } }, + "ApiGatewayResourceBackgroundsUseridVar": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceBackgrounds" + }, + "PathPart": "{userId}", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, + "ApiGatewayResourceBackgroundsUseridVarInitialize": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "PathPart": "initialize", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + } + } + }, "ApiGatewayResourceAuth": { "Type": "AWS::ApiGateway::Resource", "Properties": { @@ -782,8 +958,8 @@ { "StatusCode": "200", "ResponseParameters": { - "method.response.header.Access-Control-Allow-Origin": "'http://localhost:5173'", - "method.response.header.Access-Control-Allow-Headers": "'Content-Type,Authorization,X-Requested-With,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", + "method.response.header.Access-Control-Allow-Origin": "'*'", + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent,X-Amzn-Trace-Id,X-Requested-With'", "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET,POST'", "method.response.header.Access-Control-Allow-Credentials": "'true'" }, @@ -1460,13 +1636,13 @@ "Auth0AuthorizerApiGatewayAuthorizer" ] }, - "ApiGatewayMethodAuthValidatePost": { + "ApiGatewayMethodBackgroundsUseridVarInitializePost": { "Type": "AWS::ApiGateway::Method", "Properties": { "HttpMethod": "POST", "RequestParameters": {}, "ResourceId": { - "Ref": "ApiGatewayResourceAuthValidate" + "Ref": "ApiGatewayResourceBackgroundsUseridVarInitialize" }, "RestApiId": { "Ref": "ApiGatewayRestApi" @@ -1491,7 +1667,7 @@ ":lambda:path/2015-03-31/functions/", { "Fn::GetAtt": [ - "Auth0AuthorizerLambdaFunction", + "InitializeBackgroundsLambdaFunction", "Arn" ] }, @@ -1503,61 +1679,245 @@ "MethodResponses": [] }, "DependsOn": [ - "Auth0AuthorizerLambdaPermissionApiGateway" + "InitializeBackgroundsLambdaPermissionApiGateway" ] }, - "Auth0AuthorizerApiGatewayAuthorizer": { - "Type": "AWS::ApiGateway::Authorizer", + "ApiGatewayMethodBackgroundsUseridVarGet": { + "Type": "AWS::ApiGateway::Method", "Properties": { - "AuthorizerResultTtlInSeconds": 300, - "IdentitySource": "method.request.header.Authorization", - "Name": "auth0Authorizer", - "RestApiId": { - "Ref": "ApiGatewayRestApi" - }, - "AuthorizerUri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:", - { - "Ref": "AWS::Region" - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "Auth0AuthorizerLambdaFunction", - "Arn" - ] - }, - "/invocations" - ] - ] + "HttpMethod": "GET", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" }, - "Type": "REQUEST" - } - }, - "ApiGatewayDeployment1732392175738": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { "RestApiId": { "Ref": "ApiGatewayRestApi" }, - "StageName": "dev" - }, - "DependsOn": [ - "ApiGatewayMethodTasksOptions", - "ApiGatewayMethodTasksTaskidVarOptions", - "ApiGatewayMethodTimerOptions", - "ApiGatewayMethodPreferencesOptions", - "ApiGatewayMethodMusicOptions", - "ApiGatewayMethodBackgroundsOptions", - "ApiGatewayMethodAuthValidateOptions", - "ApiGatewayMethodTasksPost", + "ApiKeyRequired": false, + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "GetBackgroundsLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "GetBackgroundsLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarPost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": false, + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "AddBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "AddBackgroundLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodBackgroundsUseridVarDelete": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "DELETE", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceBackgroundsUseridVar" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": false, + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "DeleteBackgroundLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "DeleteBackgroundLambdaPermissionApiGateway" + ] + }, + "ApiGatewayMethodAuthValidatePost": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "HttpMethod": "POST", + "RequestParameters": {}, + "ResourceId": { + "Ref": "ApiGatewayResourceAuthValidate" + }, + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "ApiKeyRequired": false, + "AuthorizationType": "NONE", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + } + }, + "MethodResponses": [] + }, + "DependsOn": [ + "Auth0AuthorizerLambdaPermissionApiGateway" + ] + }, + "Auth0AuthorizerApiGatewayAuthorizer": { + "Type": "AWS::ApiGateway::Authorizer", + "Properties": { + "AuthorizerResultTtlInSeconds": 300, + "IdentitySource": "method.request.header.Authorization", + "Name": "auth0Authorizer", + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "AuthorizerUri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Auth0AuthorizerLambdaFunction", + "Arn" + ] + }, + "/invocations" + ] + ] + }, + "Type": "REQUEST" + } + }, + "ApiGatewayDeployment1732598895104": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "RestApiId": { + "Ref": "ApiGatewayRestApi" + }, + "StageName": "dev" + }, + "DependsOn": [ + "ApiGatewayMethodTasksOptions", + "ApiGatewayMethodTasksTaskidVarOptions", + "ApiGatewayMethodTimerOptions", + "ApiGatewayMethodPreferencesOptions", + "ApiGatewayMethodMusicOptions", + "ApiGatewayMethodBackgroundsOptions", + "ApiGatewayMethodAuthValidateOptions", + "ApiGatewayMethodTasksPost", "ApiGatewayMethodTasksGet", "ApiGatewayMethodTasksTaskidVarPut", "ApiGatewayMethodTasksTaskidVarDelete", @@ -1565,6 +1925,10 @@ "ApiGatewayMethodPreferencesPut", "ApiGatewayMethodMusicGet", "ApiGatewayMethodBackgroundsPut", + "ApiGatewayMethodBackgroundsUseridVarInitializePost", + "ApiGatewayMethodBackgroundsUseridVarGet", + "ApiGatewayMethodBackgroundsUseridVarPost", + "ApiGatewayMethodBackgroundsUseridVarDelete", "ApiGatewayMethodAuthValidatePost" ] }, @@ -1901,6 +2265,154 @@ } } }, + "InitializeBackgroundsLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "InitializeBackgroundsLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "GetBackgroundsLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "GetBackgroundsLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "AddBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "AddBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, + "DeleteBackgroundLambdaPermissionApiGateway": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "FunctionName": { + "Fn::GetAtt": [ + "DeleteBackgroundLambdaFunction", + "Arn" + ] + }, + "Action": "lambda:InvokeFunction", + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "ApiGatewayRestApi" + }, + "/*/*" + ] + ] + } + } + }, "TasksTable": { "Type": "AWS::DynamoDB::Table", "Properties": { @@ -1947,10 +2459,29 @@ ] } }, + "UserBackgroundsTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-user-backgrounds", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, "AssetsBucket": { "Type": "AWS::S3::Bucket", "Properties": { - "BucketName": "dev-focusflow-assets", + "BucketName": "dev-focusflow-assets-274552760074", "CorsConfiguration": { "CorsRules": [ { @@ -1984,7 +2515,7 @@ "CreateTaskLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "CreateTaskLambdaVersionk30cu9y50e5sOq8XtrIxMTWLhghYgNRK8RgZoEYIGYw" + "Ref": "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM" }, "Export": { "Name": "sls-backend-dev-CreateTaskLambdaFunctionQualifiedArn" @@ -1993,7 +2524,7 @@ "GetTaskLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "GetTaskLambdaVersiongXM56yZkGsQlnDb6WDCtOEDbduxrzUj1n6drT1Ds" + "Ref": "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M" }, "Export": { "Name": "sls-backend-dev-GetTaskLambdaFunctionQualifiedArn" @@ -2002,7 +2533,7 @@ "UpdateTaskLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "UpdateTaskLambdaVersionLVQNXG4ycaaTjNA87jUZHr5KUky8EK3SL1Nnqxf8" + "Ref": "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE" }, "Export": { "Name": "sls-backend-dev-UpdateTaskLambdaFunctionQualifiedArn" @@ -2011,7 +2542,7 @@ "DeleteTaskLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "DeleteTaskLambdaVersionbIxEVCZEfnNfNmF7C6APqdnRa2qGfa8uJbDu8LgXW0" + "Ref": "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg" }, "Export": { "Name": "sls-backend-dev-DeleteTaskLambdaFunctionQualifiedArn" @@ -2020,7 +2551,7 @@ "ManageTimerLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "ManageTimerLambdaVersionC6S83E8qe3dWiTU9VbMMgG77ou962v41HGAoSgzghOg" + "Ref": "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw" }, "Export": { "Name": "sls-backend-dev-ManageTimerLambdaFunctionQualifiedArn" @@ -2029,7 +2560,7 @@ "UpdatePreferencesLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "UpdatePreferencesLambdaVersioni5HctCd5bCmzGE75DP4AXMDIxXfWqWLY5HnJgMGU" + "Ref": "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ" }, "Export": { "Name": "sls-backend-dev-UpdatePreferencesLambdaFunctionQualifiedArn" @@ -2038,7 +2569,7 @@ "GetMusicLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "GetMusicLambdaVersionAGbhi19HVk79KS2hVYQLrY4HuhO4As6VfyVaUlrk" + "Ref": "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU" }, "Export": { "Name": "sls-backend-dev-GetMusicLambdaFunctionQualifiedArn" @@ -2047,16 +2578,52 @@ "UpdateBackgroundLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "UpdateBackgroundLambdaVersiongFcVopCo5kYCSelYvEKVfGn4pxaLVIjYrPviLUTM" + "Ref": "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs" }, "Export": { "Name": "sls-backend-dev-UpdateBackgroundLambdaFunctionQualifiedArn" } }, + "InitializeBackgroundsLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw" + }, + "Export": { + "Name": "sls-backend-dev-InitializeBackgroundsLambdaFunctionQualifiedArn" + } + }, + "GetBackgroundsLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg" + }, + "Export": { + "Name": "sls-backend-dev-GetBackgroundsLambdaFunctionQualifiedArn" + } + }, + "AddBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw" + }, + "Export": { + "Name": "sls-backend-dev-AddBackgroundLambdaFunctionQualifiedArn" + } + }, + "DeleteBackgroundLambdaFunctionQualifiedArn": { + "Description": "Current Lambda function version", + "Value": { + "Ref": "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc" + }, + "Export": { + "Name": "sls-backend-dev-DeleteBackgroundLambdaFunctionQualifiedArn" + } + }, "Auth0AuthorizerLambdaFunctionQualifiedArn": { "Description": "Current Lambda function version", "Value": { - "Ref": "Auth0AuthorizerLambdaVersionUMEDyDFlyLIyWSsK6xWjoOLLkQNiEtvaBzHSTree2Xw" + "Ref": "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg" }, "Export": { "Name": "sls-backend-dev-Auth0AuthorizerLambdaFunctionQualifiedArn" @@ -2095,7 +2662,7 @@ "custom": { "tableName": "dev-focusflow-tasks", "usersTableName": "dev-focusflow-users", - "bucketName": "dev-focusflow-assets" + "bucketName": "dev-focusflow-assets-274552760074" }, "plugins": [ "serverless-offline" @@ -2150,7 +2717,7 @@ "timeout": 6, "runtime": "nodejs20.x", "vpc": {}, - "versionLogicalId": "CreateTaskLambdaVersionk30cu9y50e5sOq8XtrIxMTWLhghYgNRK8RgZoEYIGYw" + "versionLogicalId": "CreateTaskLambdaVersionr31iKEaiHMFRxy2aZBdCT4aQ6iyyp6mgZqib90wJWM" }, "getTask": { "handler": "src/handlers/task/getTask.getTasks", @@ -2160,19 +2727,19 @@ "path": "tasks", "method": "get", "cors": { - "origin": "http://localhost:5173", + "origin": "*", "methods": [ "OPTIONS", "GET" ], "headers": [ "Content-Type", - "Authorization", - "X-Requested-With", "X-Amz-Date", + "Authorization", "X-Api-Key", "X-Amz-Security-Token", - "X-Amz-User-Agent" + "X-Amz-User-Agent", + "X-Amzn-Trace-Id" ], "allowCredentials": false }, @@ -2187,7 +2754,6 @@ "identitySource": "method.request.header.Authorization", "claims": [] }, - "allowCredentials": true, "integration": "AWS_PROXY" } } @@ -2198,7 +2764,7 @@ "timeout": 6, "runtime": "nodejs20.x", "vpc": {}, - "versionLogicalId": "GetTaskLambdaVersiongXM56yZkGsQlnDb6WDCtOEDbduxrzUj1n6drT1Ds" + "versionLogicalId": "GetTaskLambdaVersion4NXsS0xIRDAAK02feRxKAow7h27Q3PYvYRqY4x2M" }, "updateTask": { "handler": "src/handlers/task/updateTask.updateTask", @@ -2246,7 +2812,7 @@ "timeout": 6, "runtime": "nodejs20.x", "vpc": {}, - "versionLogicalId": "UpdateTaskLambdaVersionLVQNXG4ycaaTjNA87jUZHr5KUky8EK3SL1Nnqxf8" + "versionLogicalId": "UpdateTaskLambdaVersionCPysptk9GVB6lyGbEYT2wJYoVwf6S47pClfrggVecoE" }, "deleteTask": { "handler": "src/handlers/task/deleteTask.deleteTask", @@ -2294,7 +2860,7 @@ "timeout": 6, "runtime": "nodejs20.x", "vpc": {}, - "versionLogicalId": "DeleteTaskLambdaVersionbIxEVCZEfnNfNmF7C6APqdnRa2qGfa8uJbDu8LgXW0" + "versionLogicalId": "DeleteTaskLambdaVersionqp8ay4pJexWW1J750A2NF9KhOFRuR5n9yHhaNlFg" }, "manageTimer": { "handler": "src/handlers/timer/manageTimer.manageTimer", @@ -2341,7 +2907,7 @@ "timeout": 6, "runtime": "nodejs20.x", "vpc": {}, - "versionLogicalId": "ManageTimerLambdaVersionC6S83E8qe3dWiTU9VbMMgG77ou962v41HGAoSgzghOg" + "versionLogicalId": "ManageTimerLambdaVersionaudkDhVaKirTQLLyZjtxXk9pgsrtsBqP8uazwsD9cw" }, "updatePreferences": { "handler": "src/handlers/preferences/updatePreferences.updatePreferences", @@ -2388,7 +2954,7 @@ "timeout": 6, "runtime": "nodejs20.x", "vpc": {}, - "versionLogicalId": "UpdatePreferencesLambdaVersioni5HctCd5bCmzGE75DP4AXMDIxXfWqWLY5HnJgMGU" + "versionLogicalId": "UpdatePreferencesLambdaVersioncsZYLEJeykO8hKRQN4hvlQsIh4kDgcB3IUZDBZKUeQ" }, "getMusic": { "handler": "src/handlers/music/getMusic.getMusic", @@ -2424,7 +2990,7 @@ "timeout": 6, "runtime": "nodejs20.x", "vpc": {}, - "versionLogicalId": "GetMusicLambdaVersionAGbhi19HVk79KS2hVYQLrY4HuhO4As6VfyVaUlrk" + "versionLogicalId": "GetMusicLambdaVersionVqQygCeCuNnxHMJi0obwPvjTRZsP9REVNlvu2J5GbU" }, "updateBackground": { "handler": "src/handlers/background/updateBackground.updateBackground", @@ -2471,7 +3037,83 @@ "timeout": 6, "runtime": "nodejs20.x", "vpc": {}, - "versionLogicalId": "UpdateBackgroundLambdaVersiongFcVopCo5kYCSelYvEKVfGn4pxaLVIjYrPviLUTM" + "versionLogicalId": "UpdateBackgroundLambdaVersionwAJqtAYT5eOKbrJ16s7y3CPFGOg6ihCeVrZNBlQVOvs" + }, + "initializeBackgrounds": { + "handler": "src/handlers/backgrounds.initializeBackgrounds", + "events": [ + { + "http": { + "path": "backgrounds/{userId}/initialize", + "method": "post", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-initializeBackgrounds", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "InitializeBackgroundsLambdaVersioneybuBOQ0Y2a9IR0UCCqtzQnBKvFEkwNkiS7gyksOVw" + }, + "getBackgrounds": { + "handler": "src/handlers/backgrounds.getBackgrounds", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "get", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-getBackgrounds", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "GetBackgroundsLambdaVersionsG9FtFDezYUqCDh2WbxEu5ihqy51hRo0xrBlbsjbg" + }, + "addBackground": { + "handler": "src/handlers/backgrounds.addBackground", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "post", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-addBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "AddBackgroundLambdaVersion7bMcoxxyiYWfqEoZskSOOslA15VB7QyIYijQjcw" + }, + "deleteBackground": { + "handler": "src/handlers/backgrounds.deleteBackground", + "events": [ + { + "http": { + "path": "backgrounds/{userId}", + "method": "delete", + "integration": "AWS_PROXY" + } + } + ], + "name": "backend-dev-deleteBackground", + "package": {}, + "memory": 1024, + "timeout": 6, + "runtime": "nodejs20.x", + "vpc": {}, + "versionLogicalId": "DeleteBackgroundLambdaVersionPydyzcZVAmWjiBqywxozOxZD4isOsEo4t7B7Yfhgc" }, "auth0Authorizer": { "handler": "src/handlers/auth/index.handler", @@ -2507,7 +3149,7 @@ "timeout": 6, "runtime": "nodejs20.x", "vpc": {}, - "versionLogicalId": "Auth0AuthorizerLambdaVersionUMEDyDFlyLIyWSsK6xWjoOLLkQNiEtvaBzHSTree2Xw" + "versionLogicalId": "Auth0AuthorizerLambdaVersionBlagLmGlZ2GbFc2cXNNOwELNxoi96aCcTSnVXGrvNg" } }, "resources": { @@ -2558,10 +3200,29 @@ ] } }, + "UserBackgroundsTable": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "TableName": "dev-user-backgrounds", + "BillingMode": "PAY_PER_REQUEST", + "AttributeDefinitions": [ + { + "AttributeName": "userId", + "AttributeType": "S" + } + ], + "KeySchema": [ + { + "AttributeName": "userId", + "KeyType": "HASH" + } + ] + } + }, "AssetsBucket": { "Type": "AWS::S3::Bucket", "Properties": { - "BucketName": "dev-focusflow-assets", + "BucketName": "dev-focusflow-assets-274552760074", "CorsConfiguration": { "CorsRules": [ { @@ -2617,7 +3278,7 @@ "artifact": "D:\\Projects\\Portfolio_Projects\\focusflow\\FocusFlow\\backend\\.serverless\\backend.zip" }, "package": { - "artifactDirectoryName": "serverless/backend/dev/1732392193211-2024-11-23T20:03:13.211Z", + "artifactDirectoryName": "serverless/backend/dev/1732598908435-2024-11-26T05:28:28.435Z", "artifact": "backend.zip" } } \ No newline at end of file diff --git a/backend/package-lock.json b/backend/package-lock.json index 702d2c9..c6eac57 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "aws-sdk": "^2.1692.0", "dotenv": "^16.4.5", + "jwks-rsa": "^3.1.0", "prop-types": "^15.8.1", "request": "^2.88.2" }, @@ -3749,6 +3750,25 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -3756,6 +3776,30 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.6", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", + "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, "node_modules/@types/graceful-fs": { "version": "4.1.9", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", @@ -3766,6 +3810,12 @@ "@types/node": "*" } }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "license": "MIT" + }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", @@ -3800,16 +3850,63 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.7.tgz", + "integrity": "sha512-ugo316mmTYBl2g81zDFnZ7cfxlut3o+/EQdaP7J8QN2kY6lJ22hmQYCK5EHcJHbrW+dkCGSCPgbG8JtYj6qSrg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.9.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.0.tgz", "integrity": "sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==", - "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.19.8" } }, + "node_modules/@types/qs": { + "version": "6.9.17", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.17.tgz", + "integrity": "sha512-rX4/bPcfmvxHDv0XjfJELTTr+iB+tn032nPILqHm5wbthUUUuVtNGGqzhya9XUxjTP8Fpr0qYgSZZKxGY++svQ==", + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "license": "MIT" + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", @@ -4762,7 +4859,6 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -7067,6 +7163,32 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/jwks-rsa": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-3.1.0.tgz", + "integrity": "sha512-v7nqlfezb9YfHHzYII3ef2a2j1XnGeSE/bK3WfumaYCqONAIstJbrEGapz4kadScZzEt7zYCN7bucj8C0Mv/Rg==", + "license": "MIT", + "dependencies": { + "@types/express": "^4.17.17", + "@types/jsonwebtoken": "^9.0.2", + "debug": "^4.3.4", + "jose": "^4.14.6", + "limiter": "^1.1.5", + "lru-memoizer": "^2.2.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/jwks-rsa/node_modules/jose": { + "version": "4.15.9", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", + "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -7121,6 +7243,11 @@ "immediate": "~3.0.5" } }, + "node_modules/limiter": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", + "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==" + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -7144,6 +7271,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -7180,6 +7313,34 @@ "yallist": "^3.0.2" } }, + "node_modules/lru-memoizer": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.3.0.tgz", + "integrity": "sha512-GXn7gyHAMhO13WSKrIiNfztwxodVsP8IoZ3XfrJV4yH2x0/OeTO/FIaAHTY5YekdGgW94njfuKmyyt1E0mR6Ug==", + "license": "MIT", + "dependencies": { + "lodash.clonedeep": "^4.5.0", + "lru-cache": "6.0.0" + } + }, + "node_modules/lru-memoizer/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lru-memoizer/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, "node_modules/luxon": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz", @@ -7309,7 +7470,6 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, "license": "MIT" }, "node_modules/natural-compare": { @@ -8854,7 +9014,6 @@ "version": "6.19.8", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "dev": true, "license": "MIT" }, "node_modules/universalify": { diff --git a/backend/package.json b/backend/package.json index 472389a..45d98f7 100644 --- a/backend/package.json +++ b/backend/package.json @@ -12,6 +12,7 @@ "dependencies": { "aws-sdk": "^2.1692.0", "dotenv": "^16.4.5", + "jwks-rsa": "^3.1.0", "prop-types": "^15.8.1", "request": "^2.88.2" }, diff --git a/backend/serverless.yml b/backend/serverless.yml index b5d390d..91e95a7 100644 --- a/backend/serverless.yml +++ b/backend/serverless.yml @@ -18,7 +18,7 @@ provider: AUTH0_ISSUER: https://dev-6zeb418i7xs8g1lc.us.auth0.com/ DYNAMODB_TASKS_TABLE: dev-focusflow-tasks DYNAMODB_USERS_TABLE: dev-focusflow-users - S3_ASSETS_BUCKET: dev-focusflow-assets + S3_ASSETS_BUCKET: dev-focusflow-assets iam: role: statements: @@ -42,27 +42,6 @@ provider: - lambda:InvokeFunction Resource: - arn:aws:lambda:${self:provider.region}:${aws:accountId}:function:${self:service}-${self:provider.stage}-auth0Authenticator - - Effect: Allow - Action: - - sts:AssumeRole - AwshttpApi: - cors: - allowedOrigins: - - http://localhost:5173 - allowedMethods: - - GET - - POST - - PUT - - DELETE - - OPTIONS - allowedHeaders: - - Authorization - - Content-Type - - X-Amz-Date - - X-Api-Key - - X-Amz-Security-Token - - X-Amz-User-Agent - allowCredentials: true custom: tableName: ${sls:stage}-focusflow-tasks @@ -101,6 +80,18 @@ resources: - AttributeName: userId KeyType: HASH + UserBackgroundsTable: + Type: AWS::DynamoDB::Table + Properties: + TableName: dev-user-backgrounds + BillingMode: PAY_PER_REQUEST + AttributeDefinitions: + - AttributeName: userId + AttributeType: S + KeySchema: + - AttributeName: userId + KeyType: HASH + # S3 Bucket for Assets AssetsBucket: Type: AWS::S3::Bucket @@ -142,21 +133,11 @@ functions: - http: path: tasks method: get - cors: - origin: "http://localhost:5173" # Use '*' for all origins or specify 'http://localhost:5173' for development - headers: - - Content-Type - - Authorization - - X-Requested-With - - X-Amz-Date - - X-Api-Key - - X-Amz-Security-Token - - X-Amz-User-Agent + cors: true authorizer: type: REQUEST identitySource: method.request.header.Authorization name: auth0Authorizer - allowCredentials: true updateTask: handler: src/handlers/task/updateTask.updateTask events: @@ -261,23 +242,45 @@ functions: - X-Amz-Security-Token - X-Amz-User-Agent - # Background Management - updateBackground: - handler: src/handlers/background/updateBackground.updateBackground + initializeBackgrounds: + handler: src/handlers/backgrounds/initializeBackgrounds.initializeBackgrounds events: - http: - path: backgrounds - method: put - cors: - origin: "*" # Use '*' for all origins or specify 'http://localhost:5173' for development - headers: - - Content-Type - - Authorization - - X-Requested-With - - X-Amz-Date - - X-Api-Key - - X-Amz-Security-Token - - X-Amz-User-Agent + path: backgrounds/{userId}/initialize + method: post + authorizer: + type: REQUEST + identitySource: method.request.header.Authorization + name: auth0Authorizer + + getBackgrounds: + handler: src/handlers/backgrounds/getBackgrounds.getBackgrounds + events: + - http: + path: backgrounds/{userId} + method: get + authorizer: + type: REQUEST + identitySource: method.request.header.Authorization + name: auth0Authorizer + + addBackground: + handler: src/handlers/backgrounds/addBackground.addBackground + events: + - http: + path: backgrounds/{userId} + method: post + authorizer: + type: REQUEST + identitySource: method.request.header.Authorization + name: auth0Authorizer + + deleteBackground: + handler: src/handlers/backgrounds/deleteBackground.deleteBackground + events: + - http: + path: backgrounds/{userId} + method: delete authorizer: type: REQUEST identitySource: method.request.header.Authorization diff --git a/backend/src/handlers/background/updateBackground.js b/backend/src/handlers/background/updateBackground.js deleted file mode 100644 index 22861f2..0000000 --- a/backend/src/handlers/background/updateBackground.js +++ /dev/null @@ -1,20 +0,0 @@ -const db = require('../../utils/db'); - -module.exports.updateBackground = async (event) => { - const userId = event.requestContext.authorizer.userId; - const { background } = JSON.parse(event.body); - - const params = { - TableName: process.env.DYNAMODB_USERS_TABLE, - Key: { userId }, - UpdateExpression: 'set background = :background', - ExpressionAttributeValues: { ':background': background }, - }; - - await db.update(params); - - return { - statusCode: 200, - body: JSON.stringify({ message: 'Background updated successfully' }), - }; -}; diff --git a/backend/src/handlers/backgrounds/addBackground,js b/backend/src/handlers/backgrounds/addBackground,js new file mode 100644 index 0000000..e78f408 --- /dev/null +++ b/backend/src/handlers/backgrounds/addBackground,js @@ -0,0 +1,29 @@ +module.exports.addBackground = async (event) => { + const userId = event.pathParameters.userId; + const { id, name, url, thumbnail } = JSON.parse(event.body); + + const params = { + TableName: 'user-backgrounds', + Key: { userId }, + UpdateExpression: 'SET backgrounds = list_append(if_not_exists(backgrounds, :emptyList), :newBackground)', + ExpressionAttributeValues: { + ':newBackground': [{ id, name, url, thumbnail }], + ':emptyList': [], + }, + ReturnValues: 'UPDATED_NEW', + }; + + try { + const result = await db.update(params).promise(); + return { + statusCode: 200, + body: JSON.stringify(result.Attributes.backgrounds), + }; + } catch (error) { + console.error('Error adding background:', error); + return { + statusCode: 500, + body: JSON.stringify({ error: 'Failed to add background.' }), + }; + } +}; diff --git a/backend/src/handlers/backgrounds/deleteBackground.js b/backend/src/handlers/backgrounds/deleteBackground.js new file mode 100644 index 0000000..eb7f8e0 --- /dev/null +++ b/backend/src/handlers/backgrounds/deleteBackground.js @@ -0,0 +1,38 @@ +module.exports.deleteBackground = async (event) => { + const userId = event.pathParameters.userId; + const { id } = JSON.parse(event.body); + + const getParams = { + TableName: 'user-backgrounds', + Key: { userId }, + }; + + try { + const result = await db.get(getParams).promise(); + const currentBackgrounds = result.Item?.backgrounds || []; + + const updatedBackgrounds = currentBackgrounds.filter((bg) => bg.id !== id); + + const updateParams = { + TableName: 'user-backgrounds', + Key: { userId }, + UpdateExpression: 'SET backgrounds = :updatedBackgrounds', + ExpressionAttributeValues: { + ':updatedBackgrounds': updatedBackgrounds, + }, + }; + + await db.update(updateParams).promise(); + + return { + statusCode: 200, + body: JSON.stringify(updatedBackgrounds), + }; + } catch (error) { + console.error('Error deleting background:', error); + return { + statusCode: 500, + body: JSON.stringify({ error: 'Failed to delete background.' }), + }; + } +}; diff --git a/backend/src/handlers/backgrounds/getBackgrounds.js b/backend/src/handlers/backgrounds/getBackgrounds.js new file mode 100644 index 0000000..339bdb7 --- /dev/null +++ b/backend/src/handlers/backgrounds/getBackgrounds.js @@ -0,0 +1,36 @@ +const AWS = require('aws-sdk'); +const db = require('../../utils/db'); +const PREDEFINED_BACKGROUNDS = require('./predefinedBackgrounds.json'); + +module.exports.getBackgrounds = async (event) => { + const userId = event.pathParameters.userId; + + const params = { + TableName: 'dev-user-backgrounds', + Key: { userId }, + }; + + try { + + const backgrounds = [...PREDEFINED_BACKGROUNDS]; + + return { + statusCode: 200, + headers: { + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Credentials': true, + }, + body: JSON.stringify(backgrounds), + }; + } catch (error) { + console.error('Error fetching backgrounds:', error); + return { + statusCode: 500, + headers: { + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Credentials': true, + }, + body: JSON.stringify({ error: 'Failed to retrieve backgrounds.' }), + }; + } +}; diff --git a/backend/src/handlers/backgrounds/initializeBackgrounds.js b/backend/src/handlers/backgrounds/initializeBackgrounds.js new file mode 100644 index 0000000..314279d --- /dev/null +++ b/backend/src/handlers/backgrounds/initializeBackgrounds.js @@ -0,0 +1,36 @@ +const AWS = require('aws-sdk'); +const db = require('../../utils/db'); +const PREDEFINED_BACKGROUNDS = require('./predefinedBackgrounds.json'); // Optional: Use a static JSON + +module.exports.initializeBackgrounds = async (event) => { + const userId = event.pathParameters.userId; + + const params = { + TableName: 'dev-user-backgrounds', + Item: { + userId, + backgrounds: PREDEFINED_BACKGROUNDS, + }, + ConditionExpression: 'attribute_not_exists(userId)', // Avoid overwriting if already initialized + }; + + try { + await db.put(params).promise(); + return { + statusCode: 201, + body: JSON.stringify({ message: 'User backgrounds initialized.' }), + }; + } catch (error) { + if (error.code === 'ConditionalCheckFailedException') { + return { + statusCode: 400, + body: JSON.stringify({ message: 'User backgrounds already initialized.' }), + }; + } + console.error('Error initializing backgrounds:', error); + return { + statusCode: 500, + body: JSON.stringify({ error: 'Failed to initialize backgrounds.' }), + }; + } +}; diff --git a/backend/src/handlers/backgrounds/predefinedBackgrounds.json b/backend/src/handlers/backgrounds/predefinedBackgrounds.json new file mode 100644 index 0000000..4f052c1 --- /dev/null +++ b/backend/src/handlers/backgrounds/predefinedBackgrounds.json @@ -0,0 +1,122 @@ +[ + { + "name": "Tiny Camp Fire", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Tiny-Camp-Fire.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Tiny-Camp-Fire.jpg" + }, + { + "name": "Apartment Night Rain", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/apartment-night-rain.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/apartment-night-rain.jpg" + }, + { + "name": "Study Room Sun Shower", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Study-Room-Sun-Shower.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Study-Room-Sun-Shower.jpg" + }, + { + "name": "90s Office", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/90s-Office.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/90-office.jpg" + }, + { + "name": "Astronaut Facing a Black Hole", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Astronaut-Facing-a-Black-Hole.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Astronaut-Facing-a-Black-Hole.jpg" + }, + { + "name": "Bart Nirvana", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Bart-Nirvana.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Bart-Nirvana.jpg" + }, + { + "name": "Bedroom in Space", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Bedroom-in-Space.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Bedroom-in-Space.jpg" + }, + { + "name": "Empty Classroom", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Empty-Classroom.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Empty-Classroom.jpg" + }, + { + "name": "Futuristic Room Apartment", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Futuristic-Room-Apartment.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Futuristic-Room-Apartment.jpg" + }, + { + "name": "Hacker Desk", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Hacker-Desk.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Hacker-Desk.jpg" + }, + { + "name": "Home Office", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Home-Office.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Home-Office.jpg" + }, + { + "name": "Japanese Living Room Night", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Japanese-Living-Room-night.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Japanese-Living-Room-night.jpg" + }, + { + "name": "Living Room Chill", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Living-Room-Chill.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Living-Room-Chill.jpg" + }, + { + "name": "Modern Apartment Short", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Modern-Apartment-short.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Modern-Apartment-short.jpg" + }, + { + "name": "Neon City Sunrise", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Neon-City-Sunrise.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Neon-City-Sunrise.jpg" + }, + { + "name": "Night Drive", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Night-Drive.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Night-Drive.jpg" + }, + { + "name": "Pixel Night", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Pixel-Night.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Pixel-Night.jpg" + }, + { + "name": "Pixel Room", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Pixel-Room.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Pixel-Room.jpg" + }, + { + "name": "Raining Outside", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Raining-Outside.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Raining-Outside.jpg" + }, + { + "name": "Rainy Night Corner Store", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Rainy-Night-Corner-Store.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Rainy-Night-Corner-Store.jpg" + }, + { + "name": "Retro Neon Car", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Retro-Neon-Car.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Retro-Neon-Car.jpg" + }, + { + "name": "Room in Space Earth", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Room-in-Space-earth.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Room-in-Space-earth.jpg" + }, + { + "name": "Space Apartment", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Space-Apartment.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Space-Apartment.jpg" + }, + { + "name": "Space Bedroom", + "src": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/videos/Space-Bedroom.mp4", + "thumbnailSrc": "https://dev-focusflow-assets-274552760074.s3.us-east-1.amazonaws.com/backgrounds/thumbnail/Space-Bedroom.jpg" + } +] diff --git a/docs/branching-merging-strategy.md b/docs/branching-merging-strategy.md new file mode 100644 index 0000000..44fded0 --- /dev/null +++ b/docs/branching-merging-strategy.md @@ -0,0 +1,159 @@ +# **Branching and Merging Strategy** + + +### **4.1 Branch Types** + +Adopt a standardized branching model to manage development workflows effectively. + +* **Main Branches:** + * `main`: Production-ready code. This branch reflects the live application. + * `develop`: Integration branch for features. All completed features are merged here before release. +* **Supporting Branches:** + * **Feature Branches** : For developing new features. + * **Naming Convention:** `feature/` + * **Example:** `feature/todo-filter` + * **Bugfix Branches** : For fixing bugs. + * **Naming Convention:** `bugfix/` + * **Example:** `bugfix/timer-resume-issue` + * **Hotfix Branches** : For urgent fixes in production. + * **Naming Convention:** `hotfix/` + * **Example:** `hotfix/login-crash` + * **Release Branches** : For preparing a new production release. + * **Naming Convention:** `release/` + * **Example:** `release/1.0.0` + +### Steps to create new branch and push + +Create and switch to the new branch + +```jsx +git checkout -b feature/... +``` + +Add your changes + +```jsx +git add . +``` + +Commit your changes + +```jsx +git commit -m "" +``` + +Push to remote with upstream tracking + +```jsx +git push --set-upstream origin feature/... +``` + +### **4.2 Branch Naming Conventions** + +Maintain clarity and consistency in branch names to facilitate easy identification and management. + +* **Feature Branches:** `feature/` + * Example: `feature/pomodoro-customization` +* **Bugfix Branches:** `bugfix/` + * Example: `bugfix/api-response-time` +* **Hotfix Branches:** `hotfix/` + * Example: `hotfix/user-authentication` +* **Release Branches:** `release/` + * Example: `release/1.0.0` + +**Guidelines:** + +* Use lowercase letters and hyphens to separate words. +* Keep branch names concise yet descriptive. +* Avoid using spaces, special characters, or uppercase letters. + +### **4.3 Merging Protocols** + +Establish clear protocols for merging branches to maintain code integrity and streamline collaboration. + +### **4.3.1 Feature Branch Merging** + +1. **Completion:** + * Once a feature is complete and tested locally, open a Pull Request (PR) to merge into `develop`. +2. **Code Review:** + * At least one team member reviews the PR. + * Address any feedback or requested changes. +3. **Merge:** + * After approval, merge the feature branch into `develop` using **squash and merge** to combine commits into a single, clean commit. +4. **Delete Branch:** + * Delete the feature branch post-merge to keep the repository clean. + +### **4.3.2 Bugfix Branch Merging** + +1. **Completion:** + * After fixing the bug and testing, open a PR to merge into `develop`. +2. **Code Review:** + * Team members review the changes for correctness and adherence to standards. +3. **Merge:** + * Merge the bugfix branch into `develop` using **squash and merge** . +4. **Delete Branch:** + * Remove the bugfix branch after merging. + +### **4.3.3 Hotfix Branch Merging** + +1. **Urgency:** + * Hotfixes address critical issues in the production environment. +2. **Merge into Main:** + * Open a PR to merge the hotfix branch directly into `main`. +3. **Code Review:** + * Conduct a swift code review to ensure the fix is appropriate and does not introduce new issues. +4. **Merge:** + * Use **merge commit** to preserve the history. +5. **Back-Merge into Develop:** + * Additionally, merge the hotfix into `develop` to ensure the fix is included in future releases. +6. **Delete Branch:** + * Delete the hotfix branch post-merge. + +### **4.3.4 Release Branch Merging** + +1. **Preparation:** + * When `develop` has accumulated enough features for a release, create a `release` branch. +2. **Stabilization:** + * Perform final testing, bug fixing, and documentation updates on the release branch. +3. **Code Review:** + * Review the release branch to ensure readiness for production. +4. **Merge into Main and Develop:** + * Merge the release branch into `main` using a **merge commit** . + * Tag the release with a version number. + * Also, merge the release branch back into `develop` to incorporate any final changes. +5. **Delete Branch:** + * Remove the release branch after merging. + +### **4.4 Conflict Resolution** + +Effective strategies to handle merge conflicts ensure smooth integration of code changes. + +* **Early Integration:** + * Frequently merge `develop` into feature branches to minimize large divergences. +* **Communication:** + * Encourage team members to communicate about overlapping work to anticipate conflicts. +* **Conflict Resolution Steps:** + 1. **Identify the Conflict:** + * Git will highlight the files and sections with conflicts during merging. + 2. **Review Conflicting Changes:** + * Understand the intent behind each conflicting change. + 3. **Resolve the Conflict:** + * Decide which changes to keep, modify, or discard. + * Edit the affected files to resolve conflicts manually. + 4. **Mark as Resolved:** + * After resolving, mark the conflicts as resolved using Git commands. + 5. **Test Thoroughly:** + * Ensure that the resolved code works as intended. + 6. **Commit the Merge:** + * Finalize the merge after resolving conflicts. +* **Use Tools:** + * Utilize Git's built-in merge tools or third-party tools like **VS Code's merge editor** , **Meld** , or **KDiff3** for visual conflict resolution. + +**Set Up Branch Protection Rules** + +* Go to your Git hosting service (e.g., GitHub). +* Navigate to the repository settings > **Branches** . +* Add rules for `main` and `develop`: + * Require pull request reviews before merging. + * Require status checks to pass before merging (CI/CD pipeline once configured). + * Prevent force pushes and deletions. diff --git a/docs/coding-standarts.md b/docs/coding-standarts.md new file mode 100644 index 0000000..fc23746 --- /dev/null +++ b/docs/coding-standarts.md @@ -0,0 +1,75 @@ +# Coding Standards + +### **2.1 General Guidelines** + +* **Consistency:** Maintain consistent coding styles across the entire codebase to enhance readability and maintainability. +* **Clarity:** Write clear and understandable code. Prioritize readability over cleverness. +* **Modularity:** Break down code into reusable and modular components/functions to promote scalability and ease of maintenance. +* **Efficiency:** Optimize code for performance without compromising readability or maintainability. + +### **2.2 Naming Conventions** + +### **2.2.1 Variables and Constants** + +* **Variables:** + * Use **camelCase** for variable names. + * Example: `userName`, `taskList`, `sessionTimer`. +* **Constants:** + * Use **UPPER_SNAKE_CASE** for constants. + * Example: `MAX_USER_LIMIT`, `DEFAULT_SESSION_LENGTH`. + +### **2.2.2 Functions and Methods** + +* Use **camelCase** for function and method names. +* Function names should be descriptive and convey the action performed. +* Example: `addTask()`, `startTimer()`, `fetchBackgroundImage()`. + +### **2.2.3 Classes and Components** + +* Use **PascalCase** for class names and React component names. +* Example: `TaskManager`, `PomodoroTimer`, `MusicPlayer`. + +### **2.2.4 Files and Folders** + +* Use **kebab-case** for file and folder names. +* Example: `task-manager.js`, `pomodoro-timer.jsx`, `music-player.css`. + +### **2.3 Code Formatting** + +* **Indentation:** Use **2 spaces** for indentation. Avoid using tabs. +* **Line Length:** Limit lines to **80 characters** to enhance readability. +* **Braces:** + * Use **K&R style** for brace placement. + * Example:`if (condition) { // code } else { // code }` +* **Semicolons:** Use semicolons to terminate statements. +* **Spacing:** + * Add a space after commas, colons, and semicolons. + * Example:`const tasks = [task1, task2, task3];` +* **Blank Lines:** Use blank lines to separate logical sections of code for better readability. + +### **2.4 Commenting and Documentation** + +* **Inline Comments:** + * Use inline comments sparingly to explain complex logic or non-obvious code segments. + * Start comments with a capital letter and end with a period. + * Example:`// Initialize the Pomodoro timer with default settings. const timer = new PomodoroTimer();` +* **Block Comments:** + * Use block comments to describe the purpose of a function, class, or module. + * Place block comments above the code they describe. + * Example:`/** * Adds a new task to the task list. * @param {string} taskName - The name of the task to add. */ function addTask(taskName) { // Implementation }` +* **Documentation:** + * Maintain comprehensive documentation using tools like **JSDoc** for JavaScript code. + * Include descriptions of functions, parameters, return values, and any exceptions thrown. + +### **2.5 Best Practices** + +* **Avoid Magic Numbers:** Use named constants instead of hard-coded numbers. + * Example:`const DEFAULT_SESSION_LENGTH = 25; // minutes const DEFAULT_BREAK_LENGTH = 5; // minutes` +* **Error Handling:** Implement robust error handling to manage exceptions gracefully. + * Use `try-catch` blocks where appropriate. + * Example:`try { // Code that may throw an error } catch (error) { console.error('An error occurred:', error); }` +* **Code Reusability:** DRY (Don't Repeat Yourself) principle—avoid code duplication by creating reusable functions and components. +* **Use of Libraries:** Only incorporate necessary third-party libraries to avoid unnecessary bloat and potential security vulnerabilities. +* **Testing:** Write unit tests for critical functions and components to ensure reliability. + +[**Airbnb React/JSX Style Guide**](https://www.notion.so/Airbnb-React-JSX-Style-Guide-142e327e7afd80c7aad9c38191492cf9?pvs=21) diff --git a/frontend/public/FocusFlow-banner.png b/docs/images/FocusFlow-banner.png similarity index 100% rename from frontend/public/FocusFlow-banner.png rename to docs/images/FocusFlow-banner.png diff --git a/frontend/public/desktop-preview.jpg b/docs/images/desktop-preview.jpg similarity index 100% rename from frontend/public/desktop-preview.jpg rename to docs/images/desktop-preview.jpg diff --git a/frontend/public/mobile-preview.jpg b/docs/images/mobile-preview.jpg similarity index 100% rename from frontend/public/mobile-preview.jpg rename to docs/images/mobile-preview.jpg diff --git a/frontend/public/phone-preview.jpg b/docs/images/phone-preview.jpg similarity index 100% rename from frontend/public/phone-preview.jpg rename to docs/images/phone-preview.jpg diff --git a/docs/version-controls.md b/docs/version-controls.md new file mode 100644 index 0000000..e9d9be0 --- /dev/null +++ b/docs/version-controls.md @@ -0,0 +1,60 @@ +# **Version Control Practices** + +### **3.1 Repository Structure** + +* **Monorepo vs. Multi-repo:** + * For **FocusFlow** , use a **monorepo** approach, keeping both frontend and backend code in a single repository for easier management and integration. +* **Directory Layout:** + * Organize the repository with clear directories for frontend and backend. + * Example:`focusflow/ ├── frontend/ │ ├── src/ │ ├── public/ │ └── package.json ├── backend/ │ ├── src/ │ └── package.json ├── .gitignore ├── README.md └── LICENSE` + +### **3.2 Commit Message Guidelines** + +Adhere to a clear and consistent commit message format to improve readability and traceability. + +### **3.2.1 Format** + +* **Header:** + * **Structure:** `(): ` + * **Types:** `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore` + * **Scope:** Optional; indicates the section of the codebase affected. + * **Example:** `feat(pomodoro): add start and pause functionality` +* **Body:** + * Provide a detailed description of the changes. + * Explain the **what** and **why** , not the **how** . + * Wrap lines at **72 characters** . +* **Footer:** + * Include references to issues or pull requests. + * Example: `Closes #45` + +### **3.2.2 Examples** + +* **Adding a Feature:** `feat(todo): add ability to filter tasks by status Implemented filtering functionality to allow users to view all, completed, or incomplete tasks. Added corresponding UI components and backend support. Closes #12` +* **Fixing a Bug:** `fix(timer): correct countdown logic when pausing and resuming Fixed an issue where the Pomodoro timer did not accurately resume after being paused. Adjusted the countdown calculations and added additional state management. Closes #23` +* **Updating Documentation:** `docs(README): update setup instructions for new developers Revised the README to include detailed setup instructions, environment variable configurations, and troubleshooting tips to assist new developers in onboarding.` + +### **3.3 Pull Request Guidelines** + +Ensure that all code changes are reviewed and approved before merging into the main branch. + +### **3.3.1 Pull Request Process** + +1. **Create a Branch:** + * Branch from the `develop` branch following the naming conventions. +2. **Develop on the Feature Branch:** + * Implement the feature or fix. + * Commit changes with clear commit messages. +3. **Open a Pull Request (PR):** + * Target the `develop` branch. + * Provide a descriptive title and detailed description. + * Link related issues using keywords (e.g., `Closes #45`). +4. **Review Process:** + * At least one team member reviews the PR. + * Conduct code reviews focusing on code quality, adherence to standards, and functionality. + * Request changes if necessary. +5. **Approval and Merge:** + * Once approved, merge the PR into `develop`. + * Use **squash and merge** or **rebase and merge** to maintain a clean commit history. +6. **Post-Merge Actions:** + * Delete the feature branch to keep the repository clean. + * Ensure that CI/CD pipelines run successfully after merging. diff --git a/frontend/.env.example b/frontend/.env.example new file mode 100644 index 0000000..b1f82cc --- /dev/null +++ b/frontend/.env.example @@ -0,0 +1,2 @@ +DYNAMODB_TABLE_NAME=example-tasks +VITE_API_BASE_URL=http://localhost:3000/example #https://example.execute-api.us-east-1.amazonaws.com/example \ No newline at end of file diff --git a/frontend/src/constants.js b/frontend/src/constants.js deleted file mode 100644 index e61fc10..0000000 --- a/frontend/src/constants.js +++ /dev/null @@ -1,13 +0,0 @@ -import theSky from '../public/music/the sky.mp3'; -import discover from '../public/music/discover.mp3'; - -export const music = [ - { - title: 'The Sky', - music: theSky, - }, - { - title: 'Discover', - music: discover, - }, -]; diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx index 4fea5b4..7825080 100644 --- a/frontend/src/pages/Dashboard.jsx +++ b/frontend/src/pages/Dashboard.jsx @@ -18,7 +18,7 @@ const Dashboard = () => { return ( isAuthenticated && ( -
+
diff --git a/frontend/src/pages/HomePage.jsx b/frontend/src/pages/HomePage.jsx index fc03ac0..e618e73 100644 --- a/frontend/src/pages/HomePage.jsx +++ b/frontend/src/pages/HomePage.jsx @@ -14,7 +14,7 @@ const HomePage = () => { }, [isAuthenticated, navigate]); return ( -
+

Home Page

{!isAuthenticated && }