Skip to content

Commit

Permalink
feat: forum images also in page board (#335)
Browse files Browse the repository at this point in the history
* chore(deps): update typescript-eslint monorepo to v5.17.0 (#182)

Co-authored-by: Renovate Bot <[email protected]>

* feat: api for put-timetable lambda. (#179)

* feat: api for put-timetable lambda.

* feat: fixed syntax errors

* feat: fixed syntax error (2)

* chore(deps): update dependencies

* chore: add lint-staged

* chore(deps): update codecov/codecov-action action to v3 (#186)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update amannn/action-semantic-pull-request action to v4.3.0 (#189)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update aws-cdk monorepo to v2.22.0

* chore(deps): update github/codeql-action action to v2 (#192)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update amannn/action-semantic-pull-request action to v4.4.0 (#190)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependencies

* chore(deps): update amannn/action-semantic-pull-request action to v4.5.0

* chore(deps): update dependency husky to v8

* chore(deps): update dependency @commitlint/cli to v16.3.0

* chore(deps): update dependency standard-version to v9.5.0

* chore(deps): update aws-cdk monorepo to v2.27.0

* chore(deps): update dependency ts-jest to v28.0.4

* chore(deps): update dependency eslint to v8.17.0

* chore(deps): update dependency ts-node to v10.8.1

* chore(deps): update typescript-eslint monorepo to v5.27.1

* chore(deps): update jest monorepo

* chore(deps): update dependency constructs to v10.1.32

* chore(deps): update dependencies

* chore(deps): update pnpm/action-setup action to v2.2.2

* chore(deps): update dependency typescript to v4.7.3

* chore(deps): update dependencies

* f:added Put method into default Headers for new api function put-timetable (#216)

* feat: updated pnpm-lock file to latest

* feat: uploading updated package file

* feat: updating package-lock file

* fix: modified jest config file

* fix: update jest config

* fix: configured rest api settings  (#221)

* fix: config rest api

* fix: update jest config

* fix: jest types

* fix: update pnpm lock

* fix: deleted package-lock

* feat: creating only database and not API (#225)

* f:added Put method into default Headers for new api function put-timetable

* feat: adding table and api

* feat: for backup

* feat: updated pnpm-lock

* feat: initiating database creation

* feat: redoing databases

* feat: building database thread

* fix: fix git branch merging error (#226)

* fix: fix git branch merging error

* fix: fixing minor issues

* fix: hotfix

* fix: fixing db

* fix(deps): update dependency flatted to v3.2.7 (#215)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update jest monorepo (#210)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency husky to v8.0.2 (#227)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: renamed forum database and fixed multiple api (#230)

* feat: updated api get schema and renamed database

* fix: fix lambda function

* fix: fixed lambda get single thread and others

* fix: changed already existing db role name (#231)

* feat: updated api get schema and renamed database

* fix: fix lambda function

* fix: fixed lambda get single thread and others

* fix: fix already existing db role

* feat: editing forum restapi resources and added multiple CRUD lambda functions (#232)

* feat: altered api resources Trying to resolve multiple trigger issue in one lambda function

* feat: added lambdas delete patch and post fixed minor issues in other lambdas

* fix: erased unused library

* chore(deps): update dependency constructs to v10.1.205 (#206)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency ts-jest to v28.0.8 (#208)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency ts-node to v10.9.1 (#234)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency constructs to v10.1.206 (#235)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency esbuild to ^0.16.0 (#233)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency eslint-import-resolver-typescript to v3 (#214)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update commitlint monorepo to v17.3.0 (#213)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update jest monorepo to v29 (#239)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: adding forum comment features (#240)

* feat: initiating forum comments function

* feat: added api gateway schemas for forum comment GET POST and PATCH

* feat: added Forum Comment Api Service

* feat: added GET POST PATCH DELETE lambda functions for forum comments

* feat: finishing fourm comment lambda functions Now capable of conducting simple curd operations

* fix: fix forum comment patch

* fix: re-configuring options resource for forum threads

* fix: renaming api resource

* fix: issue with post forum thread fixing issue (#242)

* fix: mistaken sortkey type

* fix: trying to solve a problem

* fix: changing db (#243)

* fix: solving database issue

* fix: still fixing issues

* fix: reverting error (#244)

* fix: fixing big time reverting whole thread feature

* fix: trying my best to fix

* fix: continuing fix

* fix: continuing

* fix: deleting lambda (#245)

* feat: reverting

* feat: idontknowwhatshappeningnow

* feat: fixing mistakes

* feat: retrieving db and api

* chore(deps): update dependency constructs to v10.1.210 (#241)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: fixing cross stack referencing (#247)

* fix: fixing cross stack referencing

* fix: fixing export value

* chore(deps): update dependency husky to v8.0.3 (#246)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: updating dependencies and syllabus structure (#249)

* fix: configuring-rest-api (#219)

* chore(deps): update dependency eslint to v8.9.0 (#141)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update amannn/action-semantic-pull-request action to v4.2.0 (#140)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.70 (#138)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.71 (#145)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update pnpm/action-setup action to v2.2.0 (#142)

Co-authored-by: Renovate Bot <[email protected]>

* feat: lambda for put-timetable (#144)

* feat: lambda for put-timetable

* deleted newline for put-timetable.

* changed file name for consistency

* chore(deps): update actions/setup-node action to v3 (#148)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update pnpm/action-setup action to v2.2.1 (#147)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.72 (#146)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update typescript-eslint monorepo to v5.12.1 (#143)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update aws-cdk monorepo to v2.14.0 (#133)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.74 (#150)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency eslint to v8.10.0 (#149)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency typescript to v4.6.2 (#153)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update aws-cdk monorepo to v2.15.0 (#154)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.75 (#152)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency ts-node to v10.6.0 (#155)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update actions/checkout action to v3 (#156)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update typescript-eslint monorepo to v5.13.0 (#151)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.76 (#157)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.77 (#158)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.79 (#159)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update typescript-eslint monorepo to v5.14.0 (#162)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency ts-node to v10.7.0 (#161)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.81 (#160)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.82 (#163)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.83 (#164)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update aws-cdk monorepo to v2.16.0 (#168)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update endbug/add-and-commit action to v9 (#167)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency @commitlint/cli to v16.2.3 (#170)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update typescript-eslint monorepo to v5.15.0 (#169)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.90 (#165)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update peter-evans/find-comment action to v2 (#175)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update peter-evans/create-or-update-comment action to v2 (#174)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update aws-cdk monorepo to v2.17.0 (#171)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency constructs to v10.0.92 (#172)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update typescript-eslint monorepo to v5.16.0 (#173)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependency eslint-import-resolver-typescript to v2.7.0 (#176)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update aws-cdk monorepo to v2.19.0 (#183)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update typescript-eslint monorepo to v5.17.0 (#182)

Co-authored-by: Renovate Bot <[email protected]>

* feat: api for put-timetable lambda. (#179)

* feat: api for put-timetable lambda.

* feat: fixed syntax errors

* feat: fixed syntax error (2)

* chore(deps): update dependencies

* chore: add lint-staged

* chore(deps): update codecov/codecov-action action to v3 (#186)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update amannn/action-semantic-pull-request action to v4.3.0 (#189)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update aws-cdk monorepo to v2.22.0

* chore(deps): update github/codeql-action action to v2 (#192)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update amannn/action-semantic-pull-request action to v4.4.0 (#190)

Co-authored-by: Renovate Bot <[email protected]>

* chore(deps): update dependencies

* chore(deps): update amannn/action-semantic-pull-request action to v4.5.0

* chore(deps): update dependency husky to v8

* chore(deps): update dependency @commitlint/cli to v16.3.0

* chore(deps): update dependency standard-version to v9.5.0

* chore(deps): update aws-cdk monorepo to v2.27.0

* chore(deps): update dependency ts-jest to v28.0.4

* chore(deps): update dependency eslint to v8.17.0

* chore(deps): update dependency ts-node to v10.8.1

* chore(deps): update typescript-eslint monorepo to v5.27.1

* chore(deps): update jest monorepo

* chore(deps): update dependency constructs to v10.1.32

* chore(deps): update dependencies

* chore(deps): update pnpm/action-setup action to v2.2.2

* chore(deps): update dependency typescript to v4.7.3

* chore(deps): update dependencies

* f:added Put method into default Headers for new api function put-timetable (#216)

* feat: updated pnpm-lock file to latest

* feat: uploading updated package file

* feat: updating package-lock file

* fix: modified jest config file

* fix: update jest config

* fix: config rest api

* fix: update jest config

* fix: jest types

* fix: update pnpm lock

* fix: deleted package-lock

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: AustinZhu <[email protected]>

* Revert "fix: configuring-rest-api (#219)" (#220)

This reverts commit 665e252.

* fix: chaning syllabus constants

* fix: fixing actions

* fix: adding pnpm command

* fix: reverting changes to original form

---------

Co-authored-by: Jason Park <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: AustinZhu <[email protected]>

* chore(deps): update dependency constructs to v10.1.279 (#250)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: establishing table (#252)

* fix: minor changes (#253)

* fix: renaming table (#254)

* fix: renaming table

* fix: might be an empty commit

* fix: exporting table arn (#255)

* fix: resolving already existing identifier (#256)

* fix: rereferencing export (#258)

* fix: removed conflicting service

* fix: removing exporting value

* fix: re connecting thread service

* fix: adding lsi to table exporting arn with tablename (#259)

* fix: deleting thread table (#260)

* fix: recreating thread table with proper lsi (#261)

* fix: recreating lambdas for forum threads (#262)

* chore(deps): update typescript-eslint monorepo to v5.55.0 (#207)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/node to v18 (#237)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update aws-cdk monorepo (#209)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: api service added (#266)

* chore(deps): update dependency typescript to v4.9.5 (#211)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency eslint to v8.36.0 (#212)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update commitlint monorepo to v17.4.4 (#267)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: fixing error for get thread (#271)

* feat: adding amplify micro app forum (#272)

* feat: adding amplify app forums

* fix: deleting added micro app

* feat: readding amplify app forum

* chore(deps): update dependency esbuild to ^0.17.0 (#269)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: updating outdated pnpm lock file (#274)

* fix: reinstalling pnpm lock file to solve outdate issue

* fix: reinstalling pnpm and then reinstalling pnpm lock file

* chore(deps): update dependency constructs to v10.1.305 (#263)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @commitlint/cli to v17.5.1 (#275)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency constructs to v10.1.309 (#276)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency aws-cdk-lib to v2.74.0 (#277)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency constructs to v10.1.311 (#278)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update commitlint monorepo to v17.6.1 (#279)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency eslint to v8.38.0 (#280)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update jest monorepo to v29.5.0 (#281)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency constructs to v10.1.312 (#282)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/node to v18.15.12 (#273)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: adding response handler (#285)

* fix: fixing multiple lambda functions (#286)

* fix: fixing redundant data requirements described in the schema (#287)

* fix: fixing multiple lambda functions

* fix: fixing api schema

* fix: fixed schema and some lambdas (#288)

* fix: scraper and period location (#289)

* feat: adding new case for scrapper for instance multiple periods and multiple locations

* feat: adding case of multiple locations and periods devided with a slash

* feat: updated get single thread lambda role to all access to db (#290)

* feat: enabling multi-line evaluation criteria scraping (#291)

* feat: adding regex to scrape multiple eval criterias

* feat: enabling multiple line of criteria

* chore(deps): update dependency @types/jest to v29.5.1 (#284)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update typescript-eslint monorepo to v5.59.6 (#283)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix: applying hotfix changes to branch develop

* feat: adding case 3 for merging period and location for exceptions (#295)

* chore(deps): update pnpm/action-setup action to v2.2.4 (#228)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chores: simple update

* fix: refactoring forum table keys (#298)

* fix: refactoring forum table keys

* fix: first deleting the table

* feat: exporting table arn

* feat: destroying table forum (#299)

* feat: destroying table forum

* feat: exporting table name and arn to disconnect api service

* feat: continue destorying the forum table (#300)

* feat: continue destorying the forum table

* feat: disconnecting endpoint and stop exporting table arn

* feat: finishing refactoring forum functionaility (#301)

* feat: changing parameters for uid (#302)

* feat: changing parameters for uid

* fix: fixing conditional statements

* feat: adding default value

* feat: github why are you doing this stop this please

* fix: small changes

* fix: fix get-course (#303)

* feat: fixing cron

* fix: fix get eval criteria (#306)

* fix-get-eval-criteria

* fix: fix get-eval-criteria

* fix: fixing pnpm version to 6 (#309)

* feat: adding oauth for flutter app (#310)

* feat: adding oauth for flutter app

* fix: fixing typo

* fix: hotfix for conditional (#311)

* fix: fixing the fucking delete and patch

* feat: i might have solved the fucking issue

* feat: add mod flag (#312)

* feat: adding mod flag to get all threads lambda

* feat: adding mod flag to board threads

* fix: multiple lambdas related forums (#313)

* fix: update node version

* feat: fixing get functionality

* fix: getting rid of default values

* fix: final fix please

* fix: taking out int

* fix: lets make it work

* feat: adding school filtering

* fix: adding contigency

* fix: fixing bool

* fix: fixing bull for starting index

* feat: adding some loggings

* fix: fixing indexing

* chore: adding logging for debug

* feat: adding end index to message response

* fix: fixing schema to array

* feat: adding tags filtering to lambda

* feat: adding filitering and pagination functionality to board thread api

* fix: fixing small typos

* feat: contacting two lambdas to one

* feat: fixing

* fix: adding default

* feat: adding loggings for debugging

* feat: fixing sorting logic

* feat: refactoring sorting method

* feat: adding builtin dynamo pagination

* feat: reverting changes back to original built in pagination requires more examination

* feat: returning the created thread item for smooth UX

* feat: popping uid for secruity measures

* feat: adding thread comment to retunred data without uid exposure

* feat: adding mod flag

* feat: adding backend functionality for like

* feat: passing thread id back to client

* fix: fixing like logic

* fix: fixing logic for likes

* fix: refixing the fucking likes feature

* feat: major update into main from develop

* feat: renaming actions names

* feat: adding magic command to get rid of the table

* feat: destroying table on stage dev

* fix: fixing export value

* fix: what the fuck is happening

* fix: finalizing db reset

* feat: disconnecting service

* chore: small stuff

* feat: destroying table

* fix: commenting out export value method

* feat: rebuilding tables

* feat: rebuilding table what just happened

* feat: fixing git workflows and adding environment variables to amplfi… (#321)

* feat: fixing git workflows and adding environment variables to amplfiy configurations

* fix: variable instantiation error fixed

* fix: adding some error loggings to figure out the issue

* feat: adding additional API base url for VITE for forums

* fix: fixing variable name typo

* feat: adding needed variables to github actions yaml

* fix: fixing buildspec due to git merge conflicts

* fix: fixing basepath for dev env

* fix: refixing public base path

* feat: thread comment count (#322)

* feat: added comment count to post thread

* feat: update comment count

* feat: schema update new action

* chore: empty commit

* chore: test

* chore: update count change

* feat: adding newComment flag

* chore: small changes due to git merge conflict

---------

Co-authored-by: Jason Park <[email protected]>

* fix: messed up update expressions

* feat: adding more logic to patch and get threads related to likes and comments

* feat: adding new action of comment count decrease to patch thread lambda

* chore: adding logging statements

* fix: accidently deleted handler

* feat: adding increase and decrease action to schema

* fix: fixing envvar base path for app root

* fix: is it because of the space

* feat: adding logging statements

* chore: deleting condition expression

* feat: adding functionalities for user thread (#324)

* feat: adding functionalities for user thread

* chore: typo fix

* feat: changing schema model to an empty model

* fix: resource error fix

* fix: authorizer not working why

* feat: why isint it working

* feat: adding authorizer to user thread fetch

* chore: making response data dict concise

* fix: fixing conditional expressions to include 1

* feat: connecting thread forum bucket and dynamodb (#326)

* feat: adding connection to db for forum images and commenting out graphql stuff

* chore: commenting out graphql stuff

* chore: fixing identical names

* chore: fixing identical construct names in forumthreadfunctions

* chore: identical identifier in forum thread functions

* Revert "feat: connecting thread forum bucket and dynamodb (#326)"

This reverts commit 2df6f4a.

* feat: init forum image table (#327)

* feat: init forum image table

* feat: instantiating forum thread image data pipeline

* feat: threadimgdatapipeline

* feat: adding permissions and envvar for forum thread (#328)

* feat: adding permissions

* feat: adding test lambda for post (#329)

* feat: adding test post thread with images

* feat: taking board_id outo of path to data payload

* fix: fixing resource method

* feat: creating test lambda for forum get single thread (#330)

* chore: fixing typo

* feat: adding split to properly decode base64

* feat: adding image functionality to threads (#331)

* fix: adding boardid from path parameters

* feat: changing access control for forums (#332)

* feat: changing access control for forums

* fix: removing block public access

* feat: init thumbnail and ads processors (#333)

* test: test code for ads

* chore: test code update

* feat: adding thumbnail feature

* feat: adding sync image

* fix: fix function name

---------

Co-authored-by: Y.H LIEN <[email protected]>

* chore: changing logical id name

* feat: enabling public access

* fix: fixing public access

* feat: defining public read

* fix: fixing in two different stacks

* feat: removal policy destroy

* feat: destroying buckets

* feat: oh no

* feat: adding processor

* feat: adding different table name

* feat: adding prefix with wildcards

* fix: adding github ssh rsa as trusted

* feat: adding images for board view also (#334)

* feat: adding images for board view also

* fix: removing policies

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Jason Park <[email protected]>
Co-authored-by: AustinZhu <[email protected]>
Co-authored-by: Y.H LIEN <[email protected]>
Co-authored-by: Y.H LIEN <[email protected]>
  • Loading branch information
7 people authored Oct 3, 2023
1 parent d2c66b6 commit 1ad464c
Show file tree
Hide file tree
Showing 24 changed files with 1,166 additions and 62 deletions.
1 change: 1 addition & 0 deletions lib/configs/amplify/build-setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const preBuildForFeeds = {
commands: [
'eval $(ssh-agent -s)',
'ssh-add <(echo "$DEPLOY_KEY" | base64 --decode)',
'echo "github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=" >> ~/.ssh/known_hosts',
'git submodule init',
'git submodule update --remote',
'yum -y install make nasm autoconf automake libtool dpkg pkgconfig libpng libpng-dev g++',
Expand Down
1 change: 1 addition & 0 deletions lib/configs/common/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const enum DataEndpoint {
COURSE,
THREAD,
COMMENT,
ADS, //! New ADS value
}

export enum OperationEndpoint {
Expand Down
76 changes: 59 additions & 17 deletions lib/constructs/business/api-endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,31 @@ import { API_DOMAIN } from '../../configs/route53/domain';
import { GraphqlApiService } from './graphql-api-service';
import { AbstractHttpApiService } from './http-api-service';
import { RestApiService } from './rest-api-service';
import { GraphqlApiServiceId, graphqlApiServiceMap, RestApiServiceId, restApiServiceMap } from './service';
import {
GraphqlApiServiceId,
graphqlApiServiceMap,
RestApiServiceId,
restApiServiceMap,
} from './service';

export interface ApiEndpointProps {
zone: route53.IHostedZone;
authProvider?: cognito.IUserPool;
}

export abstract class AbstractApiEndpoint extends Construct {
abstract readonly apiEndpoint: apigw.RestApi | apigw.LambdaRestApi | apigw.SpecRestApi | apigw2.HttpApi | appsync.GraphqlApi;
abstract readonly apiEndpoint:
| apigw.RestApi
| apigw.LambdaRestApi
| apigw.SpecRestApi
| apigw2.HttpApi
| appsync.GraphqlApi;

protected constructor(scope: Construct, id: string, props?: ApiEndpointProps) {
protected constructor(
scope: Construct,
id: string,
props?: ApiEndpointProps,
) {
super(scope, id);
}
}
Expand All @@ -44,24 +58,29 @@ export abstract class AbstractRestApiEndpoint extends AbstractApiEndpoint {
}

public getDomain(): string {
const domainName: apigw.DomainName | undefined = this.apiEndpoint.domainName;
const domainName: apigw.DomainName | undefined =
this.apiEndpoint.domainName;

if (typeof domainName === 'undefined') {
throw RangeError('Domain not configured for this API endpoint.');
}
return domainName.domainName;
}

public addService(name: RestApiServiceId, dataSource?: string, auth = false): this {
this.apiServices[name] = new restApiServiceMap[name](this, `${ name }-api`, {
public addService(
name: RestApiServiceId,
dataSource?: string,
auth = false,
): this {
this.apiServices[name] = new restApiServiceMap[name](this, `${name}-api`, {
dataSource: dataSource,
authorizer: auth ? this.authorizer : undefined,
validator: this.reqValidator,
});
return this;
}

public abstract deploy(): void
public abstract deploy(): void;
}

export abstract class AbstractGraphqlEndpoint extends AbstractApiEndpoint {
Expand All @@ -75,16 +94,30 @@ export abstract class AbstractGraphqlEndpoint extends AbstractApiEndpoint {
super(scope, id, props);
}

public addService(name: GraphqlApiServiceId, dataSource: string, auth = 'apiKey'): this {
this.apiServices[name] = new graphqlApiServiceMap[name](this, `${ name }-api`, {
dataSource: dynamodb.Table.fromTableName(this, `${ name }-table`, dataSource),
auth: this.authMode[auth],
});
public addService(
name: GraphqlApiServiceId,
dataSource: string,
auth = 'apiKey',
): this {
this.apiServices[name] = new graphqlApiServiceMap[name](
this,
`${name}-api`,
{
dataSource: dynamodb.Table.fromTableName(
this,
`${name}-table`,
dataSource,
),
auth: this.authMode[auth],
},
);
return this;
}

public getDomain(): string {
const domain = this.apiEndpoint.graphqlUrl.match(/https:\/\/(.*)\/graphql/g);
const domain = this.apiEndpoint.graphqlUrl.match(
/https:\/\/(.*)\/graphql/g,
);
if (domain === null) {
return '';
}
Expand Down Expand Up @@ -127,7 +160,12 @@ export class WasedaTimeRestApiEndpoint extends AbstractRestApiEndpoint {
description: 'The main API endpoint for WasedaTime Web App.',
endpointTypes: [apigw.EndpointType.REGIONAL],
deploy: false,
binaryMediaTypes: ['application/pdf', 'image/png'],
binaryMediaTypes: [
'application/pdf',
'image/png',
'image/jpeg',
'image/gif',
],
});
this.apiEndpoint.addGatewayResponse('4xx-resp', {
type: apigw.ResponseType.DEFAULT_4XX,
Expand Down Expand Up @@ -171,7 +209,9 @@ export class WasedaTimeRestApiEndpoint extends AbstractRestApiEndpoint {
});
new route53.ARecord(this, 'alias-record', {
zone: props.zone,
target: route53.RecordTarget.fromAlias(new route53_targets.ApiGatewayDomain(this.domain)),
target: route53.RecordTarget.fromAlias(
new route53_targets.ApiGatewayDomain(this.domain),
),
recordName: API_DOMAIN,
});
}
Expand All @@ -186,7 +226,10 @@ export class WasedaTimeRestApiEndpoint extends AbstractRestApiEndpoint {
api: this.apiEndpoint,
retainDeployments: false,
});
const hash = Buffer.from(flatted.stringify(this.apiServices), 'binary').toString('base64');
const hash = Buffer.from(
flatted.stringify(this.apiServices),
'binary',
).toString('base64');
if (STAGE === 'dev') {
devDeployment.addToLogicalId(hash);
} else if (STAGE === 'prod') {
Expand Down Expand Up @@ -232,7 +275,6 @@ export class WasedaTimeGraphqlEndpoint extends AbstractGraphqlEndpoint {
readonly apiServices: { [name: string]: GraphqlApiService } = {};

constructor(scope: Construct, id: string, props: ApiEndpointProps) {

super(scope, id, props);

const apiKeyAuth: appsync.AuthorizationMode = {
Expand Down
60 changes: 59 additions & 1 deletion lib/constructs/business/rest-api-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ export class ForumThreadsApiService extends RestApiService {
const boardResource = root.addResource('{board_id}');
const threadResource = boardResource.addResource('{thread_id}');
const userResource = root.addResource('user');
const testResource = root.addResource('test');

const optionsForumHome = root.addCorsPreflight({
allowOrigins: allowOrigins,
Expand Down Expand Up @@ -766,6 +767,18 @@ export class ForumThreadsApiService extends RestApiService {
],
});

const optionsTestThreads = testResource.addCorsPreflight({
allowOrigins: allowOrigins,
allowHeaders: allowHeaders,
allowMethods: [
apigw2.HttpMethod.GET,
apigw2.HttpMethod.POST,
apigw2.HttpMethod.PATCH,
apigw2.HttpMethod.DELETE,
apigw2.HttpMethod.OPTIONS,
],
});

const getRespModel = scope.apiEndpoint.addModel('threads-get-resp-model', {
schema: forumThreadGetRespSchema,
contentType: 'application/json',
Expand All @@ -791,6 +804,7 @@ export class ForumThreadsApiService extends RestApiService {
{
envVars: {
TABLE_NAME: props.dataSource!,
BUCKET_NAME: 'wasedatime-thread-img',
},
},
);
Expand Down Expand Up @@ -819,6 +833,14 @@ export class ForumThreadsApiService extends RestApiService {
forumThreadsFunctions.deleteFunction,
{ proxy: true },
);
const testPostIntegration = new apigw.LambdaIntegration(
forumThreadsFunctions.testPostFunction,
{ proxy: true },
);
const testGetIntegration = new apigw.LambdaIntegration(
forumThreadsFunctions.testGetFunction,
{ proxy: true },
);

const getAllForumThreads = root.addMethod(
apigw2.HttpMethod.GET,
Expand Down Expand Up @@ -918,13 +940,44 @@ export class ForumThreadsApiService extends RestApiService {
requestValidator: props.validator,
},
);
const testPostForumThreads = testResource.addMethod(
apigw2.HttpMethod.POST,
testPostIntegration,
{
operationName: 'testPostThread',
methodResponses: [
{
statusCode: '200',
responseParameters: lambdaRespParams,
},
],
authorizer: props.authorizer,
requestValidator: props.validator,
},
);

const testGetForumThreads = testResource.addMethod(
apigw2.HttpMethod.GET,
testGetIntegration,
{
operationName: 'testGetThread',
methodResponses: [
{
statusCode: '200',
responseParameters: lambdaRespParams,
},
],
authorizer: props.authorizer,
requestValidator: props.validator,
},
);

this.resourceMapping = {
'/forum': {
[apigw2.HttpMethod.GET]: getAllForumThreads,
[apigw2.HttpMethod.OPTIONS]: optionsForumHome,
},
'/forum/{uid}': {
'/forum/user': {
[apigw2.HttpMethod.GET]: getUserForumThreads,
[apigw2.HttpMethod.OPTIONS]: optionsUserThreads,
},
Expand All @@ -938,6 +991,11 @@ export class ForumThreadsApiService extends RestApiService {
[apigw2.HttpMethod.PATCH]: patchForumThreads,
[apigw2.HttpMethod.DELETE]: deleteForumThreads,
},
'/forum/test': {
[apigw2.HttpMethod.POST]: testPostForumThreads,
[apigw2.HttpMethod.GET]: testGetForumThreads,
[apigw2.HttpMethod.OPTIONS]: optionsTestThreads,
},
};
}
}
Expand Down
Loading

0 comments on commit 1ad464c

Please sign in to comment.